001 /**
002 * Copyright 2010 The Kuali Foundation Licensed under the
003 * Educational Community License, Version 2.0 (the "License"); you may
004 * not use this file except in compliance with the License. You may
005 * obtain a copy of the License at
006 *
007 * http://www.osedu.org/licenses/ECL-2.0
008 *
009 * Unless required by applicable law or agreed to in writing,
010 * software distributed under the License is distributed on an "AS IS"
011 * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
012 * or implied. See the License for the specific language governing
013 * permissions and limitations under the License.
014 */
015
016 package org.kuali.student.common.ui.client.widgets;
017
018 import com.google.gwt.event.dom.client.ClickHandler;
019 import com.google.gwt.event.dom.client.HasClickHandlers;
020 import com.google.gwt.event.dom.client.HasMouseOutHandlers;
021 import com.google.gwt.event.dom.client.HasMouseOverHandlers;
022 import com.google.gwt.user.client.ui.Composite;
023
024 public abstract class KSButtonAbstract extends Composite implements HasClickHandlers, HasMouseOverHandlers, HasMouseOutHandlers{
025
026 public static enum ButtonStyle{
027 PRIMARY("ks-button-primary", "ks-button-primary-disabled"),
028 SECONDARY("ks-button-secondary", "ks-button-secondary-disabled"),
029 PRIMARY_SMALL("ks-button-primary-small", "ks-button-primary-small-disabled"),
030 SECONDARY_SMALL("ks-button-secondary-small", "ks-button-secondary-small-disabled"),
031 FORM_SMALL("ks-form-button-small", null),
032 FORM_LARGE("ks-form-button-large", null),
033 HELP("ks-form-module-elements-help", null),
034 DELETE("ks-form-module-elements-delete", null),
035 ANCHOR_LARGE_CENTERED("ks-link-large", "ks-link-large-disabled"),
036 DEFAULT_ANCHOR("ks-link", "ks-link-disabled");
037
038 private String style;
039 private String disabledStyle;
040
041 private ButtonStyle(String style, String disabledStyle){
042 this.style = style;
043 this.disabledStyle = disabledStyle;
044 }
045
046 public String getStyle(){
047 return style;
048 }
049
050 public String getDisabledStyle() {
051 return disabledStyle;
052 }
053 };
054
055 public abstract boolean isEnabled();
056
057 public abstract void setEnabled(boolean enabled);
058
059 public abstract void setText(String text);
060
061 public abstract void init();
062
063 public abstract void init(String text);
064
065 public abstract void init(String text, ButtonStyle style);
066
067 public abstract void init(String text, ClickHandler handler);
068
069 public abstract void init(String text, ButtonStyle style, ClickHandler handler);
070 }