1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.student.common.ui.client.widgets.buttongroups;
17
18 import org.kuali.student.common.ui.client.mvc.Callback;
19 import org.kuali.student.common.ui.client.widgets.KSButton;
20 import org.kuali.student.common.ui.client.widgets.buttongroups.ButtonEnumerations.OkEnum;
21 import org.kuali.student.common.ui.client.widgets.buttonlayout.ButtonRow;
22
23 import com.google.gwt.event.dom.client.ClickEvent;
24 import com.google.gwt.event.dom.client.ClickHandler;
25
26 public class OkGroup extends ButtonGroup<OkEnum>{
27
28 public OkGroup(Callback<OkEnum> callback){
29 layout = new ButtonRow();
30 this.addCallback(callback);
31
32 addButton(OkEnum.Ok);
33
34 this.initWidget(layout);
35 }
36
37 private void addButton(final OkEnum type){
38 KSButton button = new KSButton(type.getText(), new ClickHandler(){
39
40 @Override
41 public void onClick(ClickEvent event) {
42 sendCallbacks(type);
43 }
44 });
45 ((ButtonRow) layout).addButtonToSecondaryGroup(button);
46 buttonMap.put(type, button);
47 }
48 }