NextApp Echo2 Extras
v2.1.0

nextapp.echo2.extras.app
Class DragSource

java.lang.Object
  extended by nextapp.echo2.app.Component
      extended by nextapp.echo2.extras.app.DragSource
All Implemented Interfaces:
java.io.Serializable, nextapp.echo2.app.RenderIdSupport

public class DragSource
extends nextapp.echo2.app.Component

A container Component that enables its child to be dragged and dropeed by the user onto any Component registered as a drop target. When a Component is successfully dropped onto a valid drop target, a DropEvent is fired and all registered DropTargetListeners are notified.

WARNING: This component is EXPERIMENTAL. The API is VERY LIKELY to change.

See Also:
Serialized Form

Field Summary
static java.lang.String DROP_TARGET_LISTENERS_CHANGED_PROPERTY
           
static java.lang.String INPUT_DROP
           
static java.lang.String PROPERTY_TOOL_TIP_TEXT
           
 
Fields inherited from class nextapp.echo2.app.Component
CHILDREN_CHANGED_PROPERTY, ENABLED_CHANGED_PROPERTY, FOCUS_TRAVERSAL_INDEX_CHANGED_PROPERTY, FOCUS_TRAVERSAL_PARTICIPANT_CHANGED_PROPERTY, LAYOUT_DIRECTION_CHANGED_PROPERTY, LOCALE_CHANGED_PROPERTY, PROPERTY_BACKGROUND, PROPERTY_FONT, PROPERTY_FOREGROUND, PROPERTY_LAYOUT_DATA, STYLE_CHANGED_PROPERTY, STYLE_NAME_CHANGED_PROPERTY, VISIBLE_CHANGED_PROPERTY
 
Constructor Summary
DragSource()
          Creates an empty DragSource
DragSource(nextapp.echo2.app.Component draggable)
          Creates a DragSource making the given Component visually draggable
 
Method Summary
 void addDropTarget(nextapp.echo2.app.Component dropTarget)
          Adds a target component to the drop target list.
 void addDropTargetListener(DropListener listener)
          Adds a DropListener to the listener list
 void fireDropEvent(DropEvent event)
          Notifies all listeners that have registered for this event type.
 nextapp.echo2.app.Component getDropTargetAt(int n)
          Returns the drop target Component at the specified index
 int getDropTargetCount()
          Returns total number of drop target Components
protected  java.util.List getDropTargetList()
          Returns the local list of Drop Target Components.
 nextapp.echo2.app.Component[] getDropTargets()
          Returns all drop target Components
 java.lang.String getToolTipText(java.lang.String newValue)
          Gets the tool tip text (displayed when the draggable component is over a valid drop target).
 void processInput(java.lang.String name, java.lang.Object value)
           
 void removeAllDropTargets()
          Removes all Components from the drop target list
 void removeDropTarget(nextapp.echo2.app.Component dropTarget)
          Removes a Component from the drop target list
 void removeDropTargetListener(DropListener listener)
          Removes a DropListener from the listener list
 void setToolTipText(java.lang.String newValue)
          Sets the tool tip text (displayed when the draggable component is over a valid drop target).
 
Methods inherited from class nextapp.echo2.app.Component
add, add, addPropertyChangeListener, addPropertyChangeListener, dispose, firePropertyChange, getApplicationInstance, getBackground, getComponent, getComponent, getComponentCount, getComponents, getEventListenerList, getFocusTraversalIndex, getFont, getForeground, getId, getIndexedProperty, getLayoutData, getLayoutDirection, getLocale, getParent, getProperty, getRenderId, getRenderIndexedProperty, getRenderIndexedProperty, getRenderLayoutDirection, getRenderLocale, getRenderProperty, getRenderProperty, getStyle, getStyleName, getVisibleComponent, getVisibleComponentCount, getVisibleComponents, hasEventListenerList, indexOf, init, isAncestorOf, isEnabled, isFocusTraversalParticipant, isRegistered, isRenderEnabled, isRenderVisible, isValidChild, isValidParent, isVisible, remove, remove, removeAll, removePropertyChangeListener, removePropertyChangeListener, setBackground, setEnabled, setFocusTraversalIndex, setFocusTraversalParticipant, setFont, setForeground, setId, setIndexedProperty, setLayoutData, setLayoutDirection, setLocale, setProperty, setRenderId, setStyle, setStyleName, setVisible, validate, verifyInput, visibleIndexOf
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DROP_TARGET_LISTENERS_CHANGED_PROPERTY

public static final java.lang.String DROP_TARGET_LISTENERS_CHANGED_PROPERTY
See Also:
Constant Field Values

INPUT_DROP

public static final java.lang.String INPUT_DROP
See Also:
Constant Field Values

PROPERTY_TOOL_TIP_TEXT

public static final java.lang.String PROPERTY_TOOL_TIP_TEXT
See Also:
Constant Field Values
Constructor Detail

DragSource

public DragSource()
Creates an empty DragSource


DragSource

public DragSource(nextapp.echo2.app.Component draggable)
Creates a DragSource making the given Component visually draggable

Parameters:
draggable - The Component.
Method Detail

addDropTarget

public void addDropTarget(nextapp.echo2.app.Component dropTarget)
Adds a target component to the drop target list.

Parameters:
dropTarget - the drop target.

addDropTargetListener

public void addDropTargetListener(DropListener listener)
Adds a DropListener to the listener list

Parameters:
listener - the listener.

fireDropEvent

public void fireDropEvent(DropEvent event)
Notifies all listeners that have registered for this event type.

Parameters:
event - the DropEvent to send

getDropTargetAt

public nextapp.echo2.app.Component getDropTargetAt(int n)
Returns the drop target Component at the specified index

Parameters:
n - the index.
Returns:
the drop target.

getDropTargetCount

public int getDropTargetCount()
Returns total number of drop target Components

Returns:
the total number drop targets.

getDropTargetList

protected java.util.List getDropTargetList()
Returns the local list of Drop Target Components.

Returns:
the drop target list

getDropTargets

public nextapp.echo2.app.Component[] getDropTargets()
Returns all drop target Components

Returns:
the drop targets.

getToolTipText

public java.lang.String getToolTipText(java.lang.String newValue)
Gets the tool tip text (displayed when the draggable component is over a valid drop target).

Returns:
the tool tip text

processInput

public void processInput(java.lang.String name,
                         java.lang.Object value)
Overrides:
processInput in class nextapp.echo2.app.Component
See Also:
Component.processInput(java.lang.String, java.lang.Object)

removeAllDropTargets

public void removeAllDropTargets()
Removes all Components from the drop target list


removeDropTarget

public void removeDropTarget(nextapp.echo2.app.Component dropTarget)
Removes a Component from the drop target list

Parameters:
dropTarget - the component.

removeDropTargetListener

public void removeDropTargetListener(DropListener listener)
Removes a DropListener from the listener list

Parameters:
listener - the listener.

setToolTipText

public void setToolTipText(java.lang.String newValue)
Sets the tool tip text (displayed when the draggable component is over a valid drop target).

Parameters:
newValue - the new tool tip text

NextApp Echo2 Extras
v2.1.0