View Javadoc

1   /**
2    * Copyright 2005-2013 The Kuali Foundation
3    *
4    * Licensed under the Educational Community License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    * http://www.opensource.org/licenses/ecl2.php
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.kuali.rice.krad.uif.control;
17  
18  import org.kuali.rice.krad.uif.component.ComponentBase;
19  
20  /**
21   * Base class for all <code>Control</code> implementations
22   * 
23   * @author Kuali Rice Team (rice.collab@kuali.org)
24   * 
25   * @see org.kuali.rice.krad.uif.control.Control
26   */
27  public abstract class ControlBase extends ComponentBase implements Control {
28  	private static final long serialVersionUID = -7898244978136312663L;
29  	
30  	private int tabIndex;
31  
32      private boolean disabled;
33      private String disabledReason;
34  
35      public ControlBase() {
36          super();
37  
38          disabled = false;
39      }
40  
41  	/**
42  	 * @see org.kuali.rice.krad.uif.component.Component#getComponentTypeName()
43  	 */
44  	@Override
45  	public final String getComponentTypeName() {
46  		return "control";
47  	}
48  
49      /**
50       * @see Control#getTabIndex()
51       */
52  	public int getTabIndex() {
53  		return this.tabIndex;
54  	}
55  
56      /**
57       * @see Control#setTabIndex(int)
58       */
59  	public void setTabIndex(int tabIndex) {
60  		this.tabIndex = tabIndex;
61  	}
62  
63      /**
64       * @see Control#isDisabled()
65       */
66      public boolean isDisabled() {
67          return disabled;
68      }
69  
70      /**
71       * @see Control#setDisabled(boolean)
72       */
73      public void setDisabled(boolean disabled) {
74          this.disabled = disabled;
75      }
76  
77      /**
78       * @see Control#getDisabledReason()
79       */
80      public String getDisabledReason() {
81          return disabledReason;
82      }
83  
84      /**
85       * @see Control#setDisabledReason(java.lang.String)
86       */
87      public void setDisabledReason(String disabledReason) {
88          this.disabledReason = disabledReason;
89      }
90  
91      @Override
92      public boolean getSupportsOnChange() {
93          return true;
94      }
95  
96      @Override
97      public boolean getSupportsOnBlur() {
98          return true;
99      }
100 
101     @Override
102     public boolean getSupportsOnClick() {
103         return true;
104     }
105 
106     @Override
107     public boolean getSupportsOnDblClick() {
108         return true;
109     }
110 
111     @Override
112     public boolean getSupportsOnFocus() {
113         return true;
114     }
115 }