|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.cafesip.gwtcomp.client.ui.Draggable
public class Draggable
An utility class for making a widget "draggable". A draggable widget can be
dragged and dropped into a
DroppableList object. Each draggable
object must have a unique id and a "class" associated with it. The class (not
to be confused with a class in object-oriented programming) is used to
classify the object. For example, a draggable object with id="123" and
class="country" can be dropped into a DroppableList that accepts objects of
class="country". Therefore, it is possible to have more than one
DroppableList in a screen that accepts objects of different class. Note that
the id attribute is the same as the DOM id and must be unique for the
underlying HTML document.
Important note: the makeDraggable() method must be invoked only after the
object has been attached to the DOM document because of the limitation of the
underlying implementation. If the application requires a label that is
draggable, use the DraggableLabel
instead. The makeDraggable() method does not have to be invoked for this
class.
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>
| Method Summary | |
|---|---|
void |
dispose()
This method must be called when the object is no longer attached with the DOM document. |
String |
getClazz()
Returns the class. |
Element |
getDraggable()
Returns the DOM element associated with the draggable object. |
static HashMap<String,org.cafesip.gwtcomp.client.helpers.DraggableElement> |
getDraggables()
Returns a list of draggable items. |
String |
getName()
Returns the name of the draggable object. |
Widget |
getObject()
Returns the draggable widget. |
static Draggable |
makeDraggable(Widget object,
String name,
String id,
String clazz)
This static method is used to make a widget draggable. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public void dispose()
public Widget getObject()
public String getClazz()
public Element getDraggable()
public String getName()
public static HashMap<String,org.cafesip.gwtcomp.client.helpers.DraggableElement> getDraggables()
public static Draggable makeDraggable(Widget object,
String name,
String id,
String clazz)
object - widget to make draggable.name - the name of the object. The DroppableList object identifies
the object with this name.id - the DOM id of the object.clazz - the class of the widget.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||