com.vaadin.client.ui.dd
Class DragHandle

java.lang.Object
  extended by com.vaadin.client.ui.dd.DragHandle

public class DragHandle
extends java.lang.Object

Drag handle implementation. Drag handles are used for moving or resizing widgets. This is a minimal-case component, meant to be used specifically as a drag handle attached to another widget or element. As such, it does not provide access to the events it's listening to (from the point of view of this component, there really is no use for that). For the more general, event-providing interface that this component is based on, see DragAndDropHandler.

Since:
7.6

Nested Class Summary
static interface DragHandle.DragHandleCallback
          Callback interface for the DragHandle event life cycle
 
Constructor Summary
DragHandle(java.lang.String baseName, DragHandle.DragHandleCallback callback)
          Creates a new DragHandle.
 
Method Summary
 void addStyleName(java.lang.String styleName)
          Adds CSS style name to the drag handle element.
 void addTo(Element elem)
          Adds this drag handle to an HTML element.
 Element getElement()
          Gets the element used as actual drag handle.
 Element getParent()
          Returns the current parent element for this drag handle.
 void removeFromParent()
          Removes this drag handle from whatever it was attached to.
 void removeStyleName(java.lang.String styleName)
          Removes existing style name from drag handle element.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DragHandle

public DragHandle(java.lang.String baseName,
                  DragHandle.DragHandleCallback callback)
Creates a new DragHandle.

Parameters:
baseName - CSS style name to use for this DragHandle element. This parameter is supplied to the constructor (rather than added later) both to provide the "-dragged" style and to make sure that the drag handle can be properly styled (it's otherwise invisible)
callback - Callback object allows hooking up the drag handle to the rest of the program logic
Method Detail

getParent

public Element getParent()
Returns the current parent element for this drag handle. May be null.

Returns:
an Element or null

getElement

public Element getElement()
Gets the element used as actual drag handle.

Returns:
an Element

addTo

public void addTo(Element elem)
Adds this drag handle to an HTML element.

Parameters:
elem - an element

removeFromParent

public void removeFromParent()
Removes this drag handle from whatever it was attached to.


addStyleName

public void addStyleName(java.lang.String styleName)
Adds CSS style name to the drag handle element.

Parameters:
styleName - a CSS style name

removeStyleName

public void removeStyleName(java.lang.String styleName)
Removes existing style name from drag handle element.

Parameters:
styleName - a CSS style name


Copyright © 2000-2014 Vaadin Ltd. All Rights Reserved.