Package org.opencms.ui.sitemap
Class CmsSitemapTreeController
java.lang.Object
org.opencms.ui.sitemap.CmsSitemapTreeController
Manages the sitemap tree in the 'locale comparison' view in the sitemap editor.
-
Nested Class Summary
Modifier and TypeClassDescriptionclass
The context used for child dialogs. -
Field Summary
Modifier and TypeFieldDescriptionstatic final int
Default width for linked items displayed on the right side of tree items. -
Constructor Summary
ConstructorDescriptionCmsSitemapTreeController
(CmsObject cms, CmsResource root, I_CmsLocaleCompareContext context, com.vaadin.ui.Component parent) Creates a new instance. -
Method Summary
Modifier and TypeMethodDescriptionstatic CmsMenuItemVisibilityMode
activeIfTrue
(boolean condition) Returns VISIBILITY_ACTIVE if the given parameter is true, and VISIBILITY_INACTIVE otherwise.createNode
(CmsSitemapTreeNodeData entry) Creates a sitemap tree node widget from a tree node bean.Creates the root node of the tree.getRoot()
Gets the resource corresponding to the tree's root.void
Initializes the event handlers for a tree node widget.void
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
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 Details
-
RHS_WIDTH
Default width for linked items displayed on the right side of tree items.- See Also:
-
-
Constructor Details
-
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 Details
-
activeIfTrue
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
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
Creates a sitemap tree node widget from a tree node bean.- Parameters:
entry
- the tree node bean- Returns:
- the tree node widget
-
createRootNode
Creates the root node of the tree.- Returns:
- the root node of the tree
-
getRoot
Gets the resource corresponding to the tree's root.- Returns:
- the resource for the root node
-
initEventHandlers
Initializes the event handlers for a tree node widget.- Parameters:
node
- the node for which to initialize the event handlers
-
onClickOpen
Called when the user clicks on the 'opener' icon of a sitemap tree entry.- Parameters:
node
- the sitemap node widget
-
openPageCopyDialog
Opens the page copy dialog for a tree entry.- Parameters:
node
- the tree node widgetentry
- the tree entry
-
updateNode
Updates a sitemap node widget after the resource it corresponds to has changed.- Parameters:
node
- the sitemap node
-
updateNodeForId
Updates the tree node for the resource with the given structure id, if it exists.- Parameters:
id
- the structure id of a resource
-
readSitemapEntryFolderIfPossible
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
-