Package com.jalios.jcms.unifiedinsert
Class MenuItem
- java.lang.Object
-
- com.jalios.jcms.unifiedinsert.MenuItem
-
public class MenuItem extends java.lang.Object
Represented an menu item in the unified insertion interface.- Since:
- jcms-10.0.0 - JCMS-5321
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
DEFAULT_ICON
Default icon of a Menu Item.static int
DEFAULT_ORDER
Default order of a Menu Item.protected boolean
enabled
protected java.lang.String
icon
protected java.lang.String
id
protected java.lang.String
jspPath
protected int
order
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
disable()
Disable this item.void
enable()
Enable this item.java.lang.String
getIcon()
Returns the icon of this this item.java.lang.String
getId()
Returns the unique ID od this item.java.lang.String
getJspPath()
Returns the path of the JSP for this item.java.lang.String
getLabel(java.lang.String lang)
Retrieve the label of this Menu item in the specified languageint
getOrder()
Returns the order of this item when compared to other MenuItem instance.boolean
isEnabled()
Check if this item is enabled or not.void
setEnabled(boolean enabled)
Set the enabled status of this item.void
setIcon(java.lang.String icon)
Sets the icon this item.void
setId(java.lang.String id)
Sets the id of this itemvoid
setJspPath(java.lang.String jspPath)
Sets the path of JSP.void
setOrder(int order)
Sets the order of this item when compared to othersjava.lang.String
toString()
-
-
-
Field Detail
-
DEFAULT_ICON
public static final java.lang.String DEFAULT_ICON
Default icon of a Menu Item.- See Also:
- Constant Field Values
-
DEFAULT_ORDER
public static final int DEFAULT_ORDER
Default order of a Menu Item.- See Also:
- Constant Field Values
-
id
protected java.lang.String id
-
jspPath
protected java.lang.String jspPath
-
icon
protected java.lang.String icon
-
order
protected int order
-
enabled
protected boolean enabled
-
-
Constructor Detail
-
MenuItem
public MenuItem(MenuItem other)
Constructor by copy- Parameters:
other
- a MenuItem to copy
-
MenuItem
public MenuItem(java.lang.String id, java.lang.String jspPath, java.lang.String icon, int order)
Builds a new Menu Item from the specified parameter- Parameters:
id
- a unique id for this item.jspPath
- the path of the JSP for this item.icon
- the icon of this itemorder
- the order of this item
-
-
Method Detail
-
getLabel
public java.lang.String getLabel(java.lang.String lang)
Retrieve the label of this Menu item in the specified language- Parameters:
lang
- an ISO-639 language code- Returns:
- the MenuItem label
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
getId
public java.lang.String getId()
Returns the unique ID od this item.- Returns:
- a unique id
-
setId
public void setId(java.lang.String id)
Sets the id of this item- Parameters:
id
- a unique id
-
getJspPath
public java.lang.String getJspPath()
Returns the path of the JSP for this item.- Returns:
- a path (relative to webapp root)
-
setJspPath
public void setJspPath(java.lang.String jspPath)
Sets the path of JSP.- Parameters:
jspPath
- a path (relative to webapp root)
-
getIcon
public java.lang.String getIcon()
Returns the icon of this this item.- Returns:
- the jalios icon id
-
setIcon
public void setIcon(java.lang.String icon)
Sets the icon this item.- Parameters:
icon
- the jalios icon id set
-
getOrder
public int getOrder()
Returns the order of this item when compared to other MenuItem instance.- Returns:
- the order
-
setOrder
public void setOrder(int order)
Sets the order of this item when compared to others- Parameters:
order
- the order to set
-
isEnabled
public boolean isEnabled()
Check if this item is enabled or not.- Returns:
- true if item is enabled, false otherwise
-
enable
public void enable()
Enable this item.
-
disable
public void disable()
Disable this item.
-
setEnabled
public void setEnabled(boolean enabled)
Set the enabled status of this item.- Parameters:
enabled
- true if enabled, false if disabled
-
-