protected class UiWidgetAdapterGwtTree.TreeNodeAdapter extends com.google.gwt.user.client.ui.TreeItem implements Consumer<List<NODE>>, com.google.gwt.event.logical.shared.ValueChangeHandler<Boolean>, com.google.gwt.event.dom.client.ClickHandler, UiWidgetAbstractTree.UiWidgetTreeNode<NODE>
TreeItem
.Modifier and Type | Class and Description |
---|---|
private class |
UiWidgetAdapterGwtTree.TreeNodeAdapter.SizeImpl
The implementation of
Size for UiWidgetAdapterGwtTree.TreeNodeAdapter . |
com.google.gwt.user.client.ui.TreeItem.TreeItemImpl, com.google.gwt.user.client.ui.TreeItem.TreeItemImplIE8ToIE10
Modifier and Type | Field and Description |
---|---|
private boolean |
loaded |
private com.google.gwt.user.client.ui.SimpleCheckBox |
multiSelectionCheckbox
The
SimpleCheckBox for SelectionMode.MULTIPLE_SELECTION . |
private NODE |
node |
private UiWidgetRegular |
nodeWidget |
private Size |
size |
private com.google.gwt.user.client.ui.FlowPanel |
widgetPanel |
STYLE_HEADER
HTML_ATTRIBUTE_ID, ID_SEPARATOR, PROPERTY_ID
PROPERTY_STYLES, STYLE_PATTERN_MULTIPLE, STYLE_PATTERN_SINGLE
WAI_ARIA
Modifier | Constructor and Description |
---|---|
private |
TreeNodeAdapter()
The dummy constructor.
|
|
TreeNodeAdapter(NODE node,
UiWidgetRegular widget)
The constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
accept(List<NODE> value)
Accept an input value.
|
void |
addEventHandler(UiHandlerEvent handler)
This method adds the given
UiHandlerEvent to this object. |
boolean |
addStyle(String style)
This method adds the given
style to the styles . |
private void |
clearChildren()
Clears all existing children.
|
void |
clearMessages()
This method is clearing all messages.
|
void |
dispose()
This method disposes this object.
|
Role |
getAriaRole()
This method gets the
Accessibility.WAI_ARIA role of this object. |
UiContext |
getContext()
This method gets the
UiContext . |
String |
getId()
This method gets the unique identifier of this object.
|
UiMode |
getMode()
This method gets the current
UiMode of this object. |
UiMode |
getModeFixed()
This method gets the fixed
UiMode of this object. |
NODE |
getNode() |
UiWidgetRegular |
getNodeWidget()
Please note that you may need to cast to the
UiWidgetRegular -type according to your
UiWidgetAbstractTree.UiTreeNodeRenderer . |
UiWidgetComposite<?> |
getParent() |
String |
getPrimaryStyle()
This method gets the primary
style of this object. |
Size |
getSize() |
String |
getStyles()
This method gets the style(s) (also called style-name(s)) of this object.
|
String |
getTooltip()
This method gets the tooltip of this object.
|
NODE |
getValue()
This method gets the value of this object.
|
AttributeWriteFlagAdvanced |
getVisibleFlag()
This method gets advanced visibility support.
|
com.google.gwt.user.client.ui.FlowPanel |
getWidgetPanel() |
boolean |
hasStyle(String style)
This method checks if the given
style is contained in the set of styles
of this object. |
private void |
initializeMultiSelection()
Initializes checkboxes for
multi-selection . |
boolean |
isCollapsed()
This method determines if this object is collapsed.
|
boolean |
isDisposed()
This method tests if this object has been
disposed . |
boolean |
isEnabled()
This method determines if this object is enabled.
|
boolean |
isModified()
This method determines if this object (or more precisely its value) is modified.
|
boolean |
isVisibleRecursive()
This method determines if this object is actually visible for the end-user.
|
protected void |
loadChildren()
Loads the children of this node asynchronously.
|
void |
onClick(com.google.gwt.event.dom.client.ClickEvent event) |
void |
onValueChange(com.google.gwt.event.logical.shared.ValueChangeEvent<Boolean> event) |
boolean |
removeEventHandler(UiHandlerEvent handler)
This method removes the given
UiHandlerEvent from this object. |
boolean |
removeStyle(String style)
This method removes the given
style from the styles . |
void |
setCollapsed(boolean collapsed)
This method sets the
collapsed status of this object. |
void |
setEnabled(boolean enabled)
This method sets the
enabled status of this object. |
void |
setId(String id)
This method set the
ID of this object. |
void |
setMode(UiMode mode)
This method sets the
mode of this object. |
void |
setModeFixed(UiMode mode)
This method sets the
fixed mode of this object. |
private void |
setNodeSelected(boolean selected)
Sets the selection state.
|
void |
setPrimaryStyle(String primaryStyle)
This method sets the
primary style . |
void |
setStyles(String styles)
This method clears all
styles and sets them to the given styles . |
void |
setTooltip(String tooltip)
This method sets the tooltip text of this object.
|
void |
setVisible(boolean visible,
boolean programmatic)
This method shows or hides this object.
|
protected void |
updateNode()
Updates the UI of this node.
|
private void |
updateSelectionMode()
Recursively updates the
SelectionMode . |
boolean |
validate(ValidationState state)
This method performs the actual validation.
|
addItem, addItem, addItem, addItem, addTextItem, asTreeItem, getChild, getChildCount, getChildIndex, getFocusable, getFocusableWidget, getHTML, getParentItem, getState, getText, getTree, getUserObject, getWidget, insertItem, insertItem, insertItem, insertTextItem, isSelected, onEnsureDebugId, remove, removeItem, removeItem, removeItems, setHTML, setHTML, setSelected, setState, setState, setText, setUserObject, setWidget
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, removeStyleDependentName, removeStyleName, resolvePotentialElement, setElement, setElement, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkBitlessEvent, sinkEvents, toString, unsinkEvents
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
isVisible, setVisible
private final UiWidgetRegular nodeWidget
TreeItem.getWidget()
private boolean loaded
loadChildren()
private com.google.gwt.user.client.ui.FlowPanel widgetPanel
getWidgetPanel()
private com.google.gwt.user.client.ui.SimpleCheckBox multiSelectionCheckbox
SimpleCheckBox
for SelectionMode.MULTIPLE_SELECTION
.private TreeNodeAdapter()
public TreeNodeAdapter(NODE node, UiWidgetRegular widget)
node
- is the unwrapped node (business object).widget
- is the UiWidgetRegular
rendering this node.public NODE getNode()
public com.google.gwt.user.client.ui.FlowPanel getWidgetPanel()
protected void updateNode()
protected void loadChildren()
private void clearChildren()
private void updateSelectionMode()
SelectionMode
.private void initializeMultiSelection()
multi-selection
.public void onClick(com.google.gwt.event.dom.client.ClickEvent event)
onClick
in interface com.google.gwt.event.dom.client.ClickHandler
public void onValueChange(com.google.gwt.event.logical.shared.ValueChangeEvent<Boolean> event)
onValueChange
in interface com.google.gwt.event.logical.shared.ValueChangeHandler<Boolean>
private void setNodeSelected(boolean selected)
selected
- - true
for selected, false
for not selected.public UiWidgetRegular getNodeWidget()
UiWidgetRegular
-type according to your
UiWidgetAbstractTree.UiTreeNodeRenderer
.getNodeWidget
in interface UiWidgetAbstractTree.UiWidgetTreeNode<NODE>
regular widget
used to render the node data.UiWidgetAbstractTree.setTreeNodeRenderer(UiTreeNodeRenderer)
public boolean isCollapsed()
isCollapsed
in interface AttributeReadCollapsed
true
if this object is collapsed, false
if expanded.public void setCollapsed(boolean collapsed)
collapsed
status of this object.setCollapsed
in interface AttributeWriteCollapsed
collapsed
- - if true
the object will be collapsed, else it will be expanded.public void setTooltip(String tooltip)
setTooltip
in interface AttributeWriteTooltip
tooltip
- is the new tooltip text or null
to disable the tooltip.AttributeReadTooltip.getTooltip()
public String getTooltip()
getTooltip
in interface AttributeReadTooltip
public void setId(String id)
ID
of this object. Use this method to give the object a meaningful
identifier after creation. AttributeReadHtmlId.getId()
for the syntax constraints of IDs.setId
in interface AttributeWriteHtmlId
setId
in interface AttributeWriteId<String>
id
- is the new ID
for the object.public String getId()
[a-zA-Z][a-zA-Z0-9_$]*
.
Invalid IDs (e.g. containing colon, hash or period) are not accepted to prevent you from later having
problems with CSS selectors.getId
in interface AttributeReadHtmlId
getId
in interface AttributeReadId<String>
AttributeReadHtmlId.ID_SEPARATOR
public UiMode getMode()
UiMode
of this object.getMode
in interface AttributeReadMode
UiMode
.public void setMode(UiMode mode)
mode
of this object. It will change the object to view
or edit
mode. This is a recursive operation that will also apply to all
descendants of this object. If a fixed mode
is set (not
null
), this method will have no effect and recursive calls will stop at this object.setMode
in interface AttributeWriteMode
mode
- is the new UiMode
to set.public void setModeFixed(UiMode mode)
fixed mode
of this object. This will
set
the mode
to the given
mode (if not null
, recursively) and then mark the mode as fixed so
AttributeWriteMode.setMode(UiMode)
will have no effect anymore. The fixed
mode
itself will NOT be set recursively. UiMode.VIEW
in order to prevent a UI widget (a
field or even an entire sub-dialog) from switching to edit-mode (UiMode.EDIT
) so the UI widget
will always remain read-only.setModeFixed
in interface AttributeWriteModeFixed
mode
- is the new fixed UiMode
to set. May be null
to unset fixation.public UiMode getModeFixed()
UiMode
of this object. While a fixed UiMode
is
set
(NOT null)
changing the mode
will have no effect.getModeFixed
in interface AttributeReadModeFixed
UiMode
or null
if the UiMode
may be
changed
.public UiWidgetComposite<?> getParent()
getParent
in interface UiWidget
null
if NOT attached to the UI or if this is a root
widget (e.g. UiWidgetMainWindow
).public NODE getValue()
getValue
in interface AttributeReadValue<NODE>
null
unless otherwise stated.public void setEnabled(boolean enabled)
enabled
status of this object. If it is disabled, the user can
not interact with the object.setEnabled
in interface AttributeWriteEnabled
enabled
- - if true
the object will be enabled, else the object will be disabled.public void setVisible(boolean visible, boolean programmatic)
setVisible
in interface AttributeWriteVisibleAdvanced
visible
- is the new visibility status of this object. If true
, the object will be
shown (and raised), if false the object will be hidden (iconified).programmatic
- - see UiEvent.isProgrammatic()
.AttributeWriteVisibleAdvanced.isVisible()
public boolean isEnabled()
isEnabled
in interface AttributeReadEnabled
true
if this object is enabled, false
if this object is disabled.public void dispose()
dispose
in interface AttributeWriteDisposed
public boolean isDisposed()
disposed
. A disposed object can
NOT be used anymore.isDisposed
in interface AttributeReadDisposed
true
if this object has been disposed.AttributeWriteDisposed.dispose()
public boolean isVisibleRecursive()
AttributeReadVisible.isVisible()
it also takes its parent objects into account. So it only returns true
if the object is actually attached to the UI and physically in the current dialogue (it may still be
clipped from the screen or scrolled out of the visible panel).isVisibleRecursive
in interface AttributeReadVisibleRecursive
true
if visible to the end-user, false
otherwise.public UiContext getContext()
UiContext
. This is the container with central components for the UI and
client infrastructure. E.g. it contains the widget-factory
that
created this UiWidget
. It may be used internally in UiWidget
implementations as well as
externally to create new UiWidget
s (typically children).getContext
in interface UiWidget
UiContext
.public boolean validate(ValidationState state)
validate
in interface AbstractValidatableObject
state
- is the ValidationState
. Shall initially be created as new instance and passed on in case of
recursive validations. May also be null
and will then be created internally (in case you do not need
more feedback than a boolean result).true
if the validation of this object has been successful, false
otherwise (if there are
validation failures).public void addEventHandler(UiHandlerEvent handler)
UiHandlerEvent
to this object.addEventHandler
in interface UiFeatureEvent
handler
- is the UiHandlerEvent
to add.public boolean removeEventHandler(UiHandlerEvent handler)
UiHandlerEvent
from this object.removeEventHandler
in interface UiFeatureEvent
handler
- is the UiHandlerEvent
to remove.true
if the handler
has been removed successfully, false
if it was NOT registered
and nothing has changed.public void setPrimaryStyle(String primaryStyle)
primary style
.setPrimaryStyle
in interface AttributeWritePrimaryStyle
primaryStyle
- is the new value for primary style
.AttributeReadStyles.getStyles()
public void setStyles(String styles)
styles
and sets them to the given styles
. This
will also update the primary style
.setStyles
in interface AttributeWriteStyles
styles
- are the styles of this object. Either a single style or a list of styles separated by
whitespaces. Use the empty string to unset all styles.public String getStyles()
class
attribute of HTML
elements that are then configured via some cascading style sheet (CSS). AttributeReadStyles.STYLE_PATTERN_SINGLE
. Any number of styles or in other words
the result of this has to match AttributeReadStyles.STYLE_PATTERN_MULTIPLE
. The first style is called the
primary style
.getStyles
in interface AttributeReadStyles
public boolean addStyle(String style)
style
to the styles
.addStyle
in interface AttributeWriteStylesAdvanced
style
- is the style to add. If this style is already contained in the styles
,
this will have no effect.true
if the styles has actually been added, false
if it was already
present before.public boolean removeStyle(String style)
style
from the styles
.removeStyle
in interface AttributeWriteStylesAdvanced
style
- is the style to remove. If this style is NOT contained in the styles
,
this will have no effect.true
if the given style
has actually been removed, false
otherwise (if it was NOT present
).public String getPrimaryStyle()
style
of this object.getPrimaryStyle
in interface AttributeReadPrimaryStyle
null
if NOT defined.public boolean hasStyle(String style)
style
is contained in the set of styles
of this object.hasStyle
in interface AttributeReadStylesAdvanced
style
- is the style to check.style
is active.public Size getSize()
public Role getAriaRole()
Accessibility.WAI_ARIA
role
of this object. UiWidget
) is supposed to provide high-level
widgets and support setting the according Role
and their attributes automatically. Therefore
users should only use this for special situations e.g. for setting aria-hidden
intentionally for a visible object.getAriaRole
in interface AttributeReadAriaRole
Role
or null
if NOT set.Accessibility
public boolean isModified()
set
for the last time. Often this is also called
dirty. A composite object is also modified if one of its children are modified. modified
.isModified
in interface AttributeReadModified
true
if this object has been modified, false
otherwise (if no changes
have been made to this object).AttributeReadValueAdvanced.getOriginalValue()
,
AttributeWriteValueAdvanced.setValueForUser(Object)
public AttributeWriteFlagAdvanced getVisibleFlag()
boolean
attribute or property.
However, this is leading to various problems if you have multiple aspects that influence the flag. E.g.
assume you have some dynamic effect that is showing or hiding a widget. Additionally the widget is in a
collapsable section, tab-panel, or the like that is also showing or hiding the widget. Further, there
might be an authorization in your application as a cross-cutting concern that hides widgets from the UI
according to the current roles and permissions of the user. If this is all based on a simple boolean flag
you will end up in a mess and with a buggy application. So the dynamic effect or even worse the
authorization will hide the widget but after the user collapses and then expands a panel it becomes
visible again. You do not want to deal with bugs like this. AttributeWriteVisibleAdvanced.isVisible()
for reading visibility.getVisibleFlag
in interface AttributeWriteVisibleAdvanced
mutable flag
for advanced visibility support.public void clearMessages()
validation failures
as well as other messages
such as infos, errors, or warnings
(e.g. in a message-panel). This is a recursive operation that is propagated to all potential children.clearMessages
in interface UiFeatureMessages
Copyright © 2001–2016 mmm-Team. All rights reserved.