001: /*
002: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
003: *
004: * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
005: *
006: * The contents of this file are subject to the terms of either the GNU
007: * General Public License Version 2 only ("GPL") or the Common
008: * Development and Distribution License("CDDL") (collectively, the
009: * "License"). You may not use this file except in compliance with the
010: * License. You can obtain a copy of the License at
011: * http://www.netbeans.org/cddl-gplv2.html
012: * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
013: * specific language governing permissions and limitations under the
014: * License. When distributing the software, include this License Header
015: * Notice in each file and include the License file at
016: * nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this
017: * particular file as subject to the "Classpath" exception as provided
018: * by Sun in the GPL Version 2 section of the License file that
019: * accompanied this code. If applicable, add the following below the
020: * License Header, with the fields enclosed by brackets [] replaced by
021: * your own identifying information:
022: * "Portions Copyrighted [year] [name of copyright owner]"
023: *
024: * Contributor(s):
025: *
026: * The Original Software is NetBeans. The Initial Developer of the Original
027: * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
028: * Microsystems, Inc. All Rights Reserved.
029: *
030: * If you wish your version of this file to be governed by only the CDDL
031: * or only the GPL Version 2, indicate your decision by adding
032: * "[Contributor] elects to include this software in this distribution
033: * under the [CDDL or GPL Version 2] license." If you do not indicate a
034: * single choice of license, a recipient has the option to distribute
035: * your version of this file under either the CDDL, the GPL Version 2 or
036: * to extend the choice of license to its licensees as provided above.
037: * However, if you add GPL Version 2 code and therefore, elected the GPL
038: * Version 2 license, then the option applies only if the new code is
039: * made subject to such option by the copyright holder.
040: */
041:
042: package org.netbeans.modules.sql.framework.ui.editor.property;
043:
044: import java.beans.PropertyEditor;
045:
046: /**
047: * @author Ritesh Adval
048: * @version $Revision$
049: */
050: public interface IProperty extends INode {
051:
052: /**
053: * get the group to which this property belongs
054: *
055: * @return group to which property belongs
056: */
057: public String getGroup();
058:
059: /**
060: * get the position where this property should appear in the property sheet gui
061: *
062: * @return position
063: */
064: public int getPosition();
065:
066: /**
067: * get the property customizer
068: *
069: * @return property customizer
070: */
071: public IPropertyCustomizer getPropertyCustomizer();
072:
073: /**
074: * Get the optional property editor which can be used to edit this property
075: *
076: * @return property editor
077: */
078: public PropertyEditor getPropertyEditor();
079:
080: /**
081: * get the gui type of this property
082: *
083: * @return gui type
084: */
085: public String getType();
086:
087: public Object getValue() throws java.lang.IllegalAccessException,
088: java.lang.reflect.InvocationTargetException;
089:
090: /**
091: * get the type of value of this property
092: *
093: * @return property value type
094: */
095: public Class getValueType();
096:
097: /**
098: * does this property has a custom editor
099: *
100: * @return whether property has a custom editor
101: */
102: public boolean isCustomEditor();
103:
104: /**
105: * Does this property has a default value
106: *
107: * @returrn whether property has a default value
108: */
109: public boolean isDefault();
110:
111: /**
112: * Is this property read only, if readonly then gui can not edit this property
113: *
114: * @return whether this property is read only
115: */
116: public boolean isReadOnly();
117:
118: /**
119: * Is this property require if yes then this property should always have a vaule
120: *
121: * @return whether this property is required
122: */
123: public boolean isRequired();
124:
125: /**
126: * is this value valid
127: *
128: * @return value if valid
129: */
130: public boolean isValid();
131:
132: /**
133: * deos this property has a custom editor
134: *
135: * @param editor whether property has a custom editor
136: */
137: public void setCustomEditor(String editor);
138:
139: /**
140: * Does this property has a default value
141: *
142: * @returrn whether property has a default value
143: */
144: public void setDefault(boolean def);
145:
146: /**
147: * Does this property has a default value
148: *
149: * @returrn whether property has a default value
150: */
151: public void setDefault(String def);
152:
153: /**
154: * set the optional property editor which can be used to edit this property
155: *
156: * @return property editor
157: */
158: public void setEditorClass(String editorClass);
159:
160: /**
161: * set the group to which this property belongs
162: *
163: * @return group to which property belongs
164: */
165: public void setGroup(String group);
166:
167: /**
168: * set the owner object which has this property
169: */
170: public void setOwnerObject(Object obj);
171:
172: /**
173: * set the position where this property should appear in the property sheet gui
174: *
175: * @return position
176: */
177: public void setPosition(String position);
178:
179: /**
180: * set the property customizer
181: *
182: * @param customizer customizer
183: */
184: public void setPropertyCustomizer(IPropertyCustomizer customizer);
185:
186: /**
187: * set the optional property editor which can be used to edit this property
188: *
189: * @return property editor
190: */
191: public void setPropertyEditor(PropertyEditor editor);
192:
193: /**
194: * Is this property read only, if readonly then gui can not edit this property
195: *
196: * @return whether this property is read only
197: */
198: public void setReadOnly(boolean readOnly);
199:
200: /**
201: * Is this property read only, if readonly then gui can not edit this property
202: *
203: * @return whether this property is read only
204: */
205: public void setReadOnly(String readOnly);
206:
207: /**
208: * Is this property require if yes then this property should always have a vaule
209: *
210: * @return whether this property is required
211: */
212: public void setRequired(boolean required);
213:
214: /**
215: * Is this property require if yes then this property should always have a vaule
216: *
217: * @return whether this property is required
218: */
219: public void setRequired(String required);
220:
221: /**
222: * get the gui type of this property
223: *
224: * @return gui type
225: */
226: public void setType(String type);
227:
228: public void setValue(Object obj)
229: throws java.lang.IllegalAccessException,
230: java.lang.IllegalArgumentException,
231: java.lang.reflect.InvocationTargetException;
232:
233: /**
234: * set the type of value of this property
235: *
236: * @return property value type
237: */
238: public void setValueType(String valueType);
239:
240: }
|