Package com.myscript.iink
Class ContentSelection
java.lang.Object
com.myscript.iink.ContentSelection
- All Implemented Interfaces:
AutoCloseable
- Direct Known Subclasses:
ContentBlock
Represents a selection of content.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
protected void
finalize()
@NotNull Rectangle
getBox()
Returns the box that represents the position of this selection.@NotNull EnumSet<ConversionState>
Returns the current conversion state of this selection, as a set of ConversionState values.@Nullable ContentPart
getPart()
Returns the part that contains this selection.boolean
isClosed()
Tells whether theclose()
method has been called.boolean
isValid()
Tells whether this selection is still valid.@NotNull String
toString()
Returns a String representation of the object, with its part type and box.
-
Method Details
-
finalize
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
-
isClosed
public boolean isClosed()Tells whether theclose()
method has been called. Once an object is closed any method will throwIllegalStateException
.- Returns:
true
if this object is closed.
-
getPart
Returns the part that contains this selection.Note: do not close the returned object as it is owned by another entity.
- Returns:
- the content part.
- Throws:
IllegalStateException
- when this selection is closed.IllegalStateException
- when selection is invalid.
-
isValid
public boolean isValid()Tells whether this selection is still valid. A selection becomes invalid when it is removed or when the currently edited part changes (seeIEditorListener.partChanged(Editor)
.- Returns:
true
if this selection is valid.- Throws:
IllegalStateException
- when this selection is closed.
-
getBox
Returns the box that represents the position of this selection.- Returns:
- the selection (document coordinates in mm).
- Throws:
IllegalStateException
- when this selection is closed.IllegalStateException
- when selection is invalid.
-
getConversionState
Returns the current conversion state of this selection, as a set of ConversionState values.- Returns:
- the conversion state of this selection.
- Throws:
IllegalStateException
- when this selection is closed.IllegalStateException
- when selection is invalid.
-
toString
Returns a String representation of the object, with its part type and box.
-