| 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 | 0 | public OkGroup(Callback<OkEnum> callback){ |
| 29 | 0 | layout = new ButtonRow(); |
| 30 | 0 | this.addCallback(callback); |
| 31 | |
|
| 32 | 0 | addButton(OkEnum.Ok); |
| 33 | |
|
| 34 | 0 | this.initWidget(layout); |
| 35 | 0 | } |
| 36 | |
|
| 37 | |
private void addButton(final OkEnum type){ |
| 38 | 0 | KSButton button = new KSButton(type.getText(), new ClickHandler(){ |
| 39 | |
|
| 40 | |
@Override |
| 41 | |
public void onClick(ClickEvent event) { |
| 42 | 0 | sendCallbacks(type); |
| 43 | 0 | } |
| 44 | |
}); |
| 45 | 0 | ((ButtonRow) layout).addButtonToSecondaryGroup(button); |
| 46 | 0 | buttonMap.put(type, button); |
| 47 | 0 | } |
| 48 | |
} |