I - the specific list item implementationpublic class CmsList<I extends I_CmsListItem> extends com.google.gwt.user.client.ui.ComplexPanel implements I_CmsTruncable, I_CmsDropTarget
CmsListItemWidget.com.google.gwt.user.client.ui.UIObject.DebugIdImpl, com.google.gwt.user.client.ui.UIObject.DebugIdImplEnabled| 限定符和类型 | 字段和说明 |
|---|---|
protected CmsDNDHandler |
m_dndHandler
The drag'n drop handler.
|
protected com.google.gwt.dom.client.Element |
m_placeholder
The current place holder.
|
protected int |
m_placeholderIndex
The placeholder position index.
|
| 构造器和说明 |
|---|
CmsList()
Constructor.
|
| 限定符和类型 | 方法和说明 |
|---|---|
void |
add(com.google.gwt.user.client.ui.Widget widget) |
void |
addItem(I item)
Adds an item to the list.
|
protected void |
changeId(I item,
java.lang.String id)
Changes the id for the given item.
|
boolean |
checkPosition(int x,
int y,
CmsDNDHandler.Orientation orientation)
Returns true if the given cursor position is over the drop target.
|
void |
clearList()
Clears the list.
|
CmsDNDHandler |
getDnDHandler()
Returns the drag'n drop handler.
|
I |
getItem(int index)
Returns the list item at the given position.
|
I |
getItem(java.lang.String itemId)
Returns the list item with the given id.
|
int |
getItemPosition(I item)
Returns the given item position.
|
int |
getPlaceholderIndex()
Returns the index of the placeholder or -1 if no placeholder is attached.
|
void |
insert(com.google.gwt.user.client.ui.Widget widget,
int position)
Inserts the given widget at the given position.
|
void |
insertItem(I item,
int position)
Inserts the given item at the given position.
|
void |
insertPlaceholder(com.google.gwt.dom.client.Element placeholder,
int x,
int y,
CmsDNDHandler.Orientation orientation)
Inserts a new placeholder.
|
boolean |
isDNDTakeAll()
Returns if the list will always return
true on check target requests within drag and drop. |
boolean |
isDropEnabled()
Checks if dropping is enabled.
|
void |
onDrop(I_CmsDraggable draggable)
Executed on drop.
|
protected void |
registerItem(I item)
Registers the given item on this list.
|
boolean |
remove(com.google.gwt.user.client.ui.Widget w) |
I |
removeItem(I item)
Removes an item from the list.
|
I |
removeItem(java.lang.String itemId)
Removes an item from the list.
|
void |
removePlaceholder()
Removes the placeholder.
|
void |
repositionPlaceholder(int x,
int y,
CmsDNDHandler.Orientation orientation)
Repositions the placeholder.
|
void |
setDNDHandler(CmsDNDHandler handler)
Sets the drag'n drop handler.
|
void |
setDNDTakeAll(boolean takeAll)
Sets if the list will always return
true on check target requests within drag and drop. |
void |
setDropEnabled(boolean enabled)
Enables/disables dropping.
|
protected void |
setPlaceholder(com.google.gwt.dom.client.Element placeholder)
Sets the current drag'n drop place holder.
|
void |
truncate(java.lang.String textMetricsPrefix,
int widgetWidth)
Truncates long text and sets the original text to the title attribute.
|
add, adjustIndex, checkIndexBoundsForAccess, checkIndexBoundsForInsertion, getChildren, getWidget, getWidgetCount, getWidgetIndex, getWidgetIndex, insert, insert, iterator, removeadd, adopt, adopt, clear, disown, doAttachChildren, doDetachChildren, orphan, removeaddAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, fireEvent, getHandlerCount, getLayoutData, getParent, isAttached, isOrWasAttached, onAttach, onBrowserEvent, onDetach, 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, resolvePotentialElement, 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 CmsDNDHandler m_dndHandler
protected com.google.gwt.dom.client.Element m_placeholder
protected int m_placeholderIndex
public void add(com.google.gwt.user.client.ui.Widget widget)
add 在接口中 com.google.gwt.user.client.ui.HasWidgetsadd 在类中 com.google.gwt.user.client.ui.PanelPanel.add(com.google.gwt.user.client.ui.Widget)public void addItem(I item)
item - the item to addadd(Widget)public boolean checkPosition(int x,
int y,
CmsDNDHandler.Orientation orientation)
I_CmsDropTargetcheckPosition 在接口中 I_CmsDropTargetx - the cursor client x positiony - the cursor client y positionorientation - the drag and drop orientationtrue if the given cursor position is over the drop targetorg.opencms.gwt.client.dnd.I_CmsDropTarget#checkPosition(int, int, Orientation)public void clearList()
public CmsDNDHandler getDnDHandler()
public I getItem(int index)
index - the positionComplexPanel.getWidget(int)public I getItem(java.lang.String itemId)
itemId - the id of the item to retrieveComplexPanel.getWidget(int)public int getItemPosition(I item)
item - the item to get the position forpublic int getPlaceholderIndex()
I_CmsDropTargetgetPlaceholderIndex 在接口中 I_CmsDropTargetI_CmsDropTarget.getPlaceholderIndex()public void insert(com.google.gwt.user.client.ui.Widget widget,
int position)
widget - the widget to insertposition - the positionpublic void insertItem(I item, int position)
item - the item to insertposition - the positionpublic void insertPlaceholder(com.google.gwt.dom.client.Element placeholder,
int x,
int y,
CmsDNDHandler.Orientation orientation)
I_CmsDropTargetinsertPlaceholder 在接口中 I_CmsDropTargetplaceholder - the placeholder elementx - the cursor client x positiony - the cursor client y positionorientation - the drag and drop orientationorg.opencms.gwt.client.dnd.I_CmsDropTarget#insertPlaceholder(com.google.gwt.dom.client.Element, int, int, Orientation)public boolean isDNDTakeAll()
true on check target requests within drag and drop.true if take all is enabled for drag and droppublic boolean isDropEnabled()
true if dropping is enabledpublic void onDrop(I_CmsDraggable draggable)
I_CmsDropTargetonDrop 在接口中 I_CmsDropTargetdraggable - the draggable being droppedI_CmsDropTarget.onDrop(org.opencms.gwt.client.dnd.I_CmsDraggable)public boolean remove(com.google.gwt.user.client.ui.Widget w)
remove 在接口中 com.google.gwt.user.client.ui.HasWidgetsremove 在类中 com.google.gwt.user.client.ui.ComplexPanelComplexPanel.remove(com.google.gwt.user.client.ui.Widget)public I removeItem(I item)
item - the item to removeremove(Widget)public I removeItem(java.lang.String itemId)
itemId - the id of the item to removeremove(Widget)public void removePlaceholder()
I_CmsDropTargetremovePlaceholder 在接口中 I_CmsDropTargetI_CmsDropTarget.removePlaceholder()public void repositionPlaceholder(int x,
int y,
CmsDNDHandler.Orientation orientation)
I_CmsDropTargetrepositionPlaceholder 在接口中 I_CmsDropTargetx - the cursor client x positiony - the cursor client y positionorientation - the drag and drop orientationorg.opencms.gwt.client.dnd.I_CmsDropTarget#repositionPlaceholder(int, int, Orientation)public void setDNDHandler(CmsDNDHandler handler)
handler - the handler to setpublic void setDNDTakeAll(boolean takeAll)
true on check target requests within drag and drop.takeAll - true to enable take all for drag and droppublic void setDropEnabled(boolean enabled)
enabled - true to enable, or false to disablepublic 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 changeId(I item, java.lang.String id)
item - the item to change the id forid - the new idprotected void registerItem(I item)
item - the item to registerprotected void setPlaceholder(com.google.gwt.dom.client.Element placeholder)
placeholder - the element to set as place holder