| 1 | |
|
| 2 | |
|
| 3 | |
|
| 4 | |
|
| 5 | |
|
| 6 | |
|
| 7 | |
|
| 8 | |
|
| 9 | |
|
| 10 | |
|
| 11 | |
|
| 12 | |
|
| 13 | |
|
| 14 | |
|
| 15 | |
|
| 16 | |
package org.kuali.student.common.ui.client.widgets; |
| 17 | |
|
| 18 | |
import com.google.gwt.event.dom.client.ClickHandler; |
| 19 | |
import com.google.gwt.event.dom.client.HasClickHandlers; |
| 20 | |
import com.google.gwt.event.dom.client.HasMouseOutHandlers; |
| 21 | |
import com.google.gwt.event.dom.client.HasMouseOverHandlers; |
| 22 | |
import com.google.gwt.user.client.ui.Composite; |
| 23 | |
|
| 24 | 0 | public abstract class KSButtonAbstract extends Composite implements HasClickHandlers, HasMouseOverHandlers, HasMouseOutHandlers{ |
| 25 | |
|
| 26 | 0 | public static enum ButtonStyle{ |
| 27 | 0 | PRIMARY("ks-button-primary", "ks-button-primary-disabled"), |
| 28 | 0 | SECONDARY("ks-button-secondary", "ks-button-secondary-disabled"), |
| 29 | 0 | PRIMARY_SMALL("ks-button-primary-small", "ks-button-primary-small-disabled"), |
| 30 | 0 | SECONDARY_SMALL("ks-button-secondary-small", "ks-button-secondary-small-disabled"), |
| 31 | 0 | FORM_SMALL("ks-form-button-small", null), |
| 32 | 0 | FORM_LARGE("ks-form-button-large", null), |
| 33 | 0 | HELP("ks-form-module-elements-help", null), |
| 34 | 0 | DELETE("ks-form-module-elements-delete", null), |
| 35 | 0 | ANCHOR_LARGE_CENTERED("ks-link-large", "ks-link-large-disabled"), |
| 36 | 0 | DEFAULT_ANCHOR("ks-link", "ks-link-disabled"); |
| 37 | |
|
| 38 | |
private String style; |
| 39 | |
private String disabledStyle; |
| 40 | |
|
| 41 | 0 | private ButtonStyle(String style, String disabledStyle){ |
| 42 | 0 | this.style = style; |
| 43 | 0 | this.disabledStyle = disabledStyle; |
| 44 | 0 | } |
| 45 | |
|
| 46 | |
public String getStyle(){ |
| 47 | 0 | return style; |
| 48 | |
} |
| 49 | |
|
| 50 | |
public String getDisabledStyle() { |
| 51 | 0 | return disabledStyle; |
| 52 | |
} |
| 53 | |
}; |
| 54 | |
|
| 55 | |
public abstract boolean isEnabled(); |
| 56 | |
|
| 57 | |
public abstract void setEnabled(boolean enabled); |
| 58 | |
|
| 59 | |
public abstract void setText(String text); |
| 60 | |
|
| 61 | |
public abstract void init(); |
| 62 | |
|
| 63 | |
public abstract void init(String text); |
| 64 | |
|
| 65 | |
public abstract void init(String text, ButtonStyle style); |
| 66 | |
|
| 67 | |
public abstract void init(String text, ClickHandler handler); |
| 68 | |
|
| 69 | |
public abstract void init(String text, ButtonStyle style, ClickHandler handler); |
| 70 | |
} |