Package org.opencms.ui.contextmenu
Class CmsMenuItemVisibilityMode
java.lang.Object
org.opencms.util.A_CmsModeIntEnumeration
org.opencms.ui.contextmenu.CmsMenuItemVisibilityMode
- All Implemented Interfaces:
Serializable
The visibility modes of a context menu item in the explorer view.
- Since:
- 6.5.6
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionstatic final CmsMenuItemVisibilityMode
Menu item visibility: active.static final CmsMenuItemVisibilityMode
Menu item visibility: inactive.static final CmsMenuItemVisibilityMode
Menu item visibility: invisible.static final CmsMenuItemVisibilityMode
Menu item visibility: invisible, use next best menu item with same ID. -
Method Summary
Modifier and TypeMethodDescriptionstatic CmsMenuItemVisibilityMode
activeInactive
(boolean active) Utilitiy method that returns 'active' if the parameter is true, otherwise inactive.static CmsMenuItemVisibilityMode
activeInvisible
(boolean active) Utility method that returns 'active' if the parameter is true, otherwise invisible.addMessageKey
(String messageKey) Adds the name of the message key for the visibility mode.protected CmsMenuItemVisibilityMode
clone()
Returns the name of the message key for the visibility mode.boolean
isActive()
Returns if the mode is set toVISIBILITY_ACTIVE
.boolean
Returns if the mode is set toVISIBILITY_INACTIVE
.boolean
Returns if the mode is set toVISIBILITY_INVISIBLE
orVISIBILITY_USE_NEXT
.boolean
Returns the prioritization flag.boolean
Returns true if this item is invisible, but the next best item with the same ID should be used instead.prioritize
(boolean prioritized) Returns a prioritized instance of the visibility mode.static CmsMenuItemVisibilityMode
valueOf
(int type) Returns the menu item visibility mode for the given mode value.Methods inherited from class org.opencms.util.A_CmsModeIntEnumeration
equals, getMode, hashCode, toString
-
Field Details
-
VISIBILITY_ACTIVE
Menu item visibility: active. -
VISIBILITY_INACTIVE
Menu item visibility: inactive. -
VISIBILITY_INVISIBLE
Menu item visibility: invisible. -
VISIBILITY_USE_NEXT
Menu item visibility: invisible, use next best menu item with same ID.
-
-
Method Details
-
activeInactive
Utilitiy method that returns 'active' if the parameter is true, otherwise inactive.- Parameters:
active
- - whether return value should be 'active'- Returns:
- the visibility
-
activeInvisible
Utility method that returns 'active' if the parameter is true, otherwise invisible.- Parameters:
active
- - whether return value should be 'active' rather than 'invisible'- Returns:
- the visibility
-
valueOf
Returns the menu item visibility mode for the given mode value.This is used only for serialization and should not be accessed for other purposes.
- Parameters:
type
- the mode value to get the item visibility mode for- Returns:
- the menu item visibility mode for the given mode value
-
addMessageKey
Adds the name of the message key for the visibility mode.- Parameters:
messageKey
- the name of the message key for the visibility mode- Returns:
- an extended visibility mode containing the message key
-
getMessageKey
Returns the name of the message key for the visibility mode.Is usually used as description for the inactive visibility modes.
- Returns:
- the name of the message key for the visibility mode
-
isActive
Returns if the mode is set toVISIBILITY_ACTIVE
.- Returns:
- true if the mode is set to
VISIBILITY_ACTIVE
, otherwise false
-
isInActive
Returns if the mode is set toVISIBILITY_INACTIVE
.- Returns:
- true if the mode is set to
VISIBILITY_INACTIVE
, otherwise false
-
isInVisible
Returns if the mode is set toVISIBILITY_INVISIBLE
orVISIBILITY_USE_NEXT
.- Returns:
- true if the mode is set to
VISIBILITY_INVISIBLE
orVISIBILITY_USE_NEXT
, otherwise false
-
isPrioritized
Returns the prioritization flag.- Returns:
- prioritization flag
-
isUseNext
Returns true if this item is invisible, but the next best item with the same ID should be used instead.- Returns:
- true if this item is invisible, but the next best item with the same ID should be used instead
-
prioritize
Returns a prioritized instance of the visibility mode.- Parameters:
prioritized
-true
to prioritize- Returns:
- the new visibility mode instance
-
clone
-