Class JsonValueField<VALUE_FIELD extends IValueField<?>>
- java.lang.Object
-
- org.eclipse.scout.rt.ui.html.json.AbstractJsonAdapter<T>
-
- org.eclipse.scout.rt.ui.html.json.AbstractJsonPropertyObserver<T>
-
- org.eclipse.scout.rt.ui.html.json.AbstractJsonWidget<FORM_FIELD>
-
- org.eclipse.scout.rt.ui.html.json.form.fields.JsonFormField<VALUE_FIELD>
-
- org.eclipse.scout.rt.ui.html.json.form.fields.JsonValueField<VALUE_FIELD>
-
- Type Parameters:
VALUE_FIELD
-
- All Implemented Interfaces:
IJsonAdapter<VALUE_FIELD>
,IJsonObject
,IJsonContextMenuOwner
- Direct Known Subclasses:
JsonBasicField
,JsonBeanField
,JsonCheckBoxField
,JsonClipboardField
,JsonColorField
,JsonDateField
,JsonFileChooserButton
,JsonFileChooserField
,JsonHtmlField
,JsonLabelField
,JsonModeSelectorField
,JsonRadioButtonGroup
,JsonSmartField
,JsonTagField
public abstract class JsonValueField<VALUE_FIELD extends IValueField<?>> extends JsonFormField<VALUE_FIELD>
Base class used to create JSON output for Scout form-fields with a value. When a sub-class need to provide a customvalueToJson()
method for the value property, it should replace the default JsonProperty for PROP_VALUE , with it's own implementation by callingputJsonProperty()
.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.eclipse.scout.rt.ui.html.json.AbstractJsonWidget
AbstractJsonWidget.P_WidgetListener
-
Nested classes/interfaces inherited from class org.eclipse.scout.rt.ui.html.json.AbstractJsonPropertyObserver
AbstractJsonPropertyObserver.P_PropertyChangeListener
-
-
Field Summary
Fields Modifier and Type Field Description static String
EVENT_ACCEPT_INPUT
This event is used when display-text has changed after field loses focus or when the display-text has changed while typing (this event is send after each key-press).-
Fields inherited from class org.eclipse.scout.rt.ui.html.json.AbstractJsonWidget
EVENT_REVEAL, EVENT_SCROLL_TO_TOP
-
Fields inherited from interface org.eclipse.scout.rt.ui.html.json.menu.IJsonContextMenuOwner
PROP_CURRENT_MENU_TYPES, PROP_MENUS, PROP_MENUS_VISIBLE
-
-
Constructor Summary
Constructors Constructor Description JsonValueField(VALUE_FIELD model, IUiSession uiSession, String id, IJsonAdapter<?> parent)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getObjectType()
Returns a string used to identify the object-type in the JSON output (JSON attribute 'objectType').protected void
handleUiAcceptInput(JsonEvent event)
protected void
handleUiAcceptInputAfterTyping(String displayText)
Called by the UI when the displayText has changed and the editing action has finished (whileTyping = false
).protected void
handleUiAcceptInputWhileTyping(String displayText)
Called by the UI when the displayText has changed but the editing action has not yet finished (whileTyping = true
).protected void
handleUiDisplayTextChange(JSONObject data)
Info: the handle*Change methods below are used by some sub-classes, but not by all sub-classes.protected void
handleUiErrorStatusChange(JSONObject data)
void
handleUiEvent(JsonEvent event)
protected void
handleUiValueChange(JSONObject data)
protected void
initJsonProperties(VALUE_FIELD model)
protected Object
jsonToValue(Object jsonValue)
protected void
setDisplayTextFromUI(String displayText)
protected void
setErrorStatusFromUI(org.eclipse.scout.rt.platform.status.IStatus status)
protected void
setValueFromUI(Object value)
-
Methods inherited from class org.eclipse.scout.rt.ui.html.json.form.fields.JsonFormField
attachChildAdapters, attachModel, detachModel, disposeChildAdapters, handleModelContextMenuChanged, handleModelContextMenuCurrentMenuTypesChanged, handleModelContextMenuVisibleChanged, handleModelPropertyChange, menuTypesToJson, toJson
-
Methods inherited from class org.eclipse.scout.rt.ui.html.json.AbstractJsonWidget
handleModelReveal, handleModelScrollTopTop, handleModelWidgetEvent, scrollOptionsToJson
-
Methods inherited from class org.eclipse.scout.rt.ui.html.json.AbstractJsonPropertyObserver
addCustomJsonProperty, addPropertyChangeEvent, addPropertyChangeEvent, addPropertyEventFilterCondition, addPropertyEventFilterCondition, cleanUpEventFilters, filterPropertyChangeEvent, getCustomJsonProperties, getJsonProperty, handleLazyJsonProperties, handleModelPropertyChange, init, putJsonProperty, removeCustomJsonProperty, removeJsonProperty, responseAlreadyContainsPropertyChangeEvent
-
Methods inherited from class org.eclipse.scout.rt.ui.html.json.AbstractJsonAdapter
addActionEvent, addActionEvent, addActionEvent, addPropertyChangeEvent, attachAdapter, attachAdapter, attachAdapters, attachAdapters, attachGlobalAdapter, attachGlobalAdapter, attachGlobalAdapters, attachGlobalAdapters, dispose, getAdapter, getAdapter, getAdapters, getAdapters, getGlobalAdapter, getGlobalAdapter, getId, getModel, getObjectTypeVariant, getParent, getUiSession, handleUiPropertyChange, handleUiPropertyChange, hasAncestor, isDisposed, isInitialized, processBufferedEvents, putAdapterIdProperty, putAdapterIdProperty, putAdapterIdsProperty, putAdapterIdsProperty, putProperty, registerAsBufferedEventsAdapter, replaceActionEvent, toString, unregisterAsBufferedEventsAdapter
-
-
-
-
Field Detail
-
EVENT_ACCEPT_INPUT
public static final String EVENT_ACCEPT_INPUT
This event is used when display-text has changed after field loses focus or when the display-text has changed while typing (this event is send after each key-press). You can distinct the two cases by looking on the while- Typing flag.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
JsonValueField
public JsonValueField(VALUE_FIELD model, IUiSession uiSession, String id, IJsonAdapter<?> parent)
-
-
Method Detail
-
getObjectType
public String getObjectType()
Description copied from interface:IJsonAdapter
Returns a string used to identify the object-type in the JSON output (JSON attribute 'objectType').- Specified by:
getObjectType
in interfaceIJsonAdapter<VALUE_FIELD extends IValueField<?>>
- Overrides:
getObjectType
in classJsonFormField<VALUE_FIELD extends IValueField<?>>
-
initJsonProperties
protected void initJsonProperties(VALUE_FIELD model)
- Overrides:
initJsonProperties
in classJsonFormField<VALUE_FIELD extends IValueField<?>>
-
handleUiEvent
public void handleUiEvent(JsonEvent event)
- Specified by:
handleUiEvent
in interfaceIJsonAdapter<VALUE_FIELD extends IValueField<?>>
- Overrides:
handleUiEvent
in classAbstractJsonAdapter<VALUE_FIELD extends IValueField<?>>
-
handleUiAcceptInput
protected void handleUiAcceptInput(JsonEvent event)
-
handleUiDisplayTextChange
protected void handleUiDisplayTextChange(JSONObject data)
Info: the handle*Change methods below are used by some sub-classes, but not by all sub-classes. Additionally IValueField does not define a getUIFacade() method. The implementations of the UIFacade interfaces are quite different from each other, so there's no easy way to add the method to IValueField and implement an IValueUIFacade.
-
setDisplayTextFromUI
protected void setDisplayTextFromUI(String displayText)
-
handleUiValueChange
protected void handleUiValueChange(JSONObject data)
-
setValueFromUI
protected void setValueFromUI(Object value)
-
handleUiErrorStatusChange
protected void handleUiErrorStatusChange(JSONObject data)
-
setErrorStatusFromUI
protected void setErrorStatusFromUI(org.eclipse.scout.rt.platform.status.IStatus status)
-
handleUiAcceptInputWhileTyping
protected void handleUiAcceptInputWhileTyping(String displayText)
Called by the UI when the displayText has changed but the editing action has not yet finished (whileTyping = true
). The model field does not yet change its value. This method is usually only called when theIBasicField.PROP_UPDATE_DISPLAY_TEXT_ON_MODIFY
flag is set.
-
handleUiAcceptInputAfterTyping
protected void handleUiAcceptInputAfterTyping(String displayText)
Called by the UI when the displayText has changed and the editing action has finished (whileTyping = false
). The model field parses the displayText and updates its value.
-
-