Class CmsElementOptionBar
- 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.containerpage.client.ui.CmsElementOptionBar
-
- All Implemented Interfaces:
com.google.gwt.event.dom.client.HasMouseOutHandlers
,com.google.gwt.event.dom.client.HasMouseOverHandlers
,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
,I_CmsElementToolbarContext
,I_CmsUniqueActiveItem
public class CmsElementOptionBar extends com.google.gwt.user.client.ui.Composite implements com.google.gwt.event.dom.client.HasMouseOverHandlers, com.google.gwt.event.dom.client.HasMouseOutHandlers, I_CmsUniqueActiveItem, I_CmsElementToolbarContext
A panel to be displayed inside a container element to provide optional functions like edit, move, remove...- Since:
- 8.0.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
CmsElementOptionBar.HoverHandler
Hover handler for option bar.
-
Field Summary
-
Fields inherited from interface org.opencms.gwt.client.I_CmsElementToolbarContext
ELEMENT_OPTION_BAR_CSS_CLASS
-
-
Constructor Summary
Constructors Constructor Description CmsElementOptionBar(CmsContainerPageElementPanel containerElement)
Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
activateToolbarContext()
Show the toolbar.void
add(com.google.gwt.user.client.ui.Widget w)
Adds another option button.protected void
addHighlighting()
Adds the highlighting and option bar.com.google.gwt.event.shared.HandlerRegistration
addMouseOutHandler(com.google.gwt.event.dom.client.MouseOutHandler handler)
com.google.gwt.event.shared.HandlerRegistration
addMouseOverHandler(com.google.gwt.event.dom.client.MouseOverHandler handler)
void
clear()
Clears the bar.static CmsElementOptionBar
createOptionBarForElement(CmsContainerPageElementPanel element, CmsDNDHandler dndHandler, A_CmsToolbarOptionButton... buttons)
Creates an option-bar for the given drag element.void
deactivateToolbarContext()
Hide the toolbar.int
getCalculatedWidth()
Returns the calculated width of the widget.protected CmsContainerPageElementPanel
getContainerElement()
Returns the parent container element.protected void
internalRemoveHighlighting()
Removes the highlighting.java.util.Iterator<com.google.gwt.user.client.ui.Widget>
iterator()
Returns an iterator for the child widgets.void
onDeactivate()
This method is called when the item is removed from a container.void
removeHighlighting()
Removes the highlighting and option bar.-
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
-
-
-
-
Constructor Detail
-
CmsElementOptionBar
public CmsElementOptionBar(CmsContainerPageElementPanel containerElement)
Constructor.- Parameters:
containerElement
- the parent container element
-
-
Method Detail
-
createOptionBarForElement
public static CmsElementOptionBar createOptionBarForElement(CmsContainerPageElementPanel element, CmsDNDHandler dndHandler, A_CmsToolbarOptionButton... buttons)
Creates an option-bar for the given drag element.- Parameters:
element
- the element to create the option-bar fordndHandler
- the drag and drop handlerbuttons
- the list of buttons to display- Returns:
- the created option-bar
-
activateToolbarContext
public void activateToolbarContext()
Description copied from interface:I_CmsElementToolbarContext
Show the toolbar.- Specified by:
activateToolbarContext
in interfaceI_CmsElementToolbarContext
- See Also:
I_CmsElementToolbarContext.activateToolbarContext()
-
add
public void add(com.google.gwt.user.client.ui.Widget w)
Adds another option button.- Parameters:
w
- the button to add
-
addMouseOutHandler
public com.google.gwt.event.shared.HandlerRegistration addMouseOutHandler(com.google.gwt.event.dom.client.MouseOutHandler handler)
- Specified by:
addMouseOutHandler
in interfacecom.google.gwt.event.dom.client.HasMouseOutHandlers
- See Also:
HasMouseOutHandlers.addMouseOutHandler(com.google.gwt.event.dom.client.MouseOutHandler)
-
addMouseOverHandler
public com.google.gwt.event.shared.HandlerRegistration addMouseOverHandler(com.google.gwt.event.dom.client.MouseOverHandler handler)
- Specified by:
addMouseOverHandler
in interfacecom.google.gwt.event.dom.client.HasMouseOverHandlers
- See Also:
HasMouseOverHandlers.addMouseOverHandler(com.google.gwt.event.dom.client.MouseOverHandler)
-
clear
public void clear()
Clears the bar.
-
deactivateToolbarContext
public void deactivateToolbarContext()
Description copied from interface:I_CmsElementToolbarContext
Hide the toolbar.- Specified by:
deactivateToolbarContext
in interfaceI_CmsElementToolbarContext
- See Also:
I_CmsElementToolbarContext.deactivateToolbarContext()
-
getCalculatedWidth
public int getCalculatedWidth()
Returns the calculated width of the widget.- Returns:
- the calculated width
-
iterator
public java.util.Iterator<com.google.gwt.user.client.ui.Widget> iterator()
Returns an iterator for the child widgets.- Returns:
- the iterator
-
onDeactivate
public void onDeactivate()
Description copied from interface:I_CmsUniqueActiveItem
This method is called when the item is removed from a container.- Specified by:
onDeactivate
in interfaceI_CmsUniqueActiveItem
- See Also:
I_CmsUniqueActiveItem.onDeactivate()
-
removeHighlighting
public void removeHighlighting()
Removes the highlighting and option bar.
-
addHighlighting
protected void addHighlighting()
Adds the highlighting and option bar.
-
getContainerElement
protected CmsContainerPageElementPanel getContainerElement()
Returns the parent container element.- Returns:
- the parent container element
-
internalRemoveHighlighting
protected void internalRemoveHighlighting()
Removes the highlighting.
-
-