org.apache.myfaces.trinidad.menu
Class ImmutableItemNode

java.lang.Object
  extended by org.apache.myfaces.trinidad.menu.MenuNode
      extended by org.apache.myfaces.trinidad.menu.ItemNode
          extended by org.apache.myfaces.trinidad.menu.ImmutableItemNode

public class ImmutableItemNode
extends ItemNode

This class is a thread safe version of ItemNode class. It replicates most of the code in ItemNode but makes sure it does not modify state of the object. Therefore multiple request threads can access the properties of the objects of this class,in a thread safe manner. Please note that setters should not be called on objects of this class.Objects of this class are fully initialized on construction.


Constructor Summary
ImmutableItemNode(ItemNode node)
           
 
Method Summary
 void actionListener(javax.faces.event.ActionEvent event)
           
 String doAction()
          Gets the value of the node's action property.
 char getAccessKey()
          getAccessKey - get the label's accessKey as a char.
 String getActionListener()
          getActionListener - gets the value of the Menu Node's actionListener attribute.
 String getBundleKey()
           
 String getBundleName()
           
 List<MenuNode> getChildren()
          Get the List of menu item's children.
 Map<String,String> getCustomPropList()
          Get the Attributes containing the custom attributes on this node.
 boolean getDefaultFocusPath()
          Gets the defaultFocusPath attribute of the menu item.
 String getDestination()
          Gets the value of the node's destination property.
 boolean getDisabled()
          Gets the disabled attribute of the menu item.
 String getFocusViewId()
          Gets the value of the node's focusViewId property.
protected  String getHandlerId()
          Set the MenuContentHandlerImpl's id.
 String getIcon()
          Get the icon used by the menu item This could either be a string value set directly in the metadata or an EL expression string.
 String getId()
          getId - gets the metadata id of the node.
 boolean getImmediate()
          Gets the immediate attribute of the menu item.
 String getLabel()
          Get the menu item's label This could either be a string value set directly in the metadata or an EL expression string.
 String getLabelAndAccessKey()
          getLabelAndAccessKey - get the label and accessKey together in a single string.
 String getLaunchListener()
          getLaunchListener - gets the value of the Menu Node's launchListener attribute.
 String getModelId()
          Gets the local (shared node's) menu Model's Request map key.
 boolean getReadOnly()
          Gets the readOnly state of the node.
 boolean getRendered()
          Gets the rendered attribute of the menu item.
 String getReturnListener()
          getReturnListener - gets the value of the Menu Node's returnListener attribute.
 int getRootId()
           
 String getRootModelKey()
          Get the top-level, root menu model Request Map Key.
 String getTargetFrame()
          getTargetFrame - gets the value of the Destination Node's targetFrame attribute
 String getUniqueId()
          getUniqueId - gets the unique id of the node.
 boolean getUseWindow()
          Gets the useWindow attribute of the menu item.
 boolean getVisible()
          Gets the visible attribute of the menu item.
 int getWindowHeight()
          Gets the windowHeight attribute of the menu item.
 int getWindowWidth()
          Gets the windowWidth attribute of the menu item.
 void setChildren(List<MenuNode> children)
          Set the List of menu item's children.
 
Methods inherited from class org.apache.myfaces.trinidad.menu.ItemNode
getActionListenerProperty, getActionProperty, getCustomPropListProperty, getDestinationProperty, getImmediateProperty, getLaunchListenerProperty, getReturnListenerProperty, getTargetFrameProperty, getThreadSafeCopy, getUseWindowProperty, getWindowHeightProperty, getWindowWidthProperty, setAction, setActionListener, setCustomPropList, setDestination, setImmediate, setImmediate, setLaunchListener, setReturnListener, setTargetFrame, setUseWindow, setUseWindow, setWindowHeight, setWindowHeight, setWindowWidth, setWindowWidth
 
Methods inherited from class org.apache.myfaces.trinidad.menu.MenuNode
getAccessKeyProperty, getBundleKeyProperty, getBundleNameProperty, getChildrenProperty, getDefaultFocusPathProperty, getDisabledProperty, getFocusViewIdProperty, getHandlerIdProperty, getIconProperty, getIdProperty, getLabelAndAccessKeyProperty, getLabelProperty, getModelIdProperty, getReadOnlyProperty, getRefNode, getRenderedProperty, getRootIdProperty, getRootModel, getRootModelKeyProperty, getUniqueIdProperty, getVisibleProperty, postSelectedNode, setAccessKey, setAccessKey, setDefaultFocusPath, setDefaultFocusPath, setDisabled, setDisabled, setFocusViewId, setHandlerId, setIcon, setId, setLabel, setLabelAndAccessKey, setModelId, setReadOnly, setReadOnly, setRendered, setRendered, setResBundleKey, setResBundleName, setRootId, setRootModelKey, setVisible, setVisible
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImmutableItemNode

public ImmutableItemNode(ItemNode node)
Method Detail

getCustomPropList

public final Map<String,String> getCustomPropList()
Description copied from class: ItemNode
Get the Attributes containing the custom attributes on this node. This needs to be public so that the menu model can get them.

Overrides:
getCustomPropList in class ItemNode
Returns:
Attributes list containing the custom attributes on this node

getDestination

public final String getDestination()
Description copied from class: ItemNode
Gets the value of the node's destination property. The destination attr value could be one of 2 things: 1) a uri 2) An EL expression So that the model can identify this node as the currently selected node, the node's id is appended to the destination as a parameter that is picked up when the getFocusRowKey() method of the model is called to get the focus path.

Overrides:
getDestination in class ItemNode
Returns:
destination - the String value of the destinationNode's "destination" property.

getTargetFrame

public final String getTargetFrame()
Description copied from class: ItemNode
getTargetFrame - gets the value of the Destination Node's targetFrame attribute

Overrides:
getTargetFrame in class ItemNode
Returns:
the target frame for the goCommandMenuItem.

getActionListener

public final String getActionListener()
Description copied from class: ItemNode
getActionListener - gets the value of the Menu Node's actionListener attribute.

Overrides:
getActionListener in class ItemNode
Returns:
String - method reference to an action listener

getLaunchListener

public final String getLaunchListener()
Description copied from class: ItemNode
getLaunchListener - gets the value of the Menu Node's launchListener attribute.

Overrides:
getLaunchListener in class ItemNode
Returns:
String - method reference to an launch listener

getReturnListener

public final String getReturnListener()
Description copied from class: ItemNode
getReturnListener - gets the value of the Menu Node's returnListener attribute.

Overrides:
getReturnListener in class ItemNode
Returns:
String - method reference to an return listener

getImmediate

public final boolean getImmediate()
Description copied from class: ItemNode
Gets the immediate attribute of the menu item.

Overrides:
getImmediate in class ItemNode
Returns:
boolean - indicating whether or not data validation - client-side or server-side - should take place when events are generated by this component.

getUseWindow

public final boolean getUseWindow()
Description copied from class: ItemNode
Gets the useWindow attribute of the menu item.

Overrides:
getUseWindow in class ItemNode
Returns:
boolean - indicating whether or not to use a new window when launching dialogs.

getWindowHeight

public final int getWindowHeight()
Description copied from class: ItemNode
Gets the windowHeight attribute of the menu item.

Overrides:
getWindowHeight in class ItemNode
Returns:
int height of the window, if this command is used to launch a window.

getWindowWidth

public final int getWindowWidth()
Description copied from class: ItemNode
Gets the windowWidth attribute of the menu item.

Overrides:
getWindowWidth in class ItemNode
Returns:
int width of the window, if this command is used to launch a window.

getLabel

public final String getLabel()
Description copied from class: MenuNode
Get the menu item's label This could either be a string value set directly in the metadata or an EL expression string. In the case of an EL expression, we need to get its bound value.

Overrides:
getLabel in class MenuNode
Returns:
label as a String

getIcon

public final String getIcon()
Description copied from class: MenuNode
Get the icon used by the menu item This could either be a string value set directly in the metadata or an EL expression string. In the case of an EL expression, we need to get its bound value.

Overrides:
getIcon in class MenuNode
Returns:
icon - the String URI to the icon.

getChildren

public final List<MenuNode> getChildren()
Description copied from class: MenuNode
Get the List of menu item's children.

Overrides:
getChildren in class MenuNode
Returns:
List of menu item's children

setChildren

public void setChildren(List<MenuNode> children)
Description copied from class: MenuNode
Set the List of menu item's children.

Overrides:
setChildren in class MenuNode
Parameters:
children - - List of MenuNode children for this MenuNode

getFocusViewId

public final String getFocusViewId()
Description copied from class: MenuNode
Gets the value of the node's focusViewId property.

Overrides:
getFocusViewId in class MenuNode
Returns:
string - the value of the Node's "focusViewId" property.

getRendered

public final boolean getRendered()
Description copied from class: MenuNode
Gets the rendered attribute of the menu item. If false, menu item will not appear.

Overrides:
getRendered in class MenuNode
Returns:
boolean indicating whether or not the menu item is visible.

getDisabled

public final boolean getDisabled()
Description copied from class: MenuNode
Gets the disabled attribute of the menu item. If true, menu item will not appear greyed-out and clicking on it will have no effect

Overrides:
getDisabled in class MenuNode
Returns:
boolean indicating whether or not the menu item is disabled.

getVisible

public final boolean getVisible()
Description copied from class: MenuNode
Gets the visible attribute of the menu item. If false, menu item will not appear

Overrides:
getVisible in class MenuNode
Returns:
boolean indicating whether or not the menu item is visible.

getReadOnly

public final boolean getReadOnly()
Description copied from class: MenuNode
Gets the readOnly state of the node.

Overrides:
getReadOnly in class MenuNode
Returns:
the node's readOnly state as a boolean.

getHandlerId

protected final String getHandlerId()
Description copied from class: MenuNode
Set the MenuContentHandlerImpl's id.

Overrides:
getHandlerId in class MenuNode
Returns:
String object id of the MenuContentHandlerImpl

getBundleKey

public final String getBundleKey()

getBundleName

public final String getBundleName()

actionListener

public void actionListener(javax.faces.event.ActionEvent event)
Overrides:
actionListener in class ItemNode

doAction

public String doAction()
Description copied from class: ItemNode
Gets the value of the node's action property. The action attr value could be one of 2 things: 1) An EL expression 2) An outcome referencing a navigation rule in the faces_config file. Since this method is called only when an ItemNode is clicked, the model is notified that this node is the currently selected node.

Overrides:
doAction in class ItemNode
Returns:
String value of the ItemNode's "action" property.

getAccessKey

public final char getAccessKey()
Description copied from class: MenuNode
getAccessKey - get the label's accessKey as a char.

Overrides:
getAccessKey in class MenuNode
Returns:
the access key of the label as a char.

getId

public final String getId()
Description copied from class: MenuNode
getId - gets the metadata id of the node.

Overrides:
getId in class MenuNode
Returns:
- String identifier for the node component.

getModelId

public final String getModelId()
Description copied from class: MenuNode
Gets the local (shared node's) menu Model's Request map key.

Overrides:
getModelId in class MenuNode

getUniqueId

public final String getUniqueId()
Description copied from class: MenuNode
getUniqueId - gets the unique id of the node.

Overrides:
getUniqueId in class MenuNode
Returns:
- String identifier for the node component.

getLabelAndAccessKey

public final String getLabelAndAccessKey()
Description copied from class: MenuNode
getLabelAndAccessKey - get the label and accessKey together in a single string.

Overrides:
getLabelAndAccessKey in class MenuNode
Returns:
a String containing (representing) the label and accessKey together.

getDefaultFocusPath

public final boolean getDefaultFocusPath()
Description copied from class: MenuNode
Gets the defaultFocusPath attribute of the menu item.

Overrides:
getDefaultFocusPath in class MenuNode
Returns:
boolean indicating whether or not this is the focus path to use, by default, in cases where there are duplicate paths to this node and the focus path is not determinable by the XMLMenuModel model.

getRootModelKey

public final String getRootModelKey()
Description copied from class: MenuNode
Get the top-level, root menu model Request Map Key.

Overrides:
getRootModelKey in class MenuNode
Returns:
root, top-level XMLMenuModel's Request Map Key.

getRootId

public final int getRootId()
Overrides:
getRootId in class MenuNode


Copyright © 2001-2012 The Apache Software Foundation. All Rights Reserved.