com.vaadin.terminal.gwt.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.terminal.gwt.client.ui.SimpleFocusablePanel
com.vaadin.terminal.gwt.client.ui.FocusElementPanel
com.vaadin.terminal.gwt.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.HasOneWidget, com.google.gwt.user.client.ui.HasWidgets, com.google.gwt.user.client.ui.HasWidgets.ForIsWidget, com.google.gwt.user.client.ui.IsWidget, Focusable, Paintable, ActionOwner, VHasDropHandler, SubPartAware, Iterable<com.google.gwt.user.client.ui.Widget>
- extends FocusElementPanel
- implements Paintable, 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, com.google.gwt.user.client.ui.Focusable
public class VTree
Nested Class Summary | |
---|---|
class |
VTree.TreeNode
|
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject |
---|
com.google.gwt.user.client.ui.UIObject.DebugIdImpl, com.google.gwt.user.client.ui.UIObject.DebugIdImplEnabled |
Nested classes/interfaces inherited from interface com.google.gwt.user.client.ui.HasWidgets |
---|
com.google.gwt.user.client.ui.HasWidgets.ForIsWidget |
Field Summary | |
---|---|
static String |
CLASSNAME
|
VLazyExecutor |
iconLoaded
|
static String |
ITEM_CLICK_EVENT_ID
|
static int |
MULTISELECT_MODE_DEFAULT
Click selects the current node, ctrl/shift toggles multi selection |
static int |
MULTISELECT_MODE_SIMPLE
Click/touch on node toggles its selected status |
Fields inherited from class com.google.gwt.user.client.ui.UIObject |
---|
DEBUG_ID_PREFIX |
Constructor Summary | |
---|---|
VTree()
|
Method Summary | |
---|---|
void |
deselectAll()
Deselects all items in the tree |
String |
getActionCaption(String actionKey)
|
String |
getActionIcon(String actionKey)
|
Action[] |
getActions()
|
ApplicationConnection |
getClient()
|
VTree.TreeNode |
getCommonGrandParent(VTree.TreeNode node1,
VTree.TreeNode node2)
Returns the first common parent of two nodes |
VDropHandler |
getDropHandler()
|
protected VTree.TreeNode |
getFirstRootNode()
Returns the first root node of the tree or null if there are no root nodes. |
protected VTree.TreeNode |
getLastRootNode()
Returns the last root node of the tree or null if there are no root nodes. |
protected int |
getNavigationDownKey()
Get the key that moves the selection head downwards. |
protected int |
getNavigationEndKey()
Get the key the moves the selection to the end of the table. |
protected int |
getNavigationLeftKey()
Get the key that scrolls to the left in the table. |
protected int |
getNavigationPageDownKey()
Get the key the moves the selection one page down in the table. |
protected int |
getNavigationPageUpKey()
Get the key the moves the selection one page up in the table. |
protected int |
getNavigationRightKey()
Get the key that scroll to the right on the table. |
protected int |
getNavigationSelectKey()
Get the key that selects an item in the table. |
protected int |
getNavigationStartKey()
Get the key the moves the selection to the beginning of the table. |
protected int |
getNavigationUpKey()
Get the key that moves the selection head upwards. |
VTree.TreeNode |
getNodeByKey(String key)
|
String |
getPaintableId()
|
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.Element |
getSubPartElement(String subPart)
Locates an element inside a component using the identifier provided in subPart . |
String |
getSubPartName(com.google.gwt.user.client.Element subElement)
Provides an identifier that identifies the element within the component. |
protected boolean |
handleKeyNavigation(int keycode,
boolean ctrl,
boolean shift)
Handles the keyboard navigation |
boolean |
isSelected(VTree.TreeNode treeNode)
Is a node selected in the tree |
void |
onBlur(com.google.gwt.event.dom.client.BlurEvent event)
|
void |
onBrowserEvent(com.google.gwt.user.client.Event event)
|
void |
onFocus(com.google.gwt.event.dom.client.FocusEvent event)
|
void |
onKeyDown(com.google.gwt.event.dom.client.KeyDownEvent event)
|
void |
onKeyPress(com.google.gwt.event.dom.client.KeyPressEvent event)
|
void |
setFocusedNode(VTree.TreeNode node)
Focuses a node and scrolls it into view |
void |
setFocusedNode(VTree.TreeNode node,
boolean scrollIntoView)
Sets the node currently in focus |
void |
setSelected(VTree.TreeNode treeNode,
boolean selected)
|
void |
updateFromUIDL(UIDL uidl,
ApplicationConnection client)
|
Methods inherited from class com.vaadin.terminal.gwt.client.ui.FocusElementPanel |
---|
getFocusElement, getTabIndex, setAccessKey, setFocus, setTabIndex, setWidget |
Methods inherited from class com.vaadin.terminal.gwt.client.ui.SimpleFocusablePanel |
---|
addBlurHandler, addFocusHandler, addKeyDownHandler, addKeyPressHandler, addKeyUpHandler, focus |
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, adopt, clear, disown, 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 |
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, setElement, setElement, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkBitlessEvent, toString, unsinkEvents |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface com.google.gwt.user.client.ui.Focusable |
---|
getTabIndex, setAccessKey, setFocus, setTabIndex |
Methods inherited from interface com.google.gwt.event.shared.HasHandlers |
---|
fireEvent |
Methods inherited from interface com.google.gwt.event.shared.HasHandlers |
---|
fireEvent |
Methods inherited from interface com.google.gwt.event.shared.HasHandlers |
---|
fireEvent |
Methods inherited from interface com.google.gwt.event.shared.HasHandlers |
---|
fireEvent |
Field Detail |
---|
CLASSNAME
public static final String CLASSNAME
See Also:
ITEM_CLICK_EVENT_ID
public static final String ITEM_CLICK_EVENT_ID
See Also:
MULTISELECT_MODE_DEFAULT
public static final int MULTISELECT_MODE_DEFAULT
- See Also:
- Constant Field Values
Click selects the current node, ctrl/shift toggles multi selection
MULTISELECT_MODE_SIMPLE
public static final int MULTISELECT_MODE_SIMPLE
- See Also:
- Constant Field Values
Click/touch on node toggles its selected status
iconLoaded
public VLazyExecutor iconLoaded
Constructor Detail |
---|
VTree
public VTree()
Method Detail |
---|
onBrowserEvent
public void onBrowserEvent(com.google.gwt.user.client.Event event)
- Specified by:
onBrowserEvent
in interfacecom.google.gwt.user.client.EventListener
- Overrides:
onBrowserEvent
in classcom.google.gwt.user.client.ui.Widget
getActionCaption
public String getActionCaption(String actionKey)
getActionIcon
public String getActionIcon(String actionKey)
updateFromUIDL
public void updateFromUIDL(UIDL uidl,
ApplicationConnection client)
- Specified by:
updateFromUIDL
in interfacePaintable
getFirstRootNode
protected VTree.TreeNode getFirstRootNode()
- Returns:
- The first root
VTree.TreeNode
Returns the first root node of the tree or null if there are no root nodes.
getLastRootNode
protected VTree.TreeNode getLastRootNode()
- Returns:
- The last root
VTree.TreeNode
Returns the last root node of the tree or null if there are no root nodes.
getRootNodes
protected List<VTree.TreeNode> getRootNodes()
- Returns:
- A list of all root
VTree.TreeNode
s.
Returns a list of all root nodes in the Tree in the order they appear in the tree.
setSelected
public void setSelected(VTree.TreeNode treeNode,
boolean selected)
isSelected
public boolean isSelected(VTree.TreeNode treeNode)
- Parameters:
treeNode
- The node to check- Returns:
Is a node selected in the tree
getDropHandler
public VDropHandler getDropHandler()
- Specified by:
getDropHandler
in 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)
- Parameters:
node1
- The first nodenode2
- The second node- Returns:
- The common parent or null
Returns the first common parent of two nodes
setFocusedNode
public void setFocusedNode(VTree.TreeNode node,
boolean scrollIntoView)
- Parameters:
node
- The node to focus or null to remove the focus completelyscrollIntoView
- Scroll the node into view
Sets the node currently in focus
setFocusedNode
public void setFocusedNode(VTree.TreeNode node)
- Parameters:
node
- The node to focus
Focuses a node and scrolls it into view
onFocus
public void onFocus(com.google.gwt.event.dom.client.FocusEvent event)
- Specified by:
onFocus
in interfacecom.google.gwt.event.dom.client.FocusHandler
onBlur
public void onBlur(com.google.gwt.event.dom.client.BlurEvent event)
- Specified by:
onBlur
in interfacecom.google.gwt.event.dom.client.BlurHandler
onKeyPress
public void onKeyPress(com.google.gwt.event.dom.client.KeyPressEvent event)
- Specified by:
onKeyPress
in interfacecom.google.gwt.event.dom.client.KeyPressHandler
onKeyDown
public void onKeyDown(com.google.gwt.event.dom.client.KeyDownEvent event)
- Specified by:
onKeyDown
in interfacecom.google.gwt.event.dom.client.KeyDownHandler
handleKeyNavigation
protected boolean handleKeyNavigation(int keycode,
boolean ctrl,
boolean shift)
- Parameters:
keycode
- The keycode of the pressed keyctrl
- Was ctrl pressedshift
- Was shift pressed- Returns:
- Returns true if the key was handled, else false
Handles the keyboard navigation
getNavigationUpKey
protected int getNavigationUpKey()
- Returns:
- The keycode of the key
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.
getNavigationDownKey
protected int getNavigationDownKey()
- Returns:
- The keycode of the key
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.
getNavigationLeftKey
protected int getNavigationLeftKey()
- Returns:
- The keycode of the key
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.
getNavigationRightKey
protected int getNavigationRightKey()
- Returns:
- The keycode of the key
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.
getNavigationSelectKey
protected int getNavigationSelectKey()
- Returns:
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.
getNavigationPageUpKey
protected int getNavigationPageUpKey()
- Returns:
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.
getNavigationPageDownKey
protected int getNavigationPageDownKey()
- Returns:
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.
getNavigationStartKey
protected int getNavigationStartKey()
- Returns:
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.
getNavigationEndKey
protected int getNavigationEndKey()
- Returns:
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.
getSubPartElement
public com.google.gwt.user.client.Element getSubPartElement(String subPart)
- Specified by:
getSubPartElement
in interfaceSubPartAware
- Parameters:
subPart
- The identifier for the element inside the component- Returns:
- The element identified by subPart or null if the element could not be found.
Description copied from interface: SubPartAware
Locates an element inside a component using the identifier provided in
subPart
. The subPart
identifier is component specific and
may be any string of characters, numbers, space characters and brackets.
getSubPartName
public String getSubPartName(com.google.gwt.user.client.Element subElement)
- Specified by:
getSubPartName
in interfaceSubPartAware
- Parameters:
subElement
- The element the identifier string should uniquely identify- Returns:
- An identifier that uniquely identifies
subElement
or null if no identifier could be provided.
Description copied from interface: SubPartAware
Provides an identifier that identifies the element within the component.
The subElement
is a part of the component and must never be null.
Note!
getSubPartElement(getSubPartName(element)) == element
is not
always true. A component can choose to provide a more generic
identifier for any given element if the results of all interactions with
subElement
are the same as interactions with the element
identified by the return value. For example a button can return an
identifier for the root element even though a DIV inside the button was
passed as subElement
because interactions with the DIV and the
root button element produce the same result.
getActions
public Action[] getActions()
- Specified by:
getActions
in interfaceActionOwner
- Returns:
- Array of IActions
getClient
public ApplicationConnection getClient()
- Specified by:
getClient
in interfaceActionOwner
getPaintableId
public String getPaintableId()
- Specified by:
getPaintableId
in interfaceActionOwner