Class ContentSelection

java.lang.Object
com.myscript.iink.ContentSelection
All Implemented Interfaces:
AutoCloseable
Direct Known Subclasses:
ContentBlock

public class ContentSelection extends Object implements AutoCloseable
Represents a selection of content.
  • Method Details

    • finalize

      protected void finalize() throws Throwable
      Overrides:
      finalize in class Object
      Throws:
      Throwable
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
    • isClosed

      public boolean isClosed()
      Tells whether the close() method has been called. Once an object is closed any method will throw IllegalStateException.
      Returns:
      true if this object is closed.
    • getPart

      @Nullable public @Nullable ContentPart 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 (see IEditorListener.partChanged(Editor).
      Returns:
      true if this selection is valid.
      Throws:
      IllegalStateException - when this selection is closed.
    • toString

      @NotNull public @NotNull String toString()
      Returns a String representation of the object, with its part type.
      Overrides:
      toString in class Object
      Returns:
      the representation of the object.
      Since:
      2.1