Class CmsContextMenuActionItem
- java.lang.Object
-
- org.opencms.ui.actions.CmsContextMenuActionItem
-
- All Implemented Interfaces:
I_CmsADEAction
,I_CmsContextMenuAction
,I_CmsContextMenuItem
,I_CmsHasMenuItemVisibility
public class CmsContextMenuActionItem extends java.lang.Object implements I_CmsContextMenuItem, I_CmsADEAction
A workplace action context menu item.
-
-
Constructor Summary
Constructors Constructor Description CmsContextMenuActionItem(I_CmsWorkplaceAction action, java.lang.String parentId, float order, int priority)
Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
executeAction(I_CmsDialogContext context)
Executes the context menu action given a dialog context.java.lang.String
getCommandClassName()
Returns the client side command to execute.java.lang.String
getId()
Gets the id.java.lang.String
getJspPath()
Returns the optional dialog JSP.float
getOrder()
Integer attribute which is used to order menu items.java.util.Map<java.lang.String,java.lang.String>
getParams()
Returns the optional command parameters.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.I_CmsWorkplaceAction
getWorkplaceAction()
Returns the workplace action.boolean
isAdeSupported()
Returns whether the ADE context is supported.boolean
isLeafItem()
Returns true if this is a leaf item, i.e.
-
-
-
Constructor Detail
-
CmsContextMenuActionItem
public CmsContextMenuActionItem(I_CmsWorkplaceAction action, java.lang.String parentId, float order, int priority)
Creates a new instance.- Parameters:
action
- the action to executeparentId
- the parent item idorder
- the orderpriority
- the priority
-
-
Method Detail
-
executeAction
public void executeAction(I_CmsDialogContext context)
Description copied from interface:I_CmsContextMenuItem
Executes the context menu action given a dialog context.- Specified by:
executeAction
in interfaceI_CmsContextMenuAction
- Specified by:
executeAction
in interfaceI_CmsContextMenuItem
- Parameters:
context
- the dialog context- See Also:
I_CmsContextMenuItem.executeAction(org.opencms.ui.I_CmsDialogContext)
-
getCommandClassName
public java.lang.String getCommandClassName()
Description copied from interface:I_CmsADEAction
Returns the client side command to execute.- Specified by:
getCommandClassName
in interfaceI_CmsADEAction
- Returns:
- the client side command
- See Also:
I_CmsADEAction.getCommandClassName()
-
getId
public java.lang.String getId()
Description copied from interface:I_CmsContextMenuItem
Gets the id.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.
- Specified by:
getId
in interfaceI_CmsContextMenuItem
- Returns:
- the id
- See Also:
I_CmsContextMenuItem.getId()
-
getJspPath
public java.lang.String getJspPath()
Description copied from interface:I_CmsADEAction
Returns the optional dialog JSP.- Specified by:
getJspPath
in interfaceI_CmsADEAction
- Returns:
- the dialog JSP
- See Also:
I_CmsADEAction.getJspPath()
-
getOrder
public float getOrder()
Description copied from interface:I_CmsContextMenuItem
Integer attribute which is used to order menu items.Items with a higher 'order' value will appear after items with a lower order at the same tree level.
- Specified by:
getOrder
in interfaceI_CmsContextMenuItem
- Returns:
- the order
- See Also:
I_CmsContextMenuItem.getOrder()
-
getParams
public java.util.Map<java.lang.String,java.lang.String> getParams()
Description copied from interface:I_CmsADEAction
Returns the optional command parameters.- Specified by:
getParams
in interfaceI_CmsADEAction
- Returns:
- the command parameters
- See Also:
I_CmsADEAction.getParams()
-
getParentId
public java.lang.String getParentId()
Description copied from interface:I_CmsContextMenuItem
Gets the id of the parent entry.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).
- Specified by:
getParentId
in interfaceI_CmsContextMenuItem
- Returns:
- the parent id
- See Also:
I_CmsContextMenuItem.getParentId()
-
getPriority
public int getPriority()
Description copied from interface:I_CmsContextMenuItem
Gets the priority.If multiple context menu items with the same id are available for a menu, the one with the highest priority will be picked.
- Specified by:
getPriority
in interfaceI_CmsContextMenuItem
- Returns:
- the priority
- See Also:
I_CmsContextMenuItem.getPriority()
-
getTitle
public java.lang.String getTitle(java.util.Locale locale)
Description copied from interface:I_CmsContextMenuItem
Gets the title.- Specified by:
getTitle
in interfaceI_CmsContextMenuItem
- Parameters:
locale
- the locale- Returns:
- the title
- See Also:
I_CmsContextMenuItem.getTitle(java.util.Locale)
-
getVisibility
public CmsMenuItemVisibilityMode getVisibility(CmsObject cms, java.util.List<CmsResource> resources)
Description copied from interface:I_CmsContextMenuItem
Computes the visibility for this context menu items with the given CMS context and resources.- Specified by:
getVisibility
in interfaceI_CmsContextMenuItem
- Specified by:
getVisibility
in interfaceI_CmsHasMenuItemVisibility
- Parameters:
cms
- the current CMS contextresources
- the resources for which the context menu is being opened- Returns:
- the visibility of the context menu item
- See Also:
I_CmsContextMenuItem.getVisibility(org.opencms.file.CmsObject, java.util.List)
-
getVisibility
public CmsMenuItemVisibilityMode getVisibility(I_CmsDialogContext context)
Description copied from interface:I_CmsHasMenuItemVisibility
Gets the visibility for the current dialog context.- Specified by:
getVisibility
in interfaceI_CmsHasMenuItemVisibility
- Parameters:
context
- the dialog context- Returns:
- the visibility
- See Also:
I_CmsHasMenuItemVisibility.getVisibility(org.opencms.ui.I_CmsDialogContext)
-
getWorkplaceAction
public I_CmsWorkplaceAction getWorkplaceAction()
Returns the workplace action.- Returns:
- the workplace action
-
isAdeSupported
public boolean isAdeSupported()
Description copied from interface:I_CmsADEAction
Returns whether the ADE context is supported.- Specified by:
isAdeSupported
in interfaceI_CmsADEAction
- Returns:
true
in case the ADE context is supported- See Also:
I_CmsADEAction.isAdeSupported()
-
isLeafItem
public boolean isLeafItem()
Description copied from interface:I_CmsContextMenuItem
Returns true if this is a leaf item, i.e. an item which has no child items.- Specified by:
isLeafItem
in interfaceI_CmsContextMenuItem
- Returns:
- true if this is a leaf item
- See Also:
I_CmsContextMenuItem.isLeafItem()
-
-