Project Wonder 5.0.0.8654

er.extensions.appserver.navigation
Class ERXModernNavigationMenuItem

java.lang.Object
  extended by com.webobjects.appserver.WOElement
      extended by com.webobjects.appserver.WOComponent
          extended by er.extensions.components.ERXComponent
              extended by er.extensions.components.ERXNonSynchronizingComponent
                  extended by er.extensions.components.ERXStatelessComponent
                      extended by er.extensions.appserver.navigation.ERXModernNavigationMenuItem
All Implemented Interfaces:
WOActionResults, NSKeyValueCoding, NSKeyValueCoding.ErrorHandling, NSKeyValueCodingAdditions, NSValidation, Serializable, Cloneable

public class ERXModernNavigationMenuItem
extends ERXStatelessComponent

This is a menu item component that represents a single item in the tree of navigation menu items. It's an updated ERXNavigationMenuItem component that should simplify common usage. Namely, it now recurses through the tree of navigation items, creating nested, unordered lists of navigation items. Just as importantly, with a very few exceptions,it forgoes declaring element style as possible, leaving positioning and styling to be defined in the user's stylesheet. Please read "Documentation/Navigation.html" to find out how to use the navigation components.

Author:
Travis Cripps
See Also:
Serialized Form

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
protected  Boolean _hasActivity
           
protected  Boolean _isDisabled
           
protected  Boolean _isSelected
           
protected  boolean _linkDirectlyToDirectActions
           
protected  Boolean _meetsDisplayConditions
           
protected  ERXNavigationItem _navigationItem
           
protected  ERXNavigationState _navigationState
           
protected  WOComponent _redirect
           
 ERXNavigationItem aChildItem
           
static Logger log
          logging support
static String SHOULD_DISPLAY_DISABLED_MENU_ITEMS
           
protected static String STYLE_CLASS_DISABLED
           
protected static String STYLE_CLASS_SELECTED
           
protected static String STYLE_CLASS_SUB
           
 
Fields inherited from class er.extensions.components.ERXComponent
_dynamicBindings
 
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
ERXModernNavigationMenuItem(WOContext context)
           
 
Method Summary
 NSArray children()
           
 String contextComponentActionURL()
           
 WOComponent directActionRedirect()
          AK This is only an experiment: when calling up a DA, we use a component action and redirect to the actual DA
 String displayName()
           
 boolean hasActivity()
           
 boolean hasActivityAndIsEnabled()
           
 boolean isDisabled()
           
 boolean isSelected()
           
 String itemStyleClass()
           
 boolean meetsDisplayConditions()
          Decides whether the item gets displayed at all.
 WOComponent menuItemSelected()
          Determines whether the menu item is selected, or in the path of the current navigation state.
 NSKeyValueCodingAdditions navigationContext()
           
 ERXNavigationItem navigationItem()
          Gets the ERXNavigationItem that provides the backing store for the properties of this menu item.
 String navigationItemID()
           
 String navigationItemWidth()
           
 ERXNavigationState navigationState()
           
 void reset()
           
 Object resolveValue(String key)
           
 boolean shouldDisplay()
          Determines if the item should be displayed in the UI, based upon the disabled status.
 
Methods inherited from class er.extensions.components.ERXStatelessComponent
isStateless, valueForBooleanBinding, valueForBooleanBinding, valueForBooleanBinding, valueForIntBinding, valueForObjectBinding, valueForObjectBinding
 
Methods inherited from class er.extensions.components.ERXNonSynchronizingComponent
synchronizesVariablesWithBindings
 
Methods inherited from class er.extensions.components.ERXComponent
_awakeInContext, _checkAccess, _frameworkName, _includeCSSResources, _includeJavascriptResources, additionalCSSFiles, additionalJavascriptFiles, appendToResponse, booleanValueForBinding, booleanValueForBinding, booleanValueForBinding, checkAccess, clickToOpenEnabled, componentName, defaultCSSPath, defaultJavascriptPath, dynamicBindings, floatValueForBinding, intValueForBinding, invokeAction, isPageAccessAllowed, localizer, objectValueForBinding, objectValueForBinding, pageWithName, postAppendToResponse, preAppendToResponse, primaryCSSFile, primaryJavascriptFile, stringValueForBinding, stringValueForBinding, takeValuesFromRequest, useDefaultComponentCSS, useDefaultComponentJavascript
 
Methods inherited from class com.webobjects.appserver.WOComponent
__valueForBinding, _associationWithName, _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, 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, valueForIntegerBinding, valueForKey, valueForKeyPath, valueForNSArrayBindings, valueForNSDictionaryBindings, valueForNumberBinding, valueForStringBinding
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

log

public static final Logger log
logging support


_navigationItem

protected ERXNavigationItem _navigationItem

_navigationState

protected ERXNavigationState _navigationState

_linkDirectlyToDirectActions

protected boolean _linkDirectlyToDirectActions

_isDisabled

protected Boolean _isDisabled

_meetsDisplayConditions

protected Boolean _meetsDisplayConditions

_isSelected

protected Boolean _isSelected

_hasActivity

protected Boolean _hasActivity

_redirect

protected WOComponent _redirect

aChildItem

public ERXNavigationItem aChildItem

STYLE_CLASS_SELECTED

protected static String STYLE_CLASS_SELECTED

STYLE_CLASS_DISABLED

protected static String STYLE_CLASS_DISABLED

STYLE_CLASS_SUB

protected static String STYLE_CLASS_SUB

SHOULD_DISPLAY_DISABLED_MENU_ITEMS

public static final String SHOULD_DISPLAY_DISABLED_MENU_ITEMS
See Also:
Constant Field Values
Constructor Detail

ERXModernNavigationMenuItem

public ERXModernNavigationMenuItem(WOContext context)
Method Detail

navigationItemID

public String navigationItemID()

reset

public void reset()
Overrides:
reset in class ERXStatelessComponent

navigationItemWidth

public String navigationItemWidth()

navigationState

public ERXNavigationState navigationState()

directActionRedirect

public WOComponent directActionRedirect()
AK This is only an experiment: when calling up a DA, we use a component action and redirect to the actual DA

Returns:
a WORedirect to the direct action URL.

contextComponentActionURL

public String contextComponentActionURL()

menuItemSelected

public WOComponent menuItemSelected()
Determines whether the menu item is selected, or in the path of the current navigation state.

Returns:
true if the menu item is selected

meetsDisplayConditions

public boolean meetsDisplayConditions()
Decides whether the item gets displayed at all. This is done by evaluating the boolean value of a "conditions" array in the definition file. eg: conditions = ("session.user.canEditThisStuff", "session.user.isEditor") will display the item only if the user can edit this stuff *and* is an editor.

Returns:
true if the display conditions are met

shouldDisplay

public boolean shouldDisplay()
Determines if the item should be displayed in the UI, based upon the disabled status. You may disable display of items that do not meet their display conditions or are explicitly disabled.

Returns:
true if the item should be displayed

navigationItem

public ERXNavigationItem navigationItem()
Gets the ERXNavigationItem that provides the backing store for the properties of this menu item.

Returns:
the navigation item

isDisabled

public boolean isDisabled()

isSelected

public boolean isSelected()

itemStyleClass

public String itemStyleClass()

resolveValue

public Object resolveValue(String key)

hasActivity

public boolean hasActivity()

hasActivityAndIsEnabled

public boolean hasActivityAndIsEnabled()

displayName

public String displayName()

children

public NSArray children()

navigationContext

public NSKeyValueCodingAdditions navigationContext()

Last updated: Thu, Nov 20, 2008 • 04:36 AM EST

Copyright © 2002 – 2007 Project Wonder.