| java.lang.Object javax.swing.TransferHandler org.netbeans.modules.visualweb.extension.openide.text.TextTransferHandler
Inner Class :public static class CodeClipTransferData extends StringSelection | |
Field Summary | |
public static boolean | dontRemove Flag which is only defined during a drag & drop operation.
Clients (typically drop zones) can set it to true to indicate
that the data being dragged should be copied, not moved.
For example, the clipboard viewer sets this when it handles
the import. |
dontRemove | public static boolean dontRemove(Code) | | Flag which is only defined during a drag & drop operation.
Clients (typically drop zones) can set it to true to indicate
that the data being dragged should be copied, not moved.
For example, the clipboard viewer sets this when it handles
the import. That way, the exportDone method knows not to remove
the text being placed on the clipboard from the document, since
text dragging (without modified keys) defaults to moving, not
copying. And we don't want to disallow copying in getSourceActions,
since dragging text from one place in the document to another
SHOULD be moved, not copied.
|
canImport | public boolean canImport(JComponent comp, DataFlavor[] flavors)(Code) | | This method indicates if a component would accept an import of the given
set of data flavors prior to actually attempting to import it.
Parameters: comp - The component to receive the transfer. Thisargument is provided to enable sharing of TransferHandlers bymultiple components. Parameters: flavors - The data formats available true if the data can be inserted into the component, false otherwise. |
createTransferable | protected Transferable createTransferable(JComponent comp)(Code) | | Create a Transferable to use as the source for a data transfer.
Parameters: comp - The component holding the data to be transfered. Thisargument is provided to enable sharing of TransferHandlers bymultiple components. The representation of the data to be transfered. |
exportDone | protected void exportDone(JComponent source, Transferable data, int action)(Code) | | This method is called after data has been exported. This
method should remove the data that was transfered if the action
was MOVE.
Parameters: source - The component that was the source of the data. Parameters: data - The data that was transferred or possibly nullif the action is NONE . Parameters: action - The actual action that was performed. |
getImportFlavor | protected DataFlavor getImportFlavor(DataFlavor[] flavors, JTextComponent c)(Code) | | Try to find a flavor that can be used to import a Transferable.
The set of usable flavors are tried in the following order:
- First, an attempt is made to find a flavor matching the content type
of the EditorKit for the component.
- Second, an attempt to find a text/plain flavor is made.
- Third, an attempt to find a flavor representing a String reference
in the same VM is made.
- Lastly, DataFlavor.stringFlavor is searched for.
|
getSourceActions | public int getSourceActions(JComponent c)(Code) | | This is the type of transfer actions supported by the source. Some models are
not mutable, so a transfer operation of COPY only should
be advertised in that case.
Parameters: c - The component holding the data to be transfered. Thisargument is provided to enable sharing of TransferHandlers bymultiple components. This is implemented to return NONE if the component is a JPasswordFieldsince exporting data via user gestures is not allowed. If the text component iseditable, COPY_OR_MOVE is returned, otherwise just COPY is allowed. |
importData | public boolean importData(JComponent comp, Transferable t)(Code) | | This method causes a transfer to a component from a clipboard or a
DND drop operation. The Transferable represents the data to be
imported into the component.
Parameters: comp - The component to receive the transfer. Thisargument is provided to enable sharing of TransferHandlers bymultiple components. Parameters: t - The data to import true if the data was inserted into the component, false otherwise. |
|
|