org.apache.ojb.tools.mapping.reversedb2.dnd2
Class ReverseDbNodesDropWorker

java.lang.Object
  extended byorg.apache.ojb.tools.mapping.reversedb2.dnd2.ReverseDbNodesDropWorker
All Implemented Interfaces:
DropPasteWorkerInterface

public class ReverseDbNodesDropWorker
extends java.lang.Object
implements DropPasteWorkerInterface

Version:
$Id: ReverseDbNodesDropWorker.java,v 1.4 2002/09/04 16:11:08 florianbruckner Exp $
Author:
Florian Bruckner

Constructor Summary
ReverseDbNodesDropWorker()
          Creates a new instance of ReverseDbNodesDropWorker
 
Method Summary
 int getAcceptableActions(java.awt.Component c)
          Returns a bitmask of acceptable actions for this component.
 int getAcceptableActions(java.awt.Component c, java.awt.datatransfer.DataFlavor[] flavor)
          Returns a bitmaks of acceptable actions for the supplied Component and DataFlavor.
 java.awt.datatransfer.DataFlavor getSupportedDataFlavor()
           
 boolean importData(java.awt.Component c, java.awt.datatransfer.Transferable t, int action)
          This is the method that is doing the real work.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReverseDbNodesDropWorker

public ReverseDbNodesDropWorker()
Creates a new instance of ReverseDbNodesDropWorker

Method Detail

getAcceptableActions

public int getAcceptableActions(java.awt.Component c)
Description copied from interface: DropPasteWorkerInterface
Returns a bitmask of acceptable actions for this component. As this method doesn't provide the DataFlavors in this action, all possible acceptable actions should be returned. All possible actions are defined in DnDWorkerConstants

Specified by:
getAcceptableActions in interface DropPasteWorkerInterface
Parameters:
c - The component where the drop could occur.
Returns:
a bitmask of actions this Worker capable of.

getAcceptableActions

public int getAcceptableActions(java.awt.Component c,
                                java.awt.datatransfer.DataFlavor[] flavor)
Description copied from interface: DropPasteWorkerInterface
Returns a bitmaks of acceptable actions for the supplied Component and DataFlavor. If more than one DataFlavor is queried, the resulting bitmask should include all possible actions for all flavors.

Specified by:
getAcceptableActions in interface DropPasteWorkerInterface
Parameters:
c - The component that is the possible drop target.
flavor - The DataFlavours that are associate with the drop action
Returns:
a bitmask of actions this Worker can process with the supplied flavors.

getSupportedDataFlavor

public java.awt.datatransfer.DataFlavor getSupportedDataFlavor()
Specified by:
getSupportedDataFlavor in interface DropPasteWorkerInterface
Returns:
the DataFlavor this Worker is going to accept.

importData

public boolean importData(java.awt.Component c,
                          java.awt.datatransfer.Transferable t,
                          int action)
Description copied from interface: DropPasteWorkerInterface
This is the method that is doing the real work. You get the Component where the drop has occurred, the Transferable with the data and the requested action.

Specified by:
importData in interface DropPasteWorkerInterface
Parameters:
c - The component where the drop has occurred
t - The transferable that shall be imported
action - The action that should be performed.
Returns:
true if the transfer was successful, false if not. If there are more than one Workers are registered with the helper and this method returns false, the next helper is asked to do the import. If true is returned, the action is supposed to be complete and no other worker will be asked. So be careful what you return here, if you return false, no modification to the target model should have happened.


Authors: Thomas Mahler and others. (C) 2000 - 2003 Apache Software Foundation
All rights reserved. Published under the Apache License.
http://db.apache.org/ojb
Version: 1.0.rc5, 2003-12-14