001 /**
002 * Copyright 2005-2013 The Kuali Foundation
003 *
004 * Licensed under the Educational Community License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 * http://www.opensource.org/licenses/ecl2.php
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016 package org.kuali.rice.krad.uif.control;
017
018 import org.kuali.rice.krad.uif.component.ComponentBase;
019
020 /**
021 * Base class for all <code>Control</code> implementations
022 *
023 * @author Kuali Rice Team (rice.collab@kuali.org)
024 *
025 * @see org.kuali.rice.krad.uif.control.Control
026 */
027 public abstract class ControlBase extends ComponentBase implements Control {
028 private static final long serialVersionUID = -7898244978136312663L;
029
030 private int tabIndex;
031
032 private boolean disabled;
033 private String disabledReason;
034
035 public ControlBase() {
036 super();
037
038 disabled = false;
039 }
040
041 /**
042 * @see org.kuali.rice.krad.uif.component.Component#getComponentTypeName()
043 */
044 @Override
045 public final String getComponentTypeName() {
046 return "control";
047 }
048
049 /**
050 * @see Control#getTabIndex()
051 */
052 public int getTabIndex() {
053 return this.tabIndex;
054 }
055
056 /**
057 * @see Control#setTabIndex(int)
058 */
059 public void setTabIndex(int tabIndex) {
060 this.tabIndex = tabIndex;
061 }
062
063 /**
064 * @see Control#isDisabled()
065 */
066 public boolean isDisabled() {
067 return disabled;
068 }
069
070 /**
071 * @see Control#setDisabled(boolean)
072 */
073 public void setDisabled(boolean disabled) {
074 this.disabled = disabled;
075 }
076
077 /**
078 * @see Control#getDisabledReason()
079 */
080 public String getDisabledReason() {
081 return disabledReason;
082 }
083
084 /**
085 * @see Control#setDisabledReason(java.lang.String)
086 */
087 public void setDisabledReason(String disabledReason) {
088 this.disabledReason = disabledReason;
089 }
090
091 @Override
092 public boolean getSupportsOnChange() {
093 return true;
094 }
095
096 @Override
097 public boolean getSupportsOnBlur() {
098 return true;
099 }
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 }