|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.levigo.jadice.swing.thumbnailview.dnd.DocumentUnmarshallerPageImportHandler
public abstract class DocumentUnmarshallerPageImportHandler
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 |
---|
public DocumentUnmarshallerPageImportHandler()
Method Detail |
---|
public boolean importData(Transferable t, int dropAction, ImportParameters parameters) throws IOException, UnsupportedFlavorException, JadiceException
ImportHandler
Transferable
into the given ViewComponent
.
importData
in interface ImportHandler
t
- The Transferable
to importdropAction
- the user drop action
of the
importparameters
- the import parameters containing additional context information
true
if the import succeeded
IOException
UnsupportedFlavorException
JadiceException
protected Document beforeImportDocument(Document doc)
doc
-
protected InputStream getTransferDataAsStream(Transferable transferable, DataFlavor dataFlavor) throws UnsupportedFlavorException, IOException
ByteBuffer
: payload data transferred directly via the transferable as a byte buffer
InputStream
: payload data transferred directly via the transferable as an input
stream
File
: payload data transferred via a filesystem-accessible file
URL
: payload data transferred via a URL-based service (e.g. HTTP)
transferable
- dataFlavor
-
UnsupportedFlavorException
IOException
protected abstract com.levigo.jadice.document.internal.marshalling.DocumentUnmarshaller getUnmarshaller(Transferable transferable, DataFlavor flavor, ImportParameters parameters)
transferable
- flavor
- parameters
-
public int getImportActionForFlavor(DataFlavor flavor, ImportParameters parameters)
ImportHandler
DataFlavor
by this import handler.
getImportActionForFlavor
in interface ImportHandler
flavor
- The flavor in which the transfer bundle will be provided when supported.parameters
- the import parameters containing additional context information
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.ImportHandler.getImportActionForFlavor(java.awt.datatransfer.DataFlavor,
ImportParameters)
public ReaderControls getReaderControls()
ReaderControls
to be used during unmarshalling. Whether the
ReaderSettings
contained therein are used or not may depend on the file format and
unmarshaller implementation.
public void setReaderControls(ReaderControls readerControls)
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.
readerControls
-
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |