Package org.opencms.acacia.client.ui
Class CmsInlineEntityWidget
- 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.acacia.client.ui.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.
-
Field Summary
Fields Modifier and Type Field Description protected CmsAttributeChoiceWidget
m_addButton
The add button.protected CmsAttributeChoiceWidget
m_attributeChoice
The attribute choice button.protected CmsPushButton
m_downButton
The down button.protected CmsPushButton
m_editButton
The injected button.protected CmsPushButton
m_removeButton
The remove button.protected CmsPushButton
m_upButton
The up button.
-
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
-
-
-
-
Field Detail
-
m_addButton
@UiField protected CmsAttributeChoiceWidget m_addButton
The add button.
-
m_attributeChoice
@UiField protected CmsAttributeChoiceWidget m_attributeChoice
The attribute choice button.
-
m_downButton
@UiField protected CmsPushButton m_downButton
The down button.
-
m_editButton
@UiField protected CmsPushButton m_editButton
The injected button.
-
m_removeButton
@UiField protected CmsPushButton m_removeButton
The remove button.
-
m_upButton
@UiField protected CmsPushButton m_upButton
The up button.
-
-
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 elementformParent
- the parent widgetparentEntity
- the parent entityattributeHandler
- the attribute handlerattributeIndex
- the attribute value indexhtmlUpdateHandler
- handles HTML updates if requiredwidgetService
- 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 visiblehasAddButton
-true
if the add button should be visiblehasRemoveButton
-true
if the remove button should be visiblehasSortButtons
-true
if the sort buttons should be visible
-
positionWidget
protected void positionWidget()
Positions the widget button above the reference element.
-
-