Package org.opencms.gwt.client.ui
Class CmsHighlightingBorder
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.gwt.client.ui.CmsHighlightingBorder
- 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
A Widget to display a highlighting border around a specified position.
- Since:
- 8.0.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
Enumeration of available border colours.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
FieldsModifier and TypeFieldDescriptionprotected com.google.gwt.dom.client.DivElement
The bottom border.protected com.google.gwt.dom.client.DivElement
The left border.protected com.google.gwt.dom.client.DivElement
The right border.protected com.google.gwt.dom.client.DivElement
The top border.protected com.google.gwt.dom.client.DivElement
The element containing the midpoint separators, if any.static final int
Horizontal offset of the midpoint separators.Fields inherited from class com.google.gwt.user.client.ui.UIObject
DEBUG_ID_PREFIX
-
Constructor Summary
ConstructorsConstructorDescriptionCmsHighlightingBorder
(int height, int width, int positionLeft, int positionTop, CmsHighlightingBorder.BorderColor color, int borderOffset, boolean correctTop) Constructor.CmsHighlightingBorder
(com.google.gwt.dom.client.Element positioningParent, CmsHighlightingBorder.BorderColor color) Constructor.CmsHighlightingBorder
(CmsPositionBean position, CmsHighlightingBorder.BorderColor color) Constructor.CmsHighlightingBorder
(CmsPositionBean position, CmsHighlightingBorder.BorderColor color, int borderOffset) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoid
enableAnimation
(boolean animated) Enables the border animation.Gets the vertical offsets (relative to the viewport) of the horizontal lines (top, midpoints, bottom, in this order).void
hide()
Hides the border.void
Recalculates the position and dimension when a positioning parent is given.void
Sets the color of the border.void
setMidpoints
(List<Integer> verticalOffsets) Sets the midpoint separators, given a list of their vertical offsets from the top.void
setPosition
(int height, int width, int positionLeft, int positionTop) Sets the border position.void
setPosition
(CmsPositionBean position) Sets the border position.void
show()
Shows the border.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 Details
-
SEPARATOR_OFFSET
Horizontal offset of the midpoint separators.- See Also:
-
m_borderBottom
The bottom border. -
m_borderLeft
The left border. -
m_borderRight
The right border. -
m_midpoints
The element containing the midpoint separators, if any. -
m_borderTop
The top border.
-
-
Constructor Details
-
CmsHighlightingBorder
Constructor.- Parameters:
position
- the position datacolor
- the border color
-
CmsHighlightingBorder
public CmsHighlightingBorder(CmsPositionBean position, CmsHighlightingBorder.BorderColor color, int borderOffset) Constructor.- Parameters:
position
- the position datacolor
- the border colorborderOffset
- the border offset
-
CmsHighlightingBorder
public CmsHighlightingBorder(com.google.gwt.dom.client.Element positioningParent, CmsHighlightingBorder.BorderColor color) Constructor.- Parameters:
positioningParent
- the element the border is positioned around, position is set relative to itcolor
- the border color
-
CmsHighlightingBorder
public CmsHighlightingBorder(int height, int width, int positionLeft, int positionTop, CmsHighlightingBorder.BorderColor color, int borderOffset, boolean correctTop) Constructor.- Parameters:
height
- the heightwidth
- the widthpositionLeft
- the absolute left positionpositionTop
- the absolute top positioncolor
- the border colorborderOffset
- the border offset
-
-
Method Details
-
enableAnimation
Enables the border animation.(Is enabled by default)
- Parameters:
animated
-true
to enable border animation
-
getClientVerticalOffsets
Gets the vertical offsets (relative to the viewport) of the horizontal lines (top, midpoints, bottom, in this order).- Returns:
- the vertical offsets of the horizonral lines
-
hide
Hides the border. -
resetPosition
Recalculates the position and dimension when a positioning parent is given. -
setColor
Sets the color of the border.- Parameters:
color
- the color of the border
-
setMidpoints
Sets the midpoint separators, given a list of their vertical offsets from the top.- Parameters:
verticalOffsets
- the list of midpoint offsets
-
setPosition
Sets the border position.- Parameters:
position
- the position data
-
setPosition
Sets the border position.- Parameters:
height
- the heightwidth
- the widthpositionLeft
- the absolute left positionpositionTop
- the absolute top position
-
show
Shows the border.
-