Class A_CmsListTab

java.lang.Object
com.google.gwt.user.client.ui.UIObject
com.google.gwt.user.client.ui.Widget
com.google.gwt.user.client.ui.Composite
org.opencms.ade.galleries.client.ui.A_CmsTab
org.opencms.ade.galleries.client.ui.A_CmsListTab
All Implemented Interfaces:
com.google.gwt.event.logical.shared.HasAttachHandlers, com.google.gwt.event.logical.shared.ValueChangeHandler<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<String>, I_CmsTruncable
Provides a widget for the content of a tab.

Since:
8.0.
  • Field Details

  • Constructor Details

    • 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(String tabId)
      Sets up a list tab with a given tab id.

      Parameters:
      tabId - the tab id
  • Method Details

    • getList

      Returns the list.

      Returns:
      the list
    • getRequiredHeight

      public int getRequiredHeight()
      Description copied from class: A_CmsTab
      Returns the height required by this tab.

      Specified by:
      getRequiredHeight in class A_CmsTab
      Returns:
      the height
      See Also:
    • onContentChange

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

    • onResize

      public void onResize()
      Description copied from class: A_CmsTab
      Adjust content when outer dimensions are changed.

      Overrides:
      onResize in class A_CmsTab
      See Also:
    • onValueChange

      public void onValueChange(com.google.gwt.event.logical.shared.ValueChangeEvent<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<String>
      See Also:
      • ValueChangeHandler.onValueChange(com.google.gwt.event.logical.shared.ValueChangeEvent)
    • setSortSelectBoxValue

      public void setSortSelectBoxValue(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
    • truncate

      public void truncate(String textMetricsKey, int clientWidth)
      Description copied from interface: I_CmsTruncable
      Truncates long text and sets the original text to the title attribute.

      Specified by:
      truncate in interface I_CmsTruncable
      Parameters:
      textMetricsKey - the key identifying the text metrics to use
      clientWidth - the width to use in pixels
      See Also:
    • 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
    • cancelQuickFilterTimer

      protected void cancelQuickFilterTimer()
      Cancels the quick filter timer.

    • 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(String nativeMethod, 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

      Generates a button to create new external link resources.

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

      Creates the 'optmize gallery' button.
      Parameters:
      selectionHandler - the selection handler
      Returns:
      the created button
    • createScrollList

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

      Returns:
      the newly created list widget
    • createSelectBox

      Creates the sort select box.
      Parameters:
      options - the options for the select box
      Returns:
      the sort select box
    • createSelectButton

      Creates a select button.

      Parameters:
      selectionHandler - the selction handler
      Returns:
      the select button
    • createSelectResourceButton

      protected CmsPushButton createSelectResourceButton(String resourcePath, org.opencms.util.CmsUUID structureId, String title, 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(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 LinkedHashMap<String,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.

    • scheduleQuickFilterTimer

      protected void scheduleQuickFilterTimer()
      Schedules the quick filter action.

    • searchTreeItem

      protected CmsTreeItem searchTreeItem(CmsList<? extends I_CmsListItem> list, 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