Module jEdit

Class Selection

java.lang.Object
org.gjt.sp.jedit.textarea.Selection
All Implemented Interfaces:
Cloneable
Direct Known Subclasses:
Selection.Range, Selection.Rect

public abstract class Selection extends Object implements Cloneable
An abstract class that holds data on a region of selected text. As an abstract class, it cannot be used directly, but instead serves as a parent class for two specific types of selection structures:
Since:
jEdit 3.2pre1
Version:
$Id: Selection.java 25283 2020-04-22 08:37:19Z kpouer $
Author:
Slava Pestov, John Gellene (API documentation)
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
    An ordinary range selection.
    static class 
    A rectangular selection.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
     
    protected
    Selection(int start, int end)
     
    protected
    Selection(int startLine, int start, int endLine, int end)
     
    protected
     
  • Method Summary

    Modifier and Type
    Method
    Description
     
    int
    Returns the end offset of this selection.
    abstract int
    getEnd(JEditBuffer buffer, int line)
    Returns the end of the portion of the selection falling on the specified line.
    int
    Returns the ending line number of this selection.
    int
    Returns the start offset of this selection.
    abstract int
    getStart(JEditBuffer buffer, int line)
    Returns the beginning of the portion of the selection falling on the specified line.
    int
    Returns the starting line number of this selection.
    boolean
    Returns if this selection and the specified selection overlap.
     

    Methods inherited from class java.lang.Object

    equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • Selection

      protected Selection()
    • Selection

      protected Selection(Selection sel)
    • Selection

      protected Selection(int start, int end)
    • Selection

      protected Selection(int startLine, int start, int endLine, int end)
  • Method Details

    • getStart

      public int getStart()
      Returns the start offset of this selection.
    • getEnd

      public int getEnd()
      Returns the end offset of this selection.
    • getStart

      public abstract int getStart(JEditBuffer buffer, int line)
      Returns the beginning of the portion of the selection falling on the specified line. Used to manipulate selection text on a line-by-line basis.
      Parameters:
      buffer - The buffer
      line - The line number
      Since:
      jEdit 4.1pre1
    • getEnd

      public abstract int getEnd(JEditBuffer buffer, int line)
      Returns the end of the portion of the selection falling on the specified line. Used to manipulate selection text on a line-by-line basis.
      Parameters:
      buffer - The buffer
      line - The line number
      Since:
      jEdit 4.1pre1
    • getStartLine

      public int getStartLine()
      Returns the starting line number of this selection.
    • getEndLine

      public int getEndLine()
      Returns the ending line number of this selection.
    • overlaps

      public boolean overlaps(Selection s)
      Returns if this selection and the specified selection overlap.
      Parameters:
      s - The other selection
      Since:
      jEdit 4.1pre1
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • clone

      public Object clone()
      Overrides:
      clone in class Object