com.alee.extended.tab
Class DocumentDragHandler

java.lang.Object
  extended by javax.swing.TransferHandler
      extended by com.alee.extended.tab.DocumentDragHandler
All Implemented Interfaces:
java.io.Serializable

public class DocumentDragHandler
extends javax.swing.TransferHandler

Custom TransferHandler for DocumentData object. This TransferHandler is made specially for WebDocumentPane component.

Author:
Mikle Garin
See Also:
How to use WebDocumentPane, WebDocumentPane, Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.TransferHandler
javax.swing.TransferHandler.DropLocation, javax.swing.TransferHandler.TransferSupport
 
Field Summary
protected  DocumentData document
          Dragged document.
protected  int documentIndex
          Dragged away document index.
protected  PaneData paneData
          PaneData to which this TransferHandler is attached.
protected  WebTabbedPane tabbedPane
          WebTabbedPane from PaneData.
 
Fields inherited from class javax.swing.TransferHandler
COPY, COPY_OR_MOVE, LINK, MOVE, NONE
 
Constructor Summary
DocumentDragHandler(PaneData paneData)
          Constructs new DocumentDragHandler for the specified PaneData.
 
Method Summary
 boolean canImport(javax.swing.TransferHandler.TransferSupport support)
          
protected  java.awt.datatransfer.Transferable createTransferable(javax.swing.JComponent c)
          
 void exportAsDrag(javax.swing.JComponent comp, java.awt.event.InputEvent e, int action)
          
protected  void exportDone(javax.swing.JComponent source, java.awt.datatransfer.Transferable data, int action)
          
 int getSourceActions(javax.swing.JComponent c)
          
 boolean importData(javax.swing.TransferHandler.TransferSupport support)
          
static void install(PaneData paneData)
          Quick drag handler installation method.
 
Methods inherited from class javax.swing.TransferHandler
canImport, exportToClipboard, getCopyAction, getCutAction, getPasteAction, getVisualRepresentation, importData
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

paneData

protected final PaneData paneData
PaneData to which this TransferHandler is attached.


tabbedPane

protected final WebTabbedPane tabbedPane
WebTabbedPane from PaneData.


documentIndex

protected int documentIndex
Dragged away document index. Used to restore document position if drag is cancelled for some reason.


document

protected DocumentData document
Dragged document.

Constructor Detail

DocumentDragHandler

public DocumentDragHandler(PaneData paneData)
Constructs new DocumentDragHandler for the specified PaneData.

Parameters:
paneData - PaneData
Method Detail

getSourceActions

public int getSourceActions(javax.swing.JComponent c)

Overrides:
getSourceActions in class javax.swing.TransferHandler

exportAsDrag

public void exportAsDrag(javax.swing.JComponent comp,
                         java.awt.event.InputEvent e,
                         int action)

Overrides:
exportAsDrag in class javax.swing.TransferHandler

createTransferable

protected java.awt.datatransfer.Transferable createTransferable(javax.swing.JComponent c)

Overrides:
createTransferable in class javax.swing.TransferHandler

exportDone

protected void exportDone(javax.swing.JComponent source,
                          java.awt.datatransfer.Transferable data,
                          int action)

Overrides:
exportDone in class javax.swing.TransferHandler

canImport

public boolean canImport(javax.swing.TransferHandler.TransferSupport support)

Overrides:
canImport in class javax.swing.TransferHandler

importData

public boolean importData(javax.swing.TransferHandler.TransferSupport support)

Overrides:
importData in class javax.swing.TransferHandler

install

public static void install(PaneData paneData)
Quick drag handler installation method.

Parameters:
paneData - pane into which this drag handler should be installed