Package com.vaadin.v7.client.ui
Class VTree
- java.lang.Object
-
- com.google.gwt.user.client.ui.UIObject
-
- com.google.gwt.user.client.ui.Widget
-
- com.google.gwt.user.client.ui.Panel
-
- com.google.gwt.user.client.ui.SimplePanel
-
- com.vaadin.client.ui.SimpleFocusablePanel
-
- com.vaadin.client.ui.FocusElementPanel
-
- com.vaadin.v7.client.ui.VTree
-
- All Implemented Interfaces:
com.google.gwt.event.dom.client.BlurHandler,com.google.gwt.event.dom.client.FocusHandler,com.google.gwt.event.dom.client.HasBlurHandlers,com.google.gwt.event.dom.client.HasFocusHandlers,com.google.gwt.event.dom.client.HasKeyDownHandlers,com.google.gwt.event.dom.client.HasKeyPressHandlers,com.google.gwt.event.dom.client.KeyDownHandler,com.google.gwt.event.dom.client.KeyPressHandler,com.google.gwt.event.logical.shared.HasAttachHandlers,com.google.gwt.event.shared.EventHandler,com.google.gwt.event.shared.HasHandlers,com.google.gwt.user.client.EventListener,com.google.gwt.user.client.ui.AcceptsOneWidget,com.google.gwt.user.client.ui.Focusable,com.google.gwt.user.client.ui.HasOneWidget,com.google.gwt.user.client.ui.HasVisibility,com.google.gwt.user.client.ui.HasWidgets,com.google.gwt.user.client.ui.HasWidgets.ForIsWidget,com.google.gwt.user.client.ui.IsWidget,Focusable,ActionOwner,HandlesAriaCaption,VHasDropHandler,SubPartAware,Iterable<com.google.gwt.user.client.ui.Widget>
public class VTree extends FocusElementPanel implements VHasDropHandler, com.google.gwt.event.dom.client.FocusHandler, com.google.gwt.event.dom.client.BlurHandler, com.google.gwt.event.dom.client.KeyPressHandler, com.google.gwt.event.dom.client.KeyDownHandler, SubPartAware, ActionOwner, HandlesAriaCaption
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classVTree.TreeNode
-
Field Summary
Fields Modifier and Type Field Description com.google.gwt.user.client.ui.FlowPanelbodyFor internal use only.String[]bodyActionKeysFor internal use only.static StringCLASSNAMEApplicationConnectionclientFor internal use only.TreeConnectorconnectorFor internal use only.booleandisabledFor internal use only.intdragModeFor internal use only.VTree.TreeNodefocusedNodeFor internal use only.VLazyExecutoriconLoadedbooleanimmediateFor internal use only.booleanisHtmlContentAllowedFor internal use only.booleanisMultiselectFor internal use only.booleanisNullSelectionAllowedFor internal use only.VTree.TreeNodelastSelectionFor internal use only.static com.vaadin.shared.ui.MultiSelectModeMULTISELECT_MODE_DEFAULTDeprecated.As of 7.0, useMultiSelectMode.DEFAULTinstead.static com.vaadin.shared.ui.MultiSelectModeMULTISELECT_MODE_SIMPLEDeprecated.As of 7.0, useMultiSelectMode.SIMPLEinstead.com.vaadin.shared.ui.MultiSelectModemultiSelectModeFor internal use only.StringpaintableIdFor internal use only.booleanreadonlyFor internal use only.booleanrenderingFor internal use only.booleanselectableFor internal use only.Set<String>selectedIdsFor internal use only.
-
Constructor Summary
Constructors Constructor Description VTree()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbindAriaCaption(com.google.gwt.user.client.Element captionElement)voidclearNodeToKeyMap()voiddeselectAll()Deselects all items in the tree.StringgetActionCaption(String actionKey)StringgetActionIcon(String actionKey)Action[]getActions()ApplicationConnectiongetClient()VTree.TreeNodegetCommonGrandParent(VTree.TreeNode node1, VTree.TreeNode node2)Returns the first common parent of two nodes.VDropHandlergetDropHandler()protected VTree.TreeNodegetFirstRootNode()Returns the first root node of the tree or null if there are no root nodes.protected VTree.TreeNodegetLastRootNode()Returns the last root node of the tree or null if there are no root nodes.protected intgetNavigationDownKey()Get the key that moves the selection head downwards.protected intgetNavigationEndKey()Get the key the moves the selection to the end of the table.protected intgetNavigationLeftKey()Get the key that scrolls to the left in the table.protected intgetNavigationPageDownKey()Get the key the moves the selection one page down in the table.protected intgetNavigationPageUpKey()Get the key the moves the selection one page up in the table.protected intgetNavigationRightKey()Get the key that scroll to the right on the table.protected intgetNavigationSelectKey()Get the key that selects an item in the table.protected intgetNavigationStartKey()Get the key the moves the selection to the beginning of the table.protected intgetNavigationUpKey()Get the key that moves the selection head upwards.VTree.TreeNodegetNodeByKey(String key)StringgetPaintableId()protected List<VTree.TreeNode>getRootNodes()Returns a list of all root nodes in the Tree in the order they appear in the tree.com.google.gwt.user.client.ElementgetSubPartElement(String subPart)StringgetSubPartName(com.google.gwt.user.client.Element subElement)protected booleanhandleKeyNavigation(int keycode, boolean ctrl, boolean shift)Handles the keyboard navigation.booleanisSelected(VTree.TreeNode treeNode)Is a node selected in the tree.voidonBlur(com.google.gwt.event.dom.client.BlurEvent event)voidonBrowserEvent(com.google.gwt.user.client.Event event)voidonFocus(com.google.gwt.event.dom.client.FocusEvent event)voidonKeyDown(com.google.gwt.event.dom.client.KeyDownEvent event)voidonKeyPress(com.google.gwt.event.dom.client.KeyPressEvent event)voidregisterAction(String key, String caption, String iconUrl)voidregisterNode(VTree.TreeNode treeNode)voidsetFocusedNode(VTree.TreeNode node)Focuses a node and scrolls it into view.voidsetFocusedNode(VTree.TreeNode node, boolean scrollIntoView)Sets the node currently in focus.voidsetSelected(VTree.TreeNode treeNode, boolean selected)voidupdateDropHandler(UIDL childUidl)For internal use only.-
Methods inherited from class com.vaadin.client.ui.FocusElementPanel
getFocusElement, setFocus, setTabIndex, setWidget
-
Methods inherited from class com.vaadin.client.ui.SimpleFocusablePanel
addBlurHandler, addFocusHandler, addKeyDownHandler, addKeyPressHandler, addKeyUpHandler, focus, getTabIndex, setAccessKey
-
Methods inherited from class com.google.gwt.user.client.ui.SimplePanel
add, getContainerElement, getWidget, iterator, remove, setWidget
-
Methods inherited from class com.google.gwt.user.client.ui.Panel
add, adopt, clear, doAttachChildren, doDetachChildren, orphan, remove
-
Methods inherited from class com.google.gwt.user.client.ui.Widget
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, fireEvent, getHandlerCount, getLayoutData, getParent, isAttached, isOrWasAttached, onAttach, onDetach, onLoad, onUnload, removeFromParent, setLayoutData, sinkEvents, unsinkEvents
-
Methods inherited from class com.google.gwt.user.client.ui.UIObject
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, resolvePotentialElement, setElement, setElement, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkBitlessEvent, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Field Detail
-
CLASSNAME
public static final String CLASSNAME
- See Also:
- Constant Field Values
-
MULTISELECT_MODE_DEFAULT
@Deprecated public static final com.vaadin.shared.ui.MultiSelectMode MULTISELECT_MODE_DEFAULT
Deprecated.As of 7.0, useMultiSelectMode.DEFAULTinstead.
-
MULTISELECT_MODE_SIMPLE
@Deprecated public static final com.vaadin.shared.ui.MultiSelectMode MULTISELECT_MODE_SIMPLE
Deprecated.As of 7.0, useMultiSelectMode.SIMPLEinstead.
-
body
public final com.google.gwt.user.client.ui.FlowPanel body
For internal use only. May be removed or replaced in the future.
-
selectedIds
public Set<String> selectedIds
For internal use only. May be removed or replaced in the future.
-
client
public ApplicationConnection client
For internal use only. May be removed or replaced in the future.
-
paintableId
public String paintableId
For internal use only. May be removed or replaced in the future.
-
selectable
public boolean selectable
For internal use only. May be removed or replaced in the future.
-
isMultiselect
public boolean isMultiselect
For internal use only. May be removed or replaced in the future.
-
lastSelection
public VTree.TreeNode lastSelection
For internal use only. May be removed or replaced in the future.
-
focusedNode
public VTree.TreeNode focusedNode
For internal use only. May be removed or replaced in the future.
-
multiSelectMode
public com.vaadin.shared.ui.MultiSelectMode multiSelectMode
For internal use only. May be removed or replaced in the future.
-
immediate
public boolean immediate
For internal use only. May be removed or replaced in the future.
-
isNullSelectionAllowed
public boolean isNullSelectionAllowed
For internal use only. May be removed or replaced in the future.
-
isHtmlContentAllowed
public boolean isHtmlContentAllowed
For internal use only. May be removed or replaced in the future.
-
disabled
public boolean disabled
For internal use only. May be removed or replaced in the future.
-
readonly
public boolean readonly
For internal use only. May be removed or replaced in the future.
-
rendering
public boolean rendering
For internal use only. May be removed or replaced in the future.
-
dragMode
public int dragMode
For internal use only. May be removed or replaced in the future.
-
bodyActionKeys
public String[] bodyActionKeys
For internal use only. May be removed or replaced in the future.
-
connector
public TreeConnector connector
For internal use only. May be removed or replaced in the future.
-
iconLoaded
public VLazyExecutor iconLoaded
-
-
Method Detail
-
onBrowserEvent
public void onBrowserEvent(com.google.gwt.user.client.Event event)
- Specified by:
onBrowserEventin interfacecom.google.gwt.user.client.EventListener- Overrides:
onBrowserEventin classcom.google.gwt.user.client.ui.Widget
-
getFirstRootNode
protected VTree.TreeNode getFirstRootNode()
Returns the first root node of the tree or null if there are no root nodes.- Returns:
- The first root
VTree.TreeNode
-
getLastRootNode
protected VTree.TreeNode getLastRootNode()
Returns the last root node of the tree or null if there are no root nodes.- Returns:
- The last root
VTree.TreeNode
-
getRootNodes
protected List<VTree.TreeNode> getRootNodes()
Returns a list of all root nodes in the Tree in the order they appear in the tree.- Returns:
- A list of all root
VTree.TreeNodes.
-
updateDropHandler
public void updateDropHandler(UIDL childUidl)
For internal use only. May be removed or replaced in the future.
-
setSelected
public void setSelected(VTree.TreeNode treeNode, boolean selected)
-
isSelected
public boolean isSelected(VTree.TreeNode treeNode)
Is a node selected in the tree.- Parameters:
treeNode- The node to check- Returns:
-
getDropHandler
public VDropHandler getDropHandler()
- Specified by:
getDropHandlerin interfaceVHasDropHandler
-
getNodeByKey
public VTree.TreeNode getNodeByKey(String key)
-
deselectAll
public void deselectAll()
Deselects all items in the tree.
-
getCommonGrandParent
public VTree.TreeNode getCommonGrandParent(VTree.TreeNode node1, VTree.TreeNode node2)
Returns the first common parent of two nodes.- Parameters:
node1- The first nodenode2- The second node- Returns:
- The common parent or null
-
setFocusedNode
public void setFocusedNode(VTree.TreeNode node, boolean scrollIntoView)
Sets the node currently in focus.- Parameters:
node- The node to focus or null to remove the focus completelyscrollIntoView- Scroll the node into view
-
setFocusedNode
public void setFocusedNode(VTree.TreeNode node)
Focuses a node and scrolls it into view.- Parameters:
node- The node to focus
-
onFocus
public void onFocus(com.google.gwt.event.dom.client.FocusEvent event)
- Specified by:
onFocusin interfacecom.google.gwt.event.dom.client.FocusHandler
-
onBlur
public void onBlur(com.google.gwt.event.dom.client.BlurEvent event)
- Specified by:
onBlurin interfacecom.google.gwt.event.dom.client.BlurHandler
-
onKeyPress
public void onKeyPress(com.google.gwt.event.dom.client.KeyPressEvent event)
- Specified by:
onKeyPressin interfacecom.google.gwt.event.dom.client.KeyPressHandler
-
onKeyDown
public void onKeyDown(com.google.gwt.event.dom.client.KeyDownEvent event)
- Specified by:
onKeyDownin interfacecom.google.gwt.event.dom.client.KeyDownHandler
-
handleKeyNavigation
protected boolean handleKeyNavigation(int keycode, boolean ctrl, boolean shift)Handles the keyboard navigation.- Parameters:
keycode- The keycode of the pressed keyctrl- Was ctrl pressedshift- Was shift pressed- Returns:
- Returns true if the key was handled, else false
-
getNavigationUpKey
protected int getNavigationUpKey()
Get the key that moves the selection head upwards. By default it is the up arrow key but by overriding this you can change the key to whatever you want.- Returns:
- The keycode of the key
-
getNavigationDownKey
protected int getNavigationDownKey()
Get the key that moves the selection head downwards. By default it is the down arrow key but by overriding this you can change the key to whatever you want.- Returns:
- The keycode of the key
-
getNavigationLeftKey
protected int getNavigationLeftKey()
Get the key that scrolls to the left in the table. By default it is the left arrow key but by overriding this you can change the key to whatever you want.- Returns:
- The keycode of the key
-
getNavigationRightKey
protected int getNavigationRightKey()
Get the key that scroll to the right on the table. By default it is the right arrow key but by overriding this you can change the key to whatever you want.- Returns:
- The keycode of the key
-
getNavigationSelectKey
protected int getNavigationSelectKey()
Get the key that selects an item in the table. By default it is the space bar key but by overriding this you can change the key to whatever you want.- Returns:
-
getNavigationPageUpKey
protected int getNavigationPageUpKey()
Get the key the moves the selection one page up in the table. By default this is the Page Up key but by overriding this you can change the key to whatever you want.- Returns:
-
getNavigationPageDownKey
protected int getNavigationPageDownKey()
Get the key the moves the selection one page down in the table. By default this is the Page Down key but by overriding this you can change the key to whatever you want.- Returns:
-
getNavigationStartKey
protected int getNavigationStartKey()
Get the key the moves the selection to the beginning of the table. By default this is the Home key but by overriding this you can change the key to whatever you want.- Returns:
-
getNavigationEndKey
protected int getNavigationEndKey()
Get the key the moves the selection to the end of the table. By default this is the End key but by overriding this you can change the key to whatever you want.- Returns:
-
getSubPartElement
public com.google.gwt.user.client.Element getSubPartElement(String subPart)
- Specified by:
getSubPartElementin interfaceSubPartAware
-
getSubPartName
public String getSubPartName(com.google.gwt.user.client.Element subElement)
- Specified by:
getSubPartNamein interfaceSubPartAware
-
getActions
public Action[] getActions()
- Specified by:
getActionsin interfaceActionOwner
-
getClient
public ApplicationConnection getClient()
- Specified by:
getClientin interfaceActionOwner
-
getPaintableId
public String getPaintableId()
- Specified by:
getPaintableIdin interfaceActionOwner
-
registerNode
public void registerNode(VTree.TreeNode treeNode)
-
clearNodeToKeyMap
public void clearNodeToKeyMap()
-
bindAriaCaption
public void bindAriaCaption(com.google.gwt.user.client.Element captionElement)
- Specified by:
bindAriaCaptionin interfaceHandlesAriaCaption
-
-