Package org.opencms.gwt.client.ui
Class CmsSimpleListItem
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.CmsSimpleListItem
- 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
,I_CmsDraggable
,I_CmsListItem
,I_CmsTruncable
public class CmsSimpleListItem
extends com.google.gwt.user.client.ui.Composite
implements I_CmsListItem
Provides a UI list item.
- Since:
- 8.0.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
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected String
The logical id, it is not the HTML id.protected CmsFlowPanel
The underlying panel.Fields inherited from class com.google.gwt.user.client.ui.UIObject
DEBUG_ID_PREFIX
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(com.google.gwt.user.client.ui.Widget w) Adds a widget to this list item.com.google.common.base.Optional<int[]>
Gets an optional pair of integers which are to be used as an "offset delta" for the drag and drop process.com.google.gwt.dom.client.Element
getDragHelper
(I_CmsDropTarget target) Creates the drag helper element and attaches it into the DOM.getId()
Returns the logical id, it is not the HTML id.Returns the parent drop target ornull
if there is none.com.google.gwt.dom.client.Element
getPlaceholder
(I_CmsDropTarget target) Creates the drag placeholder element.com.google.gwt.user.client.ui.Widget
getWidget
(int index) Returns the child widget with the given index.void
Executed on drag cancel.void
onDrop
(I_CmsDropTarget target) Executed on drop.void
onStartDrag
(I_CmsDropTarget target) Executed on drag start.void
Sets the logical id, it is not the HTML id.void
Truncates long text and sets the original text to the title attribute.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
Methods inherited from interface org.opencms.gwt.client.dnd.I_CmsDraggable
getElement
-
Field Details
-
m_id
The logical id, it is not the HTML id. -
m_panel
The underlying panel.
-
-
Constructor Details
-
CmsSimpleListItem
public CmsSimpleListItem()Constructor. -
CmsSimpleListItem
Constructor.- Parameters:
widget
- the widget to use
-
-
Method Details
-
add
Description copied from interface:I_CmsListItem
Adds a widget to this list item.- Specified by:
add
in interfaceI_CmsListItem
- Parameters:
w
- the widget to add- See Also:
-
getCursorOffsetDelta
Description copied from interface:I_CmsDraggable
Gets an optional pair of integers which are to be used as an "offset delta" for the drag and drop process.- Specified by:
getCursorOffsetDelta
in interfaceI_CmsDraggable
- Returns:
- an optional array containing exactly 2 entries [x,y]
- See Also:
-
getDragHelper
Description copied from interface:I_CmsDraggable
Creates the drag helper element and attaches it into the DOM.- Specified by:
getDragHelper
in interfaceI_CmsDraggable
- Parameters:
target
- the drop target- Returns:
- the drag helper element
- See Also:
-
getId
Description copied from interface:I_CmsListItem
Returns the logical id, it is not the HTML id.- Specified by:
getId
in interfaceI_CmsDraggable
- Specified by:
getId
in interfaceI_CmsListItem
- Returns:
- the id
- See Also:
-
getParentTarget
Description copied from interface:I_CmsDraggable
Returns the parent drop target ornull
if there is none.- Specified by:
getParentTarget
in interfaceI_CmsDraggable
- Returns:
- the parent drop target
- See Also:
-
getPlaceholder
Description copied from interface:I_CmsDraggable
Creates the drag placeholder element.- Specified by:
getPlaceholder
in interfaceI_CmsDraggable
- Parameters:
target
- the drop target- Returns:
- the drag placeholder element
- See Also:
-
getWidget
Returns the child widget with the given index.- Parameters:
index
- the index- Returns:
- the child widget
-
onDragCancel
Description copied from interface:I_CmsDraggable
Executed on drag cancel.- Specified by:
onDragCancel
in interfaceI_CmsDraggable
- See Also:
-
onDrop
Description copied from interface:I_CmsDraggable
Executed on drop.- Specified by:
onDrop
in interfaceI_CmsDraggable
- Parameters:
target
- the drop target- See Also:
-
onStartDrag
Description copied from interface:I_CmsDraggable
Executed on drag start.- Specified by:
onStartDrag
in interfaceI_CmsDraggable
- Parameters:
target
- the current drop target- See Also:
-
setId
Description copied from interface:I_CmsListItem
Sets the logical id, it is not the HTML id.- Specified by:
setId
in interfaceI_CmsListItem
- Parameters:
id
- the id to set- See Also:
-
truncate
Description copied from interface:I_CmsTruncable
Truncates long text and sets the original text to the title attribute.- Specified by:
truncate
in interfaceI_CmsTruncable
- Parameters:
textMetricsPrefix
- the key identifying the text metrics to usewidgetWidth
- the width to use in pixels- See Also:
-