public class CmsListItem extends com.google.gwt.user.client.ui.Composite implements I_CmsListItem
| 限定符和类型 | 类和说明 |
|---|---|
class |
CmsListItem.MoveHandle
The move handle.
|
| 限定符和类型 | 字段和说明 |
|---|---|
protected CmsCheckBox |
m_checkbox
The checkbox of this list item, or null if there is no checkbox.
|
protected CmsSimpleDecoratedPanel |
m_decoratedPanel
The panel which contains both the decorations (checkbox, etc.) and the main widget.
|
protected java.util.LinkedList<com.google.gwt.user.client.ui.Widget> |
m_decorationWidgets
A list of decoration widgets which is used to initialize
m_decoratedPanel. |
protected int |
m_decorationWidth
The decoration width which should be used to initialize
m_decoratedPanel. |
protected java.lang.String |
m_id
The logical id, it is not the HTML id.
|
protected CmsListItemWidget |
m_listItemWidget
The list item widget, if this widget has one.
|
protected com.google.gwt.user.client.ui.Widget |
m_mainWidget
The main widget of the list item.
|
protected CmsFlowPanel |
m_panel
This widgets panel.
|
protected com.google.gwt.dom.client.Element |
m_placeholder
The drag'n drop place holder element.
|
protected com.google.gwt.dom.client.Element |
m_provisionalParent
The provisional drag parent.
|
| 构造器和说明 |
|---|
CmsListItem()
Default constructor.
|
CmsListItem(CmsCheckBox checkBox,
CmsListItemWidget widget)
Default constructor.
|
CmsListItem(CmsListItemWidget widget)
Default constructor.
|
| 限定符和类型 | 方法和说明 |
|---|---|
void |
add(com.google.gwt.user.client.ui.Widget w)
Adds a widget to this list item.
|
protected void |
addCheckBox(CmsCheckBox checkbox)
Adds a check box to this list item.
|
protected void |
addDecoration(com.google.gwt.user.client.ui.Widget widget,
int width,
boolean first)
Helper method for adding a decoration widget and updating the decoration width accordingly.
|
void |
addDecorationWidget(com.google.gwt.user.client.ui.Widget widget,
int width)
Adds a decoration widget to the list item.
|
protected void |
addMainWidget(com.google.gwt.user.client.ui.Widget widget)
Adds the main widget to the list item.
|
protected com.google.gwt.dom.client.Element |
cloneForPlaceholder(CmsListItem listItem)
Clones the given item to be used as a place holder.
|
CmsCheckBox |
getCheckBox()
Gets the checkbox of this list item.
|
<T> T |
getData()
Gets the data belonging to the list item.
|
java.util.List<com.google.gwt.user.client.ui.Widget> |
getDecorationWidgets()
Returns the decoration widgets of this list item.
|
com.google.gwt.dom.client.Element |
getDragHelper(I_CmsDropTarget target)
Creates the drag helper element and attaches it into the DOM.
|
java.lang.String |
getId()
Returns the logical id, it is not the HTML id.
|
CmsListItemWidget |
getListItemWidget()
Returns the list item widget of this list item, or null if this item doesn't have a list item widget.
|
com.google.gwt.user.client.ui.Widget |
getMainWidget()
Returns the main widget.
|
I_CmsDragHandle |
getMoveHandle()
Returns the move handle.
|
CmsList<CmsListItem> |
getParentList()
Returns the parent list.
|
I_CmsDropTarget |
getParentTarget()
Returns the parent drop target or
null if there is none. |
com.google.gwt.dom.client.Element |
getPlaceholder(I_CmsDropTarget target)
Creates the drag placeholder element.
|
protected void |
initContent()
This internal helper method creates the actual contents of the widget by combining the decorators and the main widget.
|
protected void |
initContent(CmsCheckBox checkbox,
com.google.gwt.user.client.ui.Widget mainWidget)
This method is a convenience method which sets the checkbox and main widget of this widget, and then calls
initContent(). |
protected void |
initContent(com.google.gwt.user.client.ui.Widget mainWidget)
This method is a convenience method which sets the main widget of this widget, and then calls
initContent(). |
boolean |
initMoveHandle(CmsDNDHandler dndHandler)
Initializes the move handle with the given drag and drop handler and adds it to the list item widget.
|
boolean |
initMoveHandle(CmsDNDHandler dndHandler,
boolean addFirst)
Initializes the move handle with the given drag and drop handler and adds it to the list item widget.
|
void |
onDragCancel()
Executed on drag cancel.
|
void |
onDrop(I_CmsDropTarget target)
Executed on drop.
|
void |
onStartDrag(I_CmsDropTarget target)
Executed on drag start.
|
protected void |
removeDecorationWidget(com.google.gwt.user.client.ui.Widget widget,
int width)
Removes a decoration widget.
|
void |
setData(java.lang.Object data)
Sets the data for this list item.
|
void |
setId(java.lang.String id)
Sets the logical id, it is not the HTML id.
|
void |
setSmallView(boolean smallView)
Sets the decoration style to fit with the small view of list items.
|
void |
truncate(java.lang.String textMetricsPrefix,
int widgetWidth)
Truncates long text and sets the original text to the title attribute.
|
claimElement, getWidget, initializeClaimedElement, initWidget, isAttached, onAttach, onBrowserEvent, onDetach, render, render, resolvePotentialElement, setWidgetaddAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, doAttachChildren, doDetachChildren, fireEvent, getHandlerCount, getLayoutData, getParent, isOrWasAttached, onLoad, onUnload, removeFromParent, setLayoutData, sinkEventsaddStyleDependentName, 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, unsinkEventsclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetElementprotected CmsCheckBox m_checkbox
protected CmsSimpleDecoratedPanel m_decoratedPanel
protected java.util.LinkedList<com.google.gwt.user.client.ui.Widget> m_decorationWidgets
m_decoratedPanel.protected int m_decorationWidth
m_decoratedPanel.protected java.lang.String m_id
protected CmsListItemWidget m_listItemWidget
protected com.google.gwt.user.client.ui.Widget m_mainWidget
protected CmsFlowPanel m_panel
protected com.google.gwt.dom.client.Element m_placeholder
protected com.google.gwt.dom.client.Element m_provisionalParent
public CmsListItem()
public CmsListItem(CmsCheckBox checkBox, CmsListItemWidget widget)
checkBox - the checkboxwidget - the widget to usepublic CmsListItem(CmsListItemWidget widget)
widget - the widget to usepublic void add(com.google.gwt.user.client.ui.Widget w)
I_CmsListItemadd 在接口中 I_CmsListItemw - the widget to addI_CmsListItem.add(com.google.gwt.user.client.ui.Widget)public void addDecorationWidget(com.google.gwt.user.client.ui.Widget widget,
int width)
widget - the widgetwidth - the widget widthpublic CmsCheckBox getCheckBox()
This method will return a checkbox if this list item has one, or null if it doesn't.
public <T> T getData()
public java.util.List<com.google.gwt.user.client.ui.Widget> getDecorationWidgets()
public com.google.gwt.dom.client.Element getDragHelper(I_CmsDropTarget target)
I_CmsDraggablegetDragHelper 在接口中 I_CmsDraggabletarget - the drop targetI_CmsDraggable.getDragHelper(I_CmsDropTarget)public java.lang.String getId()
I_CmsListItemgetId 在接口中 I_CmsDraggablegetId 在接口中 I_CmsListItemI_CmsListItem.getId()public CmsListItemWidget getListItemWidget()
public com.google.gwt.user.client.ui.Widget getMainWidget()
public I_CmsDragHandle getMoveHandle()
public CmsList<CmsListItem> getParentList()
public I_CmsDropTarget getParentTarget()
I_CmsDraggablenull if there is none.getParentTarget 在接口中 I_CmsDraggableI_CmsDraggable.getParentTarget()public com.google.gwt.dom.client.Element getPlaceholder(I_CmsDropTarget target)
I_CmsDraggablegetPlaceholder 在接口中 I_CmsDraggabletarget - the drop targetI_CmsDraggable.getPlaceholder(I_CmsDropTarget)public boolean initMoveHandle(CmsDNDHandler dndHandler)
This method will not work for list items that don't have a list-item-widget.
dndHandler - the drag and drop handlertrue if initialization was successfulpublic boolean initMoveHandle(CmsDNDHandler dndHandler, boolean addFirst)
This method will not work for list items that don't have a list-item-widget.
dndHandler - the drag and drop handleraddFirst - if true, adds the move handle as first childtrue if initialization was successfulpublic void onDragCancel()
I_CmsDraggableonDragCancel 在接口中 I_CmsDraggableI_CmsDraggable.onDragCancel()public void onDrop(I_CmsDropTarget target)
I_CmsDraggableonDrop 在接口中 I_CmsDraggabletarget - the drop targetI_CmsDraggable.onDrop(org.opencms.gwt.client.dnd.I_CmsDropTarget)public void onStartDrag(I_CmsDropTarget target)
I_CmsDraggableonStartDrag 在接口中 I_CmsDraggabletarget - the current drop targetI_CmsDraggable.onStartDrag(org.opencms.gwt.client.dnd.I_CmsDropTarget)public void setData(java.lang.Object data)
data - the data to setpublic void setId(java.lang.String id)
I_CmsListItemsetId 在接口中 I_CmsListItemid - the id to setI_CmsListItem.setId(java.lang.String)public void setSmallView(boolean smallView)
smallView - true if the decoration has to fit with the small view of list itemspublic void truncate(java.lang.String textMetricsPrefix,
int widgetWidth)
I_CmsTruncabletruncate 在接口中 I_CmsTruncabletextMetricsPrefix - the key identifying the text metrics to usewidgetWidth - the width to use in pixelsI_CmsTruncable.truncate(java.lang.String, int)protected void addCheckBox(CmsCheckBox checkbox)
checkbox - the check boxprotected void addDecoration(com.google.gwt.user.client.ui.Widget widget,
int width,
boolean first)
widget - the decoration widget to addwidth - the intended width of the decoration widgetfirst - if true, inserts the widget at the front of the decorations, else at the end.protected void addMainWidget(com.google.gwt.user.client.ui.Widget widget)
In most cases, the widget will be a list item widget. If this is the case, then further calls to getListItemWidget() will
return the widget which was passed as a parameter to this method. Otherwise, the method will return null.
widget - protected com.google.gwt.dom.client.Element cloneForPlaceholder(CmsListItem listItem)
listItem - the item to cloneprotected void initContent()
protected void initContent(CmsCheckBox checkbox, com.google.gwt.user.client.ui.Widget mainWidget)
initContent().checkbox - the checkbox to addmainWidget - the mainWidget to addprotected void initContent(com.google.gwt.user.client.ui.Widget mainWidget)
initContent().mainWidget - the main widget to addprotected void removeDecorationWidget(com.google.gwt.user.client.ui.Widget widget,
int width)
widget - the widget to removewidth - the widget width