src/share/classes/javax/swing/TransferHandler.java

Print this page




  58  * represent data that is exchanged via a cut, copy, or paste
  59  * to/from a clipboard.  It is also used in drag-and-drop operations
  60  * to represent a drag from a component, and a drop to a component.
  61  * Swing provides functionality that automatically supports cut, copy,
  62  * and paste keyboard bindings that use the functionality provided by
  63  * an implementation of this class.  Swing also provides functionality
  64  * that automatically supports drag and drop that uses the functionality
  65  * provided by an implementation of this class.  The Swing developer can
  66  * concentrate on specifying the semantics of a transfer primarily by setting
  67  * the <code>transferHandler</code> property on a Swing component.
  68  * <p>
  69  * This class is implemented to provide a default behavior of transferring
  70  * a component property simply by specifying the name of the property in
  71  * the constructor.  For example, to transfer the foreground color from
  72  * one component to another either via the clipboard or a drag and drop operation
  73  * a <code>TransferHandler</code> can be constructed with the string "foreground".  The
  74  * built in support will use the color returned by <code>getForeground</code> as the source
  75  * of the transfer, and <code>setForeground</code> for the target of a transfer.
  76  * <p>
  77  * Please see
  78  * <a href="http://java.sun.com/docs/books/tutorial/uiswing/misc/dnd.html">
  79  * How to Use Drag and Drop and Data Transfer</a>,
  80  * a section in <em>The Java Tutorial</em>, for more information.
  81  *
  82  *
  83  * @author Timothy Prinzing
  84  * @author Shannon Hickey
  85  * @since 1.4
  86  */
  87 @SuppressWarnings("serial")
  88 public class TransferHandler implements Serializable {
  89 
  90     /**
  91      * An <code>int</code> representing no transfer action.
  92      */
  93     public static final int NONE = DnDConstants.ACTION_NONE;
  94 
  95     /**
  96      * An <code>int</code> representing a &quot;copy&quot; transfer action.
  97      * This value is used when data is copied to a clipboard
  98      * or copied elsewhere in a drag and drop operation.




  58  * represent data that is exchanged via a cut, copy, or paste
  59  * to/from a clipboard.  It is also used in drag-and-drop operations
  60  * to represent a drag from a component, and a drop to a component.
  61  * Swing provides functionality that automatically supports cut, copy,
  62  * and paste keyboard bindings that use the functionality provided by
  63  * an implementation of this class.  Swing also provides functionality
  64  * that automatically supports drag and drop that uses the functionality
  65  * provided by an implementation of this class.  The Swing developer can
  66  * concentrate on specifying the semantics of a transfer primarily by setting
  67  * the <code>transferHandler</code> property on a Swing component.
  68  * <p>
  69  * This class is implemented to provide a default behavior of transferring
  70  * a component property simply by specifying the name of the property in
  71  * the constructor.  For example, to transfer the foreground color from
  72  * one component to another either via the clipboard or a drag and drop operation
  73  * a <code>TransferHandler</code> can be constructed with the string "foreground".  The
  74  * built in support will use the color returned by <code>getForeground</code> as the source
  75  * of the transfer, and <code>setForeground</code> for the target of a transfer.
  76  * <p>
  77  * Please see
  78  * <a href="http://docs.oracle.com/javase/tutorial/uiswing/dnd/index.html">
  79  * How to Use Drag and Drop and Data Transfer</a>,
  80  * a section in <em>The Java Tutorial</em>, for more information.
  81  *
  82  *
  83  * @author Timothy Prinzing
  84  * @author Shannon Hickey
  85  * @since 1.4
  86  */
  87 @SuppressWarnings("serial")
  88 public class TransferHandler implements Serializable {
  89 
  90     /**
  91      * An <code>int</code> representing no transfer action.
  92      */
  93     public static final int NONE = DnDConstants.ACTION_NONE;
  94 
  95     /**
  96      * An <code>int</code> representing a &quot;copy&quot; transfer action.
  97      * This value is used when data is copied to a clipboard
  98      * or copied elsewhere in a drag and drop operation.