Class CmsContextMenuHandler
- java.lang.Object
-
- org.opencms.gwt.client.ui.contextmenu.CmsContextMenuHandler
-
- All Implemented Interfaces:
I_CmsActionHandler
,I_CmsContextMenuHandler
- Direct Known Subclasses:
CmsDialogContextMenuHandler
,CmsResultContextMenuHandler
public class CmsContextMenuHandler extends java.lang.Object implements I_CmsContextMenuHandler
The context menu handler for the search result tab.
-
-
Constructor Summary
Constructors Constructor Description CmsContextMenuHandler()
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
ensureLockOnResource(org.opencms.util.CmsUUID structureId, I_CmsSimpleCallback<java.lang.Boolean> callback)
Tries to lock the given resource and returnstrue
on success.java.util.Map<java.lang.String,I_CmsContextMenuCommand>
getContextMenuCommands()
Returns the available context menu commands as a map by class name.java.lang.String
getContextType()
Returns the context type.I_CmsContentEditorHandler
getEditorHandler()
Returns the editor handler.void
leavePage(java.lang.String targetUri)
Leaves the current page calling the target URI.void
loadContextMenu(org.opencms.util.CmsUUID structureId, org.opencms.gwt.shared.CmsCoreData.AdeContext context, CmsContextMenuButton menuButton)
Loads the context menu.void
onSiteOrProjectChange(java.lang.String sitePath, java.lang.String serverLink)
Called when site and or project have been changed.void
refreshResource(org.opencms.util.CmsUUID structureId)
Reloads the resource edited.void
setEditorHandler(I_CmsContentEditorHandler editorHandler)
Sets the editor handler.protected java.util.List<I_CmsContextMenuEntry>
transformEntries(java.util.List<org.opencms.gwt.shared.CmsContextMenuEntryBean> menuBeans, org.opencms.util.CmsUUID structureId)
Transforms a list of context menu entry beans to a list of context menu entries.protected I_CmsContextMenuEntry
transformSingleEntry(org.opencms.gwt.shared.CmsContextMenuEntryBean bean, org.opencms.util.CmsUUID structureId)
Creates a single context menu entry from a context menu entry bean.void
unlockResource(org.opencms.util.CmsUUID structureId)
Unlocks the resource if appropriate.
-
-
-
Constructor Detail
-
CmsContextMenuHandler
public CmsContextMenuHandler()
Constructor.
-
-
Method Detail
-
ensureLockOnResource
public void ensureLockOnResource(org.opencms.util.CmsUUID structureId, I_CmsSimpleCallback<java.lang.Boolean> callback)
Description copied from interface:I_CmsContextMenuHandler
Tries to lock the given resource and returnstrue
on success. If not successful a warning should be displayed.- Specified by:
ensureLockOnResource
in interfaceI_CmsContextMenuHandler
- Parameters:
structureId
- the structure id of the resource to lockcallback
- the callback to execute- See Also:
I_CmsContextMenuHandler.ensureLockOnResource(org.opencms.util.CmsUUID, org.opencms.gwt.client.util.I_CmsSimpleCallback)
-
getContextMenuCommands
public java.util.Map<java.lang.String,I_CmsContextMenuCommand> getContextMenuCommands()
Description copied from interface:I_CmsContextMenuHandler
Returns the available context menu commands as a map by class name.- Specified by:
getContextMenuCommands
in interfaceI_CmsContextMenuHandler
- Returns:
- the available context menu commands as a map by class name
- See Also:
I_CmsContextMenuHandler.getContextMenuCommands()
-
getContextType
public java.lang.String getContextType()
Description copied from interface:I_CmsContextMenuHandler
Returns the context type.- Specified by:
getContextType
in interfaceI_CmsContextMenuHandler
- Returns:
- the context type
- See Also:
I_CmsContextMenuHandler.getContextType()
-
getEditorHandler
public I_CmsContentEditorHandler getEditorHandler()
Description copied from interface:I_CmsContextMenuHandler
Returns the editor handler.- Specified by:
getEditorHandler
in interfaceI_CmsContextMenuHandler
- Returns:
- the editor handler
- See Also:
I_CmsContextMenuHandler.getEditorHandler()
-
leavePage
public void leavePage(java.lang.String targetUri)
Description copied from interface:I_CmsActionHandler
Leaves the current page calling the target URI.- Specified by:
leavePage
in interfaceI_CmsActionHandler
- Parameters:
targetUri
- the target URI- See Also:
I_CmsActionHandler.leavePage(java.lang.String)
-
loadContextMenu
public void loadContextMenu(org.opencms.util.CmsUUID structureId, org.opencms.gwt.shared.CmsCoreData.AdeContext context, CmsContextMenuButton menuButton)
Loads the context menu.- Parameters:
structureId
- the resource structure idcontext
- the contextmenuButton
- the menu button
-
onSiteOrProjectChange
public void onSiteOrProjectChange(java.lang.String sitePath, java.lang.String serverLink)
Description copied from interface:I_CmsActionHandler
Called when site and or project have been changed.- Specified by:
onSiteOrProjectChange
in interfaceI_CmsActionHandler
- Parameters:
sitePath
- the site path to the target resourceserverLink
- the server link to the resource- See Also:
I_CmsActionHandler.onSiteOrProjectChange(java.lang.String, java.lang.String)
-
refreshResource
public void refreshResource(org.opencms.util.CmsUUID structureId)
Description copied from interface:I_CmsActionHandler
Reloads the resource edited.- Specified by:
refreshResource
in interfaceI_CmsActionHandler
- Parameters:
structureId
- the structure id of the resource to lock- See Also:
I_CmsActionHandler.refreshResource(org.opencms.util.CmsUUID)
-
setEditorHandler
public void setEditorHandler(I_CmsContentEditorHandler editorHandler)
Sets the editor handler.- Parameters:
editorHandler
- the editor handler
-
unlockResource
public void unlockResource(org.opencms.util.CmsUUID structureId)
Description copied from interface:I_CmsContextMenuHandler
Unlocks the resource if appropriate.- Specified by:
unlockResource
in interfaceI_CmsContextMenuHandler
- Parameters:
structureId
- the structure id of the resource to lock- See Also:
I_CmsContextMenuHandler.unlockResource(org.opencms.util.CmsUUID)
-
transformEntries
protected java.util.List<I_CmsContextMenuEntry> transformEntries(java.util.List<org.opencms.gwt.shared.CmsContextMenuEntryBean> menuBeans, org.opencms.util.CmsUUID structureId)
Transforms a list of context menu entry beans to a list of context menu entries.- Parameters:
menuBeans
- the list of context menu entry beansstructureId
- the id of the resource for which to transform the context menu entries- Returns:
- a list of context menu entries
-
transformSingleEntry
protected I_CmsContextMenuEntry transformSingleEntry(org.opencms.gwt.shared.CmsContextMenuEntryBean bean, org.opencms.util.CmsUUID structureId)
Creates a single context menu entry from a context menu entry bean.- Parameters:
bean
- the menu entry beanstructureId
- the structure id- Returns:
- the context menu for the given entry
-
-