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:
HasAllMouseHandlers, HasClickHandlers, HasMouseDownHandlers, HasMouseMoveHandlers, HasMouseOutHandlers, HasMouseOverHandlers, HasMouseUpHandlers, HasMouseWheelHandlers, HasHandlers, HasDirection, EventListener, HasHorizontalAlignment, HasHTML, HasText, HasWordWrap, SourcesClickEvents, SourcesMouseEvents

public class DraggableLabel
extends 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>
 

CSS Style Rules:

Screen-Shots:

Author:
Amit Chatterjee

Nested Class Summary
 
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject
UIObject.DebugIdImpl, UIObject.DebugIdImplEnabled
 
Nested classes/interfaces inherited from interface com.google.gwt.user.client.ui.HasHorizontalAlignment
HasHorizontalAlignment.HorizontalAlignmentConstant
 
Nested classes/interfaces inherited from interface com.google.gwt.i18n.client.HasDirection
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(String name, String id, String clazz)
          A constructor for this class with just the text label (no icon).
DraggableLabel(String imageUrl, String name, String id, String clazz)
          A constructor for this class that displays an icon and a text label.
 
Method Summary
 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
addClickHandler, addClickListener, addMouseDownHandler, addMouseListener, addMouseMoveHandler, addMouseOutHandler, addMouseOverHandler, addMouseUpHandler, addMouseWheelHandler, addMouseWheelListener, getDirection, getHorizontalAlignment, getText, getWordWrap, removeClickListener, removeMouseListener, removeMouseWheelListener, setDirection, setHorizontalAlignment, setText, setWordWrap
 
Methods inherited from class com.google.gwt.user.client.ui.Widget
addDomHandler, addHandler, delegateEvent, doAttachChildren, doDetachChildren, fireEvent, getHandlerCount, getLayoutData, getParent, isAttached, isOrWasAttached, onAttach, onBrowserEvent, onDetach, 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
 
Methods inherited from interface com.google.gwt.user.client.ui.HasText
getText, setText
 
Methods inherited from interface com.google.gwt.event.shared.HasHandlers
fireEvent
 
Methods inherited from interface com.google.gwt.event.shared.HasHandlers
fireEvent
 
Methods inherited from interface com.google.gwt.event.shared.HasHandlers
fireEvent
 
Methods inherited from interface com.google.gwt.event.shared.HasHandlers
fireEvent
 
Methods inherited from interface com.google.gwt.event.shared.HasHandlers
fireEvent
 
Methods inherited from interface com.google.gwt.event.shared.HasHandlers
fireEvent
 
Methods inherited from interface com.google.gwt.event.shared.HasHandlers
fireEvent
 

Constructor Detail

DraggableLabel

public DraggableLabel(String imageUrl,
                      String name,
                      String id,
                      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(String name,
                      String id,
                      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 Widget

onUnload

protected void onUnload()
Overrides:
onUnload in class Widget

getImageUrl

public String getImageUrl()
Returns:
Returns the imageUrl.


Copyright © 2010 Cafesip.org. All Rights Reserved.