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
Nested ClassesModifier and TypeClassDescriptionclassThe context used for child dialogs. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intDefault width for linked items displayed on the right side of tree items. -
Constructor Summary
ConstructorsConstructorDescriptionCmsSitemapTreeController(CmsObject cms, CmsResource root, I_CmsLocaleCompareContext context, com.vaadin.ui.Component parent) Creates a new instance. -
Method Summary
Modifier and TypeMethodDescriptionstatic CmsMenuItemVisibilityModeactiveIfTrue(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.voidInitializes the event handlers for a tree node widget.voidCalled when the user clicks on the 'opener' icon of a sitemap tree entry.static CmsResourcereadSitemapEntryFolderIfPossible(CmsResource resource) If the given resource is the default file of a sitmeap entry folder, then returns that folder, else the original file.voidupdateNode(CmsSitemapTreeNode node) Updates a sitemap node widget after the resource it corresponds to has changed.voidUpdates the tree node for the resource with the given structure id, if it exists.static CmsMenuItemVisibilityModevisibleIfTrue(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
-
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
-
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
-
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
-