Class A_CmsListTab

  • All Implemented Interfaces:
    com.google.gwt.event.logical.shared.HasAttachHandlers, com.google.gwt.event.logical.shared.ValueChangeHandler<java.lang.String>, com.google.gwt.event.shared.EventHandler, 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_CmsTruncable
    Direct Known Subclasses:
    CmsCategoriesTab, CmsGalleriesTab, CmsResultsTab, CmsSitemapTab, CmsTypesTab, CmsVfsTab

    public abstract class A_CmsListTab
    extends A_CmsTab
    implements com.google.gwt.event.logical.shared.ValueChangeHandler<java.lang.String>, I_CmsTruncable
    Provides a widget for the content of a tab.

    Since:
    8.0.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      protected class  A_CmsListTab.A_SelectionHandler
      Selection handler to handle check box click events and double clicks on the list items.
      protected class  A_CmsListTab.SelectHandler
      Special click handler to use with select button.
      • Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject

        com.google.gwt.user.client.ui.UIObject.DebugIdImpl, com.google.gwt.user.client.ui.UIObject.DebugIdImplEnabled
    • Constructor Summary

      Constructors 
      Constructor Description
      A_CmsListTab​(java.lang.String tabId)
      Sets up a list tab with a given tab id.
      A_CmsListTab​(org.opencms.ade.galleries.shared.I_CmsGalleryProviderConstants.GalleryTabId tabId)
      The default constructor with drag handler.
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      protected void addWidgetToFrontOfList​(com.google.gwt.user.client.ui.Widget listItem)
      Adds a widget to the front of the list.
      protected void addWidgetToList​(com.google.gwt.user.client.ui.Widget listItem)
      Add a list item widget to the list panel.
      protected void addWidgetToOptions​(com.google.gwt.user.client.ui.Widget widget)
      Add a widget to the option panel.
      protected void cancelQuickFilterTimer()
      Cancels the quick filter timer.
      protected void checkQuickSearchStatus()
      Checks the quick search input and enables/disables the search button accordingly.
      protected void clearList()
      Clears the list panel.
      protected CmsPushButton createCustomUploadButton​(java.lang.String nativeMethod, java.lang.String target)
      Generates a new custom upload button.
      protected CmsPushButton createNewExternalLinkButton​(java.lang.String parentPath)
      Generates a button to create new external link resources.
      protected CmsPushButton createOptimizeButton​(A_CmsListTab.A_SelectionHandler selectionHandler)
      Creates the 'optmize gallery' button.
      protected CmsList<? extends I_CmsListItem> createScrollList()
      Creates the list which should contain the list items of the tab.
      protected A_CmsSelectBox<?> createSelectBox​(java.util.LinkedHashMap<java.lang.String,​java.lang.String> options)
      Creates the sort select box.
      protected CmsPushButton createSelectButton​(A_CmsListTab.A_SelectionHandler selectionHandler)
      Creates a select button.
      protected CmsPushButton createSelectResourceButton​(java.lang.String resourcePath, org.opencms.util.CmsUUID structureId, java.lang.String title, java.lang.String resourceType)
      Creates a button widget to select the specified resource.
      protected CmsUploadButton createUploadButtonForTarget​(java.lang.String target, boolean isRootPath)
      Creates an upload button for the given target.
      CmsScrollPanel getList()
      Returns the list.
      int getRequiredHeight()
      Returns the height required by this tab.
      protected abstract java.util.LinkedHashMap<java.lang.String,​java.lang.String> getSortList()
      Returns a list with sort values for this tab.
      protected boolean hasQuickFilter()
      Returns if this tab has quick filter enabled.
      protected boolean hasQuickSearch()
      Returns if the tab has the quick search box.
      protected void init()
      Call after all handlers have been set.
      void onContentChange()
      Call on content change to update the layout.
      void onResize()
      Adjust content when outer dimensions are changed.
      void onValueChange​(com.google.gwt.event.logical.shared.ValueChangeEvent<java.lang.String> event)
      Will be triggered if the value in the select box changes.
      protected void quickSearch()
      Sets the search query an selects the result tab.
      protected void scheduleQuickFilterTimer()
      Schedules the quick filter action.
      protected CmsTreeItem searchTreeItem​(CmsList<? extends I_CmsListItem> list, java.lang.String categoryPath)
      Searches in the categories tree or list the item and returns it.
      void setSortSelectBoxValue​(java.lang.String value, boolean fireEvents)
      Sets the value selected in the sort select box, if possible.
      void truncate​(java.lang.String textMetricsKey, int clientWidth)
      Truncates long text and sets the original text to the title attribute.
      • Methods inherited from class com.google.gwt.user.client.ui.Composite

        claimElement, getWidget, initializeClaimedElement, initWidget, isAttached, onAttach, onBrowserEvent, onDetach, render, render, resolvePotentialElement, setWidget
      • Methods inherited from class com.google.gwt.user.client.ui.Widget

        addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, doAttachChildren, doDetachChildren, fireEvent, getHandlerCount, getLayoutData, getParent, isOrWasAttached, onLoad, onUnload, removeFromParent, setLayoutData, sinkEvents, unsinkEvents
      • Methods inherited from class com.google.gwt.user.client.ui.UIObject

        addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, setElement, setElement, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkBitlessEvent, toString
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • A_CmsListTab

        public A_CmsListTab​(org.opencms.ade.galleries.shared.I_CmsGalleryProviderConstants.GalleryTabId tabId)
        The default constructor with drag handler.

        Parameters:
        tabId - the tab id
      • A_CmsListTab

        public A_CmsListTab​(java.lang.String tabId)
        Sets up a list tab with a given tab id.

        Parameters:
        tabId - the tab id
    • Method Detail

      • onContentChange

        public void onContentChange()
        Call on content change to update the layout.

      • onValueChange

        public void onValueChange​(com.google.gwt.event.logical.shared.ValueChangeEvent<java.lang.String> event)
        Will be triggered if the value in the select box changes.

        Specified by:
        onValueChange in interface com.google.gwt.event.logical.shared.ValueChangeHandler<java.lang.String>
        See Also:
        ValueChangeHandler.onValueChange(com.google.gwt.event.logical.shared.ValueChangeEvent)
      • setSortSelectBoxValue

        public void setSortSelectBoxValue​(java.lang.String value,
                                          boolean fireEvents)
        Sets the value selected in the sort select box, if possible.

        Parameters:
        value - the new value for the sort select box
        fireEvents - if true, the change event of the select box is fired
      • addWidgetToFrontOfList

        protected void addWidgetToFrontOfList​(com.google.gwt.user.client.ui.Widget listItem)
        Adds a widget to the front of the list.

        Parameters:
        listItem - the list item to add
      • addWidgetToList

        protected void addWidgetToList​(com.google.gwt.user.client.ui.Widget listItem)
        Add a list item widget to the list panel.

        Parameters:
        listItem - the list item to add
      • addWidgetToOptions

        protected void addWidgetToOptions​(com.google.gwt.user.client.ui.Widget widget)
        Add a widget to the option panel.

        The option panel should contain drop down boxes or other list options.

        Parameters:
        widget - the widget to add
      • checkQuickSearchStatus

        protected void checkQuickSearchStatus()
        Checks the quick search input and enables/disables the search button accordingly.

      • clearList

        protected void clearList()
        Clears the list panel.

      • createCustomUploadButton

        protected CmsPushButton createCustomUploadButton​(java.lang.String nativeMethod,
                                                         java.lang.String target)
        Generates a new custom upload button.

        Parameters:
        nativeMethod - the name of the custom JS upload action
        target - the upload target
        Returns:
        the button widget
      • createNewExternalLinkButton

        protected CmsPushButton createNewExternalLinkButton​(java.lang.String parentPath)
        Generates a button to create new external link resources.

        Parameters:
        parentPath - the parent folder site path
        Returns:
        the button widget
      • createScrollList

        protected CmsList<? extends I_CmsListItemcreateScrollList()
        Creates the list which should contain the list items of the tab.

        Returns:
        the newly created list widget
      • createSelectBox

        protected A_CmsSelectBox<?> createSelectBox​(java.util.LinkedHashMap<java.lang.String,​java.lang.String> options)
        Creates the sort select box.
        Parameters:
        options - the options for the select box
        Returns:
        the sort select box
      • createSelectResourceButton

        protected CmsPushButton createSelectResourceButton​(java.lang.String resourcePath,
                                                           org.opencms.util.CmsUUID structureId,
                                                           java.lang.String title,
                                                           java.lang.String resourceType)
        Creates a button widget to select the specified resource.

        Parameters:
        resourcePath - the item resource path
        structureId - the structure id
        title - the resource title
        resourceType - the item resource type
        Returns:
        the initialized select resource button
      • createUploadButtonForTarget

        protected CmsUploadButton createUploadButtonForTarget​(java.lang.String target,
                                                              boolean isRootPath)
        Creates an upload button for the given target.

        Parameters:
        target - the upload target folder
        isRootPath - true if target is a root path
        Returns:
        the upload button
      • getSortList

        protected abstract java.util.LinkedHashMap<java.lang.String,​java.lang.String> getSortList()
        Returns a list with sort values for this tab.

        Returns:
        list of sort order value/text pairs
      • hasQuickFilter

        protected boolean hasQuickFilter()
        Returns if this tab has quick filter enabled.

        Returns:
        true if this tab has quick filter enabled
      • hasQuickSearch

        protected boolean hasQuickSearch()
        Returns if the tab has the quick search box.

        Returns:
        true if the tab has the quick search box
      • init

        protected void init()
        Call after all handlers have been set.

      • quickSearch

        protected void quickSearch()
        Sets the search query an selects the result tab.

      • searchTreeItem

        protected CmsTreeItem searchTreeItem​(CmsList<? extends I_CmsListItem> list,
                                             java.lang.String categoryPath)
        Searches in the categories tree or list the item and returns it.

        Parameters:
        list - the list of items to start from
        categoryPath - the category id to search
        Returns:
        the category item widget