public class CmsSubmenu extends java.lang.Object implements I_CmsContextMenuItem
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
m_id
The item id.
|
protected float |
m_order
The order.
|
protected java.lang.String |
m_parentId
The parent item id.
|
protected int |
m_priority
The priority.
|
Constructor and Description |
---|
CmsSubmenu(java.lang.String id,
java.lang.String parentId,
java.lang.String title,
float order,
int priority)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
void |
executeAction(I_CmsDialogContext context)
Executes the context menu action given a dialog context.
|
java.lang.String |
getId()
Gets the id.
|
float |
getOrder()
Integer attribute which is used to order menu items.
|
java.lang.String |
getParentId()
Gets the id of the parent entry.
|
int |
getPriority()
Gets the priority.
|
java.lang.String |
getTitle(java.util.Locale locale)
Gets the title.
|
CmsMenuItemVisibilityMode |
getVisibility(CmsObject cms,
java.util.List<CmsResource> resources)
Computes the visibility for this context menu items with the given CMS context and resources.
|
CmsMenuItemVisibilityMode |
getVisibility(I_CmsDialogContext context)
Gets the visibility for the current dialog context.
|
boolean |
isLeafItem()
Returns true if this is a leaf item, i.e. an item which has no child items.
|
protected java.lang.String m_id
protected java.lang.String m_parentId
protected float m_order
protected int m_priority
public CmsSubmenu(java.lang.String id, java.lang.String parentId, java.lang.String title, float order, int priority)
id
- the idparentId
- the parent idtitle
- the titleorder
- the orderpriority
- the prioritypublic void executeAction(I_CmsDialogContext context)
I_CmsContextMenuItem
executeAction
in interface I_CmsContextMenuAction
executeAction
in interface I_CmsContextMenuItem
context
- the dialog contextI_CmsContextMenuItem.executeAction(org.opencms.ui.I_CmsDialogContext)
public java.lang.String getId()
I_CmsContextMenuItem
The id does not need to be unique among all context menu items which are in use in the system, but when multiple menu items with the same id are available for a given context menu, only one of them will be picked, based on the priority (a higher priority context menu item will be preferred to one with a lower priority.
getId
in interface I_CmsContextMenuItem
I_CmsContextMenuItem.getId()
public float getOrder()
I_CmsContextMenuItem
Items with a higher 'order' value will appear after items with a lower order at the same tree level.
getOrder
in interface I_CmsContextMenuItem
I_CmsContextMenuItem.getOrder()
public java.lang.String getParentId()
I_CmsContextMenuItem
If this returns null, the context menu item will be inserted at the root level of the context menu, otherwise, it will be added I_CmsContextMenuActionas a sub-entry of the context menu entry with the given id (if such an entry exists; otherwise, the child entry will be ignored).
getParentId
in interface I_CmsContextMenuItem
I_CmsContextMenuItem.getParentId()
public int getPriority()
I_CmsContextMenuItem
If multiple context menu items with the same id are available for a menu, the one with the highest priority will be picked.
getPriority
in interface I_CmsContextMenuItem
I_CmsContextMenuItem.getPriority()
public java.lang.String getTitle(java.util.Locale locale)
I_CmsContextMenuItem
getTitle
in interface I_CmsContextMenuItem
locale
- the localeI_CmsContextMenuItem.getTitle(java.util.Locale)
public CmsMenuItemVisibilityMode getVisibility(CmsObject cms, java.util.List<CmsResource> resources)
I_CmsContextMenuItem
getVisibility
in interface I_CmsContextMenuItem
getVisibility
in interface I_CmsHasMenuItemVisibility
cms
- the current CMS contextresources
- the resources for which the context menu is being openedI_CmsContextMenuItem.getVisibility(org.opencms.file.CmsObject, java.util.List)
public CmsMenuItemVisibilityMode getVisibility(I_CmsDialogContext context)
I_CmsHasMenuItemVisibility
getVisibility
in interface I_CmsHasMenuItemVisibility
context
- the dialog contextI_CmsHasMenuItemVisibility.getVisibility(org.opencms.ui.I_CmsDialogContext)
public boolean isLeafItem()
I_CmsContextMenuItem
isLeafItem
in interface I_CmsContextMenuItem
I_CmsContextMenuItem.isLeafItem()