|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.google.gwt.user.client.ui.UIObject
com.google.gwt.user.client.ui.Widget
com.google.gwt.user.client.ui.Composite
com.sage.swt.client.widget.AbstractSwtWidget
com.sage.swt.client.widget.AbstractSwtDataWidget
com.sage.swt.client.widget.AbstractSwtTextBox
public abstract class AbstractSwtTextBox
The "SWT-ized" version of TextBoxBase, but with formatting support added. This base class provides convenience implementations of methods, many of which just delegate to the underlying TextBoxBase widget (provided by implementing class), underlying formatter (provided by the implementing class), or other members created by this class.
| Nested Class Summary | |
|---|---|
protected class |
AbstractSwtTextBox.FormattableTextBoxBlurHandler
Focus handler for a formattable text box. |
protected class |
AbstractSwtTextBox.HintBlurHandler
Blur handler for a text box. |
protected class |
AbstractSwtTextBox.HintClickHandler
HintClickHandler when the user clicks on the textBox, if a hint exists in the box, then the cursor position must be on the first position. |
protected class |
AbstractSwtTextBox.HintFocusHandler
Focus handler for a text box. |
protected class |
AbstractSwtTextBox.HintKeyDownHandler
Keyboard handler for a text box. |
| Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject |
|---|
com.google.gwt.user.client.ui.UIObject.DebugIdImpl, com.google.gwt.user.client.ui.UIObject.DebugIdImplEnabled |
| Field Summary |
|---|
| Fields inherited from class com.sage.swt.client.widget.AbstractSwtDataWidget |
|---|
PIXEL_FACTOR |
| Fields inherited from class com.google.gwt.user.client.ui.UIObject |
|---|
DEBUG_ID_PREFIX |
| Fields inherited from interface com.sage.swt.client.widget.BehavesAsTextBox |
|---|
ALIGN_CENTER, ALIGN_JUSTIFY, ALIGN_LEFT, ALIGN_RIGHT |
| Constructor Summary | |
|---|---|
AbstractSwtTextBox()
Default constructor. |
|
AbstractSwtTextBox(WidgetKey widgetKey,
SwtErrorStack errorStack)
Constructor. |
|
| Method Summary | |
|---|---|
com.google.gwt.event.shared.HandlerRegistration |
addBeforeFocusHandler(BeforeFocusHandler handler)
Adds a handler to receive BeforeFocus events. |
com.google.gwt.event.shared.HandlerRegistration |
addBlurHandler(com.google.gwt.event.dom.client.BlurHandler handler)
|
com.google.gwt.event.shared.HandlerRegistration |
addClickHandler(com.google.gwt.event.dom.client.ClickHandler handler)
|
com.google.gwt.event.shared.HandlerRegistration |
addFocusHandler(com.google.gwt.event.dom.client.FocusHandler handler)
|
com.google.gwt.event.shared.HandlerRegistration |
addKeyDownHandler(com.google.gwt.event.dom.client.KeyDownHandler handler)
|
com.google.gwt.event.shared.HandlerRegistration |
addKeyPressHandler(com.google.gwt.event.dom.client.KeyPressHandler handler)
|
com.google.gwt.event.shared.HandlerRegistration |
addKeyUpHandler(com.google.gwt.event.dom.client.KeyUpHandler handler)
|
void |
cancelKey()
If a keyboard event is currently being handled on this text box, calling this method will suppress it. |
int |
getCursorPos()
Gets the current position of the cursor (this also serves as the beginning of the text selection). |
protected static java.util.Collection<Property> |
getDefaultProperties()
Make it static so widgets can do static initializers of their properties (for efficiency). |
protected abstract Formatter |
getFormatter()
Returns the formatter associated with this (composite) widget. |
java.lang.String |
getHintText()
Get hint text |
java.lang.String |
getName()
|
protected abstract PatternFormatter |
getPatternFormatter()
|
java.util.Collection<Property> |
getProperties()
Gets the collection of properties contained in this bag. |
java.lang.String |
getSelectedText()
Gets the text currently selected within this text box. |
int |
getSelectionLength()
Gets the length of the current text selection. |
int |
getTabIndex()
|
java.lang.String |
getText()
Get the text in the text box |
protected abstract com.google.gwt.user.client.ui.TextBoxBase |
getTextBox()
Returns the text entry (TextBoxBase) widget that is being wrapped by this composite class. |
java.lang.Object |
getValue()
Gets the widget's value. |
protected com.google.gwt.user.client.ui.Widget |
getWidget()
Gets the topmost underlying widget that is being wrapped by this SWT widget. |
int |
getWidth()
Return the width set by the width property or the auto size property |
boolean |
isReadOnly()
Determines whether or not the widget is read-only. |
void |
onBlur(com.google.gwt.event.dom.client.BlurEvent event)
|
void |
onFocus(com.google.gwt.event.dom.client.FocusEvent event)
|
void |
refreshFormattedValue()
Re-format the value based on the format information. |
void |
selectAll()
Selects all of the text in the box. |
void |
setAccessKey(char key)
|
void |
setAutoSizeLayout(AutoSizeLayoutInfo info)
Set the width via the auto size property |
void |
setCursorPos(int pos)
Sets the cursor position. |
protected boolean |
setDefaultPropertyValue(Property property,
java.lang.Object newValue)
Sets the value of one of the wrapped widget's default properties. |
void |
setFocus(boolean focused)
|
void |
setFormatError(boolean error)
Sets or removes the format error style ("formatError" style name). |
void |
setHeight(int height)
Sets the object's height. |
void |
setHintText(java.lang.String hintText)
Set hint text |
void |
setName(java.lang.String name)
|
void |
setReadOnly(boolean readOnly)
Turns read-only mode on or off. |
void |
setSelectionRange(int pos,
int length)
Sets the range of text to be selected. |
void |
setTabIndex(int index)
|
void |
setText(java.lang.String text)
Set the text in the text box |
void |
setTextAlignment(com.google.gwt.user.client.ui.ValueBoxBase.TextAlignment alignment)
Sets the alignment of the text in the text box. |
void |
setupDefaultSizeProperties()
This method will setup the Height and Width properties that are stored for a widget - so that a subsequent call to getPropertyValue will return a non-null value. |
protected void |
setupPropertyDefaultValues()
Stores the current value of the widget properties as the default values. |
void |
setValue(java.lang.Object value)
Sets the value of the widget. |
void |
setWidth(int width)
Sets the object's width. |
| Methods inherited from class com.sage.swt.client.widget.AbstractSwtDataWidget |
|---|
addChangeHandler, fireChangeEvent, fireChangeEvent, getDataPropertyBinding, getDataType, getEvent, getEvents, getFormatPattern, getFractionDigits, getMaxLength, getNumberDomain, getTotalDigits, integerOf, refreshValue, saveValueToDataSource, setDataPropertyBinding, setDataType, setFormatPattern, setFractionDigits, setMaxLength, setNumberDomain, setTotalDigits, setValue |
| Methods inherited from class com.google.gwt.user.client.ui.Composite |
|---|
initWidget, isAttached, onAttach, onBrowserEvent, onDetach, setWidget |
| Methods inherited from class com.google.gwt.user.client.ui.Widget |
|---|
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, doAttachChildren, doDetachChildren, fireEvent, getHandlerCount, getLayoutData, getParent, isOrWasAttached, onLoad, onUnload, removeFromParent, setLayoutData, sinkEvents |
| Methods inherited from class com.google.gwt.user.client.ui.UIObject |
|---|
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, setElement, setElement, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setVisible, setWidth, sinkBitlessEvent, toString, unsinkEvents |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface com.sage.swt.client.widget.BehavesAsFocusWidget |
|---|
isEnabled, setEnabled |
| Methods inherited from interface com.google.gwt.event.shared.HasHandlers |
|---|
fireEvent |
| Methods inherited from interface com.sage.swt.client.widget.HasBeforeWidgetKeyChangedHandlers |
|---|
addBeforeWidgetKeyChangedHandler |
| Methods inherited from interface com.sage.swt.client.widget.HasAfterWidgetKeyChangedHandlers |
|---|
addAfterWidgetKeyChangedHandler |
| Methods inherited from interface com.sage.swt.client.customization.PropertyBag |
|---|
setPropertyValue |
| Constructor Detail |
|---|
public AbstractSwtTextBox()
public AbstractSwtTextBox(WidgetKey widgetKey,
SwtErrorStack errorStack)
widgetKey - The WidgetKey for the widget.errorStack - The SwtErrorStack that stores
the list of UI errors.| Method Detail |
|---|
protected com.google.gwt.user.client.ui.Widget getWidget()
getWidget in class AbstractSwtWidgetprotected abstract com.google.gwt.user.client.ui.TextBoxBase getTextBox()
protected abstract Formatter getFormatter()
protected abstract PatternFormatter getPatternFormatter()
public java.lang.Object getValue()
getValue in interface SwtSimpleDataWidgetpublic void setValue(java.lang.Object value)
Sets the value of the widget.
setValue in interface SwtSimpleBindableWidgetvalue - The value to set in this widget.public void refreshFormattedValue()
refreshFormattedValue in interface SwtSimpleDataWidgetrefreshFormattedValue in class AbstractSwtDataWidgetpublic boolean isReadOnly()
isReadOnly in interface HasReadOnlytrue if the widget is currently read-only,
false if the widget is currently editablepublic void setReadOnly(boolean readOnly)
setReadOnly in interface HasReadOnlyreadOnly - if true, the widget becomes read-only; if
false the widget becomes editablepublic void setHeight(int height)
setHeight in interface Resizeableheight - the object's new height in pixelspublic int getWidth()
public void setWidth(int width)
setWidth in interface Resizeablewidth - the object's new width in pixelspublic void setAutoSizeLayout(AutoSizeLayoutInfo info)
info - the auto size informationpublic java.util.Collection<Property> getProperties()
getProperties in interface PropertyBaggetProperties in class AbstractSwtDataWidgetpublic void setupDefaultSizeProperties()
setupDefaultSizeProperties in interface Resizeable
protected boolean setDefaultPropertyValue(Property property,
java.lang.Object newValue)
setDefaultPropertyValue in class AbstractSwtDataWidgetproperty - The default property whose value is to be set.newValue - The new value of the default property.
protected void setupPropertyDefaultValues()
setupPropertyDefaultValues in class AbstractSwtDataWidgetprotected static java.util.Collection<Property> getDefaultProperties()
Collection of Propertypublic void setFormatError(boolean error)
error - true to set the style, false to remove
it.public void cancelKey()
cancelKey in interface BehavesAsTextBoxpublic int getCursorPos()
getCursorPos in interface BehavesAsTextBoxpublic java.lang.String getSelectedText()
getSelectedText in interface BehavesAsTextBoxpublic int getSelectionLength()
getSelectionLength in interface BehavesAsTextBoxpublic void selectAll()
selectAll in interface BehavesAsTextBoxpublic void setCursorPos(int pos)
setCursorPos in interface BehavesAsTextBoxpos - the new cursor position
public void setSelectionRange(int pos,
int length)
setSelectionRange in interface BehavesAsTextBoxpos - the position of the first character to be selectedlength - the number of characters to be selectedpublic void setTextAlignment(com.google.gwt.user.client.ui.ValueBoxBase.TextAlignment alignment)
setTextAlignment in interface BehavesAsTextBoxalignment - the text alignment (as specified by BehavesAsTextBox.ALIGN_CENTER,
BehavesAsTextBox.ALIGN_JUSTIFY, BehavesAsTextBox.ALIGN_LEFT, and
BehavesAsTextBox.ALIGN_RIGHT)public com.google.gwt.event.shared.HandlerRegistration addClickHandler(com.google.gwt.event.dom.client.ClickHandler handler)
addClickHandler in interface com.google.gwt.event.dom.client.HasClickHandlerspublic com.google.gwt.event.shared.HandlerRegistration addFocusHandler(com.google.gwt.event.dom.client.FocusHandler handler)
addFocusHandler in interface com.google.gwt.event.dom.client.HasFocusHandlerspublic com.google.gwt.event.shared.HandlerRegistration addBlurHandler(com.google.gwt.event.dom.client.BlurHandler handler)
addBlurHandler in interface com.google.gwt.event.dom.client.HasBlurHandlerspublic com.google.gwt.event.shared.HandlerRegistration addBeforeFocusHandler(BeforeFocusHandler handler)
addBeforeFocusHandler in interface HasCancellableFocusHandlershandler - the handler
public int getTabIndex()
getTabIndex in interface com.google.gwt.user.client.ui.Focusablepublic void setAccessKey(char key)
setAccessKey in interface com.google.gwt.user.client.ui.Focusablepublic void setFocus(boolean focused)
setFocus in interface com.google.gwt.user.client.ui.Focusablepublic void setTabIndex(int index)
setTabIndex in interface com.google.gwt.user.client.ui.Focusablepublic com.google.gwt.event.shared.HandlerRegistration addKeyPressHandler(com.google.gwt.event.dom.client.KeyPressHandler handler)
addKeyPressHandler in interface com.google.gwt.event.dom.client.HasKeyPressHandlerspublic com.google.gwt.event.shared.HandlerRegistration addKeyDownHandler(com.google.gwt.event.dom.client.KeyDownHandler handler)
addKeyDownHandler in interface com.google.gwt.event.dom.client.HasKeyDownHandlerspublic com.google.gwt.event.shared.HandlerRegistration addKeyUpHandler(com.google.gwt.event.dom.client.KeyUpHandler handler)
addKeyUpHandler in interface com.google.gwt.event.dom.client.HasKeyUpHandlerspublic void onFocus(com.google.gwt.event.dom.client.FocusEvent event)
onFocus in interface com.google.gwt.event.dom.client.FocusHandlerpublic void onBlur(com.google.gwt.event.dom.client.BlurEvent event)
onBlur in interface com.google.gwt.event.dom.client.BlurHandlerpublic java.lang.String getName()
getName in interface com.google.gwt.user.client.ui.HasNamepublic void setName(java.lang.String name)
setName in interface com.google.gwt.user.client.ui.HasNamepublic java.lang.String getText()
public void setText(java.lang.String text)
text - the text in the text boxpublic java.lang.String getHintText()
getHintText in interface HasHintpublic void setHintText(java.lang.String hintText)
setHintText in interface HasHinthintText - The hint text of the widget.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||