|
|||||||||||
| 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
com.tensegrity.gui.swt.control.widgets.IntegerTextField
An IntegerTextField is an extension of a TextField which only handles
integers. To decide which input is valid this class overwrites the
isValid(char) and the
isValid(String) methods.
Each registered InputChangedListener is notified on input changes.
| Field Summary |
| Fields inherited from class org.eclipse.swt.widgets.Control |
handle |
| Constructor Summary | |
IntegerTextField(org.eclipse.swt.widgets.Composite parent,
int style,
int initialValue)
Constructor which requires the initial input of the textfield |
|
IntegerTextField(org.eclipse.swt.widgets.Composite parent,
int style,
java.lang.String initialValue)
Constructor which requires an initial value string for initializing the textfield |
|
| Method Summary | |
int |
getIntValue()
Returns the current integer value |
protected boolean |
isValid(char keyCode)
Checks if the given character is valid in the sense of an implementing class. |
protected boolean |
isValid(java.lang.String input)
Checks if the given string is valid in the sense of an implementing class. |
void |
setIntValue(int val)
Sets the specified integer value. |
| Methods inherited from class com.tensegrity.gui.swt.control.widgets.TextField |
addFocusListener, addInputChangedListener, addModifyListener, allowIsoControl, getCaretPosition, getText, removeFocusListener, removeInputChangedListener, removeModifyListener, setEnabled, setText, setTextLimit |
| 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 IntegerTextField(org.eclipse.swt.widgets.Composite parent,
int style,
int initialValue)
parent - Composite to add this IntegerTextField tostyle - SWT style bitsinitialValue - initial input value
public IntegerTextField(org.eclipse.swt.widgets.Composite parent,
int style,
java.lang.String initialValue)
parent - Composite to add this IntegerTextField tostyle - SWT style bitsinitialValue - initial input value as String| Method Detail |
public final void setIntValue(int val)
val - an arbitrary integer valuepublic final int getIntValue()
protected final boolean isValid(char keyCode)
TextFieldChecks 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).
isValid in class TextFieldprotected final boolean isValid(java.lang.String input)
TextFieldChecks 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.
isValid in class TextFieldinput - the current text content of the textfield.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||