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.Font;
045:
046: import org.netbeans.modules.uml.core.eventframework.IEventDispatcher;
047: import org.netbeans.modules.uml.core.metamodel.core.foundation.IElement;
048: import org.netbeans.modules.uml.core.support.umlsupport.IStrings;
049: import java.awt.Color;
050:
051: public interface IEditControl {
052: /**
053: *
054: */
055: public void setAutoSize(boolean value);
056:
057: /**
058: *
059: */
060: public boolean getAutoSize();
061:
062: /**
063: *
064: */
065: public void setrefFont(Font value);
066:
067: /**
068: *
069: */
070: public void setFont(Font value);
071:
072: /**
073: *
074: */
075: public Font getFont();
076:
077: /**
078: * Sets the control's font via an HFONT (in-process only)
079: */
080: public void setHFont(/* long */
081: int value);
082:
083: /**
084: *
085: */
086: public void getBackColor();
087:
088: /**
089: *
090: */
091: public void setrefBackColor(long value);
092:
093: /**
094: *
095: */
096: public void setBackColor(long value);
097:
098: /**
099: *
100: */
101: public Color getForeColor();
102:
103: /**
104: *
105: */
106: public void setForeColor(Color value);
107:
108: /**
109: *
110: */
111: public void setrefForeColor(long value);
112:
113: /**
114: *
115: */
116: public String getText();
117:
118: /**
119: *
120: */
121: public void setText(String value);
122:
123: /**
124: * Sets input focus to the control, optionally passing a keycode to be used as the first input character.
125: */
126: public void activate(int KeyCode, int nPos);
127:
128: /**
129: * Terminates input focus to the control.
130: */
131: public void deactivate();
132:
133: /**
134: * Gets/Sets the control's translator
135: */
136: public ITranslator getTranslator();
137:
138: /**
139: * Gets/Sets the control's translator
140: */
141: public void setTranslator(ITranslator value);
142:
143: /**
144: * Gets if the edit control is a multiline edit
145: */
146: public boolean getMultiline();
147:
148: /**
149: * Gets/Sets the range of selected characters
150: */
151: public long getSel(int nStartChar, int nEndChar);
152:
153: /**
154: * Gets/Sets the range of selected characters
155: */
156: public long setSel(int nStartChar, int nEndChar);
157:
158: /**
159: * Replaces the selected range with text
160: */
161: public void replaceSel(String sText);
162:
163: /**
164: * Establishes the control's event dispatcher
165: */
166: public void putEventDispatcher(IEventDispatcher pDispatcher);
167:
168: /**
169: * Establishes the control's event dispatcher
170: */
171: public IEventDispatcher getEventDispatcher();
172:
173: /**
174: * Sets/Returns the control's modified status.
175: */
176: public boolean getModified();
177:
178: /**
179: * Sets/Returns the control's modified status.
180: */
181: public void setModified(boolean value);
182:
183: /**
184: * Returns the length of the current or specified line in the edit window
185: */
186: public int lineLength(int nLine);
187:
188: /**
189: * Returns the character index for the current or specified line.
190: */
191: public int lineIndex(int nLine);
192:
193: /**
194: * Gets/Sets the Edit Style of the control.
195: */
196: public int getStyle();
197:
198: /**
199: * Gets/Sets the Edit Style of the control.
200: */
201: public void setStyle(long value);
202:
203: /**
204: * Forces a text read from the attached translator.
205: */
206: public void refresh();
207:
208: /**
209: * Gets/Sets the overstrike mode of the control.
210: */
211: public boolean getOverstrike();
212:
213: /**
214: * Gets/Sets the overstrike mode of the control.
215: */
216: public void setOverstrike(boolean value);
217:
218: /**
219: * The text for the tooltip. The subject portion is highlighted.
220: */
221: public long getTooltipText(StringBuffer sLeft,
222: StringBuffer sSubject, StringBuffer sRight);
223:
224: /**
225: * The text for the tooltip. The subject portion is highlighted.
226: */
227: public void setTooltipText(String sLeft, String sSubject,
228: String sRight);
229:
230: /**
231: * Enable/disable the popup tooltip when the edit control has focus.
232: */
233: public void setEnableTooltip(boolean value);
234:
235: /**
236: * Reload the tooltip's data.
237: */
238: public void updateToolTip();
239:
240: /**
241: * Get/Sets the logical input position (does not update the currently selected text.
242: */
243: public void setCurrentPosition(int value);
244:
245: /**
246: * Get/Sets the logical input position (does not update the currently selected text.
247: */
248: public int getCurrentPosition();
249:
250: /**
251: * If TRUE the control resizes itself to fit its contents.
252: */
253: public boolean getAutoExpand();
254:
255: /**
256: * If TRUE the control resizes itself to fit its contents.
257: */
258: public void setAutoExpand(boolean value);
259:
260: /**
261: * Causes the hintbar to shown at the specified character position.
262: */
263: public void showHintBar(int nPos);
264:
265: /**
266: * Hides the hintbar.
267: */
268: public void hideHintBar();
269:
270: /**
271: * Invokes the hint control.
272: */
273: public void handleHint();
274:
275: /**
276: * Displays a dropdown list or combobox at the specified position.
277: */
278: public void displayList(boolean bList, IStrings pList, int nStart,
279: String sInitialText);
280:
281: /**
282: * Returns the text field that the caret is currently in.
283: */
284: public IEditControlField getCurrentField();
285:
286: /**
287: * Registers an accelerator key + control key on behalf of a translator.
288: */
289: public void registerAccelerator(int nChar, long nModifier);
290:
291: /**
292: * Sets the model element to be edited.
293: */
294: public void setElement(IElement value);
295:
296: /**
297: * A list of separator characters used by the fields.
298: */
299: public String getSeparatorList();
300:
301: /**
302: * A list of separator characters used by the fields.
303: */
304: public void setSeparatorList(String value);
305:
306: /**
307: * Calculates the new caret position when changing lines in a multiline edit
308: */
309: public int calcNewPos(int changeLineBy);
310:
311: //these two methods are used when we are removing characters from names.
312: public int getSelEndPos();
313:
314: public int getSelStartPos();
315:
316: public boolean isShiftDown();
317:
318: public boolean isControlDown();
319:
320: /**
321: * Returns the object associated with the edit control, generally the compartment being edited.
322: */
323: public Object getAssociatedParent();
324: }
|