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<Integer>, com.google.gwt.event.logical.shared.HasAttachHandlers, com.google.gwt.event.logical.shared.SelectionHandler<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<Integer>, com.google.gwt.event.logical.shared.SelectionHandler<Integer>, I_CmsTruncable
Provides the method for the gallery dialog.

Since:
8.0.
  • Nested Class Summary

    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

    Fields
    Modifier and Type
    Field
    Description
    static final int
    The initial dialog width.
    static final int
    The initial dialog width.
    protected com.google.gwt.user.client.ui.FlowPanel
    The parent panel for the gallery dialog.
    The tabbed panel.

    Fields inherited from class com.google.gwt.user.client.ui.UIObject

    DEBUG_ID_PREFIX
  • Constructor Summary

    Constructors
    Constructor
    Description
    The constructor.
    The default constructor for the gallery dialog.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Disables the search tab.
    void
    Enables the search tab.
    protected void
    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
    Fill the tabs with the content provided from the info bean.
    Returns the categories tab widget.
    Returns the gallery controller.
    Returns the HTML id of the dialog element.
    Returns the drag and drop handler.
    Returns the galleries tab widget.
    Returns the image format names.
    Returns the image formats.
    com.google.gwt.user.client.ui.FlowPanel
    Returns the parent panel of the dialog.
    Returns the results tab widget.
    Returns the searchTab.
    Returns the sitemap tab.
    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
    Creates a tab text accessor for a given text.
    Returns the types tab widget.
    Returns the VFS tab widget.
    Returns the widget handler.
    void
    hideShowPreviewButton(boolean hide)
    Hides or shows the show-preview-button.
    boolean
    Returns if the gallery is used as a native widget.
    boolean
    Returns true if the formats from this dialog object should be prioritized by the format handler.
    boolean
    Returns the use formats flag.
    protected void
     
    void
    onBeforeSelection(com.google.gwt.event.logical.shared.BeforeSelectionEvent<Integer> event)
     
    void
    onSelection(com.google.gwt.event.logical.shared.SelectionEvent<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(String imageFormatNames)
    Sets the image format names.
    void
    setImageFormats(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
    Sets the widget handler.
    void
    truncate(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
    Updates the dialog size according to the requirements of the selected tab.
    void
    Updates variable ui-element dimensions, execute after dialog has been attached and it's content is displayed.
    void
    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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

  • Constructor Details

  • Method Details

    • 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

      Returns the categories tab widget.

      Returns:
      the categories widget
    • getController

      Returns the gallery controller.

      Returns:
      the gallery controller
    • getDialogId

      public String getDialogId()
      Returns the HTML id of the dialog element.

      Returns:
      the HTML id of the dialog element
    • getDndHandler

      Returns the drag and drop handler.

      Returns:
      the drag and drop handler
    • getGalleriesTab

      Returns the galleries tab widget.

      Returns:
      the galleries widget
    • getImageFormatNames

      Returns the image format names.

      Returns:
      the image format names
    • 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

      Returns the results tab widget.

      Returns:
      the results widget
    • getSearchTab

      Returns the searchTab.

      Returns:
      the searchTab
    • 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

      Returns the types tab widget.

      Returns:
      the types widget
    • getVfsTab

      public CmsVfsTab getVfsTab()
      Returns the VFS tab widget.

      Returns:
      the VFS tab widget
    • 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<Integer> event)
      Specified by:
      onBeforeSelection in interface com.google.gwt.event.logical.shared.BeforeSelectionHandler<Integer>
      See Also:
      • BeforeSelectionHandler.onBeforeSelection(com.google.gwt.event.logical.shared.BeforeSelectionEvent)
    • onSelection

      public void onSelection(com.google.gwt.event.logical.shared.SelectionEvent<Integer> event)
      Specified by:
      onSelection in interface com.google.gwt.event.logical.shared.SelectionHandler<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 id
      fireEvent - true to fire the tab event
    • selectTab

      public void selectTab(int tabIndex, boolean isInitial)
      Selects a tab.

      Parameters:
      tabIndex - the tab index to beselected
      isInitial - 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 width
      height - the new height
    • setImageFormatNames

      public void setImageFormatNames(String imageFormatNames)
      Sets the image format names.

      Parameters:
      imageFormatNames - the image format names to set
    • setImageFormats

      public void setImageFormats(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(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:
    • 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 class com.google.gwt.user.client.ui.Composite
      See Also:
      • Composite.onAttach()