Class 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.
    • 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
    • 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
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Method Detail

      • 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
      • getDialogId

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

        Returns:
        the HTML id of the dialog element
      • 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
      • 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
      • getVfsTab

        public CmsVfsTab getVfsTab()
        Returns the VFS tab widget.

        Returns:
        the VFS tab widget
      • 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 interface com.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 interface com.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 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​(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
      • 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()