WIDGET - is the generic type of AbstractUiWidgetAdapter.getToplevelWidget().VALUE - is the generic type of the changed value.ADAPTER_VALUE - is the generic type of the value of the adapted
widget.public abstract class UiWidgetAdapterGwtField<WIDGET extends com.google.gwt.user.client.ui.Widget,VALUE,ADAPTER_VALUE> extends UiWidgetAdapterGwtWidgetActive<com.google.gwt.user.client.ui.Widget> implements UiWidgetAdapterField<VALUE,ADAPTER_VALUE>, AttributeReadMinimumValue<ADAPTER_VALUE>, AttributeReadMaximumValue<ADAPTER_VALUE>
UiWidgetAdapterField using GWT.| Modifier and Type | Field and Description |
|---|---|
private WIDGET |
activeWidget |
private String |
recentStringValue |
private ADAPTER_VALUE |
recentValue |
private com.google.gwt.user.client.ui.InlineLabel |
widgetMarkerEditMode
A marker displayed after the
activeWidget in edit mode. |
private com.google.gwt.user.client.ui.Widget |
widgetViewMode |
TAB_INDEX_NONEHTML_ATTRIBUTE_ID, ID_SEPARATOR, PROPERTY_IDPROPERTY_STYLES, STYLE_PATTERN_MULTIPLE, STYLE_PATTERN_SINGLEWAI_ARIAACCESS_KEY_NONE, HTML_ATTRIBUTE_ACCESS_KEYPROPERTY_LABELATTRIBUTE_COLSPAN| Constructor and Description |
|---|
UiWidgetAdapterGwtField()
The constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
applyEventAdapterForChange(EventAdapterGwt adapter)
Applies for
EventType.VALUE_CHANGE events. |
protected void |
attachActiveWidget(com.google.gwt.user.client.ui.ComplexPanel panel)
|
protected String |
convertValueToString(ADAPTER_VALUE value)
Converts the given value to
String. |
protected abstract WIDGET |
createActiveWidget() |
protected com.google.gwt.user.client.ui.Widget |
createToplevelWidget()
This method creates the
underlying widget. |
protected com.google.gwt.user.client.ui.Widget |
createViewWidget()
Creates the
Widget that is used to display the field value in
view-mode. |
WIDGET |
getActiveWidget()
This method gets the active widget.
|
protected com.google.gwt.dom.client.Element |
getInputElement() |
ADAPTER_VALUE |
getMaximumValue()
This method gets the maximum
value of this object. |
ADAPTER_VALUE |
getMinimumValue()
This method gets the minimum
value of this object. |
ADAPTER_VALUE |
getValue()
This method gets the value of this object.
|
String |
getValueAsString()
|
protected abstract com.google.gwt.event.dom.client.HasChangeHandlers |
getWidgetAsHasChangeHandlers() |
protected abstract com.google.gwt.user.client.TakesValue<ADAPTER_VALUE> |
getWidgetAsTakesValue() |
protected abstract com.google.gwt.user.client.TakesValue<String> |
getWidgetAsTakesValueString() |
protected com.google.gwt.user.client.ui.Widget |
getWidgetViewMode() |
protected void |
setAdapterValueInViewMode(ADAPTER_VALUE value)
This method updates the
view-mode-widget such that it displays the given
value. |
void |
setMode(boolean editMode)
This method is called from
UiModeChanger for
AttributeWriteMode.setMode(net.sf.mmm.client.ui.api.common.UiMode). |
void |
setValidationFailure(String validationFailure)
This method sets the
validation failure. |
void |
setValue(ADAPTER_VALUE value)
This method sets the
value. |
void |
setValueAsString(String value)
This method sets the
valueAsString of this object. |
protected void |
setValueInViewMode(String value)
This method updates the
view-mode-widget such that it displays the given
value. |
protected void |
updateWidgetViewMode()
This method updates the
view-mode-widget such that it displays the
current value. |
applyEventAdapterForClick, applyEventAdapterForFocus, getKeyboardFilter, getWidgetAsFocusable, getWidgetAsHasAllFocusHandlers, getWidgetAsHasBlurHandlers, getWidgetAsHasFocusHandlers, getWidgetAsKeyPressHandlers, setAccessKey, setClickEventSender, setFocused, setKeyboardFilterdispose, removeFromParentaddHandlerRegistration, addStyle, createAbsoluteImageUrl, createEventAdapter, getHeightInPixel, getImage, getImageParentElement, getLength, getSizeElement, getToplevelWidget, getToplevelWidget, getWidthInPixel, isStyleDeltaSupported, removeStyle, setAttribute, setId, setImage, setLength, setPrimaryStyle, setStyles, setTooltip, setVisibleapplyEventAdapter, applyEventAdapterForSelection, getEventAdapter, setEventSendercreateLabel, getAccessKey, getAltText, getAttribute, getBundle, getColumnSpan, getContext, getHeightInRows, getId, getLabel, getMaximumTextLength, getPrimaryStyle, getSelectionMode, getStyles, getTitle, getTooltip, getToplevelWidget, getUiWidget, getUiWidgetTyped, getUrl, getValidationFailure, hasStyle, isDisposed, isEnabled, isFocused, isResizable, setParent, setUiWidgetclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcreateAbsoluteImageUrl, createLabel, getToplevelWidget, isStyleDeltaSupported, removeFromParent, setEventSender, setParent, setVisiblesetIdgetIdsetTooltipgetTooltipsetEnabledisEnabledaddStyle, removeStylehasStylesetStylesgetStylessetPrimaryStylegetPrimaryStyledisposeisDisposedsetLengthgetLengthgetHeightInPixel, getWidthInPixelgetAttributesetAttributeisFocusedsetFocusedsetAccessKeygetAccessKeygetValidationFailureprivate com.google.gwt.user.client.ui.Widget widgetViewMode
getWidgetViewMode()private WIDGET extends com.google.gwt.user.client.ui.Widget activeWidget
getActiveWidget()private com.google.gwt.user.client.ui.InlineLabel widgetMarkerEditMode
activeWidget in edit mode. Empty by default. May be used to show error markers.private ADAPTER_VALUE recentValue
getValue()private String recentStringValue
getValueAsString()protected abstract com.google.gwt.event.dom.client.HasChangeHandlers getWidgetAsHasChangeHandlers()
widget as HasChangeHandlers or null if NOT
supported.protected abstract com.google.gwt.user.client.TakesValue<ADAPTER_VALUE> getWidgetAsTakesValue()
widget as TakesValue.protected abstract com.google.gwt.user.client.TakesValue<String> getWidgetAsTakesValueString()
public void setMode(boolean editMode)
UiModeChanger for
AttributeWriteMode.setMode(net.sf.mmm.client.ui.api.common.UiMode). It only
handles the predefined UiModes.setMode in interface UiWidgetAdaptersetMode in class AbstractUiWidgetAdapter<com.google.gwt.user.client.ui.Widget>editMode - - true of UiMode.EDIT and
false for UiMode.VIEW.protected void updateWidgetViewMode()
view-mode-widget such that it displays the
current value.protected void setAdapterValueInViewMode(ADAPTER_VALUE value)
view-mode-widget such that it displays the given
value. By default a label is created for view-mode. If you
change this you will also need to override this method to properly apply the value.value - is the value to display.protected void setValueInViewMode(String value)
view-mode-widget such that it displays the given
value. By default a label is created for view-mode. If you
change this you will also need to override this method to properly apply the value.value - is the value to display.protected String convertValueToString(ADAPTER_VALUE value)
String.protected void applyEventAdapterForChange(EventAdapterGwt adapter)
EventType.VALUE_CHANGE events.applyEventAdapterForChange in class AbstractUiWidgetAdapterWithEvents<com.google.gwt.user.client.ui.Widget,EventAdapterGwt>adapter - is the event adapter.public ADAPTER_VALUE getValue()
getValue in interface AttributeReadValue<ADAPTER_VALUE>null unless otherwise stated.public void setValue(ADAPTER_VALUE value)
value.setValue in interface AttributeWriteValue<ADAPTER_VALUE>value - is the new value. May be null unless otherwise stated.public String getValueAsString()
value as
String. It returns the value as it is entered by the end-user that may be invalid.getValueAsString in interface AttributeReadValueAsStringString if the field is blank.public void setValueAsString(String value)
valueAsString of this object. setValueAsString in interface AttributeWriteValueAsStringvalue - is the new value as it would have been entered by the user.protected final com.google.gwt.user.client.ui.Widget createToplevelWidget()
underlying widget. createToplevelWidget in class AbstractUiWidgetAdapter<com.google.gwt.user.client.ui.Widget>underlying widget.protected final com.google.gwt.user.client.ui.Widget getWidgetViewMode()
view-mode.protected com.google.gwt.user.client.ui.Widget createViewWidget()
Widget that is used to display the field value in
view-mode. If you override this method and change the
widget type you will also need to override updateWidgetViewMode().Widget.public final WIDGET getActiveWidget()
UiWidgetAdapterGwtWidgetAbstractUiWidgetAdapter.getToplevelWidget(). In more complex scenarios the toplevel widget
may only be a container widget and this method returns a child that represents the active part.getActiveWidget in class UiWidgetAdapterGwtWidget<com.google.gwt.user.client.ui.Widget>edit-mode.protected void attachActiveWidget(com.google.gwt.user.client.ui.ComplexPanel panel)
active widget after creation to
AbstractUiWidgetAdapter.getToplevelWidget(). May be overridden for composed active widgets.panel - is the ComplexPanel (see AbstractUiWidgetAdapter.getToplevelWidget()) where to
attach.protected abstract WIDGET createActiveWidget()
Widget that is used to display and modify the field value in
edit-mode.protected com.google.gwt.dom.client.Element getInputElement()
Element representing the actual editable field.public void setValidationFailure(String validationFailure)
validation failure. UiFeatureValidation. This
method is only intended as back-door for very special cases (e.g. you have to use your own validator
infrastructure and perform validation outside this framework). It is not recommended to use this method
as an API user.setValidationFailure in interface AttributeWriteValidationFailurevalidationFailure - is the validation failure text. The empty string or null will clear
the error and mark the field as valid. Otherwise the field will be invalid.public ADAPTER_VALUE getMinimumValue()
value of this object. A legal value has
to be greater or equal to this minimum.getMinimumValue in interface AttributeReadMinimumValue<ADAPTER_VALUE>value or
null if unbounded.public ADAPTER_VALUE getMaximumValue()
value of this object. A legal value has
to be less or equal to this maximum.getMaximumValue in interface AttributeReadMaximumValue<ADAPTER_VALUE>value or
null if unbounded.Copyright © 2001–2016 mmm-Team. All rights reserved.