public class Editor extends java.lang.Object implements IAutoCloseable
ContentPart
Modifier and Type | Method and Description |
---|---|
ContentBlock |
addBlock(float x,
float y,
java.lang.String blockType)
Adds a new block to the part.
|
ContentBlock |
addBlock(float x,
float y,
java.lang.String blockType,
MimeType mimeType,
java.lang.String data)
Adds a new block to the part and fills it with data.
|
ContentBlock |
addImage(float x,
float y,
java.io.File inputFile,
MimeType mimeType)
Adds a new image to the part.
|
void |
addListener(IEditorListener listener)
Adds the specified listener to this editor.
|
boolean |
canRedo()
Tells whether redo can be performed on the part or not
|
boolean |
canUndo()
Tells whether undo can be performed on the part or not
|
void |
clampViewOffset(Point viewOffset)
Clamps the supplied view offset to the area that ensures standard scrolling
behavior.
|
void |
clear()
Removes all content from the part.
|
void |
close()
Deletes native counterpart of this auto closable object
|
void |
convert(ContentBlock block,
ConversionState targetState)
Converts the specified content to digital form.
|
void |
copy(ContentBlock block)
Copies a block to the internal clipboard.
|
void |
export_(ContentBlock block,
java.io.File outputFile,
IImageDrawer imageDrawer)
Deprecated.
use
export_(ContentBlock, String, IImageDrawer) instead. |
void |
export_(ContentBlock block,
java.io.File outputFile,
MimeType mimeType,
IImageDrawer imageDrawer)
Deprecated.
|
java.lang.String |
export_(ContentBlock block,
MimeType mimeType)
Exports the specified content.
|
java.lang.String |
export_(ContentBlock block,
MimeType mimeType,
ParameterSet overrideConfiguration)
Exports the specified content.
|
void |
export_(ContentBlock block,
java.io.OutputStream outputStream,
MimeType mimeType,
IImageDrawer imageDrawer)
Exports the specified content.
|
void |
export_(ContentBlock block,
java.io.OutputStream outputStream,
MimeType mimeType,
IImageDrawer imageDrawer,
ParameterSet overrideConfiguration)
Exports the specified content.
|
void |
export_(ContentBlock block,
java.lang.String outputFileName,
IImageDrawer imageDrawer)
Exports the specified content.
|
void |
export_(ContentBlock block,
java.lang.String outputFileName,
IImageDrawer imageDrawer,
ParameterSet overrideConfiguration)
Exports the specified content.
|
void |
export_(ContentBlock block,
java.lang.String outputFileName,
MimeType mimeType,
IImageDrawer imageDrawer)
Exports the specified content.
|
void |
export_(ContentBlock block,
java.lang.String outputFileName,
MimeType mimeType,
IImageDrawer imageDrawer,
ParameterSet overrideConfiguration)
Exports the specified content.
|
ContentBlock |
getBlockById(java.lang.String id)
Returns the content block associated with a given
id . |
Configuration |
getConfiguration()
Returns the configuration associated with this editor.
|
Engine |
getEngine()
Returns the
Engine to which this editor is attached. |
ContentPart |
getPart()
Returns the part managed by this editor.
|
java.lang.String |
getPenStyle()
Returns the style properties associated with new strokes.
|
java.lang.String |
getPenStyleClasses()
Returns the style classes associated with new strokes.
|
int |
getPossibleRedoCount()
The number of operations that can be redo.
|
int |
getPossibleUndoCount()
The number of operations that can be undone.
|
Renderer |
getRenderer()
Returns the
Renderer associated with this editor. |
ContentBlock |
getRootBlock()
Returns the content block at the root of the current part.
|
MimeType[] |
getSupportedAddBlockDataMimeTypes(java.lang.String type)
Returns the supported formats for adding a new block with data.
|
java.lang.String[] |
getSupportedAddBlockTypes()
Returns the types of blocks that can be added to the part.
|
MimeType[] |
getSupportedExportMimeTypes(ContentBlock block)
Returns the supported export formats for specified content.
|
MimeType[] |
getSupportedImportMimeTypes(ContentBlock block)
Returns the supported import formats for specified content.
|
ConversionState[] |
getSupportedTargetConversionStates(ContentBlock block)
Returns the supported target conversion states for the specified content.
|
java.lang.String |
getTheme()
Returns the rendering theme style sheet, in CSS format.
|
java.lang.String |
getUndoRedoIdAt(int stackIndex)
Returns the id of an undo or redo action, based on its position in the stack index.
|
int |
getUndoStackIndex()
Returns the number of operations performed on the part, since content part
was opened.
|
int |
getViewHeight()
The height of the view.
|
int |
getViewWidth()
The width of the view.
|
ContentBlock |
hitBlock(float x,
float y)
Return the block at the given position, or
null if there is no
block at that position. |
void |
import_(MimeType mimeType,
java.lang.String data,
ContentBlock block)
Imports data into the part or a block.
|
boolean |
isClosed()
Tells whether the
close() method has been called. |
boolean |
isEmpty(ContentBlock block)
Checks whether a block is empty.
|
boolean |
isIdle()
Checks whether part modification operations are over.
|
boolean |
isScrollAllowed()
Checks whether scrolling on the part is allowed at this time.
|
java.util.Map<java.lang.String,Style> |
listStyleClasses(IPredicate<java.lang.String> predicate)
Lists the style classes that match a given predicate, associated with their
styling properties.
|
void |
paste(float x,
float y)
Pastes the content of the internal clipboard at a given position.
|
void |
pointerCancel(int pointerId)
Cancels an ongoing pointer trace.
|
java.lang.String |
pointerDown(float x,
float y,
long t,
float f,
PointerType pointerType,
int pointerId)
Registers a pointer down event.
|
void |
pointerEvents(PointerEvent[] events,
boolean processGestures)
Registers a list of pointer events.
|
void |
pointerMove(float x,
float y,
long t,
float f,
PointerType pointerType,
int pointerId)
Registers a pointer move event.
|
void |
pointerUp(float x,
float y,
long t,
float f,
PointerType pointerType,
int pointerId)
Registers a pointer up event.
|
void |
redo()
Redo the last action reverted by
undo on part. |
void |
removeBlock(ContentBlock block)
Removes a block from the part.
|
void |
removeListener(IEditorListener listener)
Removes the specified listener from this editor.
|
void |
setFontMetricsProvider(IFontMetricsProvider fontMetricsProvider)
Sets a font metrics provider to this editor.
|
void |
setPart(ContentPart part)
Sets the part managed by this editor.
|
void |
setPenStyle(java.lang.String styleProperties)
Sets the CSS style properties associated with new strokes.
|
void |
setPenStyleClasses(java.lang.String styleClasses)
Sets the style classes associated with new strokes.
|
void |
setTheme(java.lang.String styleSheet)
Changes the rendering theme style sheet, from a buffer containing
CSS styling information.
|
void |
setViewSize(int width,
int height)
Sets the size of the view.
|
void |
undo()
Undo the last action on part.
|
void |
waitForIdle()
Waits until part modification operations are over.
|
public void close()
IAutoCloseable
close
in interface IAutoCloseable
public final boolean isClosed()
close()
method has been called. Once an object
is closed any method will throw IllegalStateException
.true
if this object is closed.public final void addListener(IEditorListener listener)
listener
- the listener to be added.java.lang.IllegalStateException
- when this editor is closed.java.lang.IllegalArgumentException
- when `listener` is null.public final void removeListener(IEditorListener listener)
listener
- the listener to be removed.java.lang.IllegalStateException
- when this editor is closed.java.lang.IllegalArgumentException
- when `listener` is null.public final void setFontMetricsProvider(IFontMetricsProvider fontMetricsProvider)
fontMetricsProvider
- a IFontMetricsProvider
.java.lang.IllegalStateException
- when this editor is closed.public final Engine getEngine()
Engine
to which this editor is attached.public final Renderer getRenderer()
Renderer
associated with this editor.public final ContentPart getPart()
public final void setPart(ContentPart part)
part
- the part.java.lang.IllegalStateException
- when this editor is closed.java.lang.IllegalStateException
- when no IFontMetricsProvider
has been set, via setFontMetricsProvider(IFontMetricsProvider)
).public final void clear()
java.lang.IllegalStateException
- when this editor is closed.public final boolean canUndo()
true
if undo can be performed, otherwise
false
.java.lang.IllegalStateException
- when this editor is closed.public final void undo()
java.lang.IllegalStateException
- when this editor is closed.java.lang.IllegalStateException
- when undo operations failed.public final boolean canRedo()
true
if redo can be performed, otherwise
false
.java.lang.IllegalStateException
- when this editor is closed.public final void redo()
undo
on part.java.lang.IllegalStateException
- when this editor is closed.java.lang.IllegalStateException
- when redo operations failed.public final int getUndoStackIndex()
java.lang.IllegalStateException
- when this editor is closed.public final int getPossibleUndoCount()
java.lang.IllegalStateException
- when this editor is closed.public final int getPossibleRedoCount()
java.lang.IllegalStateException
- when this editor is closed.public final java.lang.String getUndoRedoIdAt(int stackIndex)
stackIndex
- the index in the stack of the undo/redo action to retrieve..java.lang.IllegalStateException
- when this editor is closed.java.lang.IllegalStateException
- when stackIndex
is invalid.public final java.lang.String pointerDown(float x, float y, long t, float f, PointerType pointerType, int pointerId)
x
- pointer event x coordinate.y
- pointer event y coordinate.t
- pointer event timestamp, in ms since Unix EPOCH.f
- normalized pressure.pointerType
- the type of input.pointerId
- the id of the pointer.null
.java.lang.IllegalStateException
- when this editor is closed.java.lang.NullPointerException
- when pointerType
is null.java.lang.IllegalArgumentException
- when x
is not a number.java.lang.IllegalArgumentException
- when y
is not a number.java.lang.IllegalArgumentException
- when t
exceeds year 9999.java.lang.IllegalArgumentException
- when f
is not a number.java.lang.IllegalArgumentException
- when f
is negative.java.lang.IllegalStateException
- when pointerDown()
has already
been called.java.lang.IllegalStateException
- in "Text Document" parts, when no view size is set.public final void pointerMove(float x, float y, long t, float f, PointerType pointerType, int pointerId)
x
- pointer event x coordinate.y
- pointer event y coordinate.t
- pointer event timestamp, in ms since Unix EPOCH.f
- normalized pressure.pointerType
- the type of input.pointerId
- the id of the pointer.java.lang.IllegalStateException
- when this editor is closed.java.lang.NullPointerException
- when pointerType
is null.java.lang.IllegalArgumentException
- when x
is not a number.java.lang.IllegalArgumentException
- when y
is not a number.java.lang.IllegalArgumentException
- when t
exceeds year 9999.java.lang.IllegalArgumentException
- when f
is not a number.java.lang.IllegalArgumentException
- when f
is negative.java.lang.IllegalStateException
- when pointerDown()
has not been
called before.public final void pointerUp(float x, float y, long t, float f, PointerType pointerType, int pointerId)
x
- pointer event x coordinate.y
- pointer event y coordinate.t
- pointer event timestamp, in ms since Unix EPOCH.f
- normalized pressure.pointerType
- the type of input.pointerId
- the id of the pointer.java.lang.IllegalStateException
- when this editor is closed.java.lang.NullPointerException
- when pointerType
is null.java.lang.IllegalArgumentException
- when x
is not a number.java.lang.IllegalArgumentException
- when y
is not a number.java.lang.IllegalArgumentException
- when t
exceeds year 9999.java.lang.IllegalArgumentException
- when f
is not a number.java.lang.IllegalArgumentException
- when f
is negative.java.lang.IllegalStateException
- when pointerDown()
has not been
called before.public final void pointerCancel(int pointerId)
pointerId
- the id of the pointer.java.lang.IllegalStateException
- when this editor is closed.java.lang.IllegalStateException
- when pointerDown()
has not been
called before.public final void pointerEvents(PointerEvent[] events, boolean processGestures)
events
- the list of events.processGestures
- tells whether to process gestures or not.java.lang.IllegalStateException
- when this editor is closed.java.lang.IllegalArgumentException
- when a pointer event contains incorrect data.java.lang.IllegalStateException
- when event sequence is not allowed.public final void setViewSize(int width, int height)
width
- the view width.height
- the view height.java.lang.IllegalStateException
- when this editor is closed.java.lang.IllegalArgumentException
- when width
or height
is negative.public final int getViewWidth()
java.lang.IllegalStateException
- when this editor is closed.public final int getViewHeight()
java.lang.IllegalStateException
- when this editor is closed.public void clampViewOffset(Point viewOffset)
viewOffset
- the view offset to clamp.public final void setTheme(java.lang.String styleSheet)
styleSheet
- the style sheet, in CSS format.public final java.lang.String getTheme()
public final void setPenStyleClasses(java.lang.String styleClasses)
Note: style properties provided via setPenStyle()
may override the
styling associated with the style classes provided here.
styleClasses
- the style class names associated with new strokes,
by spaces.java.lang.IllegalStateException
- when this editor is closed.public final java.lang.String getPenStyleClasses()
Note: style properties provided with setPenStyle()
may override the
styling associated with the style classes provided here.
java.lang.IllegalStateException
- when this editor is closed.public final void setPenStyle(java.lang.String styleProperties)
Note: style properties provided with setPenStyle()
may override the properties
associated with the style classes provided via setPenStyleClasses()
.
styleProperties
- the CSS style properties associated with new strokes.java.lang.IllegalStateException
- when this editor is closed.public final java.lang.String getPenStyle()
java.lang.IllegalStateException
- when this editor is closed.public final java.util.Map<java.lang.String,Style> listStyleClasses(IPredicate<java.lang.String> predicate)
predicate
- a function that checks style class names and returns
true
if class should be added to the returned map,
otherwise false
.java.lang.IllegalStateException
- when this editor is closed.public final ContentBlock getRootBlock()
public final ContentBlock getBlockById(java.lang.String id)
id
.id
- the identifier of the block.id
or
null
if there is no such block in the current part.public final boolean isEmpty(ContentBlock block)
block
- the block to check, null
means check the full part.true
if block is empty or invalid or editor is not
associated with a part, otherwise false
.public final java.lang.String[] getSupportedAddBlockTypes()
Note: new blocks can be added only to a content part with type "Text Document".
"Text" blocks are automatically created but other blocks must be
added via addBlock(float, float, String)
. Blocks cannot be added
on other types of part.
java.lang.IllegalStateException
- when this editor is closed.public final MimeType[] getSupportedAddBlockDataMimeTypes(java.lang.String type)
type
- the type of the new block.public final ContentBlock addBlock(float x, float y, java.lang.String blockType)
x
- the approximate x position of the new block.y
- the approximate y position of the new block.blockType
- the type of the new block.java.lang.IllegalStateException
- when this editor is closed.java.lang.IllegalArgumentException
- if type is not supported by current part
type.java.lang.IllegalStateException
- if editor is not configured.java.lang.IllegalStateException
- if a block already exists at this position,
and is not a "Container" block.java.lang.IllegalStateException
- if empty space around position is too small
for a new block.public final ContentBlock addBlock(float x, float y, java.lang.String blockType, MimeType mimeType, java.lang.String data)
x
- the approximate x position of the new block.y
- the approximate y position of the new block.blockType
- the type of the new block.mimeType
- the mime type that specifies the format of data
.data
- the data to put in the new block.java.lang.IllegalStateException
- when this editor is closed.java.lang.IllegalStateException
- if type is not supported by current part
type.java.lang.IllegalStateException
- if editor is not configured.java.lang.IllegalStateException
- if a block already exists at this position,
and is not a "Container" block.java.lang.IllegalStateException
- if empty space around position is too small
for a new block.java.lang.IllegalStateException
- when the content of data could not be added
to the new block.public final ContentBlock addImage(float x, float y, java.io.File inputFile, MimeType mimeType) throws java.lang.NullPointerException, java.lang.IllegalArgumentException, java.io.IOException
Note: this method creates a new "Drawing" block in which the image will be added.
x
- the approximate x position of the new image.y
- the approximate y position of the new image.inputFile
- the image file to add.mimeType
- the mime type that specifies the format of `inputFile`.java.lang.IllegalStateException
- when this editor is closed.java.lang.IllegalStateException
- if editor is not configured.java.lang.NullPointerException
- if mimeType
is null.java.lang.NullPointerException
- if inputFile
is null.java.lang.IllegalArgumentException
- if the mime type is not an image format.java.lang.IllegalStateException
- if a block already exists at this position,
and is not a "Container" block.java.lang.IllegalStateException
- if empty space around position is too small
for a new block.java.io.IOException
- if an I/O operation fails.public final void removeBlock(ContentBlock block)
Note: the root block cannot be removed.
block
- the block to remove.java.lang.IllegalStateException
- when this editor is closed.java.lang.IllegalArgumentException
- if block is a root block.java.lang.IllegalStateException
- if editor is not configured.public final ContentBlock hitBlock(float x, float y)
null
if there is no
block at that position.x
- the hit position x coordinate.y
- the hit position y coordinate.null
if no block was
found.java.lang.IllegalStateException
- when this editor is closed.public final ConversionState[] getSupportedTargetConversionStates(ContentBlock block)
block
- the block for which the supported target conversion states
are requested, null
means convert full part.public final void convert(ContentBlock block, ConversionState targetState)
block
- the block to convert, null
means convert full
part.targetState
- the target conversion state for the block.java.lang.IllegalStateException
- when this editor is closed.java.lang.IllegalStateException
- if editor is not configured.java.lang.IllegalArgumentException
- when the target conversion state is not
reachable from the current state of the specified block.public final MimeType[] getSupportedExportMimeTypes(ContentBlock block)
block
- the block to request, null
means full part.java.lang.IllegalStateException
- when this editor is closed.public final java.lang.String export_(ContentBlock block, MimeType mimeType) throws java.lang.NullPointerException, java.lang.IllegalArgumentException, java.lang.IllegalStateException, java.lang.UnsupportedOperationException, java.io.IOException
block
- the block to export, null
means export full part.mimeType
- the mime type that specifies the output format.java.lang.IllegalStateException
- when this editor is closed.java.lang.NullPointerException
- if mimeType
is null.java.lang.IllegalArgumentException
- if the mime type is not a textual format.java.lang.UnsupportedOperationException
- if the specified mime type is not
supported.java.io.IOException
- if an I/O operation fails.java.lang.IllegalStateException
- when there are some ongoing operations on
the part that prevent export, see isIdle()
.public final void export_(ContentBlock block, java.io.OutputStream outputStream, MimeType mimeType, IImageDrawer imageDrawer) throws java.lang.NullPointerException, java.lang.IllegalStateException, java.lang.UnsupportedOperationException, java.io.IOException
block
- the block to export, null
means export full part.outputStream
- the stream to export to.mimeType
- the MIME type that specifies the desired output format.imageDrawer
- an image drawer that is required for some output
formats. If you know that the specified output format doesn't
require it you can leave it null.java.lang.IllegalStateException
- when this editor is closed.java.lang.NullPointerException
- if outputStream
is null.java.lang.NullPointerException
- if mimeType
is null.java.lang.UnsupportedOperationException
- if the specified mime type is not
supported.java.io.IOException
- if an I/O operation fails.java.lang.IllegalStateException
- when there are some ongoing operations on
the part that prevent export, see isIdle()
.public final void export_(ContentBlock block, java.io.OutputStream outputStream, MimeType mimeType, IImageDrawer imageDrawer, ParameterSet overrideConfiguration) throws java.lang.NullPointerException, java.lang.IllegalStateException, java.lang.UnsupportedOperationException, java.io.IOException
block
- the block to export, null
means export full part.outputStream
- the stream to export to.mimeType
- the MIME type that specifies the desired output format.imageDrawer
- an image drawer that is required for some output
formats. If you know that the specified output format doesn't
require it you can leave it null.overrideConfiguration
- the extra configuration used when exporting.java.lang.IllegalStateException
- when this editor is closed.java.lang.NullPointerException
- if outputStream
is null.java.lang.NullPointerException
- if mimeType
is null.java.lang.UnsupportedOperationException
- if the specified mime type is not
supported.java.io.IOException
- if an I/O operation fails.java.lang.IllegalStateException
- when there are some ongoing operations on
the part that prevent export, see isIdle()
.@Deprecated public final void export_(ContentBlock block, java.io.File outputFile, IImageDrawer imageDrawer) throws java.lang.NullPointerException, java.lang.IllegalArgumentException, java.lang.IllegalStateException, java.lang.UnsupportedOperationException, java.io.IOException
export_(ContentBlock, String, IImageDrawer)
instead.block
- the block to export, null
means export full part.outputFile
- the file to export to.imageDrawer
- an image drawer that is required for some output
formats. If you know that the specified output format doesn't
require it you can leave it null.java.lang.IllegalStateException
- when this editor is closed.java.lang.NullPointerException
- if outputFile
is null.java.lang.IllegalArgumentException
- if the mime type can't be determined from
the output file name.java.lang.UnsupportedOperationException
- if the specified mime type is not
supported.java.io.IOException
- if an I/O operation fails.java.lang.IllegalStateException
- when there are some ongoing operations on
the part that prevent export, see isIdle()
.@Deprecated public final void export_(ContentBlock block, java.io.File outputFile, MimeType mimeType, IImageDrawer imageDrawer) throws java.lang.NullPointerException, java.lang.IllegalStateException, java.lang.UnsupportedOperationException, java.io.IOException
export_(ContentBlock, String, MimeType, IImageDrawer)
instead.block
- the block to export, null
means export full part.outputFile
- the file to export to.mimeType
- the mime type that specifies the output format.imageDrawer
- an image drawer that is required for some output
formats. If you know that the specified output format doesn't
require it you can leave it null.java.lang.IllegalStateException
- when this editor is closed.java.lang.NullPointerException
- if outputFile
is null.java.lang.NullPointerException
- if mimeType
is null.java.lang.UnsupportedOperationException
- if the specified mime type is not
supported.java.io.IOException
- if an I/O operation fails.java.lang.IllegalStateException
- when there are some ongoing operations on
the part that prevent export, see isIdle()
.public final void export_(ContentBlock block, java.lang.String outputFileName, IImageDrawer imageDrawer) throws java.lang.NullPointerException, java.lang.IllegalArgumentException, java.lang.IllegalStateException, java.lang.UnsupportedOperationException, java.io.IOException
block
- the block to export, null
means export full part.outputFileName
- the name of the file to export to.imageDrawer
- an image drawer that is required for some output
formats. If you know that the specified output format doesn't
require it you can leave it null.java.lang.IllegalStateException
- when this editor is closed.java.lang.NullPointerException
- if outputFileName
is null.java.lang.IllegalArgumentException
- if outputFileName
is invalid.java.lang.IllegalArgumentException
- if the mime type can't be determined from
the output file name.java.lang.UnsupportedOperationException
- if the specified mime type is not
supported.java.io.IOException
- if an I/O operation fails.java.lang.IllegalStateException
- when there are some ongoing operations on
the part that prevent export, see isIdle()
.public final void export_(ContentBlock block, java.lang.String outputFileName, MimeType mimeType, IImageDrawer imageDrawer) throws java.lang.NullPointerException, java.lang.IllegalStateException, java.lang.UnsupportedOperationException, java.io.IOException
block
- the block to export, null
means export full part.outputFileName
- the name of the file to export to.mimeType
- the mime type that specifies the output format.imageDrawer
- an image drawer that is required for some output
formats. If you know that the specified output format doesn't
require it you can leave it null.java.lang.IllegalStateException
- when this editor is closed.java.lang.NullPointerException
- if outputFileName
is null.java.lang.IllegalArgumentException
- if outputFileName
is invalid.java.lang.NullPointerException
- if mimeType
is null.java.lang.UnsupportedOperationException
- if the specified mime type is not
supported.java.io.IOException
- if an I/O operation fails.java.lang.IllegalStateException
- when there are some ongoing operations on
the part that prevent export, see isIdle()
.public final java.lang.String export_(ContentBlock block, MimeType mimeType, ParameterSet overrideConfiguration) throws java.lang.NullPointerException, java.lang.IllegalArgumentException, java.lang.IllegalStateException, java.lang.UnsupportedOperationException, java.io.IOException
block
- the block to export, null
means export full part.mimeType
- the mime type that specifies the output format.overrideConfiguration
- the extra configuration used when exporting.java.lang.IllegalStateException
- when this editor is closed.java.lang.NullPointerException
- if mimeType
is null.java.lang.IllegalArgumentException
- if the mime type is not a textual format.java.lang.IllegalStateException
- if there is nothing to export.java.lang.UnsupportedOperationException
- if the specified mime type is not
supported.java.io.IOException
- if an I/O operation fails.java.lang.IllegalStateException
- when there are some ongoing operations on
the part that prevent export, see isIdle()
.java.lang.IllegalArgumentException
- if overrideConfiguration
is invalid.public final void export_(ContentBlock block, java.lang.String outputFileName, IImageDrawer imageDrawer, ParameterSet overrideConfiguration) throws java.lang.NullPointerException, java.lang.IllegalArgumentException, java.io.IOException
block
- the block to export, null
means export full part.outputFileName
- the name of the file to export to.imageDrawer
- an image drawer that is required for some output
formats. If you know that the specified output format doesn't
require it you can leave it null.overrideConfiguration
- the extra configuration used when exporting.java.lang.IllegalStateException
- when this editor is closed.java.lang.NullPointerException
- if outputFileName
is null.java.lang.IllegalArgumentException
- if outputFileName
is invalid.java.lang.IllegalArgumentException
- if the mime type can't be determined from
the output file name.java.lang.IllegalStateException
- if there is nothing to export.java.lang.UnsupportedOperationException
- if the specified mime type is not
supported.java.io.IOException
- if an I/O operation fails.java.lang.IllegalStateException
- when there are some ongoing operations on
the part that prevent export, see isIdle()
.java.lang.IllegalArgumentException
- if overrideConfiguration
is invalid.public final void export_(ContentBlock block, java.lang.String outputFileName, MimeType mimeType, IImageDrawer imageDrawer, ParameterSet overrideConfiguration) throws java.lang.NullPointerException, java.lang.IllegalStateException, java.lang.UnsupportedOperationException, java.io.IOException
block
- the block to export, null
means export full part.outputFileName
- the name of the file to export to.mimeType
- the mime type that specifies the output format.imageDrawer
- an image drawer that is required for some output
formats. If you know that the specified output format doesn't
require it you can leave it null.overrideConfiguration
- the extra configuration used when exporting.java.lang.IllegalStateException
- when this editor is closed.java.lang.NullPointerException
- if outputFileName
is null.java.lang.IllegalArgumentException
- if outputFileName
is invalid.java.lang.NullPointerException
- if mimeType
is null.java.lang.IllegalStateException
- if there is nothing to export.java.lang.UnsupportedOperationException
- if the specified mime type is not
supported.java.io.IOException
- if an I/O operation fails.java.lang.IllegalStateException
- when there are some ongoing operations on
the part that prevent export, see isIdle()
.java.lang.IllegalArgumentException
- if overrideConfiguration
is invalid.public final MimeType[] getSupportedImportMimeTypes(ContentBlock block)
block
- the block to request, null
means full part.java.lang.IllegalStateException
- when this editor is closed.public final void import_(MimeType mimeType, java.lang.String data, ContentBlock block) throws java.lang.IllegalStateException
mimeType
- the mime type that specifies the format of `data`.data
- the data to import.block
- the target content block, or nullptr.java.lang.IllegalStateException
- when this editor is closed.java.lang.IllegalStateException
- when the specified mime type is not supported.java.lang.IllegalStateException
- when data
could not be imported.public final void copy(ContentBlock block) throws java.lang.IllegalStateException
block
- the block to copy, null
means full part.java.lang.IllegalStateException
- when this editor is closed.public final void paste(float x, float y) throws java.lang.IllegalStateException
copy(ContentBlock)
. If internal
clipboard is empty, this does nothing.
Note: Following limitation applies: the part managed by this editor must be a "Text Document" and clipboard must contain a single block, that is not a "Container", from a "Text Document".
x
- the target pasted block x coordinate.y
- the target pasted block y coordinate.java.lang.IllegalStateException
- when this editor is closed.java.lang.IllegalStateException
- when content of the clipboard cannot be pasted
on the part.public final boolean isIdle()
true
if there are no pending operations.public final void waitForIdle()
public final boolean isScrollAllowed()
true
if scrolling is allowed.public final Configuration getConfiguration()
Note: don't close the returned object as it is owned by the editor.