dsto.dfc.swing.dnd
Interface CnpProvider

All Known Implementing Classes:
DfcTable, DfcTree, LogMessageTable, MapTableView, StyleSheetTableView

public interface CnpProvider

Defines a object that supports cut, copy and paste operations.

Version:
$Revision$
See Also:
CmdCut, CmdCopy, CmdPaste

Method Summary
 Transferable cnpCopy()
          Perform copy operation.
 Transferable cnpCut()
          Perform cut operation.
 boolean cnpPaste(Transferable transferable)
          Perform paste operation.
 boolean isCnpCopyEnabled()
          True if a copy operation is possible.
 boolean isCnpCutEnabled()
          True if a cut operation is possible.
 boolean isCnpPasteEnabled(Transferable transferable)
          True if a paste operation with a given transferable is possible.
 

Method Detail

isCnpCopyEnabled

boolean isCnpCopyEnabled()
True if a copy operation is possible. Implementors of this method who also implement PropertyEventSource are assumed to provide property change notification.


isCnpCutEnabled

boolean isCnpCutEnabled()
True if a cut operation is possible. Implementors of this method who also implement PropertyEventSource are assumed to provide property change notification.


isCnpPasteEnabled

boolean isCnpPasteEnabled(Transferable transferable)
True if a paste operation with a given transferable is possible.


cnpCopy

Transferable cnpCopy()
                     throws UnsupportedOperationException,
                            CloneNotSupportedException
Perform copy operation.

Returns:
Copied transferable or null if nothing is available to be copied (eg because there is nothing selected)
Throws:
UnsupportedOperationException - if copy operation not supported.
CloneNotSupportedException - if the data could not be cloned.

cnpCut

Transferable cnpCut()
                    throws UnsupportedOperationException,
                           CloneNotSupportedException
Perform cut operation.

Returns:
Cut transferable or null if nothing is available to be cut (eg because there is nothing selected)
Throws:
UnsupportedOperationException - if cut operation not supported.
CloneNotSupportedException - if the data could not be cloned.

cnpPaste

boolean cnpPaste(Transferable transferable)
                 throws UnsupportedOperationException,
                        UnsupportedFlavorException,
                        CloneNotSupportedException,
                        IOException
Perform paste operation.

Parameters:
transferable - The data to be pasted.
Returns:
True is transferable was pasted, false if not (eg because there is no selection to define where pasted item goes).
Throws:
UnsupportedOperationException - if paste operation not supported.
UnsupportedFlavorException - if transferable does not contain a supported data flavor for pasting.
CloneNotSupportedException - if the data could not be cloned.
IOException - if IO exception occurs during data transfer.


Copyright © 2008 Commonwealth of Australia