Package org.opencms.ui.sitemap
Class CmsSitemapTreeController
- java.lang.Object
-
- org.opencms.ui.sitemap.CmsSitemapTreeController
-
public class CmsSitemapTreeController extends java.lang.Object
Manages the sitemap tree in the 'locale comparison' view in the sitemap editor.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
CmsSitemapTreeController.DialogContext
The context used for child dialogs.
-
Field Summary
Fields Modifier and Type Field Description static int
RHS_WIDTH
Default width for linked items displayed on the right side of tree items.
-
Constructor Summary
Constructors Constructor Description CmsSitemapTreeController(CmsObject cms, CmsResource root, I_CmsLocaleCompareContext context, com.vaadin.ui.Component parent)
Creates a new instance.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static CmsMenuItemVisibilityMode
activeIfTrue(boolean condition)
Returns VISIBILITY_ACTIVE if the given parameter is true, and VISIBILITY_INACTIVE otherwise.CmsSitemapTreeNode
createNode(CmsSitemapTreeNodeData entry)
Creates a sitemap tree node widget from a tree node bean.CmsSitemapTreeNode
createRootNode()
Creates the root node of the tree.CmsResource
getRoot()
Gets the resource corresponding to the tree's root.void
initEventHandlers(CmsSitemapTreeNode node)
Initializes the event handlers for a tree node widget.void
onClickOpen(CmsSitemapTreeNode node)
Called when the user clicks on the 'opener' icon of a sitemap tree entry.void
openPageCopyDialog(CmsSitemapTreeNode node, CmsSitemapTreeNodeData entry)
Opens the page copy dialog for a tree entry.protected CmsResource
readSitemapEntryFolderIfPossible(CmsResource resource)
If the given resource is the default file of a sitmeap entry folder, then returns that folder, else the original file.void
updateNode(CmsSitemapTreeNode node)
Updates a sitemap node widget after the resource it corresponds to has changed.void
updateNodeForId(CmsUUID id)
Updates the tree node for the resource with the given structure id, if it exists.static CmsMenuItemVisibilityMode
visibleIfTrue(boolean condition)
Returns VISIBILITY_ACTIVE if the given parameter is true, and VISIBILITY_INVISIBLE otherwise.
-
-
-
Field Detail
-
RHS_WIDTH
public static final int RHS_WIDTH
Default width for linked items displayed on the right side of tree items.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
CmsSitemapTreeController
public CmsSitemapTreeController(CmsObject cms, CmsResource root, I_CmsLocaleCompareContext context, com.vaadin.ui.Component parent)
Creates a new instance.- Parameters:
cms
- the CMS contextroot
- the tree's root resourcecontext
- the locale comparison contextparent
- the parent widget in which the tree will be rendered
-
-
Method Detail
-
activeIfTrue
public static CmsMenuItemVisibilityMode activeIfTrue(boolean condition)
Returns VISIBILITY_ACTIVE if the given parameter is true, and VISIBILITY_INACTIVE otherwise.- Parameters:
condition
- a boolean value- Returns:
- the visibility based on the condition value
-
visibleIfTrue
public static CmsMenuItemVisibilityMode visibleIfTrue(boolean condition)
Returns VISIBILITY_ACTIVE if the given parameter is true, and VISIBILITY_INVISIBLE otherwise.- Parameters:
condition
- a boolean value- Returns:
- the visibility based on the condition value
-
createNode
public CmsSitemapTreeNode createNode(CmsSitemapTreeNodeData entry)
Creates a sitemap tree node widget from a tree node bean.- Parameters:
entry
- the tree node bean- Returns:
- the tree node widget
-
createRootNode
public CmsSitemapTreeNode createRootNode()
Creates the root node of the tree.- Returns:
- the root node of the tree
-
getRoot
public CmsResource getRoot()
Gets the resource corresponding to the tree's root.- Returns:
- the resource for the root node
-
initEventHandlers
public void initEventHandlers(CmsSitemapTreeNode node)
Initializes the event handlers for a tree node widget.- Parameters:
node
- the node for which to initialize the event handlers
-
onClickOpen
public void onClickOpen(CmsSitemapTreeNode node)
Called when the user clicks on the 'opener' icon of a sitemap tree entry.- Parameters:
node
- the sitemap node widget
-
openPageCopyDialog
public void openPageCopyDialog(CmsSitemapTreeNode node, CmsSitemapTreeNodeData entry)
Opens the page copy dialog for a tree entry.- Parameters:
node
- the tree node widgetentry
- the tree entry
-
updateNode
public void updateNode(CmsSitemapTreeNode node)
Updates a sitemap node widget after the resource it corresponds to has changed.- Parameters:
node
- the sitemap node
-
updateNodeForId
public void updateNodeForId(CmsUUID id)
Updates the tree node for the resource with the given structure id, if it exists.- Parameters:
id
- the structure id of a resource
-
readSitemapEntryFolderIfPossible
protected CmsResource readSitemapEntryFolderIfPossible(CmsResource resource)
If the given resource is the default file of a sitmeap entry folder, then returns that folder, else the original file.- Parameters:
resource
- a resource- Returns:
- the resource or its parent folder
-
-