org.cafesip.gwtcomp.client.ui
Class DraggableLabel

java.lang.Object
  extended by com.google.gwt.user.client.ui.UIObject
      extended by com.google.gwt.user.client.ui.Widget
          extended by com.google.gwt.user.client.ui.Label
              extended by com.google.gwt.user.client.ui.HTML
                  extended by org.cafesip.gwtcomp.client.ui.DraggableLabel
All Implemented Interfaces:
com.google.gwt.i18n.client.HasDirection, com.google.gwt.user.client.EventListener, com.google.gwt.user.client.ui.HasHorizontalAlignment, com.google.gwt.user.client.ui.HasHTML, com.google.gwt.user.client.ui.HasText, com.google.gwt.user.client.ui.HasWordWrap, com.google.gwt.user.client.ui.SourcesClickEvents, com.google.gwt.user.client.ui.SourcesMouseEvents, com.google.gwt.user.client.ui.SourcesMouseWheelEvents

public class DraggableLabel
extends com.google.gwt.user.client.ui.HTML

A label object that can be dragged and dropped into a DroppableList. The label consists of a name and optionally, an icon to the left of the name. This label can be dragged by holding the mouse button down and by moving the pointer. The object can be dropped into a DroppableList object.

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>
 

Examples:

CSS Style Rules:

Screen-Shots:


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
 
Nested classes/interfaces inherited from interface com.google.gwt.user.client.ui.HasHorizontalAlignment
com.google.gwt.user.client.ui.HasHorizontalAlignment.HorizontalAlignmentConstant
 
Nested classes/interfaces inherited from interface com.google.gwt.i18n.client.HasDirection
com.google.gwt.i18n.client.HasDirection.Direction
 
Field Summary
 
Fields inherited from class com.google.gwt.user.client.ui.UIObject
DEBUG_ID_PREFIX
 
Fields inherited from interface com.google.gwt.user.client.ui.HasHorizontalAlignment
ALIGN_CENTER, ALIGN_DEFAULT, ALIGN_LEFT, ALIGN_RIGHT
 
Constructor Summary
DraggableLabel(java.lang.String name, java.lang.String id, java.lang.String clazz)
          A constructor for this class with just the text label (no icon).
DraggableLabel(java.lang.String imageUrl, java.lang.String name, java.lang.String id, java.lang.String clazz)
          A constructor for this class that displays an icon and a text label.
 
Method Summary
 java.lang.String getImageUrl()
           
protected  void onLoad()
           
protected  void onUnload()
           
 
Methods inherited from class com.google.gwt.user.client.ui.HTML
getHTML, setHTML, wrap
 
Methods inherited from class com.google.gwt.user.client.ui.Label
addClickListener, addMouseListener, addMouseWheelListener, getDirection, getHorizontalAlignment, getText, getWordWrap, onBrowserEvent, removeClickListener, removeMouseListener, removeMouseWheelListener, setDirection, setHorizontalAlignment, setText, setWordWrap
 
Methods inherited from class com.google.gwt.user.client.ui.Widget
doAttachChildren, doDetachChildren, getParent, isAttached, onAttach, onDetach, removeFromParent
 
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, sinkEvents, toString, unsinkEvents
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.google.gwt.user.client.ui.HasText
getText, setText
 

Constructor Detail

DraggableLabel

public DraggableLabel(java.lang.String imageUrl,
                      java.lang.String name,
                      java.lang.String id,
                      java.lang.String clazz)
A constructor for this class that displays an icon and a text label.

Parameters:
imageUrl - The URL of the icon.
name - The text of the label.
id - The DOM id of this object. It must be unique. See the description for Draggable for details.
clazz - The class value for this label. See the description for Draggable for details.

DraggableLabel

public DraggableLabel(java.lang.String name,
                      java.lang.String id,
                      java.lang.String clazz)
A constructor for this class with just the text label (no icon).

Parameters:
name - The text of the label.
id - The DOM id of this object. It must be unique. See the description for Draggable for details.
clazz - The class value for this label. See the description for Draggable for details.
Method Detail

onLoad

protected void onLoad()
Overrides:
onLoad in class com.google.gwt.user.client.ui.Widget

onUnload

protected void onUnload()
Overrides:
onUnload in class com.google.gwt.user.client.ui.Widget

getImageUrl

public java.lang.String getImageUrl()
Returns:
Returns the imageUrl.


http://www.cafesip.org