VALUE
- is the generic type of the value
.public abstract class UiWidgetCustomEditor<VALUE> extends UiWidgetCustomComposite<VALUE,UiWidgetRegular,UiWidgetVerticalPanel>
custom composite widget
that
implements the UI pattern editor. It supports viewing
a composite value
(an entity
or business object). It has a button panel
with an "Edit"-Button that
switches
to the
edit-mode
. In edit-mode the user can modify the
object
and finally save his changes by pressing a "Save"-Button. This will check for
modifications
, trigger
validation
and create a new instance of
the value object
with the current modifications that is saved by delegation to the
UiHandlerObjectSave.onSave(Object, UiEvent)
on widgets for UI patterns or forms to edit business
objects (see UiWidgetCustomComposite.doGetValue(Object, ValidationState)
and UiWidgetCustomComposite.doSetValue(Object, boolean)
).Modifier and Type | Class and Description |
---|---|
private class |
UiWidgetCustomEditor.UiHandler
This inner class implements the handler interfaces.
|
AbstractUiWidget.AccessHelper, AbstractUiWidget.EventSender, AbstractUiWidget.HandlerContainer
Modifier and Type | Field and Description |
---|---|
private UiWidgetCustomEditor.UiHandler |
handler |
private UiHandlerObjectSave<VALUE> |
handlerSaveObject |
static String |
PRIMARY_STYLE
The default
primary style of this widget. |
STYLE_HEADER
HTML_ATTRIBUTE_ID, ID_SEPARATOR, PROPERTY_ID
PROPERTY_STYLES, STYLE_PATTERN_MULTIPLE, STYLE_PATTERN_SINGLE
WAI_ARIA
Constructor and Description |
---|
UiWidgetCustomEditor(UiContext context,
UiHandlerObjectSave<VALUE> handlerSaveObject,
Class<VALUE> valueClass)
The constructor.
|
Modifier and Type | Method and Description |
---|---|
protected void |
addChild(UiWidgetRegular child)
This method adds a new child.
|
protected UiWidgetButtonPanel |
createButtonPanel() |
protected void |
doInitialize()
This method is called from
UiWidgetCustom.initialize() but only if called for the first time. |
protected void |
setParent(UiWidgetComposite<?> parent)
This method sets the
parent . |
doGetValue, doSetValue, getChild, getChild, getChildCount, getChildIndex
addStyle, clearMessages, clearValidity, dispose, doSetMode, doValidate, getAriaRole, getDelegate, getDelegate, getId, getMode, getModeFixed, getParent, getPrimaryStyle, getSize, getSource, getStyles, getTooltip, getValueClass, getVisibleFlag, getWidgetAdapter, hasStyle, hasWidgetAdapter, initialize, isDisposed, isEnabled, isModifiedRecursive, isVisible, isVisibleRecursive, removeFromParent, removeStyle, setEnabled, setFocused, setId, setMode, setMode, setModeFixed, setPrimaryStyle, setStyles, setTooltip, setVisible, setVisible
addChangeHandler, addEventHandler, addValidator, clearMessagesLocal, clearValidationFailure, convertValueToString, fireEvent, fireValueChange, getBasicUtil, getContext, getDataBinding, getDataBinding, getDataBindingForWidget, getEventSender, getFactory, getLogger, getObserverSource, getOriginalValue, getRecentValue, getValueDirect, getValueOrException, getWidgetAdapter, hasEventSender, isMandatory, isModified, removeChangeHandler, removeEventHandler, removeFromParent, removeValidator, setMandatory, setModified, setParent, setValue, toString
addValidatorMandatory, createValidationFailure, getValue, getValueAndValidate, handleGetValueError, resetValue, setValue, setValueForUser, validate
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getContext, getParent, getSize
clearMessages
addEventHandler, removeEventHandler
setMode
getMode
setModeFixed
getModeFixed
setId
getId
setTooltip
getTooltip
getVisibleFlag, isVisible, setVisible, setVisible
isVisibleRecursive
setEnabled
isEnabled
addStyle, removeStyle
hasStyle
setStyles
getStyles
setPrimaryStyle
getPrimaryStyle
dispose
isDisposed
isModified
getAriaRole
validate
getValue
getValueAndValidate, getValueDirect
addChangeHandler, removeChangeHandler
resetValue, setValue, setValue, setValueForUser
getOriginalValue, getValueOrException
addValidatorMandatory, isMandatory
addValidator, removeValidator
public static final String PRIMARY_STYLE
primary style
of this widget.private final UiWidgetCustomEditor.UiHandler handler
createButtonPanel()
private final UiHandlerObjectSave<VALUE> handlerSaveObject
public UiWidgetCustomEditor(UiContext context, UiHandlerObjectSave<VALUE> handlerSaveObject, Class<VALUE> valueClass)
context
- is the context
.handlerSaveObject
- is the UiHandlerObjectSave
invoked
if the end-user clicked "save" and the
value
has been validated successfully.valueClass
- is the value class
.protected void doInitialize()
UiWidgetCustom.initialize()
but only if called for the first time. You may override
this method to add additional initialization logic. Then do not forget the super
call. doInitialize
in class UiWidgetCustom<VALUE,UiWidgetVerticalPanel>
protected void setParent(UiWidgetComposite<?> parent)
parent
.setParent
in class UiWidgetCustom<VALUE,UiWidgetVerticalPanel>
parent
- is the new parent
.protected void addChild(UiWidgetRegular child)
doInitialize()
before the super
call. Otherwise the child may appear after the button panel
.child
- is the UiWidgetRegular
to add as child.UiWidgetDynamicComposite.addChild(net.sf.mmm.client.ui.api.widget.UiWidget)
protected UiWidgetButtonPanel createButtonPanel()
UiWidgetButtonPanel
with the edit, save and cancel buttons.Copyright © 2001–2016 mmm-Team. All rights reserved.