com.alkacon.geranium.client.ui.input
OPTION - the widget type of the select optionspublic abstract class A_SelectBox<OPTION extends A_SelectCell> extends com.google.gwt.user.client.ui.Composite implements I_FormWidget, com.google.gwt.event.logical.shared.HasValueChangeHandlers<java.lang.String>, I_Truncable
| Modifier and Type | Class and Description |
|---|---|
protected static interface |
A_SelectBox.I_SelectBoxUiBinder
The UI Binder interface for this widget.
|
com.google.gwt.user.client.ui.UIObject.DebugIdImpl, com.google.gwt.user.client.ui.UIObject.DebugIdImplEnabledI_FormWidget.FieldType| Modifier and Type | Field and Description |
|---|---|
protected static I_InputCss |
CSS
The layout bundle.
|
protected ErrorWidget |
m_error
Error widget.
|
protected com.google.gwt.event.shared.SimpleEventBus |
m_eventBus
The event bus.
|
protected PushButton |
m_openClose
The open-close button.
|
protected com.google.gwt.user.client.ui.FocusPanel |
m_opener
The opener widget.
|
protected com.google.gwt.user.client.ui.Panel |
m_panel
Container for the opener and error widget.
|
protected com.google.gwt.user.client.ui.PopupPanel |
m_popup
The popup panel inside which the selector will be shown.
|
protected StyleVariable |
m_selectBoxState
Style of the select box widget.
|
protected java.util.Map<java.lang.String,OPTION> |
m_selectCells
The map of select options.
|
protected java.lang.String |
m_selectedValue
The value of the currently selected option.
|
protected com.google.gwt.user.client.ui.Panel |
m_selector
The selector which contains the select options.
|
protected StyleVariable |
m_selectorState
Style of the select box widget.
|
| Constructor and Description |
|---|
A_SelectBox()
Creates a new select box.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addOption(OPTION cell)
Adds a new select option to the select box.
|
com.google.gwt.event.shared.HandlerRegistration |
addValueChangeHandler(com.google.gwt.event.logical.shared.ValueChangeHandler<java.lang.String> handler) |
protected void |
clearItems()
Internal helper method for clearing the select options.
|
protected void |
close()
Internal method which is called when the selector is closed.
|
protected abstract OPTION |
createUnknownOption(java.lang.String value)
Internal method to create a select option for an unknown value.
|
protected void |
doClickOpener(com.google.gwt.event.dom.client.ClickEvent e)
Handle clicks on the opener.
|
I_FormWidget.FieldType |
getFieldType()
Returns the type of data this widget produces.
|
java.lang.Object |
getFormValue()
Gets the selected/entered value from the widget.
|
java.lang.String |
getFormValueAsString()
Gets the current value of the widget as a string.
|
protected void |
initMaxCellWidth()
Initializes the selector width.
|
protected abstract void |
initOpener()
The implementation of this method should initialize the opener of the select box.
|
boolean |
isEnabled()
Returns
true if this widget is enabled. |
void |
onBrowserEvent(com.google.gwt.user.client.Event event) |
protected void |
onValueSelect(java.lang.String value)
Internal handler method which is called when a new value is selected.
|
protected void |
open()
Internal method which is called when the selector is opened.
|
void |
reset()
Resets the widget to its default state.
|
void |
selectValue(java.lang.String value)
Helper method to set the current selected option.
|
void |
setEnabled(boolean enabled)
Enables or disables the widget.
|
void |
setErrorMessage(java.lang.String errorMessage)
Sets the error message for this widget.
|
void |
setFormValue(java.lang.Object value)
Sets the form value of this select box.
|
void |
setFormValueAsString(java.lang.String formValue)
Sets the current value of the widget as a string.
|
void |
truncate(java.lang.String textMetricsPrefix,
int widgetWidth)
Truncates long text and sets the original text to the title attribute.
|
protected abstract void |
truncateOpener(java.lang.String prefix,
int width)
Abstract method whose implementation should truncate the opener widget(s).
|
protected abstract void |
updateOpener(java.lang.String newValue)
The implementation of this method should update the opener when a new value is selected by the user.
|
claimElement, getWidget, initializeClaimedElement, initWidget, isAttached, onAttach, onDetach, render, render, resolvePotentialElement, setWidgetaddAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, doAttachChildren, doDetachChildren, fireEvent, getHandlerCount, getLayoutData, getParent, isOrWasAttached, onLoad, onUnload, removeFromParent, setLayoutData, sinkEvents, unsinkEventsaddStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, setElement, setElement, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkBitlessEvent, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetApparentValue, setAutoHideParentprotected static final I_InputCss CSS
@UiField protected ErrorWidget m_error
protected com.google.gwt.event.shared.SimpleEventBus m_eventBus
protected PushButton m_openClose
@UiField protected com.google.gwt.user.client.ui.FocusPanel m_opener
@UiField protected com.google.gwt.user.client.ui.Panel m_panel
protected com.google.gwt.user.client.ui.PopupPanel m_popup
protected final StyleVariable m_selectBoxState
protected java.util.Map<java.lang.String,OPTION extends A_SelectCell> m_selectCells
protected java.lang.String m_selectedValue
protected com.google.gwt.user.client.ui.Panel m_selector
protected final StyleVariable m_selectorState
public void addOption(OPTION cell)
cell - the widget representing the select optionpublic com.google.gwt.event.shared.HandlerRegistration addValueChangeHandler(com.google.gwt.event.logical.shared.ValueChangeHandler<java.lang.String> handler)
addValueChangeHandler in interface com.google.gwt.event.logical.shared.HasValueChangeHandlers<java.lang.String>HasValueChangeHandlers.addValueChangeHandler(com.google.gwt.event.logical.shared.ValueChangeHandler)public I_FormWidget.FieldType getFieldType()
I_FormWidgetgetFieldType in interface I_FormWidgetI_FormWidget.getFieldType()public java.lang.Object getFormValue()
I_FormWidgetgetFormValue in interface I_FormWidgetI_FormWidget.getFormValue()public java.lang.String getFormValueAsString()
I_FormWidgetgetFormValueAsString in interface I_FormWidgetI_FormWidget.getFormValueAsString()public boolean isEnabled()
I_FormWidgettrue if this widget is enabled.isEnabled in interface I_FormWidgettrue if this widget is enabledI_FormWidget.isEnabled()public void onBrowserEvent(com.google.gwt.user.client.Event event)
onBrowserEvent in interface com.google.gwt.user.client.EventListeneronBrowserEvent in class com.google.gwt.user.client.ui.CompositeComposite.onBrowserEvent(com.google.gwt.user.client.Event)public void reset()
I_FormWidgetreset in interface I_FormWidgetI_FormWidget.reset()public void selectValue(java.lang.String value)
This method does not trigger the "value changed" event.
value - the new valuepublic void setEnabled(boolean enabled)
I_FormWidgetsetEnabled in interface I_FormWidgetenabled - if true, the widget will be enabled, else disabledI_FormWidget.setEnabled(boolean)public void setErrorMessage(java.lang.String errorMessage)
I_FormWidgetIf the error message is null, no error message will be displayed.
setErrorMessage in interface I_FormWidgeterrorMessage - an error message or nullI_FormWidget.setErrorMessage(java.lang.String)public void setFormValue(java.lang.Object value)
value - the new valuepublic void setFormValueAsString(java.lang.String formValue)
I_FormWidgetsetFormValueAsString in interface I_FormWidgetformValue - the new value of the widgetI_FormWidget.setFormValueAsString(java.lang.String)public void truncate(java.lang.String textMetricsPrefix,
int widgetWidth)
I_Truncabletruncate in interface I_TruncabletextMetricsPrefix - the key identifying the text metrics to usewidgetWidth - the width to use in pixelsI_Truncable.truncate(java.lang.String, int)protected void clearItems()
protected void close()
protected abstract OPTION createUnknownOption(java.lang.String value)
value - the value for which to create the option@UiHandler(value="m_opener") protected void doClickOpener(com.google.gwt.event.dom.client.ClickEvent e)
e - the click eventprotected void initMaxCellWidth()
protected abstract void initOpener()
protected void onValueSelect(java.lang.String value)
value - the new valueprotected void open()
protected abstract void truncateOpener(java.lang.String prefix,
int width)
prefix - the text metrics prefixwidth - the widget widthprotected abstract void updateOpener(java.lang.String newValue)
newValue - the value selected by the user