Class CmsSitemapTreeController

java.lang.Object
org.opencms.ui.sitemap.CmsSitemapTreeController

public class CmsSitemapTreeController extends Object
Manages the sitemap tree in the 'locale comparison' view in the sitemap editor.

  • Field Details

    • RHS_WIDTH

      public static final int 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 context
      root - the tree's root resource
      context - the locale comparison context
      parent - the parent widget in which the tree will be rendered
  • Method Details

    • 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

      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

      public CmsResource 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

      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

      Opens the page copy dialog for a tree entry.

      Parameters:
      node - the tree node widget
      entry - 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

      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