OPTION
- the widget type of the select optionspublic abstract class A_CmsSelectBox<OPTION extends A_CmsSelectCell> extends com.google.gwt.user.client.ui.Composite implements I_CmsFormWidget, com.google.gwt.event.logical.shared.HasValueChangeHandlers<java.lang.String>, com.google.gwt.event.dom.client.HasFocusHandlers, I_CmsTruncable
限定符和类型 | 类和说明 |
---|---|
protected static interface |
A_CmsSelectBox.I_CmsSelectBoxUiBinder
The UI Binder interface for this widget.
|
protected class |
A_CmsSelectBox.ScrollEventPreviewHandler
Drag and drop event preview handler.
|
com.google.gwt.user.client.ui.UIObject.DebugIdImpl, com.google.gwt.user.client.ui.UIObject.DebugIdImplEnabled
I_CmsFormWidget.FieldType
限定符和类型 | 字段和说明 |
---|---|
protected static I_CmsInputCss |
CSS
The layout bundle.
|
protected CmsErrorWidget |
m_error
Error widget.
|
protected com.google.gwt.event.shared.SimpleEventBus |
m_eventBus
The event bus.
|
protected CmsPushButton |
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 com.google.gwt.event.shared.HandlerRegistration |
m_previewHandlerRegistration
The preview handler registration.
|
protected CmsStyleVariable |
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 CmsStyleVariable |
m_selectorState
Style of the select box widget.
|
构造器和说明 |
---|
A_CmsSelectBox()
Creates a new select box.
|
限定符和类型 | 方法和说明 |
---|---|
com.google.gwt.event.shared.HandlerRegistration |
addFocusHandler(com.google.gwt.event.dom.client.FocusHandler handler) |
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_CmsFormWidget.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.
|
com.google.gwt.user.client.ui.Panel |
getSelectorPopup()
Returns the selector of this widget.
|
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 |
onDetach() |
protected void |
onFocus(com.google.gwt.event.dom.client.FocusEvent event)
Handles the focus event on the opener.
|
protected void |
onLoad() |
protected void |
onValueSelect(java.lang.String value)
This method is called when a value is selected.
|
protected void |
onValueSelect(java.lang.String value,
boolean fireEvents)
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.
|
protected void |
removeWindowResizeHandler()
Deinstalls the window resize handler.
|
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 |
setFormValue(java.lang.Object value,
boolean fireEvents)
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 |
setPopupResize(boolean resize)
Sets the behavior of the popup if the input is bigger than the selectbox itself.
|
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, render, render, resolvePotentialElement, setWidget
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, doAttachChildren, doDetachChildren, fireEvent, getHandlerCount, getLayoutData, getParent, isOrWasAttached, onUnload, removeFromParent, setLayoutData, sinkEvents
addStyleDependentName, 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, toString, unsinkEvents
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getApparentValue, setAutoHideParent
protected static final I_CmsInputCss CSS
@UiField protected CmsErrorWidget m_error
protected com.google.gwt.event.shared.SimpleEventBus m_eventBus
protected CmsPushButton 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 com.google.gwt.event.shared.HandlerRegistration m_previewHandlerRegistration
protected final CmsStyleVariable m_selectBoxState
protected java.util.Map<java.lang.String,OPTION extends A_CmsSelectCell> m_selectCells
protected java.lang.String m_selectedValue
protected com.google.gwt.user.client.ui.Panel m_selector
protected final CmsStyleVariable m_selectorState
public com.google.gwt.event.shared.HandlerRegistration addFocusHandler(com.google.gwt.event.dom.client.FocusHandler handler)
addFocusHandler
在接口中 com.google.gwt.event.dom.client.HasFocusHandlers
HasFocusHandlers.addFocusHandler(com.google.gwt.event.dom.client.FocusHandler)
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
在接口中 com.google.gwt.event.logical.shared.HasValueChangeHandlers<java.lang.String>
HasValueChangeHandlers.addValueChangeHandler(com.google.gwt.event.logical.shared.ValueChangeHandler)
public I_CmsFormWidget.FieldType getFieldType()
I_CmsFormWidget
getFieldType
在接口中 I_CmsFormWidget
I_CmsFormWidget.getFieldType()
public java.lang.Object getFormValue()
I_CmsFormWidget
getFormValue
在接口中 I_CmsFormWidget
I_CmsFormWidget.getFormValue()
public java.lang.String getFormValueAsString()
I_CmsFormWidget
getFormValueAsString
在接口中 I_CmsFormWidget
I_CmsFormWidget.getFormValueAsString()
public com.google.gwt.user.client.ui.Panel getSelectorPopup()
public boolean isEnabled()
I_CmsFormWidget
true
if this widget is enabled.isEnabled
在接口中 I_CmsFormWidget
true
if this widget is enabledI_CmsFormWidget.isEnabled()
public void onBrowserEvent(com.google.gwt.user.client.Event event)
onBrowserEvent
在接口中 com.google.gwt.user.client.EventListener
onBrowserEvent
在类中 com.google.gwt.user.client.ui.Composite
Composite.onBrowserEvent(com.google.gwt.user.client.Event)
public void reset()
I_CmsFormWidget
reset
在接口中 I_CmsFormWidget
I_CmsFormWidget.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_CmsFormWidget
setEnabled
在接口中 I_CmsFormWidget
enabled
- if true, the widget will be enabled, else disabledI_CmsFormWidget.setEnabled(boolean)
public void setErrorMessage(java.lang.String errorMessage)
I_CmsFormWidget
If the error message is null, no error message will be displayed.
setErrorMessage
在接口中 I_CmsFormWidget
errorMessage
- an error message or nullI_CmsFormWidget.setErrorMessage(java.lang.String)
public void setFormValue(java.lang.Object value)
value
- the new valuepublic void setFormValue(java.lang.Object value, boolean fireEvents)
value
- the new valuefireEvents
- true if change events should be firedpublic void setFormValueAsString(java.lang.String formValue)
I_CmsFormWidget
setFormValueAsString
在接口中 I_CmsFormWidget
formValue
- the new value of the widgetI_CmsFormWidget.setFormValueAsString(java.lang.String)
public void setPopupResize(boolean resize)
resize
- public void truncate(java.lang.String textMetricsPrefix, int widgetWidth)
I_CmsTruncable
truncate
在接口中 I_CmsTruncable
textMetricsPrefix
- the key identifying the text metrics to usewidgetWidth
- the width to use in pixelsI_CmsTruncable.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 onDetach()
onDetach
在类中 com.google.gwt.user.client.ui.Composite
Composite.onDetach()
@UiHandler(value="m_opener") protected void onFocus(com.google.gwt.event.dom.client.FocusEvent event)
event
- protected void onLoad()
onLoad
在类中 com.google.gwt.user.client.ui.Widget
Widget.onLoad()
protected void onValueSelect(java.lang.String value)
value
- the selected valueprotected void onValueSelect(java.lang.String value, boolean fireEvents)
value
- the new valuefireEvents
- true if change events should be firedprotected void open()
protected void removeWindowResizeHandler()
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