public abstract class DocumentUnmarshallerPageImportHandler extends Object implements ImportHandler
DocumentUnmarshaller
.Constructor and Description |
---|
DocumentUnmarshallerPageImportHandler() |
Modifier and Type | Method and Description |
---|---|
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 DocumentUnmarshaller |
getUnmarshaller(Transferable transferable,
DataFlavor flavor,
ImportParameters parameters) |
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. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
isDataFlavorSupported
public DocumentUnmarshallerPageImportHandler()
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 informationtrue
if the import succeededIOException
UnsupportedFlavorException
JadiceException
protected Document beforeImportDocument(Document 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)
protected abstract DocumentUnmarshaller getUnmarshaller(Transferable transferable, DataFlavor flavor, ImportParameters 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 informationint
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.Copyright © 2024 levigo holding gmbh. All rights reserved.