Class CmsGalleryDialog
- 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.CmsGalleryDialog
-
- All Implemented Interfaces:
com.google.gwt.event.logical.shared.BeforeSelectionHandler<java.lang.Integer>
,com.google.gwt.event.logical.shared.HasAttachHandlers
,com.google.gwt.event.logical.shared.SelectionHandler<java.lang.Integer>
,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
public class CmsGalleryDialog extends com.google.gwt.user.client.ui.Composite implements com.google.gwt.event.logical.shared.BeforeSelectionHandler<java.lang.Integer>, com.google.gwt.event.logical.shared.SelectionHandler<java.lang.Integer>, I_CmsTruncable
Provides the method for the gallery dialog.- Since:
- 8.0.
-
-
Field Summary
Fields Modifier and Type Field Description static int
DEFAULT_DIALOG_HEIGHT
The initial dialog width.static int
DEFAULT_DIALOG_WIDTH
The initial dialog width.protected com.google.gwt.user.client.ui.FlowPanel
m_parentPanel
The parent panel for the gallery dialog.protected CmsTabbedPanel<A_CmsTab>
m_tabbedPanel
The tabbed panel.
-
Constructor Summary
Constructors Constructor Description CmsGalleryDialog(I_CmsGalleryHandler galleryHandler)
The constructor.CmsGalleryDialog(I_CmsGalleryHandler galleryHandler, CmsTabbedPanel.CmsTabbedPanelStyle style)
The default constructor for the gallery dialog.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
disableSearchTab()
Disables the search tab.void
enableSearchTab()
Enables the search tab.protected void
ensureNotifications()
Make sure a notification widget is installed.void
fillResultTab(org.opencms.ade.galleries.shared.CmsGallerySearchBean searchObj)
Displays the search result in the result tab.void
fillTabs(CmsGalleryController controller)
Fill the tabs with the content provided from the info bean.CmsCategoriesTab
getCategoriesTab()
Returns the categories tab widget.CmsGalleryController
getController()
Returns the gallery controller.java.lang.String
getDialogId()
Returns the HTML id of the dialog element.CmsDNDHandler
getDndHandler()
Returns the drag and drop handler.CmsGalleriesTab
getGalleriesTab()
Returns the galleries tab widget.java.lang.String
getImageFormatNames()
Returns the image format names.java.lang.String
getImageFormats()
Returns the image formats.com.google.gwt.user.client.ui.FlowPanel
getParentPanel()
Returns the parent panel of the dialog.CmsResultsTab
getResultsTab()
Returns the results tab widget.CmsSearchTab
getSearchTab()
Returns the searchTab.CmsSitemapTab
getSitemapTab()
Returns the sitemap tab.A_CmsTab
getTab(org.opencms.ade.galleries.shared.I_CmsGalleryProviderConstants.GalleryTabId tabId)
Gets the tab with a given tab id, or null if the dialog has no such tab.protected com.google.gwt.user.client.ui.HasText
getTabTextAccessor(int pos)
Creates a tab text accessor for a given text.CmsTypesTab
getTypesTab()
Returns the types tab widget.CmsVfsTab
getVfsTab()
Returns the VFS tab widget.I_CmsGalleryWidgetHandler
getWidgetHandler()
Returns the widget handler.void
hideShowPreviewButton(boolean hide)
Hides or shows the show-preview-button.boolean
isNativeWidget()
Returns if the gallery is used as a native widget.boolean
isOverrideFormats()
Returns true if the formats from this dialog object should be prioritized by the format handler.boolean
isUseFormats()
Returns the use formats flag.protected void
onAttach()
void
onBeforeSelection(com.google.gwt.event.logical.shared.BeforeSelectionEvent<java.lang.Integer> event)
void
onSelection(com.google.gwt.event.logical.shared.SelectionEvent<java.lang.Integer> event)
void
selectTab(int tabIndex, boolean isInitial)
Selects a tab.void
selectTab(org.opencms.ade.galleries.shared.I_CmsGalleryProviderConstants.GalleryTabId tabId, boolean fireEvent)
Selects a tab by the given id.void
setDialogSize(int width, int height)
Sets the size of the gallery parent panel and triggers the event to the tab.void
setImageFormatNames(java.lang.String imageFormatNames)
Sets the image format names.void
setImageFormats(java.lang.String imageFormats)
Sets the image formats.void
setOnAttachCommand(com.google.gwt.user.client.Command onAttachCommand)
Sets the on attach command.void
setOverrideFormats(boolean overrideFormats)
Sets the 'override formats' flag, which tells the format handler to prioritize the formats from the gallery dialog object.void
setPreviewVisible(boolean visible)
Sets the preview visibility.void
setUseFormats(boolean useFormats)
Sets the use formats flag.void
setWidgetHandler(I_CmsGalleryWidgetHandler widgetHandler)
Sets the widget handler.void
truncate(java.lang.String textMetricsKey, int clientWidth)
Truncates long text and sets the original text to the title attribute.void
updateGalleryData(org.opencms.ade.galleries.shared.CmsGalleryDataBean data)
Updates the gallery data.void
updateSizeForTab(A_CmsTab tab)
Updates the dialog size according to the requirements of the selected tab.void
updateSizes()
Updates variable ui-element dimensions, execute after dialog has been attached and it's content is displayed.void
useMaxDimensions()
Sets the dialog to use the maximum available space.-
Methods inherited from class com.google.gwt.user.client.ui.Composite
claimElement, getWidget, initializeClaimedElement, initWidget, isAttached, 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
-
DEFAULT_DIALOG_HEIGHT
public static final int DEFAULT_DIALOG_HEIGHT
The initial dialog width.- See Also:
- Constant Field Values
-
DEFAULT_DIALOG_WIDTH
public static final int DEFAULT_DIALOG_WIDTH
The initial dialog width.- See Also:
- Constant Field Values
-
m_parentPanel
protected com.google.gwt.user.client.ui.FlowPanel m_parentPanel
The parent panel for the gallery dialog.
-
m_tabbedPanel
protected CmsTabbedPanel<A_CmsTab> m_tabbedPanel
The tabbed panel.
-
-
Constructor Detail
-
CmsGalleryDialog
public CmsGalleryDialog(I_CmsGalleryHandler galleryHandler)
The constructor.- Parameters:
galleryHandler
- the gallery handler
-
CmsGalleryDialog
public CmsGalleryDialog(I_CmsGalleryHandler galleryHandler, CmsTabbedPanel.CmsTabbedPanelStyle style)
The default constructor for the gallery dialog.- Parameters:
galleryHandler
- the gallery handlerstyle
- the style for the panel
-
-
Method Detail
-
disableSearchTab
public void disableSearchTab()
Disables the search tab.
-
enableSearchTab
public void enableSearchTab()
Enables the search tab.
-
fillResultTab
public void fillResultTab(org.opencms.ade.galleries.shared.CmsGallerySearchBean searchObj)
Displays the search result in the result tab.- Parameters:
searchObj
- the search object
-
fillTabs
public void fillTabs(CmsGalleryController controller)
Fill the tabs with the content provided from the info bean.- Parameters:
controller
- the reference to the gallery controller
-
getCategoriesTab
public CmsCategoriesTab getCategoriesTab()
Returns the categories tab widget.- Returns:
- the categories widget
-
getController
public CmsGalleryController getController()
Returns the gallery controller.- Returns:
- the gallery controller
-
getDialogId
public java.lang.String getDialogId()
Returns the HTML id of the dialog element.- Returns:
- the HTML id of the dialog element
-
getDndHandler
public CmsDNDHandler getDndHandler()
Returns the drag and drop handler.- Returns:
- the drag and drop handler
-
getGalleriesTab
public CmsGalleriesTab getGalleriesTab()
Returns the galleries tab widget.- Returns:
- the galleries widget
-
getImageFormatNames
public java.lang.String getImageFormatNames()
Returns the image format names.- Returns:
- the image format names
-
getImageFormats
public java.lang.String getImageFormats()
Returns the image formats.- Returns:
- the image formats
-
getParentPanel
public com.google.gwt.user.client.ui.FlowPanel getParentPanel()
Returns the parent panel of the dialog.- Returns:
- the parent
-
getResultsTab
public CmsResultsTab getResultsTab()
Returns the results tab widget.- Returns:
- the results widget
-
getSearchTab
public CmsSearchTab getSearchTab()
Returns the searchTab.- Returns:
- the searchTab
-
getSitemapTab
public CmsSitemapTab getSitemapTab()
Returns the sitemap tab.- Returns:
- the sitemap tab
-
getTab
public A_CmsTab getTab(org.opencms.ade.galleries.shared.I_CmsGalleryProviderConstants.GalleryTabId tabId)
Gets the tab with a given tab id, or null if the dialog has no such tab.- Parameters:
tabId
- the tab id to look for- Returns:
- the tab with the given tab id, or null
-
getTypesTab
public CmsTypesTab getTypesTab()
Returns the types tab widget.- Returns:
- the types widget
-
getWidgetHandler
public I_CmsGalleryWidgetHandler getWidgetHandler()
Returns the widget handler.- Returns:
- the widget handler
-
hideShowPreviewButton
public void hideShowPreviewButton(boolean hide)
Hides or shows the show-preview-button.- Parameters:
hide
-true
to hide the button
-
isNativeWidget
public boolean isNativeWidget()
Returns if the gallery is used as a native widget.- Returns:
true
if the gallery is used as a native widget
-
isOverrideFormats
public boolean isOverrideFormats()
Returns true if the formats from this dialog object should be prioritized by the format handler.- Returns:
- the value of the 'override formats' flag
-
isUseFormats
public boolean isUseFormats()
Returns the use formats flag.- Returns:
- the use formats flag
-
onBeforeSelection
public void onBeforeSelection(com.google.gwt.event.logical.shared.BeforeSelectionEvent<java.lang.Integer> event)
- Specified by:
onBeforeSelection
in interfacecom.google.gwt.event.logical.shared.BeforeSelectionHandler<java.lang.Integer>
- See Also:
BeforeSelectionHandler.onBeforeSelection(com.google.gwt.event.logical.shared.BeforeSelectionEvent)
-
onSelection
public void onSelection(com.google.gwt.event.logical.shared.SelectionEvent<java.lang.Integer> event)
- Specified by:
onSelection
in interfacecom.google.gwt.event.logical.shared.SelectionHandler<java.lang.Integer>
- See Also:
SelectionHandler.onSelection(com.google.gwt.event.logical.shared.SelectionEvent)
-
selectTab
public void selectTab(org.opencms.ade.galleries.shared.I_CmsGalleryProviderConstants.GalleryTabId tabId, boolean fireEvent)
Selects a tab by the given id.- Parameters:
tabId
- the tab idfireEvent
-true
to fire the tab event
-
selectTab
public void selectTab(int tabIndex, boolean isInitial)
Selects a tab.- Parameters:
tabIndex
- the tab index to beselectedisInitial
- flag for initial search
-
setDialogSize
public void setDialogSize(int width, int height)
Sets the size of the gallery parent panel and triggers the event to the tab.- Parameters:
width
- the new widthheight
- the new height
-
setImageFormatNames
public void setImageFormatNames(java.lang.String imageFormatNames)
Sets the image format names.- Parameters:
imageFormatNames
- the image format names to set
-
setImageFormats
public void setImageFormats(java.lang.String imageFormats)
Sets the image formats.- Parameters:
imageFormats
- the image formats to set
-
setOnAttachCommand
public void setOnAttachCommand(com.google.gwt.user.client.Command onAttachCommand)
Sets the on attach command.- Parameters:
onAttachCommand
- the on attach command to set
-
setOverrideFormats
public void setOverrideFormats(boolean overrideFormats)
Sets the 'override formats' flag, which tells the format handler to prioritize the formats from the gallery dialog object.- Parameters:
overrideFormats
- the new value for the 'override formats' flag
-
setPreviewVisible
public void setPreviewVisible(boolean visible)
Sets the preview visibility.- Parameters:
visible
- the preview visibility
-
setUseFormats
public void setUseFormats(boolean useFormats)
Sets the use formats flag.- Parameters:
useFormats
- the use formats flag to set
-
setWidgetHandler
public void setWidgetHandler(I_CmsGalleryWidgetHandler widgetHandler)
Sets the widget handler.- Parameters:
widgetHandler
- the widget handler
-
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)
-
updateGalleryData
public void updateGalleryData(org.opencms.ade.galleries.shared.CmsGalleryDataBean data)
Updates the gallery data.- Parameters:
data
- the gallery data
-
updateSizeForTab
public void updateSizeForTab(A_CmsTab tab)
Updates the dialog size according to the requirements of the selected tab.- Parameters:
tab
- the selected tab
-
updateSizes
public void updateSizes()
Updates variable ui-element dimensions, execute after dialog has been attached and it's content is displayed.
-
useMaxDimensions
public void useMaxDimensions()
Sets the dialog to use the maximum available space.
-
ensureNotifications
protected void ensureNotifications()
Make sure a notification widget is installed.
-
getTabTextAccessor
protected com.google.gwt.user.client.ui.HasText getTabTextAccessor(int pos)
Creates a tab text accessor for a given text.- Parameters:
pos
- the index of the tab- Returns:
- the tab text accessor for the tab at index pos
-
onAttach
protected void onAttach()
- Overrides:
onAttach
in classcom.google.gwt.user.client.ui.Composite
- See Also:
Composite.onAttach()
-
-