|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.google.gwt.user.client.ui.UIObject
com.google.gwt.user.client.ui.Widget
com.google.gwt.user.client.ui.Composite
org.cafesip.gwtcomp.client.ui.DroppableList
public class DroppableList
A list object where a draggable item can be dropped into. As explained in the
documentation for Draggable, any
visual widget can be converted into a draggable object which can be dragged
by the user and dropped to this object. Alternatively, applications can use
the DraggableLabel. In addition, the
users can delete any item in the list.This object implements the GWT HasName
interface. Therefore it can be used with a GWT FormPanel. When used with a
FormPanel, it behaves like a ListBox with all its items selected.
The draggable/droppable classes use the scriptaculous javascript library for providing the functionality. Therefore, you must add the following segment to your application HTML file (see the GWTCompExamples.html for an example).
<script src="gwtcomp-scripts/scriptaculous/prototype.js" type="text/javascript"></script>
<script src="gwtcomp-scripts/scriptaculous/scriptaculous.js" type="text/javascript"></script>
<script src="gwtcomp-scripts/scriptaculous/dragdrop.js" type="text/javascript"></script>
CSS Style Rules:
Screen-Shots:
Screen-Shots:
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject |
|---|
UIObject.DebugIdImpl, UIObject.DebugIdImplEnabled |
| Field Summary |
|---|
| Fields inherited from class com.google.gwt.user.client.ui.UIObject |
|---|
DEBUG_ID_PREFIX |
| Constructor Summary | |
|---|---|
DroppableList(String id,
String clazz)
A constructor for this class. |
|
| Method Summary | |
|---|---|
void |
addItem(String name)
Add an item to the list. |
void |
addItem(String name,
boolean fireEvents)
Adds an items to the list and invokes listeners if registered. |
void |
addListener(DroppableListListener listener)
Adds a listener for listening to drop events. |
void |
deleteItem(int index)
Deletes an item at the specified index. |
void |
deleteItem(String name)
Delete an item from the list. |
String |
getBasketEmptyIcon()
Returns the currently-set icon that is displayed when the list is empty. |
String |
getBasketFullIcon()
Returns the currently-set icon that is displayed when the list has items. |
String |
getClazz()
|
String |
getId()
|
String |
getItem(int index)
Get the item at a specified index. |
int |
getItemCount()
Get the number of items in the list. |
String[] |
getItems()
Gets all the items in the list. |
String |
getName()
|
protected void |
onLoad()
|
void |
removeListener(DroppableListListener listener)
Removes a listener. |
void |
setBasketEmptyIcon(String basketEmptyIcon)
Sets the URL for the icon that is displayed when the list is empty. |
void |
setBasketFullIcon(String basketFullIcon)
Sets the URL for the icon that is displayed when the list has items. |
void |
setName(String name)
|
| Methods inherited from class com.google.gwt.user.client.ui.Composite |
|---|
getWidget, initWidget, isAttached, onAttach, onBrowserEvent, onDetach, setWidget |
| Methods inherited from class com.google.gwt.user.client.ui.Widget |
|---|
addDomHandler, addHandler, delegateEvent, doAttachChildren, doDetachChildren, fireEvent, getHandlerCount, getLayoutData, getParent, isOrWasAttached, onUnload, removeFromParent, setLayoutData, sinkEvents |
| 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, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, toString, unsinkEvents |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public DroppableList(String id,
String clazz)
id - DOM id of the list.clazz - the class of items it accepts. See
Draggable for details.| Method Detail |
|---|
public void addItem(String name)
name - the name of the item.
public void addItem(String name,
boolean fireEvents)
name - name of the item.fireEvents - listeners are invoked if set to true.public void deleteItem(String name)
name - name of the item.public int getItemCount()
public String getItem(int index)
index - index
public void deleteItem(int index)
index - public String[] getItems()
protected void onLoad()
onLoad in class Widgetpublic String getName()
getName in interface HasNameHasName.getName()public void setName(String name)
setName in interface HasNameHasName.setName(java.lang.String)public void addListener(DroppableListListener listener)
listener - public void removeListener(DroppableListListener listener)
listener - public String getBasketEmptyIcon()
public void setBasketEmptyIcon(String basketEmptyIcon)
basketEmptyIcon - The URL for basketEmptyIcon to set.public String getBasketFullIcon()
public void setBasketFullIcon(String basketFullIcon)
basketFullIcon - The URL for the basketFullIcon to set.public String getId()
public String getClazz()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||