|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.eclipse.swt.widgets.Widget
org.eclipse.swt.widgets.Control
org.eclipse.swt.widgets.Scrollable
org.eclipse.swt.widgets.Composite
com.tensegrity.gui.swt.control.widgets.TextField
Abtract base class for all Tensegrity SWT textfield widgets
| Field Summary |
| Fields inherited from class org.eclipse.swt.widgets.Control |
handle |
| Constructor Summary | |
TextField(org.eclipse.swt.widgets.Composite parent,
int style)
Creates a new TextField instance with an empty initial value |
|
TextField(org.eclipse.swt.widgets.Composite parent,
int style,
java.lang.String initialInput)
Constructor expecting initial input value |
|
| Method Summary | |
void |
addFocusListener(org.eclipse.swt.events.FocusListener l)
|
void |
addInputChangedListener(InputChangedListener l)
Adds the given InputChangedListener to the list of all listeners |
void |
addModifyListener(org.eclipse.swt.events.ModifyListener l)
Adds the specified listener to the list of listeners which gets notified when the text field value was modified. |
void |
allowIsoControl(boolean allowIsoControl)
Defines the handling of so called iso control characters, such as backspace, cursor keys etc. |
int |
getCaretPosition()
The current character position of the caret is returned. |
java.lang.String |
getText()
Gets the text field text. |
protected abstract boolean |
isValid(char character)
Checks if the given character is valid in the sense of an implementing class. |
protected abstract boolean |
isValid(java.lang.String input)
Checks if the given string is valid in the sense of an implementing class. |
void |
removeFocusListener(org.eclipse.swt.events.FocusListener l)
|
void |
removeInputChangedListener(InputChangedListener l)
Removes the given InputChangedListener from the list of all listeners |
void |
removeModifyListener(org.eclipse.swt.events.ModifyListener l)
Removes the specified listener from the list of listeners which gets notified on text field modifications |
void |
setEnabled(boolean enabled)
|
void |
setText(java.lang.String input)
Sets the specified input string if its valid. |
void |
setTextLimit(int limit)
Sets the maximum number of characters that the text field will display. |
| Methods inherited from class org.eclipse.swt.widgets.Composite |
checkSubclass, computeSize, getChildren, getLayout, getTabList, layout, layout, setFocus, setLayout, setTabList |
| Methods inherited from class org.eclipse.swt.widgets.Scrollable |
computeTrim, getClientArea, getHorizontalBar, getVerticalBar |
| Methods inherited from class org.eclipse.swt.widgets.Control |
addControlListener, addHelpListener, addKeyListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addPaintListener, addTraverseListener, computeSize, forceFocus, getAccessible, getBackground, getBorderWidth, getBounds, getEnabled, getFont, getForeground, getLayoutData, getLocation, getMenu, getMonitor, getParent, getShell, getSize, getToolTipText, getVisible, internal_dispose_GC, internal_new_GC, isEnabled, isFocusControl, isReparentable, isVisible, moveAbove, moveBelow, pack, pack, redraw, redraw, removeControlListener, removeHelpListener, removeKeyListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removePaintListener, removeTraverseListener, setBackground, setBounds, setBounds, setCapture, setCursor, setFont, setForeground, setLayoutData, setLocation, setLocation, setMenu, setParent, setRedraw, setSize, setSize, setToolTipText, setVisible, toControl, toControl, toDisplay, toDisplay, traverse, update |
| Methods inherited from class org.eclipse.swt.widgets.Widget |
addDisposeListener, addListener, checkWidget, dispose, getData, getData, getDisplay, getStyle, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, setData, setData, toString |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public TextField(org.eclipse.swt.widgets.Composite parent,
int style)
TextField instance with an empty initial value
parent - the parent widget to add this TextField tostyle - the TextField widget style defined by
SWT constants
public TextField(org.eclipse.swt.widgets.Composite parent,
int style,
java.lang.String initialInput)
parent - the parent widget (cannot be null)style - the widget styleinitialInput - the initial string input| Method Detail |
protected abstract boolean isValid(char character)
Checks if the given character is valid in the sense of an implementing class. This method is called after each key press. Invalid characters are not shown, i.e. if this method returns false, the last typed character is not displayed.
Note: by default iso control characters are allowed, i.e. backspace, cursor keys etc. If you do not want to support them you have to explicitly forbid them via allowIsoControl(false).
protected abstract boolean isValid(java.lang.String input)
Checks if the given string is valid in the sense of an implementing class. This method is called after the text input is finished. If this method returns false the input is not seen as to be completed.
input - the current text content of the textfield.
public void setTextLimit(int limit)
limit - the new text limitpublic void allowIsoControl(boolean allowIsoControl)
allowIsoControl - set to true to indicate that iso control
characters should be allowed, false otherwisepublic java.lang.String getText()
public final void setText(java.lang.String input)
isValid(String) method. If the input is
not valid this method has no effect.
input - an arbitrary textpublic final void addInputChangedListener(InputChangedListener l)
l - an InputChangedListener instancepublic final void removeInputChangedListener(InputChangedListener l)
l - an InputChangedListener instancepublic final void addFocusListener(org.eclipse.swt.events.FocusListener l)
public final void removeFocusListener(org.eclipse.swt.events.FocusListener l)
public final void addModifyListener(org.eclipse.swt.events.ModifyListener l)
l - the listener which should be notifiedpublic final void removeModifyListener(org.eclipse.swt.events.ModifyListener l)
l - the listener which should no longer be notifiedpublic final int getCaretPosition()
public void setEnabled(boolean enabled)
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||