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<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.
-
Field Summary
Fields Modifier and Type Field Description protected static I_CmsLayoutBundle.I_CmsGalleryDialogCss
DIALOG_CSS
The css bundle used for this widget.protected com.google.gwt.user.client.ui.HasText
m_infoLabel
A label for displaying additional information about the tab.protected CmsScrollPanel
m_list
The borded panel to hold the scrollable list.protected com.google.gwt.user.client.ui.FlowPanel
m_options
The option panel.protected CmsTextBox
m_quickSearch
The quick search box.protected CmsList<? extends I_CmsListItem>
m_scrollList
The scrollable list panel.protected CmsPushButton
m_searchButton
The quick search button.protected A_CmsSelectBox<?>
m_sortSelectBox
The select box to change the sort order.protected com.google.gwt.user.client.ui.FlowPanel
m_tab
The option panel.-
Fields inherited from class org.opencms.ade.galleries.client.ui.A_CmsTab
m_tabTextAccessor
-
-
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 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 Detail
-
DIALOG_CSS
protected static final I_CmsLayoutBundle.I_CmsGalleryDialogCss DIALOG_CSS
The css bundle used for this widget.
-
m_infoLabel
protected com.google.gwt.user.client.ui.HasText m_infoLabel
A label for displaying additional information about the tab.
-
m_list
@UiField protected CmsScrollPanel m_list
The borded panel to hold the scrollable list.
-
m_options
@UiField protected com.google.gwt.user.client.ui.FlowPanel m_options
The option panel.
-
m_quickSearch
protected CmsTextBox m_quickSearch
The quick search box.
-
m_scrollList
protected CmsList<? extends I_CmsListItem> m_scrollList
The scrollable list panel.
-
m_searchButton
protected CmsPushButton m_searchButton
The quick search button.
-
m_sortSelectBox
protected A_CmsSelectBox<?> m_sortSelectBox
The select box to change the sort order.
-
m_tab
@UiField protected com.google.gwt.user.client.ui.FlowPanel m_tab
The option panel.
-
-
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
-
getList
public CmsScrollPanel 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 classA_CmsTab
- Returns:
- the height
- See Also:
A_CmsTab.getRequiredHeight()
-
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 classA_CmsTab
- See Also:
A_CmsTab.onResize()
-
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 interfacecom.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 boxfireEvents
- if true, the change event of the select box is fired
-
truncate
public void truncate(java.lang.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 interfaceI_CmsTruncable
- Parameters:
textMetricsKey
- the key identifying the text metrics to useclientWidth
- the width to use in pixels- See Also:
I_CmsTruncable.truncate(java.lang.String, int)
-
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(java.lang.String nativeMethod, java.lang.String target)
Generates a new custom upload button.- Parameters:
nativeMethod
- the name of the custom JS upload actiontarget
- 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
-
createOptimizeButton
protected CmsPushButton createOptimizeButton(A_CmsListTab.A_SelectionHandler selectionHandler)
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
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
-
createSelectButton
protected CmsPushButton createSelectButton(A_CmsListTab.A_SelectionHandler selectionHandler)
Creates a select button.- Parameters:
selectionHandler
- the selction handler- Returns:
- the select button
-
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 pathstructureId
- the structure idtitle
- the resource titleresourceType
- 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 folderisRootPath
- 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.
-
scheduleQuickFilterTimer
protected void scheduleQuickFilterTimer()
Schedules the quick filter action.
-
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 fromcategoryPath
- the category id to search- Returns:
- the category item widget
-
-