View Javadoc

1   /**
2    * Copyright 2010 The Kuali Foundation Licensed under the
3    * Educational Community License, Version 2.0 (the "License"); you may
4    * not use this file except in compliance with the License. You may
5    * obtain a copy of the License at
6    *
7    * http://www.osedu.org/licenses/ECL-2.0
8    *
9    * Unless required by applicable law or agreed to in writing,
10   * software distributed under the License is distributed on an "AS IS"
11   * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
12   * or implied. See the License for the specific language governing
13   * permissions and limitations under the License.
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  public abstract class KSButtonAbstract extends Composite implements HasClickHandlers, HasMouseOverHandlers, HasMouseOutHandlers{
25  
26  	public static enum ButtonStyle{
27  		PRIMARY("ks-button-primary", "ks-button-primary-disabled"),
28  		SECONDARY("ks-button-secondary", "ks-button-secondary-disabled"),
29  		PRIMARY_SMALL("ks-button-primary-small", "ks-button-primary-small-disabled"),
30  		SECONDARY_SMALL("ks-button-secondary-small", "ks-button-secondary-small-disabled"),
31  		FORM_SMALL("ks-form-button-small", null),
32  		FORM_LARGE("ks-form-button-large", null),
33  		HELP("ks-form-module-elements-help", null),
34  		DELETE("ks-form-module-elements-delete", null),
35  		ANCHOR_LARGE_CENTERED("ks-link-large", "ks-link-large-disabled"),
36  		DEFAULT_ANCHOR("ks-link", "ks-link-disabled");
37  		
38  		private String style;
39  		private String disabledStyle;
40  
41  		private ButtonStyle(String style, String disabledStyle){
42  			this.style = style;
43  			this.disabledStyle = disabledStyle;
44  		}
45  		
46  		public String getStyle(){
47  			return style;
48  		}
49  		
50  		public String getDisabledStyle() {
51  			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  }