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.
-
Nested Class Summary
Modifier and TypeClassDescriptionprotected class
Selection handler to handle check box click events and double clicks on the list items.protected class
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
-
Field Summary
Modifier and TypeFieldDescriptionprotected static final I_CmsLayoutBundle.I_CmsGalleryDialogCss
The css bundle used for this widget.protected com.google.gwt.user.client.ui.HasText
A label for displaying additional information about the tab.protected CmsScrollPanel
The borded panel to hold the scrollable list.protected com.google.gwt.user.client.ui.FlowPanel
The option panel.protected CmsTextBox
The quick search box.protected CmsList<? extends I_CmsListItem>
The scrollable list panel.protected CmsPushButton
The quick search button.protected A_CmsSelectBox<?>
The select box to change the sort order.protected com.google.gwt.user.client.ui.FlowPanel
The option panel.Fields inherited from class org.opencms.ade.galleries.client.ui.A_CmsTab
m_tabTextAccessor
Fields inherited from class com.google.gwt.user.client.ui.UIObject
DEBUG_ID_PREFIX
-
Constructor Summary
ConstructorDescriptionA_CmsListTab
(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
Modifier and TypeMethodDescriptionprotected 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
Cancels the quick filter timer.protected void
Checks the quick search input and enables/disables the search button accordingly.protected void
Clears the list panel.protected CmsPushButton
createCustomUploadButton
(String nativeMethod, String target) Generates a new custom upload button.protected CmsPushButton
createNewExternalLinkButton
(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>
Creates the list which should contain the list items of the tab.protected A_CmsSelectBox<?>
createSelectBox
(LinkedHashMap<String, String> options) Creates the sort select box.protected CmsPushButton
createSelectButton
(A_CmsListTab.A_SelectionHandler selectionHandler) Creates a select button.protected CmsPushButton
createSelectResourceButton
(String resourcePath, org.opencms.util.CmsUUID structureId, String title, String resourceType) Creates a button widget to select the specified resource.protected CmsUploadButton
createUploadButtonForTarget
(String target, boolean isRootPath) Creates an upload button for the given target.getList()
Returns the list.int
Returns the height required by this tab.protected abstract LinkedHashMap<String,
String> Returns a list with sort values for this tab.protected boolean
Returns if this tab has quick filter enabled.protected boolean
Returns if the tab has the quick search box.protected void
init()
Call after all handlers have been set.void
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<String> event) Will be triggered if the value in the select box changes.protected void
Sets the search query an selects the result tab.protected void
Schedules the quick filter action.protected CmsTreeItem
searchTreeItem
(CmsList<? extends I_CmsListItem> list, String categoryPath) Searches in the categories tree or list the item and returns it.void
setSortSelectBoxValue
(String value, boolean fireEvents) Sets the value selected in the sort select box, if possible.void
Truncates long text and sets the original text to the title attribute.Methods inherited from class org.opencms.ade.galleries.client.ui.A_CmsTab
clearParams, getParamPanels, getTabHandler, getTabId, isSelected, onDeselection, onSelection, removeParam, setTabTextAccessor
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
-
Field Details
-
DIALOG_CSS
The css bundle used for this widget. -
m_infoLabel
A label for displaying additional information about the tab. -
m_list
The borded panel to hold the scrollable list. -
m_options
The option panel. -
m_quickSearch
The quick search box. -
m_scrollList
The scrollable list panel. -
m_searchButton
The quick search button. -
m_sortSelectBox
The select box to change the sort order. -
m_tab
The option panel.
-
-
Constructor Details
-
A_CmsListTab
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
Description copied from class:A_CmsTab
Returns the height required by this tab.- Specified by:
getRequiredHeight
in classA_CmsTab
- Returns:
- the height
- See Also:
-
onContentChange
Call on content change to update the layout. -
onResize
Description copied from class:A_CmsTab
Adjust content when outer dimensions are changed. -
setSortSelectBoxValue
Sets the value selected in the sort select box, if possible.- Parameters:
value
- the new value for the sort select boxfireEvents
- if true, the change event of the select box is fired
-
truncate
Description copied from interface:I_CmsTruncable
Truncates long text and sets the original text to the title attribute.- Specified by:
truncate
in interfaceI_CmsTruncable
- Parameters:
textMetricsKey
- the key identifying the text metrics to useclientWidth
- the width to use in pixels- See Also:
-
addWidgetToFrontOfList
Adds a widget to the front of the list.- Parameters:
listItem
- the list item to add
-
addWidgetToList
Add a list item widget to the list panel.- Parameters:
listItem
- the list item to add
-
addWidgetToOptions
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
Cancels the quick filter timer. -
checkQuickSearchStatus
Checks the quick search input and enables/disables the search button accordingly. -
clearList
Clears the list panel. -
createCustomUploadButton
Generates a new custom upload button.- Parameters:
nativeMethod
- the name of the custom JS upload actiontarget
- 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
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 pathstructureId
- the structure idtitle
- the resource titleresourceType
- the item resource type- Returns:
- the initialized select resource button
-
createUploadButtonForTarget
Creates an upload button for the given target.- Parameters:
target
- the upload target folderisRootPath
- true if target is a root path- Returns:
- the upload button
-
getSortList
Returns a list with sort values for this tab.- Returns:
- list of sort order value/text pairs
-
hasQuickFilter
Returns if this tab has quick filter enabled.- Returns:
true
if this tab has quick filter enabled
-
hasQuickSearch
Returns if the tab has the quick search box.- Returns:
true
if the tab has the quick search box
-
init
Call after all handlers have been set. -
quickSearch
Sets the search query an selects the result tab. -
scheduleQuickFilterTimer
Schedules the quick filter action. -
searchTreeItem
Searches in the categories tree or list the item and returns it.- Parameters:
list
- the list of items to start fromcategoryPath
- the category id to search- Returns:
- the category item widget
-