org.apache.jetspeed.portalsite.impl
Class MenuElementImpl

java.lang.Object
  extended by org.apache.jetspeed.portalsite.impl.MenuElementImpl
All Implemented Interfaces:
java.lang.Cloneable, MenuElement
Direct Known Subclasses:
MenuImpl, MenuOptionImpl, MenuSeparatorImpl

public abstract class MenuElementImpl
extends java.lang.Object
implements MenuElement, java.lang.Cloneable

This abstract class implements common features of portal-site menu elements constructed and returned to decorators.

Version:
$Id: MenuElementImpl.java 516448 2007-03-09 16:25:47Z ate $
Author:
Randy Watler

Field Summary
 
Fields inherited from interface org.apache.jetspeed.portalsite.MenuElement
MENU_ELEMENT_TYPE, OPTION_ELEMENT_TYPE, SEPARATOR_ELEMENT_TYPE
 
Constructor Summary
protected MenuElementImpl(MenuImpl parent)
          MenuElementImpl - constructor
protected MenuElementImpl(MenuImpl parent, Node node)
          MenuElementImpl - node proxy constructor
 
Method Summary
 java.lang.Object clone()
          clone - clone this instance
 boolean equals(java.lang.Object obj)
          equals - compare menu element implementations
abstract  java.lang.String getElementType()
          getElementType - get type of menu element
 GenericMetadata getMetadata()
          getMetadata - get generic metadata for menu element
 java.lang.String getName()
          getName - get name of menu element used for default title
protected  Node getNode()
          getNode - get menu element node proxy in the site view
 Menu getParentMenu()
          getParentMenu - get menu that contains menu element
 java.lang.String getShortTitle()
          getShortTitle - get default short title for menu element
 java.lang.String getShortTitle(java.util.Locale locale)
          getShortTitle - get locale specific short title for menu element from metadata
 java.lang.String getSkin()
          getSkin - get skin name for menu element
 java.lang.String getTitle()
          getTitle - get default title for menu element
 java.lang.String getTitle(java.util.Locale locale)
          getTitle - get locale specific title for menu element from metadata
 java.lang.String getUrl()
          getUrl - get url of menu element used for comparison
protected  void setNode(Node node)
          setNode - set menu element node proxy in the site view
protected  void setParentMenu(Menu parentMenu)
          setParentMenu - set menu that contains menu element
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MenuElementImpl

protected MenuElementImpl(MenuImpl parent)
MenuElementImpl - constructor

Parameters:
parent - containing menu implementation

MenuElementImpl

protected MenuElementImpl(MenuImpl parent,
                          Node node)
MenuElementImpl - node proxy constructor

Parameters:
parent - containing menu implementation
node - menu element node proxy
Method Detail

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
clone - clone this instance

Overrides:
clone in class java.lang.Object
Returns:
unparented copy
Throws:
java.lang.CloneNotSupportedException

equals

public boolean equals(java.lang.Object obj)
equals - compare menu element implementations

Overrides:
equals in class java.lang.Object
Returns:
equals result

getElementType

public abstract java.lang.String getElementType()
getElementType - get type of menu element

Specified by:
getElementType in interface MenuElement
Returns:
MENU_ELEMENT_TYPE, OPTION_ELEMENT_TYPE, or SEPARATOR_ELEMENT_TYPE

getParentMenu

public Menu getParentMenu()
getParentMenu - get menu that contains menu element

Specified by:
getParentMenu in interface MenuElement
Returns:
parent menu

setParentMenu

protected void setParentMenu(Menu parentMenu)
setParentMenu - set menu that contains menu element

Parameters:
parentMenu - parent menu

getName

public java.lang.String getName()
getName - get name of menu element used for default title

Returns:
menu element name

getUrl

public java.lang.String getUrl()
getUrl - get url of menu element used for comparison

Returns:
folder, page, or link url

getTitle

public java.lang.String getTitle()
getTitle - get default title for menu element

Specified by:
getTitle in interface MenuElement
Returns:
title text

getShortTitle

public java.lang.String getShortTitle()
getShortTitle - get default short title for menu element

Specified by:
getShortTitle in interface MenuElement
Returns:
short title text

getTitle

public java.lang.String getTitle(java.util.Locale locale)
getTitle - get locale specific title for menu element from metadata

Specified by:
getTitle in interface MenuElement
Parameters:
locale - preferred locale
Returns:
title text

getShortTitle

public java.lang.String getShortTitle(java.util.Locale locale)
getShortTitle - get locale specific short title for menu element from metadata

Specified by:
getShortTitle in interface MenuElement
Parameters:
locale - preferred locale
Returns:
short title text

getMetadata

public GenericMetadata getMetadata()
getMetadata - get generic metadata for menu element

Specified by:
getMetadata in interface MenuElement
Returns:
metadata

getSkin

public java.lang.String getSkin()
getSkin - get skin name for menu element

Specified by:
getSkin in interface MenuElement
Returns:
skin name

getNode

protected Node getNode()
getNode - get menu element node proxy in the site view

Returns:
node proxy

setNode

protected void setNode(Node node)
setNode - set menu element node proxy in the site view

Parameters:
node - node proxy


Copyright © 1999-2010 Apache Software Foundation. All Rights Reserved.