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.uml.ui.controls.editcontrol;
043:
044: import java.awt.Color;
045: import java.awt.Font;
046: import java.util.Vector;
047:
048: import org.netbeans.modules.uml.core.support.umlutils.IPropertyDefinition;
049: import org.netbeans.modules.uml.core.support.umlutils.IPropertyElement;
050:
051: public interface IEditControlField {
052: /**
053: * The value of this text field.
054: */
055: public String getText();
056:
057: /**
058: * The value of this text field.
059: */
060: public void setText(String value);
061:
062: /**
063: * The font to display this field, if NULL uses the compartment's default font.
064: */
065: public Font getFont();
066:
067: /**
068: * The font to display this field, if NULL uses the compartment's default font.
069: */
070: public void setFont(Font value);
071:
072: /**
073: * Is this field currently selected?
074: */
075: public boolean getSelected();
076:
077: /**
078: * Is this field currently selected?
079: */
080: public void setSelected(boolean value);
081:
082: /**
083: * Is this field currently enabled?
084: */
085: public boolean getEnabled();
086:
087: /**
088: * Is this field currently enabled?
089: */
090: public void setEnabled(boolean value);
091:
092: /**
093: * The text color.
094: */
095: public Color getTextColor();
096:
097: /**
098: * The text color.
099: */
100: public void setTextColor(Color value);
101:
102: /**
103: * Initialize the text field's properties.
104: */
105: public void init(String sText, Font Font, Color TextColor);
106:
107: /**
108: * The default value of this text field.
109: */
110: public String getDefaultText();
111:
112: /**
113: * The default value of this text field.
114: */
115: public void setDefaultText(String value);
116:
117: /**
118: * Is this field currently visible?
119: */
120: public boolean getVisible();
121:
122: /**
123: * Is this field currently visible?
124: */
125: public void setVisible(boolean value);
126:
127: /**
128: * Is this field currently visible and NOT deleted?
129: */
130: public boolean getVisible2();
131:
132: /**
133: * Is this field currently visible and NOT deleted?
134: */
135: public void setVisible2(boolean value);
136:
137: /**
138: * Get the field's editable text position within the overall character string (nStartPos=left, nEndPos=right).
139: */
140: public int getTextPos(int nStartPos);
141:
142: public int getTextStartPos();
143:
144: public int getTextEndPos();
145:
146: /**
147: * Set the field's editable text starting position within the overall character string.
148: */
149: public long setTextPos(int nStartPos);
150:
151: /**
152: * Get the field's position within the overall character string (nStartPos=left, nEndPos=right).
153: */
154: public int getFieldPos(int nStartPos);
155:
156: public int getFieldStartPos();
157:
158: public int getFieldEndPos();
159:
160: /**
161: * Set the field's starting position within the overall character string.
162: */
163: public long setFieldPos(int nStartPos);
164:
165: /**
166: * Initializes the value of this text field to it's default value.
167: */
168: public long setDefaultText();
169:
170: /**
171: * Gets/Sets a translator containing sub-textfields.
172: */
173: public ITranslator getTranslator();
174:
175: /**
176: * Gets/Sets a translator containing sub-textfields.
177: */
178: public void setTranslator(ITranslator value);
179:
180: /**
181: * Gets/Sets the translator that contains this textfield.
182: */
183: public ITranslator getOwnerTranslator();
184:
185: /**
186: * Gets/Sets the translator that contains this textfield.
187: */
188: public void setOwnerTranslator(ITranslator value);
189:
190: /**
191: * Has the text been changed?
192: */
193: public boolean getModified();
194:
195: /**
196: * Has the text been changed?
197: */
198: public void setModified(boolean value);
199:
200: /**
201: * The value of this text field's tooltip.
202: */
203: public String getToolTipText();
204:
205: /**
206: * The value of this text field's tooltip.
207: */
208: public void setToolTipText(String value);
209:
210: /**
211: * Is this field repeating (TRUE) or singular (FALSE)?
212: */
213: public boolean getMultiplicity();
214:
215: /**
216: * Is this field repeating (TRUE) or singular (FALSE)?
217: */
218: public void setMultiplicity(boolean value);
219:
220: /**
221: * Can this field be left empty?
222: */
223: public boolean getRequired();
224:
225: /**
226: * Can this field be left empty?
227: */
228: public void setRequired(boolean value);
229:
230: /**
231: * Is this the default field for editing?
232: */
233: public boolean getDefault();
234:
235: /**
236: * Is this the default field for editing?
237: */
238: public void setDefault(boolean value);
239:
240: /**
241: * The field's visibility rule, either 'yes', 'no' or 'notEmpty'.
242: */
243: public String getVisibility();
244:
245: /**
246: * The field's visibility rule, either 'yes', 'no' or 'notEmpty'.
247: */
248: public void setVisibility(String value);
249:
250: /**
251: * The leading separator that is inserted according to the field's visibility rule.
252: */
253: public String getLeadSeparator();
254:
255: /**
256: * The leading separator that is inserted according to the field's visibility rule.
257: */
258: public void setLeadSeparator(String value);
259:
260: /**
261: * The trailing separator that is appended according to the field's visibility rule.
262: */
263: public String getTrailSeparator();
264:
265: /**
266: * The trailing separator that is appended according to the field's visibility rule.
267: */
268: public void setTrailSeparator(String value);
269:
270: /**
271: * The delimitor that separates repeating fields.
272: */
273: public String getDelimitor();
274:
275: /**
276: * The delimitor that separates repeating fields.
277: */
278: public void setDelimitor(String value);
279:
280: /**
281: * The property element used to format and save this field's data.
282: */
283: public IPropertyElement getPropertyElement();
284:
285: /**
286: * The property element used to format and save this field's data.
287: */
288: public void setPropertyElement(IPropertyElement value);
289:
290: /**
291: * The property element used to format and save this field's data. DOES NOT LOAD VALUES FROM THE ELEMENT INTO THE FIELD!
292: */
293: public void setPropertyElement2(IPropertyElement value);
294:
295: /**
296: * The property Definition used to format and save this field's data.
297: */
298: public IPropertyDefinition getPropertyDefinition();
299:
300: /**
301: * The property Definition used to format and save this field's data.
302: */
303: public void setPropertyDefinition(IPropertyDefinition value);
304:
305: /**
306: * Writes changed data out to the text field's PropertyElement.
307: */
308: public boolean save();
309:
310: /**
311: * Get the picklist values.
312: */
313: public Vector getValidValues();
314:
315: /**
316: * Is the passed character a separator for this field?
317: */
318: public boolean isLeadSeparator(int nChar);
319:
320: /**
321: * Is the passed character a separator for this field?
322: */
323: public boolean isTrailSeparator(int nChar);
324:
325: /**
326: * Is the passed character a delimitor, separating sub-fields of this field?
327: */
328: public boolean isDelimitor(int nChar);
329:
330: /**
331: * Is this field currently deleted?
332: */
333: public boolean getDeleted();
334:
335: /**
336: * Is this field currently deleted?
337: */
338: public void setDeleted(boolean value);
339:
340: /**
341: * Is this field and all sub-fields currently deleted?
342: */
343: public boolean getDeleted2();
344:
345: /**
346: * Informs the field that editing is complete and it should re-format itself depending on its rules.
347: */
348: public long update();
349:
350: /**
351: * What's the field's editing method?
352: */
353: public int getEditKind();
354:
355: /**
356: * Temporary
357: */
358: public long dump(String sPad);
359:
360: /**
361: * Temporary
362: */
363: public String getName();
364:
365: /**
366: * Return true if the char is an inert separator
367: * @param nChar char in question
368: * @param position position of the char
369: */
370: public boolean checkInertSeparator(int nChar, int positon);
371:
372: /**
373: * Gets the last visible text's start position
374: */
375: public int getLastTextStartPos();
376: }
|