com.levigo.jadice.swing.thumbnailview.dnd
Class DocumentUnmarshallerPageImportHandler

java.lang.Object
  extended by com.levigo.jadice.swing.thumbnailview.dnd.DocumentUnmarshallerPageImportHandler
All Implemented Interfaces:
ImportHandler
Direct Known Subclasses:
IntraDOCPPageImportHandler

public abstract class DocumentUnmarshallerPageImportHandler
extends Object
implements ImportHandler

An abstract implementation of an import handler importing pages from some serialized form that can be deserialized using a DocumentUnmarshaller.


Constructor Summary
DocumentUnmarshallerPageImportHandler()
           
 
Method Summary
protected  Document beforeImportDocument(Document doc)
          Give subclasses a chance to modify (or even replace) the document that has just been unmarshalled and is about to be imported.
 int getImportActionForFlavor(DataFlavor flavor, ImportParameters parameters)
          Returns the accepted DnD action for the given DataFlavor by this import handler.
 ReaderControls getReaderControls()
          Get the ReaderControls to be used during unmarshalling.
protected  InputStream getTransferDataAsStream(Transferable transferable, DataFlavor dataFlavor)
          Get the transfer data as a stream.
protected abstract  com.levigo.jadice.document.internal.marshalling.DocumentUnmarshaller getUnmarshaller(Transferable transferable, DataFlavor flavor, ImportParameters parameters)
          Return the unmarshaller to be used to unmarshal the data under the given conditions.
 boolean importData(Transferable t, int dropAction, ImportParameters parameters)
          Import from the given Transferable into the given ViewComponent.
 void setReaderControls(ReaderControls readerControls)
          Set the ReaderControls to be used during unmarshalling.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.levigo.jadice.swing.dnd.ImportHandler
isDataFlavorSupported
 

Constructor Detail

DocumentUnmarshallerPageImportHandler

public DocumentUnmarshallerPageImportHandler()
Method Detail

importData

public boolean importData(Transferable t,
                          int dropAction,
                          ImportParameters parameters)
                   throws IOException,
                          UnsupportedFlavorException,
                          JadiceException
Description copied from interface: ImportHandler
Import from the given Transferable into the given ViewComponent.

Specified by:
importData in interface ImportHandler
Parameters:
t - The Transferable to import
dropAction - the user drop action of the import
parameters - the import parameters containing additional context information
Returns:
true if the import succeeded
Throws:
IOException
UnsupportedFlavorException
JadiceException

beforeImportDocument

protected Document beforeImportDocument(Document doc)
Give subclasses a chance to modify (or even replace) the document that has just been unmarshalled and is about to be imported.

Parameters:
doc -
Returns:

getTransferDataAsStream

protected InputStream getTransferDataAsStream(Transferable transferable,
                                              DataFlavor dataFlavor)
                                       throws UnsupportedFlavorException,
                                              IOException
Get the transfer data as a stream. The following representation classes are supported by default:

Parameters:
transferable -
dataFlavor -
Returns:
Throws:
UnsupportedFlavorException
IOException

getUnmarshaller

protected abstract com.levigo.jadice.document.internal.marshalling.DocumentUnmarshaller getUnmarshaller(Transferable transferable,
                                                                                                        DataFlavor flavor,
                                                                                                        ImportParameters parameters)
Return the unmarshaller to be used to unmarshal the data under the given conditions.

Parameters:
transferable -
flavor -
parameters -
Returns:

getImportActionForFlavor

public int getImportActionForFlavor(DataFlavor flavor,
                                    ImportParameters parameters)
Description copied from interface: ImportHandler
Returns the accepted DnD action for the given DataFlavor by this import handler.

Specified by:
getImportActionForFlavor in interface ImportHandler
Parameters:
flavor - The flavor in which the transfer bundle will be provided when supported.
parameters - the import parameters containing additional context information
Returns:
int one of the DnDConstants action constants. Returns which DnD action will be accepted by this import handler for the given flavor. If the flavor is not supported DnDConstants.ACTION_NONE will be returned.
See Also:
ImportHandler.getImportActionForFlavor(java.awt.datatransfer.DataFlavor, ImportParameters)

getReaderControls

public ReaderControls getReaderControls()
Get the ReaderControls to be used during unmarshalling. Whether the ReaderSettings contained therein are used or not may depend on the file format and unmarshaller implementation.

Returns:
the reader controls

setReaderControls

public void setReaderControls(ReaderControls readerControls)
Set the ReaderControls to be used during unmarshalling. Whether the ReaderSettings contained therein are used or not may depend on the file format and unmarshaller implementation. In order to modify a particular set of ReaderSettings it is preferable to use getReaderControls().ProcessingControls.getSettings(Class) instead of using this method. Instead, this method should only be used to replace all controls with an already existing set of controls.

Parameters:
readerControls -


Copyright © 1995-2020 levigo holding gmbh. All Rights Reserved.