|
|||||||||
| 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
org.opensubsystems.patterns.thickclient.application.swt.NumberPad
public class NumberPad
Control, which allows user to type numbers using mouse or finger on a screen.
| Field Summary | |
|---|---|
protected static int |
BASE_HEIGHT
Base (smallest) control height constant. |
protected boolean |
m_bDecimalDot
If true then numbers with decimal point are allowed (there can be at most 1 decimal point character in the number). |
protected java.util.Date |
m_lastModified
Date when the content was last modified. |
protected NumericText |
m_numberText
Field which collects typed numbers. |
protected org.eclipse.swt.graphics.Point |
m_preferredSize
Preferred size of this control based on the specified parameters. |
protected java.util.Set |
m_setListeners
Set where all listeners listening to the event notifications specific to this object are stored. |
protected java.lang.String |
m_strCancelConfirmation
Text to display to confirm canceling of the operation using cancel button. |
| Fields inherited from class org.eclipse.swt.widgets.Composite |
|---|
embeddedHandle |
| Fields inherited from class org.eclipse.swt.widgets.Widget |
|---|
handle |
| Constructor Summary | |
|---|---|
NumberPad(org.eclipse.swt.widgets.Composite parent,
int style,
java.lang.String strSetButtonText,
boolean bBigButtons,
boolean bDecimalDot)
Construct new instance of the number pad control. |
|
NumberPad(org.eclipse.swt.widgets.Composite parent,
int style,
java.lang.String strSetButtonText,
java.lang.String strCancelButtonText,
java.lang.String strCancelConfirmation,
boolean bBigButtons,
boolean bDecimalDot)
Construct new instance |
|
| Method Summary | |
|---|---|
void |
addNumberPadListener(NumberPadListener listener)
Add listener for this number pad. |
protected void |
createButton(java.lang.String strText,
boolean bBigButtons,
org.eclipse.swt.events.SelectionListener listener)
Create new button for this number pad. |
java.lang.String |
formatText(java.lang.String inputText)
Format text to represent a number, e.g. |
java.util.Date |
getLastModified()
|
org.eclipse.swt.graphics.Point |
getPreferredSize()
Get preferred size of this control based on the specified parameters. |
java.lang.String |
getText()
Get text typed in the numeric text field. |
void |
modified()
This method is called when some modification has happened. |
protected void |
notifyNumberPadListeners()
Notify all listeners about event. |
void |
removeNumberPadListener(NumberPadListener listener)
Remove listener from this number pad. |
void |
setText(java.lang.String text)
Set text in the numeric text field. |
boolean |
setTextLimit(int iLimit)
This function sets maximal nuber of characters typed |
| Methods inherited from class org.eclipse.swt.widgets.Composite |
|---|
changed, checkSubclass, computeSize, getChildren, getClientArea, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, setFocus, setLayout, setLayoutDeferred, setTabList |
| Methods inherited from class org.eclipse.swt.widgets.Scrollable |
|---|
computeTrim, getBorderWidth, getHorizontalBar, getVerticalBar |
| Methods inherited from class org.eclipse.swt.widgets.Control |
|---|
addControlListener, addFocusListener, addHelpListener, addKeyListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addPaintListener, addTraverseListener, computeSize, forceFocus, getAccessible, getBackground, 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, removeFocusListener, removeHelpListener, removeKeyListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removePaintListener, removeTraverseListener, setBackground, setBounds, setBounds, setCapture, setCursor, setEnabled, 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 |
| Field Detail |
|---|
protected static final int BASE_HEIGHT
protected org.eclipse.swt.graphics.Point m_preferredSize
protected java.util.Set m_setListeners
protected NumericText m_numberText
protected java.util.Date m_lastModified
protected java.lang.String m_strCancelConfirmation
protected boolean m_bDecimalDot
| Constructor Detail |
|---|
public NumberPad(org.eclipse.swt.widgets.Composite parent,
int style,
java.lang.String strSetButtonText,
boolean bBigButtons,
boolean bDecimalDot)
parent - - who is parent of this control.style - - what style to usestrSetButtonText - - text to display in button when the user wants
to finish typing number, if null, the button
won't be displayedbBigButtons - - if true then the buttons will be displayed using large
fonts otherwise they will be displayed middle sizebDecimalDot - - if true extra line of buttons with decimal dot will
be added to dialog. If bDecimalDot id true, number
of decimal places can be set
public NumberPad(org.eclipse.swt.widgets.Composite parent,
int style,
java.lang.String strSetButtonText,
java.lang.String strCancelButtonText,
java.lang.String strCancelConfirmation,
boolean bBigButtons,
boolean bDecimalDot)
parent - - who is parent of this screenstyle - - what style to usestrSetButtonText - - text to display in button which user uses to
finish typing number, if null, the button won't
be displayedstrCancelButtonText - - text to display in button to cancel the
operation, if null, the button won't be
displayedstrCancelConfirmation - - text to display to confirm canceling of the
operation using cancel button. If null, no
confirmation is displayed.bBigButtons - - if true then the buttons will be displayed using large
fonts otherwise they will be displayed middle sizebDecimalDot - - if true extra line of buttons with decimal dot will
be added to dialog. If bDecimalDot id true, number
of decimal places can be set| Method Detail |
|---|
public org.eclipse.swt.graphics.Point getPreferredSize()
public void addNumberPadListener(NumberPadListener listener)
listener - - listener to addpublic void removeNumberPadListener(NumberPadListener listener)
listener - - listener to removepublic void modified()
modified in interface ModificationListenerpublic java.util.Date getLastModified()
public java.lang.String getText()
public void setText(java.lang.String text)
text - - text typed in the numeric text fieldpublic boolean setTextLimit(int iLimit)
iLimit - - maximal number of chracters
public java.lang.String formatText(java.lang.String inputText)
inputText - - text to format
protected void notifyNumberPadListeners()
protected void createButton(java.lang.String strText,
boolean bBigButtons,
org.eclipse.swt.events.SelectionListener listener)
strText - - text to display on the buttonbBigButtons - - if true then the buttons will be displayed large
otherwise they will be displayed middle sizelistener - - listener processing events from the button
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||