Class CmsInlineEntityWidget

  • All Implemented Interfaces:
    com.google.gwt.event.logical.shared.HasAttachHandlers, 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

    public final class CmsInlineEntityWidget
    extends com.google.gwt.user.client.ui.Composite
    Widget allowing form based editing for parts of a content to enhance the in-line editing.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      protected class  CmsInlineEntityWidget.FormPanel
      Flow panel with handling descendant resizes to reposition pop-up.
      protected class  CmsInlineEntityWidget.UpdateTimer
      Timer to update the HTML.
      • 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 Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static CmsInlineEntityWidget createWidgetForEntity​(com.google.gwt.dom.client.Element element, I_CmsInlineFormParent formParent, org.opencms.acacia.shared.CmsEntity parentEntity, CmsAttributeHandler attributeHandler, int attributeIndex, I_CmsInlineHtmlUpdateHandler htmlUpdateHandler, I_CmsWidgetService widgetService)
      Creates the inline edit widget and injects it next to the context element.
      int getAttributeIndex()
      Returns the attribute value index.
      protected void positionWidget()
      Positions the widget button above the reference element.
      void setContentHighlightingVisible​(boolean visible)
      Sets the visibility of the reference element highlighting border.
      void updateButtonVisibility​(boolean hasEditButton, boolean hasAddButton, boolean hasRemoveButton, boolean hasSortButtons)
      Updates the visibility of the add, remove, up and down buttons.
      • 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
      • Methods inherited from class java.lang.Object

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

      • createWidgetForEntity

        public static CmsInlineEntityWidget createWidgetForEntity​(com.google.gwt.dom.client.Element element,
                                                                  I_CmsInlineFormParent formParent,
                                                                  org.opencms.acacia.shared.CmsEntity parentEntity,
                                                                  CmsAttributeHandler attributeHandler,
                                                                  int attributeIndex,
                                                                  I_CmsInlineHtmlUpdateHandler htmlUpdateHandler,
                                                                  I_CmsWidgetService widgetService)
        Creates the inline edit widget and injects it next to the context element.

        Parameters:
        element - the context element
        formParent - the parent widget
        parentEntity - the parent entity
        attributeHandler - the attribute handler
        attributeIndex - the attribute value index
        htmlUpdateHandler - handles HTML updates if required
        widgetService - the widget service
        Returns:
        the widget instance
      • getAttributeIndex

        public int getAttributeIndex()
        Returns the attribute value index.

        Returns:
        the attribute value index
      • setContentHighlightingVisible

        public void setContentHighlightingVisible​(boolean visible)
        Sets the visibility of the reference element highlighting border.

        Parameters:
        visible - true to show the highlighting
      • updateButtonVisibility

        public void updateButtonVisibility​(boolean hasEditButton,
                                           boolean hasAddButton,
                                           boolean hasRemoveButton,
                                           boolean hasSortButtons)
        Updates the visibility of the add, remove, up and down buttons.

        Parameters:
        hasEditButton - true if the edit button should be visible
        hasAddButton - true if the add button should be visible
        hasRemoveButton - true if the remove button should be visible
        hasSortButtons - true if the sort buttons should be visible
      • positionWidget

        protected void positionWidget()
        Positions the widget button above the reference element.