Package de.uplanet.lucy.server.menu.rt
Class AbstractMenuItem
- java.lang.Object
-
- de.uplanet.lucy.server.menu.rt.AbstractMenuItem
-
- Direct Known Subclasses:
AbstractContainerMenuItem
,ApplicationMenuItem
,LinkMenuItem
,SeparatorMenuItem
public abstract class AbstractMenuItem extends Object implements IMenuItem
-
-
Constructor Summary
Constructors Constructor Description AbstractMenuItem(String p_strId)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract AbstractMenuItem
clone()
String
getGuid()
Get the menu item's unique identifier.int
getLevel()
Get the level of this menu item.int
getLevelRelative(IMenuItem p_menuItem)
Get the level of this menu item relative to the given menu item.String
getName(String p_strLang)
Get the name of this menu item in the specified language.SortedMap<String,String>
getNames()
Get the menu item's language dependent names.IMenuItem
getNextSibling()
Get the next sibling of this menu item.AbstractContainerMenuItem
getParent()
Get the parent of this menu item.IMenuItem
getPreviousSibling()
Get the previous sibling of this menu item.SortedMap<String,String>
getProperties()
Get the menu item's properties.String
getProperty(String p_strName)
Get the value of the given propertyboolean
hasName(String p_strLang)
Test if this menu item has a name in the specified language.boolean
hasParent()
Indicates if this menu item has a parent.boolean
hasProperty(String p_strLang)
Test if this menu item has the given property.boolean
isApplicationMenuItem()
Indicates if this menu item is an application menu item.boolean
isCmsMenuItem()
Indicates if this menu item is a CMS menu item.boolean
isContainerMenuItem()
Indicates if this menu item is a container.boolean
isFirstChild()
Check if this menu item is the first child of it's parent.boolean
isLastChild()
Check if this menu item is the last child of it's parent.boolean
isLinkMenuItem()
Indicates if this menu item is a link menu item.boolean
isRootMenuItem()
Indicates if this is the root menu item.boolean
isSeparatorMenuItem()
Indicates if this menu item is a separator.boolean
isTopLevelGroupMenuItem()
Indicates if this menu item is a top-level group.-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface de.uplanet.lucy.server.menu.rt.IMenuItem
children, getChildrenCount, getDescendantOrSelf, hasChildren
-
-
-
-
Constructor Detail
-
AbstractMenuItem
public AbstractMenuItem(String p_strId)
-
-
Method Detail
-
clone
public abstract AbstractMenuItem clone()
-
getGuid
public String getGuid()
Description copied from interface:IMenuItem
Get the menu item's unique identifier.
-
isRootMenuItem
public boolean isRootMenuItem()
Description copied from interface:IMenuItem
Indicates if this is the root menu item.- Specified by:
isRootMenuItem
in interfaceIMenuItem
- Returns:
- Always
false
.
-
isApplicationMenuItem
public boolean isApplicationMenuItem()
Description copied from interface:IMenuItem
Indicates if this menu item is an application menu item.- Specified by:
isApplicationMenuItem
in interfaceIMenuItem
- Returns:
- Always
false
.
-
isLinkMenuItem
public boolean isLinkMenuItem()
Description copied from interface:IMenuItem
Indicates if this menu item is a link menu item.- Specified by:
isLinkMenuItem
in interfaceIMenuItem
- Returns:
- Always
false
.
-
isCmsMenuItem
public boolean isCmsMenuItem()
Description copied from interface:IMenuItem
Indicates if this menu item is a CMS menu item.- Specified by:
isCmsMenuItem
in interfaceIMenuItem
- Returns:
- Always
false
.
-
isSeparatorMenuItem
public boolean isSeparatorMenuItem()
Description copied from interface:IMenuItem
Indicates if this menu item is a separator.- Specified by:
isSeparatorMenuItem
in interfaceIMenuItem
- Returns:
- Always
false
.
-
isContainerMenuItem
public boolean isContainerMenuItem()
Description copied from interface:IMenuItem
Indicates if this menu item is a container.- Specified by:
isContainerMenuItem
in interfaceIMenuItem
- Returns:
- Always
false
.
-
isTopLevelGroupMenuItem
public boolean isTopLevelGroupMenuItem()
Description copied from interface:IMenuItem
Indicates if this menu item is a top-level group.- Specified by:
isTopLevelGroupMenuItem
in interfaceIMenuItem
- Returns:
- Always
false
.
-
getLevel
public int getLevel()
Description copied from interface:IMenuItem
Get the level of this menu item.0
for menu items that do not have a parent.
-
getLevelRelative
public int getLevelRelative(IMenuItem p_menuItem)
Description copied from interface:IMenuItem
Get the level of this menu item relative to the given menu item.- Specified by:
getLevelRelative
in interfaceIMenuItem
- Returns:
- The relative level of this menu item.
-
hasParent
public boolean hasParent()
Description copied from interface:IMenuItem
Indicates if this menu item has a parent.
-
getParent
public AbstractContainerMenuItem getParent()
Description copied from interface:IMenuItem
Get the parent of this menu item.
-
isFirstChild
public boolean isFirstChild()
Description copied from interface:IMenuItem
Check if this menu item is the first child of it's parent.- Specified by:
isFirstChild
in interfaceIMenuItem
- Returns:
true
if this menu item has a parent and is the first child of this parent, orfalse
otherwise.
-
isLastChild
public boolean isLastChild()
Description copied from interface:IMenuItem
Check if this menu item is the last child of it's parent.- Specified by:
isLastChild
in interfaceIMenuItem
- Returns:
true
if this menu item has a parent and is the last child of this parent, orfalse
otherwise.
-
getPreviousSibling
public IMenuItem getPreviousSibling()
Description copied from interface:IMenuItem
Get the previous sibling of this menu item.- Specified by:
getPreviousSibling
in interfaceIMenuItem
- Returns:
- If this menu item has a parent and this menu item is not the
first child of this parent, the previous sibling of this menu item
is returned. In all other cases the return value is
null
.
-
getNextSibling
public IMenuItem getNextSibling()
Description copied from interface:IMenuItem
Get the next sibling of this menu item.- Specified by:
getNextSibling
in interfaceIMenuItem
- Returns:
- If this menu item has a parent and this menu item is not the
last child of this parent, the next sibling of this menu item
is returned. In all other cases the return value is
null
.
-
hasProperty
public boolean hasProperty(String p_strLang)
Description copied from interface:IMenuItem
Test if this menu item has the given property.- Specified by:
hasProperty
in interfaceIMenuItem
- Parameters:
p_strLang
- The property name.- Returns:
true
if this menu item has the property, orfalse
otherwise.
-
getProperty
public String getProperty(String p_strName)
Description copied from interface:IMenuItem
Get the value of the given property- Specified by:
getProperty
in interfaceIMenuItem
- Parameters:
p_strName
- The property name.- Returns:
- The value of the property.
-
getProperties
public SortedMap<String,String> getProperties()
Description copied from interface:IMenuItem
Get the menu item's properties.- Specified by:
getProperties
in interfaceIMenuItem
- Returns:
- An immutable map of the menu item's properties,
never
null
.
-
hasName
public boolean hasName(String p_strLang)
Description copied from interface:IMenuItem
Test if this menu item has a name in the specified language.
-
getName
public String getName(String p_strLang)
Description copied from interface:IMenuItem
Get the name of this menu item in the specified language.
-
-