org.araneaframework.uilib.tree
Class TreeWidget

java.lang.Object
  extended by org.araneaframework.core.BaseComponent
      extended by org.araneaframework.core.BaseService
          extended by org.araneaframework.core.BaseWidget
              extended by org.araneaframework.core.BaseApplicationWidget
                  extended by org.araneaframework.uilib.tree.TreeNodeWidget
                      extended by org.araneaframework.uilib.tree.TreeWidget
All Implemented Interfaces:
Serializable, Component, Composite, Composite.CompositeComponent, Composite.CompositeService, Composite.CompositeWidget, ApplicationComponent, ApplicationService, ApplicationWidget, Service, TreeContext, TreeNodeContext, Viewable, Viewable.ViewableComponent, Viewable.ViewableService, Viewable.ViewableWidget, Widget

public class TreeWidget
extends TreeNodeWidget
implements TreeContext

Since:
1.0.7
Author:
Alar Kvell (alar@araneaframework.org)
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class org.araneaframework.core.BaseApplicationWidget
BaseApplicationWidget.CompositeImpl, BaseApplicationWidget.ViewableImpl, BaseApplicationWidget.ViewModel
 
Nested classes/interfaces inherited from class org.araneaframework.core.BaseWidget
BaseWidget.WidgetImpl
 
Nested classes/interfaces inherited from class org.araneaframework.core.BaseService
BaseService.ServiceImpl
 
Nested classes/interfaces inherited from class org.araneaframework.core.BaseComponent
BaseComponent.ComponentImpl
 
Nested classes/interfaces inherited from interface org.araneaframework.core.ApplicationWidget
ApplicationWidget.WidgetViewModel
 
Nested classes/interfaces inherited from interface org.araneaframework.core.ApplicationService
ApplicationService.ServiceViewModel
 
Nested classes/interfaces inherited from interface org.araneaframework.core.ApplicationComponent
ApplicationComponent.ComponentViewModel
 
Nested classes/interfaces inherited from interface org.araneaframework.Composite
Composite.CompositeComponent, Composite.CompositeService, Composite.CompositeWidget
 
Nested classes/interfaces inherited from interface org.araneaframework.Viewable
Viewable.ViewableComponent, Viewable.ViewableService, Viewable.ViewableWidget
 
Nested classes/interfaces inherited from interface org.araneaframework.Widget
Widget.Interface
 
Field Summary
 
Fields inherited from class org.araneaframework.uilib.tree.TreeNodeWidget
DISPLAY_KEY, TOGGLE_KEY
 
Fields inherited from class org.araneaframework.core.BaseService
currentInputData, currentOutputData
 
Fields inherited from interface org.araneaframework.core.ApplicationWidget
EVENT_HANDLER_ID_KEY, EVENT_PARAMETER_KEY, EVENT_PATH_KEY
 
Fields inherited from interface org.araneaframework.core.ApplicationService
ACTION_HANDLER_ID_KEY, ACTION_PARAMETER_KEY, ACTION_PATH_KEY
 
Constructor Summary
TreeWidget()
          Creates a new TreeWidget instance.
TreeWidget(TreeDataProvider dataProvider)
          Creates a new TreeWidget instance which will acquire the tree data from supplied TreeDataProvider.
 
Method Summary
 TreeDataProvider getDataProvider()
          Returns tree data provider.
 Widget getDisplayWidget()
          Returns the display widget of this tree node.
 Environment getEnvironment()
          Provides access to the Environment of this Component.
 TreeRenderer getRenderer()
          Returns tree renderer.
protected  void init()
          Init callback.
 boolean isRemoveChildrenOnCollapse()
          Returns if child nodes are removed and discarded when a node is closed.
protected  void render(OutputData output)
          Renders the component to output, meant for overriding.
 void setCollapsed(boolean collapsed)
          Sets collapsed state of tree node.
 void setRemoveChildrenOnCollapse(boolean removeChildrenOnCollapse)
          Set if child nodes are removed and discarded when a node is closed.
 void setRenderer(TreeRenderer renderer)
          Set tree renderer.
 void setUseActions(boolean useActions)
          Set if actions are used instead of events in submit links.
 void setUseSynchronizedActions(boolean useSynchronizedActions)
          Set if AJAX requests to tree widget are synchronized.
 void toggleCollapsed()
          Inverts collapsed state of tree node, collapsing expanded node and vice versa.
 boolean useActions()
          Returns if actions are used instead of events in submit links (e.g.
 boolean useSynchronizedActions()
          Returns if action calls (by AJAX requests) to tree widget are synchronized.
 
Methods inherited from class org.araneaframework.uilib.tree.TreeNodeWidget
addAllNodes, addNode, addNode, getDisplayWidgetEnvironment, getFullId, getIndex, getNode, getNodeCount, getNodes, getNodeWrapper, getParentCount, getParentNode, getTreeCtx, hasNodes, isCollapsed, loadChildren, removeAllNodes, removeNode, renderDisplayPrefixRecursive, renderNode, setIndex, setParentNode, shouldRenderToggleLink
 
Methods inherited from class org.araneaframework.core.BaseApplicationWidget
_getComposite, _getViewable, action, addActionListener, addEventListener, addWidget, addWidget, clearActionListeners, clearEventlisteners, clearGlobalEventListener, disableWidget, enableWidget, event, getActionId, getChildEnvironment, getChildren, getChildWidgetEnvironment, getEventId, getViewModel, getWidget, handleAction, handleEvent, handleUpdate, propagate, putViewData, putViewDataOnce, removeActionListener, removeEventListener, removeViewData, removeWidget, setGlobalEventListener, update
 
Methods inherited from class org.araneaframework.core.BaseWidget
_getWidget, getInputData, getOutputData, handleWidgetException
 
Methods inherited from class org.araneaframework.core.BaseService
_getService, handleServiceException
 
Methods inherited from class org.araneaframework.core.BaseComponent
_addComponent, _addComponent, _checkCall, _disableComponent, _enableComponent, _endCall, _endWaitingCall, _getChildren, _getComponent, _getDisabledChildren, _propagate, _relocateComponent, _removeComponent, _setEnvironment, _setScope, _startCall, _startWaitingCall, _strictCheckCall, _strictStartCall, _waitNoCall, destroy, disable, enable, getScope, handleException, isAlive, isDead, isInitialized
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.araneaframework.Widget
_getWidget
 
Methods inherited from interface org.araneaframework.Service
_getService
 
Methods inherited from interface org.araneaframework.Component
_getComponent, getScope, isAlive
 

Constructor Detail

TreeWidget

public TreeWidget()
Creates a new TreeWidget instance.


TreeWidget

public TreeWidget(TreeDataProvider dataProvider)
Creates a new TreeWidget instance which will acquire the tree data from supplied TreeDataProvider.

Parameters:
dataProvider - tree data provider.
Method Detail

init

protected void init()
             throws Exception
Description copied from class: BaseComponent
Init callback. Gets called when the component is initilized.

Overrides:
init in class TreeNodeWidget
Throws:
Exception - Any runtime exception that may occur.

getEnvironment

public Environment getEnvironment()
Description copied from interface: Component
Provides access to the Environment of this Component.

Specified by:
getEnvironment in interface Component
Overrides:
getEnvironment in class BaseApplicationWidget
Returns:
the Environment of the Component.

getDataProvider

public TreeDataProvider getDataProvider()
Description copied from interface: TreeContext
Returns tree data provider.

Specified by:
getDataProvider in interface TreeContext

setUseActions

public void setUseActions(boolean useActions)
Set if actions are used instead of events in submit links. See TreeContext.useActions().


useActions

public boolean useActions()
Description copied from interface: TreeContext
Returns if actions are used instead of events in submit links (e.g. toggle button). Default is false.

Specified by:
useActions in interface TreeContext

setUseSynchronizedActions

public void setUseSynchronizedActions(boolean useSynchronizedActions)
Set if AJAX requests to tree widget are synchronized. See TreeContext.useSynchronizedActions().

Since:
1.1

useSynchronizedActions

public boolean useSynchronizedActions()
Description copied from interface: TreeContext
Returns if action calls (by AJAX requests) to tree widget are synchronized. Default is true. If set to false (in TreeWidget constructor), then StandardHttpSessionRouterService does not synchronize requests to this TreeWidget and its children.

Specified by:
useSynchronizedActions in interface TreeContext

setRemoveChildrenOnCollapse

public void setRemoveChildrenOnCollapse(boolean removeChildrenOnCollapse)
Set if child nodes are removed and discarded when a node is closed.


isRemoveChildrenOnCollapse

public boolean isRemoveChildrenOnCollapse()
Description copied from interface: TreeContext
Returns if child nodes are removed and discarded when a node is closed.

Specified by:
isRemoveChildrenOnCollapse in interface TreeContext

setRenderer

public void setRenderer(TreeRenderer renderer)
Set tree renderer.


getRenderer

public TreeRenderer getRenderer()
Description copied from interface: TreeContext
Returns tree renderer.

Specified by:
getRenderer in interface TreeContext

render

protected void render(OutputData output)
               throws Exception
Description copied from class: BaseApplicationWidget
Renders the component to output, meant for overriding.

Overrides:
render in class TreeNodeWidget
Throws:
Exception

getDisplayWidget

public Widget getDisplayWidget()
Description copied from interface: TreeNodeContext
Returns the display widget of this tree node. Root node of the tree (TreeWidget) has no display widget (TreeNodeContext.getDisplayWidget() is null).

Specified by:
getDisplayWidget in interface TreeNodeContext
Overrides:
getDisplayWidget in class TreeNodeWidget

setCollapsed

public void setCollapsed(boolean collapsed)
Description copied from interface: TreeNodeContext
Sets collapsed state of tree node. If true, child nodes are hidden, otherwise child nodes are shown. This may trigger removal or retrieval of child nodes using TreeDataProvider if TreeContext.isRemoveChildrenOnCollapse() is true.

Specified by:
setCollapsed in interface TreeNodeContext
Overrides:
setCollapsed in class TreeNodeWidget

toggleCollapsed

public void toggleCollapsed()
Description copied from interface: TreeNodeContext
Inverts collapsed state of tree node, collapsing expanded node and vice versa.

Specified by:
toggleCollapsed in interface TreeNodeContext
Overrides:
toggleCollapsed in class TreeNodeWidget