Package org.opencms.ui.contextmenu
Class A_CmsSimpleVisibilityCheck
java.lang.Object
org.opencms.ui.contextmenu.A_CmsSimpleVisibilityCheck
- All Implemented Interfaces:
I_CmsHasMenuItemVisibility
- Direct Known Subclasses:
CmsStandardVisibilityCheck
public abstract class A_CmsSimpleVisibilityCheck
extends Object
implements I_CmsHasMenuItemVisibility
Abstract superclass for menu item visibility checks.
This class automatically handles the case where multiple resources are passed to the getVisibilityMethod. You just need to implement the getSingleVisibility method in subclasses.
-
Field Summary
Modifier and TypeFieldDescriptionprotected boolean
Flag to indicate that the check should not match multiple resources. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract CmsMenuItemVisibilityMode
getSingleVisibility
(CmsObject cms, CmsResource resource) Computes visibility of the menu item for a single resource.getVisibility
(CmsObject cms, List<CmsResource> resources) Gets the visibility for the current resource and CMS context.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.opencms.ui.contextmenu.I_CmsHasMenuItemVisibility
getVisibility
-
Field Details
-
m_singleResourceOnly
Flag to indicate that the check should not match multiple resources.
-
-
Constructor Details
-
A_CmsSimpleVisibilityCheck
public A_CmsSimpleVisibilityCheck()
-
-
Method Details
-
getSingleVisibility
Computes visibility of the menu item for a single resource.- Parameters:
cms
- the CMS context to useresource
- the resource to check- Returns:
- the visibility for the given resource
-
getVisibility
Description copied from interface:I_CmsHasMenuItemVisibility
Gets the visibility for the current resource and CMS context.- Specified by:
getVisibility
in interfaceI_CmsHasMenuItemVisibility
- Parameters:
cms
- the CMS context to useresources
- the list of resources to check- Returns:
- the visibility
- See Also:
-