Project Wonder 5.0.0.8658

er.ajax
Class AjaxTree

java.lang.Object
  extended by com.webobjects.appserver.WOElement
      extended by com.webobjects.appserver.WOComponent
          extended by er.ajax.AjaxTree
All Implemented Interfaces:
WOActionResults, NSKeyValueCoding, NSKeyValueCoding.ErrorHandling, NSKeyValueCodingAdditions, NSValidation, Serializable, Cloneable

public class AjaxTree
extends WOComponent

AjaxTree provides an Ajax-refreshing tree view. AjaxTree acts like a WOComponentContent where the content you provide will be the renderer for the tree nodes. The "item" binding provides you access to the current tree node as it iterates over the tree. If your node objects are homogenous in type, you can define parentKeyPath and childrenKeyPath. If your node objects are heterogenous, you can instead define a delegate, as defined in the AjaxTreeModel.Delegate interface.

Author:
mschrag
See Also:
Serialized Form
Bindings
root the root node of the tree
           
item the current tree node (equivalent to "item" on WORepetition)
           
itemClass the class of the current item
           
rootExpanded if true, the tree will require the root node to be open; ignored if showRoot = false
           
allExpanded if true, the tree defaults to have all its nodes expanded
           
parentKeyPath the keypath to call on a node to get its parent node (ignored if delegate is set)
           
childrenKeyPath the keypath to call on a node to get its children NSArray (ignored if delegate is set)
           
isLeafKeyPath the keypath to call on a node to determine if it is a leaf node (ignored if delegate, and defaults to return childrenKeyPath.count() == 0 if not set)
           
id the html id of the tree
           
class the html class of the tree
           
treeModel the treeModel to use (one will be created by default)
           
collapsedImage the icon to use for a collapsed node
           
collapsedImageFramework the framework to load the collapsed icon from
           
expandedImage the icon to use for an expanded node
           
expandedImageFramework the framework to load the expanded icon from
           
leafImage the icon to use for a leaf node
           
leafImageFramework the framework to load the leaf icon from
           
delegate the delegate to use instead of keypaths (see AjaxTreeModel.Delegate)
           
showRoot if false, the root node will be skipped and the tree will begin with its children
           
cache whether to cache the nodes or determine them every time from the model (default: true)
           

Nested Class Summary
 
Nested classes/interfaces inherited from class com.webobjects.appserver.WOComponent
WOComponent._EventLoggingEnabler, WOComponent.Event
 
Nested classes/interfaces inherited from interface com.webobjects.foundation.NSKeyValueCodingAdditions
NSKeyValueCodingAdditions.DefaultImplementation, NSKeyValueCodingAdditions.Utility
 
Nested classes/interfaces inherited from interface com.webobjects.foundation.NSValidation
NSValidation._MethodBinding, NSValidation._ValidationBinding, NSValidation.DefaultImplementation, NSValidation.Utility, NSValidation.ValidationException
 
Field Summary
 
Fields inherited from class com.webobjects.appserver.WOComponent
_Extension, _IsEventLoggingEnabled, _keyAssociations, MINUSONE
 
Fields inherited from interface com.webobjects.foundation.NSKeyValueCoding.ErrorHandling
_CLASS
 
Fields inherited from interface com.webobjects.foundation.NSKeyValueCodingAdditions
_CLASS, _KeyPathSeparatorChar, KeyPathSeparator
 
Fields inherited from interface com.webobjects.foundation.NSValidation
_CLASS
 
Constructor Summary
AjaxTree(WOContext context)
           
 
Method Summary
 int _closeCount()
           
protected  void _fillInOpenNodes(Object node, NSMutableArray nodes, boolean showNode)
           
 String _toggleFunctionName()
           
 void appendToResponse(WOResponse aResponse, WOContext aContext)
           
 WOActionResults collapse()
           
 String collapsedImage()
           
 String collapsedImageFramework()
           
 WOActionResults expand()
           
 String expandedImage()
           
 String expandedImageFramework()
           
 String id()
           
 String imageLinkClass()
           
 WOActionResults invokeAction(WORequest aRequest, WOContext aContext)
           
 boolean isExpanded()
           
 boolean isLeaf()
           
 Object item()
           
 String leafImage()
           
 String leafImageFramework()
           
 String nodeItem()
           
 NSArray nodes()
           
 void reset()
           
protected  void resetTree()
           
 void setItem(Object item)
           
 void setTreeModel(AjaxTreeModel treeModel)
           
protected  String stringValueForBinding(String bindingName, String defaultValue)
           
 boolean synchronizesVariablesWithBindings()
           
 void takeValuesFromRequest(WORequest aRequest, WOContext aContext)
           
 AjaxTreeModel treeModel()
           
 
Methods inherited from class com.webobjects.appserver.WOComponent
__valueForBinding, _associationWithName, _awakeInContext, _childTemplate, _cleanUpStatelessComponent, _componentDefinition, _componentUnroll, _isPage, _setContext, _setIsPage, _setParent, _setSubcomponent, _sleepInContext, _subcomponentForElementWithID, _templateNameForClass, _unroll, application, awake, baseURL, bindingKeys, canAccessFieldsDirectly, canGetValueForBinding, canSetValueForBinding, clone, context, debugString, descriptionForResponse, ensureAwakeInContext, frameworkName, generateResponse, handleQueryWithUnboundKey, handleTakeValueForUnboundKey, hasBinding, hasSession, isCachingEnabled, isEventLoggingEnabled, isStateless, logString, name, pageWithName, parent, path, pathURL, performParentAction, pullValuesFromParent, pushValuesToParent, session, set_componentUnroll, set_unroll, setCachingEnabled, setValueForBinding, sleep, takeValueForKey, takeValueForKeyPath, template, templateWithHTMLString, templateWithHTMLString, templateWithName, toString, unableToSetNullForKey, validateTakeValueForKeyPath, validateValueForKey, validationFailedWithException, valueForBinding, valueForBooleanBinding, valueForIntegerBinding, valueForKey, valueForKeyPath, valueForNSArrayBindings, valueForNSDictionaryBindings, valueForNumberBinding, valueForStringBinding
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AjaxTree

public AjaxTree(WOContext context)
Method Detail

synchronizesVariablesWithBindings

public boolean synchronizesVariablesWithBindings()
Overrides:
synchronizesVariablesWithBindings in class WOComponent

nodes

public NSArray nodes()

_fillInOpenNodes

protected void _fillInOpenNodes(Object node,
                                NSMutableArray nodes,
                                boolean showNode)

reset

public void reset()
Overrides:
reset in class WOComponent

resetTree

protected void resetTree()

appendToResponse

public void appendToResponse(WOResponse aResponse,
                             WOContext aContext)
Overrides:
appendToResponse in class WOComponent

takeValuesFromRequest

public void takeValuesFromRequest(WORequest aRequest,
                                  WOContext aContext)
Overrides:
takeValuesFromRequest in class WOComponent

invokeAction

public WOActionResults invokeAction(WORequest aRequest,
                                    WOContext aContext)
Overrides:
invokeAction in class WOComponent

setItem

public void setItem(Object item)

item

public Object item()

isLeaf

public boolean isLeaf()

isExpanded

public boolean isExpanded()

_closeCount

public int _closeCount()

setTreeModel

public void setTreeModel(AjaxTreeModel treeModel)

treeModel

public AjaxTreeModel treeModel()

id

public String id()

stringValueForBinding

protected String stringValueForBinding(String bindingName,
                                       String defaultValue)

collapsedImage

public String collapsedImage()

collapsedImageFramework

public String collapsedImageFramework()

expandedImage

public String expandedImage()

expandedImageFramework

public String expandedImageFramework()

leafImage

public String leafImage()

leafImageFramework

public String leafImageFramework()

imageLinkClass

public String imageLinkClass()

nodeItem

public String nodeItem()

_toggleFunctionName

public String _toggleFunctionName()

expand

public WOActionResults expand()

collapse

public WOActionResults collapse()

Last updated: Fri, Nov 21, 2008 • 04:36 AM EST

Copyright © 2002 – 2007 Project Wonder.