com.ibm.carma.ui.view
Class CARMATreeDropAdapter

java.lang.Object
  extended by org.eclipse.swt.dnd.DropTargetAdapter
      extended by org.eclipse.jface.viewers.ViewerDropAdapter
          extended by org.eclipse.ui.part.PluginDropAdapter
              extended by com.ibm.carma.ui.view.CARMATreeDropAdapter
All Implemented Interfaces:
java.util.EventListener, org.eclipse.swt.dnd.DropTargetListener, org.eclipse.swt.internal.SWTEventListener

public class CARMATreeDropAdapter
extends org.eclipse.ui.part.PluginDropAdapter

Assists in dropping items into the CARMA Browser. The class detects if the drop location is a valid drop location (a resource container or member with valid resource container parent) then attempts to copy the dropped object into the CARMA structure.

Since:
7.0

Field Summary
static java.lang.String COPYRIGHT
           
 
Fields inherited from class org.eclipse.ui.part.PluginDropAdapter
ATT_CLASS
 
Fields inherited from class org.eclipse.jface.viewers.ViewerDropAdapter
LOCATION_AFTER, LOCATION_BEFORE, LOCATION_NONE, LOCATION_ON
 
Constructor Summary
CARMATreeDropAdapter(org.eclipse.jface.viewers.StructuredViewer viewer)
          Creates a new Drop adapter
 
Method Summary
 void dragEnter(org.eclipse.swt.dnd.DropTargetEvent event)
           
 boolean isValidTarget(java.lang.Object target)
          Return true if the traget object is a valid drop location.
 boolean performDrop(java.lang.Object data)
           
 boolean validateDrop(java.lang.Object target, int operation, org.eclipse.swt.dnd.TransferData transferType)
           
 
Methods inherited from class org.eclipse.ui.part.PluginDropAdapter
drop
 
Methods inherited from class org.eclipse.jface.viewers.ViewerDropAdapter
dragOperationChanged, dragOver, dropAccept, getFeedbackEnabled, setFeedbackEnabled, setScrollExpandEnabled, setSelectionFeedbackEnabled
 
Methods inherited from class org.eclipse.swt.dnd.DropTargetAdapter
dragLeave
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COPYRIGHT

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

CARMATreeDropAdapter

public CARMATreeDropAdapter(org.eclipse.jface.viewers.StructuredViewer viewer)
Creates a new Drop adapter

Parameters:
viewer - the viewer that the drop adapter is working against
Method Detail

dragEnter

public void dragEnter(org.eclipse.swt.dnd.DropTargetEvent event)
Specified by:
dragEnter in interface org.eclipse.swt.dnd.DropTargetListener
Overrides:
dragEnter in class org.eclipse.jface.viewers.ViewerDropAdapter

performDrop

public boolean performDrop(java.lang.Object data)
Overrides:
performDrop in class org.eclipse.ui.part.PluginDropAdapter

isValidTarget

public boolean isValidTarget(java.lang.Object target)
Return true if the traget object is a valid drop location. In this case that means a CARMA resource container or a member with a parent container.

Parameters:
target - the drop target
Returns:
true if the target is valid, false otherwise

validateDrop

public boolean validateDrop(java.lang.Object target,
                            int operation,
                            org.eclipse.swt.dnd.TransferData transferType)
Overrides:
validateDrop in class org.eclipse.ui.part.PluginDropAdapter