|
|||||||||
| 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.eclipse.swt.widgets.Canvas
org.opensubsystems.patterns.thickclient.application.swt.CharacterPad
public class CharacterPad
Control which allows user to type characters using mouse or finger on a screen.
| Nested Class Summary | |
|---|---|
static class |
CharacterPad.CharacterPadLayout
Structure defining what keys should appear in the keyboard pad and what is the width of the pad. |
| Field Summary | |
|---|---|
protected static int |
BASE_DIALOG_HEIGHT
Base (smallest) dialog height constant. |
static int |
CAPSLOCK_WIDTH
Width of capslock button |
static int |
CHP_HIDECAPSLOCK
hide caps lock button |
static int |
CHP_NONE
special flag for character pad |
static int |
CHP_SWITCHTOLOWERCASE
if CHP_UPPERCASE switch to loweracse after first chracter |
static int |
CHP_UPPERCASE
set caps lock to uppercase on beginnig |
static java.lang.String[] |
ENTER_BUTTON
Button used to enter values |
static CharacterPad.CharacterPadLayout |
KEY_LAYOUT_123
constant for all numeric characters |
static CharacterPad.CharacterPadLayout |
KEY_LAYOUT_123_QWERTY
constant for all numeric characters |
static CharacterPad.CharacterPadLayout |
KEY_LAYOUT_123_QWERTY_SPECIAL
constant for all numeric characters |
static CharacterPad.CharacterPadLayout |
KEY_LAYOUT_QWERTY
constant for all numeric characters |
protected boolean |
m_bHideCapsLock
Should we hide the capslock flag? |
protected boolean |
m_bToLowercase
Switch to lower case after characeter will be entered |
protected org.eclipse.swt.widgets.Button |
m_capsLock
Caps lock button |
protected java.lang.String |
m_initialText
Initial text for CharacterPad |
protected java.util.Date |
m_lastModified
Date when the content was last modified. |
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 int |
m_specialFlags
Variable for special flags |
protected org.eclipse.swt.widgets.Text |
m_text
Field which collects typed characters. |
| Fields inherited from class org.eclipse.swt.widgets.Composite |
|---|
embeddedHandle |
| Fields inherited from class org.eclipse.swt.widgets.Widget |
|---|
handle |
| Constructor Summary | |
|---|---|
CharacterPad(org.eclipse.swt.widgets.Composite parent,
int style,
java.lang.String[] specialButtons,
CharacterPad.CharacterPadLayout keyboardLayout,
int specialFlags,
boolean bBigButtons)
Constructor. |
|
| Method Summary | |
|---|---|
void |
addCharacterPadListener(CharacterPadListener listener)
Add listener for this character pad. |
protected void |
createButton(java.lang.String strText,
org.eclipse.swt.events.SelectionListener listener,
boolean bBigButtons)
Create new button for this character pad. |
org.eclipse.swt.graphics.Point |
getPreferredSize()
Get preferred size of this control based on the specified parameters. |
java.lang.String |
getText()
Get text from CharacterPad. |
void |
modified()
This method is called when some modification has happened. |
protected boolean |
notifyCharacterPadListeners(int intValue,
java.lang.String strEvent)
Notify all listeners about event. |
void |
processEvent(java.lang.String strEventName,
java.lang.Integer intEventId)
This metod receives event notification |
java.lang.String |
processText(java.lang.String text)
This method receives a string representing the modification (such as the character or text typed by the user) and applies modification (if any, such as uppercase of the text) and returns the modified text. |
void |
removeCharacterPadListener(CharacterPadListener listener)
Remove listener from this character pad. |
void |
setInitialText(java.lang.String initialText)
Set initial text in the CharacterPad |
boolean |
setTextLimit(int iLimit)
This function sets maximal nuber of characters typed |
| Methods inherited from class org.eclipse.swt.widgets.Canvas |
|---|
getCaret, scroll, setCaret, setFont |
| 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, 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_DIALOG_HEIGHT
public static final int CHP_NONE
public static final int CHP_UPPERCASE
public static final int CHP_HIDECAPSLOCK
public static final int CHP_SWITCHTOLOWERCASE
public static final CharacterPad.CharacterPadLayout KEY_LAYOUT_123
public static final CharacterPad.CharacterPadLayout KEY_LAYOUT_123_QWERTY
public static final CharacterPad.CharacterPadLayout KEY_LAYOUT_QWERTY
public static final CharacterPad.CharacterPadLayout KEY_LAYOUT_123_QWERTY_SPECIAL
public static final java.lang.String[] ENTER_BUTTON
public static final int CAPSLOCK_WIDTH
protected org.eclipse.swt.graphics.Point m_preferredSize
protected java.util.Set m_setListeners
protected org.eclipse.swt.widgets.Text m_text
protected java.util.Date m_lastModified
protected boolean m_bHideCapsLock
protected boolean m_bToLowercase
protected java.lang.String m_initialText
protected int m_specialFlags
protected org.eclipse.swt.widgets.Button m_capsLock
| Constructor Detail |
|---|
public CharacterPad(org.eclipse.swt.widgets.Composite parent,
int style,
java.lang.String[] specialButtons,
CharacterPad.CharacterPadLayout keyboardLayout,
int specialFlags,
boolean bBigButtons)
parent - - parent of character padstyle - - combination of SWT.xxx valuesspecialButtons - - array of strings for special action buttons
displayed on the bottom of the dialogkeyboardLayout - - layout of keys for the keyboard pad, see the
KEY_LAYOUT_XXX constantsspecialFlags - - special styles for character pad, combination of
CHP_XXX valuesbBigButtons - - if true then the buttons will be displayed large
otherwise they will be displayed middle size| Method Detail |
|---|
public org.eclipse.swt.graphics.Point getPreferredSize()
public void modified()
modified in interface ModificationListenerpublic java.lang.String processText(java.lang.String text)
processText in interface TextProcessortext - - text for modification
public boolean setTextLimit(int iLimit)
iLimit - - maximal number of chracters
public void processEvent(java.lang.String strEventName,
java.lang.Integer intEventId)
processEvent in interface EventProcessorstrEventName - - name of the event which will be sent to listener
when widget is selected.intEventId - - Integer value representing the event. It will be sent
to listener when widget is selected.public void addCharacterPadListener(CharacterPadListener listener)
listener - - listener to addpublic void removeCharacterPadListener(CharacterPadListener listener)
listener - - listener to removepublic java.lang.String getText()
public void setInitialText(java.lang.String initialText)
initialText - - text for CharacterPad
protected void createButton(java.lang.String strText,
org.eclipse.swt.events.SelectionListener listener,
boolean bBigButtons)
strText - - text to display on the buttonlistener - - listener processing events from the buttonbBigButtons - - if true then the buttons will be displayed large
otherwise they will be displayed middle size
protected boolean notifyCharacterPadListeners(int intValue,
java.lang.String strEvent)
intValue - - int offset of special button text in original String[]strEvent - - button text
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||