Class CmsSitemapTreeItem

  • All Implemented Interfaces:
    com.google.gwt.event.logical.shared.HasAttachHandlers, com.google.gwt.event.shared.HasHandlers, com.google.gwt.user.client.EventListener, com.google.gwt.user.client.ui.HasVisibility, com.google.gwt.user.client.ui.IsRenderable, com.google.gwt.user.client.ui.IsWidget, I_CmsDraggable, I_CmsListItem, I_CmsTruncable

    public class CmsSitemapTreeItem
    extends CmsLazyTreeItem
    Sitemap entry tree item implementation.

    Since:
    8.0.0
    See Also:
    CmsLazyTreeItem, CmsClientSitemapEntry
    • Field Detail

      • m_entryId

        protected org.opencms.util.CmsUUID m_entryId
        The current sitemap entry id.
    • Constructor Detail

      • CmsSitemapTreeItem

        public CmsSitemapTreeItem​(org.opencms.ade.sitemap.shared.CmsClientSitemapEntry entry)
        Default constructor.

        Parameters:
        entry - the sitemap entry
    • Method Detail

      • getItemById

        public static CmsSitemapTreeItem getItemById​(org.opencms.util.CmsUUID id)
        Looks up a sitemap tree item by entry id.

        Parameters:
        id - the sitemap entry id
        Returns:
        the corresponding sitemap tree item, or null if there is none
      • addInfo

        protected static void addInfo​(java.util.List<org.opencms.gwt.shared.CmsAdditionalInfoBean> infos,
                                      java.lang.String label,
                                      java.lang.String value)
        Helper method to add an additional info bean to a list.

        Parameters:
        infos - the list of additional info beans
        label - the label for the new bean
        value - the value for the new bean
      • getDisplayedUrl

        public java.lang.String getDisplayedUrl​(java.lang.String sitePath)
        Given the path of a sitemap entry, this method returns the URL which should be displayed to the user.

        Parameters:
        sitePath - the site path of a sitemap entry
        Returns:
        the URL which should be displayed to the user
      • getEntryId

        public org.opencms.util.CmsUUID getEntryId()
        Returns the entry id.

        Returns:
        the entry id
      • getSitemapEntry

        public org.opencms.ade.sitemap.shared.CmsClientSitemapEntry getSitemapEntry()
        Returns the sitemap entry.

        Returns:
        the sitemap entry
      • getSitePath

        public java.lang.String getSitePath()
        Returns the site path.

        Returns:
        the site path
      • highlight

        public void highlight​(boolean highlightOn)
        Turns the highlighting for this item on or off.

        Parameters:
        highlightOn - if true, the highlighting is turned on, else off
      • highlightTemporarily

        public void highlightTemporarily​(int duration,
                                         CmsListItemWidget.Background background)
        Temporarily highlights an item.

        Parameters:
        duration - the duration for which
        background - the background to color to set when finished
      • resetEntry

        public void resetEntry()
        Resets entry appearance.

      • setBackgroundColor

        public void setBackgroundColor​(CmsListItemWidget.Background background)
        Sets the background color of the list item widget.

        If the background is null, the widget will be shown with its default style.

        Parameters:
        background - the background color to set
      • setStateIcon

        public void setStateIcon​(org.opencms.gwt.shared.CmsListInfoBean.StateIcon icon)
        Sets the icon.

        Parameters:
        icon - the icon to set
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class com.google.gwt.user.client.ui.UIObject
        See Also:
        UIObject.toString()
      • updateEditorMode

        public void updateEditorMode()
        Updates the sitemap editor mode.

      • updateEntry

        public void updateEntry​(org.opencms.ade.sitemap.shared.CmsClientSitemapEntry entry)
        Refreshes the displayed data from the given sitemap entry.

        Parameters:
        entry - the sitemap entry to update
      • updateInNavigation

        public void updateInNavigation​(org.opencms.ade.sitemap.shared.CmsClientSitemapEntry entry)
        Updates the in navigation properties of the displayed entry.

        Parameters:
        entry - the sitemap entry
      • updateSitePath

        public void updateSitePath()
        Updates the site path using the current site entry's data.

      • updateSitePath

        public void updateSitePath​(java.lang.String sitePath)
        Updates the recursively the site path.

        Parameters:
        sitePath - the new site path to set
      • addMarker

        protected com.google.gwt.user.client.ui.Widget addMarker​(java.lang.String text)
        Helper method for adding the marker widget.

        Parameters:
        text - the text for the marker widget
        Returns:
        the new marker widget
      • getName

        protected java.lang.String getName​(java.lang.String sitePath)
        Return the name of this item, which can differ from the entry name for root nodes.

        Parameters:
        sitePath - the sitemap entry's site path
        Returns:
        the name
      • removeInvalidChildren

        protected void removeInvalidChildren()
        Helper method to remove invalid children that don't have a corresponding CmsSitemapClientEntry.