Gridarta Editor
net.sf.gridarta.textedit.textarea.TextAreaSelection Class Reference
+ Collaboration diagram for net.sf.gridarta.textedit.textarea.TextAreaSelection:

Public Member Functions

void disableSelectionIfEmpty ()
 
boolean getBiasLeft ()
 
int getCaretLine ()
 Returns the caret line. More...
 
int getCaretPosition ()
 Returns the caret position. More...
 
SyntaxDocument getDocument ()
 Returns the document this text area is editing. More...
 
int getDocumentLength ()
 Returns the length of the document. More...
 
int getLineCount ()
 Returns the number of lines in the document. More...
 
int getLineEndOffset (final int line)
 Returns the end offset of the specified line. More...
 
int getLineLength (final int line)
 Returns the length of the specified line. More...
 
int getLineOfOffset (final int offset)
 Returns the line containing the specified offset. More...
 
int getLineStartOffset (final int line)
 Returns the start offset of the specified line. More...
 
CharSequence getLineText (final int lineIndex)
 Returns the text on the specified line. More...
 
void getLineText (final int lineIndex, @NotNull final Segment segment)
 Copies the text on the specified line into a segment. More...
 
int getMarkPosition ()
 Returns the mark position. More...
 
String getSelectedText ()
 Returns the selected text, or null if no selection is active. More...
 
int getSelectionEnd ()
 Returns the selection end offset. More...
 
int getSelectionEndLine ()
 Returns the selection end line. More...
 
int getSelectionStart ()
 Returns the selection start offset. More...
 
int getSelectionStartLine ()
 Returns the selection start line. More...
 
String getText (final int start, final int len)
 Returns the specified substring of the document. More...
 
void getText (final int start, final int len, @NotNull final Segment segment)
 Copies the specified substring of the document into a segment. More...
 
String getText ()
 Returns the entire text of this text area. More...
 
TokenMarker getTokenMarker ()
 Returns the document's token marker. More...
 
boolean isSelectionRectangular ()
 Returns true if the selection is rectangular, false otherwise. More...
 
void setSelectedText (@NotNull final String selectedText)
 Replaces the selection with the specified text. More...
 
void setSelection (final int newStart, final int newEnd, final int newStartLine, final int newEndLine, final boolean newBias)
 
void setSelectionRectangular (final boolean rectangleSelect)
 Sets if the selection should be rectangular. More...
 
void setText (@NotNull final String text)
 Sets the entire text of this text area. More...
 
 TextAreaSelection (@NotNull final SyntaxDocument document)
 Creates a new instance. More...
 

Private Attributes

boolean biasLeft
 
final SyntaxDocument document
 The SyntaxDocument this selection is part of. More...
 
boolean rectangleSelect
 
int selectionEnd
 
int selectionEndLine
 
int selectionStart
 
int selectionStartLine
 

Detailed Description

Definition at line 29 of file TextAreaSelection.java.

Constructor & Destructor Documentation

◆ TextAreaSelection()

net.sf.gridarta.textedit.textarea.TextAreaSelection.TextAreaSelection ( @NotNull final SyntaxDocument  document)

Creates a new instance.

Parameters
documentthe document to select in

Definition at line 53 of file TextAreaSelection.java.

References net.sf.gridarta.textedit.textarea.TextAreaSelection.document.

Member Function Documentation

◆ disableSelectionIfEmpty()

void net.sf.gridarta.textedit.textarea.TextAreaSelection.disableSelectionIfEmpty ( )

Definition at line 171 of file TextAreaSelection.java.

Referenced by net.sf.gridarta.textedit.textarea.JEditTextArea.select().

+ Here is the caller graph for this function:

◆ getBiasLeft()

boolean net.sf.gridarta.textedit.textarea.TextAreaSelection.getBiasLeft ( )

Definition at line 85 of file TextAreaSelection.java.

References net.sf.gridarta.textedit.textarea.TextAreaSelection.biasLeft.

Referenced by net.sf.gridarta.textedit.textarea.JEditTextArea.select().

+ Here is the caller graph for this function:

◆ getCaretLine()

◆ getCaretPosition()

int net.sf.gridarta.textedit.textarea.TextAreaSelection.getCaretPosition ( )

◆ getDocument()

SyntaxDocument net.sf.gridarta.textedit.textarea.TextAreaSelection.getDocument ( )

Returns the document this text area is editing.

Definition at line 298 of file TextAreaSelection.java.

References net.sf.gridarta.textedit.textarea.TextAreaSelection.document.

Referenced by net.sf.gridarta.textedit.textarea.JEditTextArea.getDocument(), and net.sf.gridarta.textedit.textarea.TextAreaPainter.paint().

+ Here is the caller graph for this function:

◆ getDocumentLength()

int net.sf.gridarta.textedit.textarea.TextAreaSelection.getDocumentLength ( )

Returns the length of the document.

Equivalent to calling

getDocument().getLength()

.

Definition at line 315 of file TextAreaSelection.java.

Referenced by net.sf.gridarta.textedit.textarea.JEditTextArea.getDocumentLength().

+ Here is the caller graph for this function:

◆ getLineCount()

int net.sf.gridarta.textedit.textarea.TextAreaSelection.getLineCount ( )

◆ getLineEndOffset()

int net.sf.gridarta.textedit.textarea.TextAreaSelection.getLineEndOffset ( final int  line)

Returns the end offset of the specified line.

Parameters
linethe line
Returns
the end offset of the specified line, or -1 if the line is invalid

Definition at line 355 of file TextAreaSelection.java.

Referenced by net.sf.gridarta.textedit.textarea.JEditTextArea.MouseHandler.doTripleClick(), net.sf.gridarta.textedit.textarea.JEditTextArea.getLineEndOffset(), net.sf.gridarta.textedit.textarea.TextAreaSelection.getLineText(), and net.sf.gridarta.textedit.textarea.JEditTextArea.overwriteSetSelectedText().

+ Here is the caller graph for this function:

◆ getLineLength()

int net.sf.gridarta.textedit.textarea.TextAreaSelection.getLineLength ( final int  line)

Returns the length of the specified line.

Parameters
linethe line

Definition at line 368 of file TextAreaSelection.java.

Referenced by net.sf.gridarta.textedit.textarea.JEditTextArea.MouseHandler.doDoubleClick(), net.sf.gridarta.textedit.textarea.TextAreaPainter.paintLineHighlight(), and net.sf.gridarta.textedit.textarea.JEditTextArea.scrollToCaret().

+ Here is the caller graph for this function:

◆ getLineOfOffset()

int net.sf.gridarta.textedit.textarea.TextAreaSelection.getLineOfOffset ( final int  offset)

Returns the line containing the specified offset.

Parameters
offsetthe offset

Definition at line 330 of file TextAreaSelection.java.

Referenced by net.sf.gridarta.textedit.textarea.JEditTextArea.documentChanged(), net.sf.gridarta.textedit.textarea.JEditTextArea.select(), and net.sf.gridarta.textedit.textarea.JEditTextArea.updateBracketHighlight().

+ Here is the caller graph for this function:

◆ getLineStartOffset()

◆ getLineText() [1/2]

◆ getLineText() [2/2]

void net.sf.gridarta.textedit.textarea.TextAreaSelection.getLineText ( final int  lineIndex,
@NotNull final Segment  segment 
)

Copies the text on the specified line into a segment.

If the line is invalid, the segment will contain a null string.

Parameters
lineIndexthe line

Definition at line 421 of file TextAreaSelection.java.

References net.sf.gridarta.textedit.textarea.TextAreaSelection.getLineEndOffset(), net.sf.gridarta.textedit.textarea.TextAreaSelection.getLineStartOffset(), and net.sf.gridarta.textedit.textarea.TextAreaSelection.getText().

+ Here is the call graph for this function:

◆ getMarkPosition()

◆ getSelectedText()

String net.sf.gridarta.textedit.textarea.TextAreaSelection.getSelectedText ( )

Returns the selected text, or null if no selection is active.

Definition at line 126 of file TextAreaSelection.java.

References net.sf.gridarta.textedit.textarea.TextAreaSelection.getText(), and net.sf.gridarta.textedit.textarea.TextAreaSelection.selectionEndLine.

Referenced by net.sf.gridarta.textedit.textarea.JEditTextArea.copy(), and net.sf.gridarta.textedit.textarea.JEditTextArea.getSelectedText().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getSelectionEnd()

◆ getSelectionEndLine()

◆ getSelectionStart()

◆ getSelectionStartLine()

◆ getText() [1/3]

String net.sf.gridarta.textedit.textarea.TextAreaSelection.getText ( final int  start,
final int  len 
)

Returns the specified substring of the document.

Parameters
startthe start offset
lenthe length of the substring
Returns
the substring, or null if the offsets are invalid

Definition at line 185 of file TextAreaSelection.java.

Referenced by net.sf.gridarta.textedit.textarea.JEditTextArea.getText(), net.sf.gridarta.textedit.textarea.JEditTextArea.isModified(), and net.sf.gridarta.textedit.textarea.JEditTextArea.resetModified().

+ Here is the caller graph for this function:

◆ getText() [2/3]

void net.sf.gridarta.textedit.textarea.TextAreaSelection.getText ( final int  start,
final int  len,
@NotNull final Segment  segment 
)

Copies the specified substring of the document into a segment.

If the offsets are invalid, the segment will contain a null string.

Parameters
startthe start offset
lenthe length of the substring
segmentthe segment

Definition at line 201 of file TextAreaSelection.java.

◆ getText() [3/3]

String net.sf.gridarta.textedit.textarea.TextAreaSelection.getText ( )

Returns the entire text of this text area.

Definition at line 381 of file TextAreaSelection.java.

Referenced by net.sf.gridarta.textedit.textarea.TextAreaSelection.getLineText(), and net.sf.gridarta.textedit.textarea.TextAreaSelection.getSelectedText().

+ Here is the caller graph for this function:

◆ getTokenMarker()

TokenMarker net.sf.gridarta.textedit.textarea.TextAreaSelection.getTokenMarker ( )

Returns the document's token marker.

Equivalent to calling

.

Definition at line 307 of file TextAreaSelection.java.

References net.sf.gridarta.textedit.textarea.SyntaxDocument.getTokenMarker().

Referenced by net.sf.gridarta.textedit.textarea.TextAreaPainter.offsetToX2(), and net.sf.gridarta.textedit.textarea.TextAreaPainter.xToOffset().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isSelectionRectangular()

boolean net.sf.gridarta.textedit.textarea.TextAreaSelection.isSelectionRectangular ( )

Returns true if the selection is rectangular, false otherwise.

Definition at line 281 of file TextAreaSelection.java.

References net.sf.gridarta.textedit.textarea.TextAreaSelection.rectangleSelect.

Referenced by net.sf.gridarta.textedit.textarea.JEditTextArea.isSelectionRectangular(), and net.sf.gridarta.textedit.textarea.TextAreaPainter.paintLineHighlight().

+ Here is the caller graph for this function:

◆ setSelectedText()

void net.sf.gridarta.textedit.textarea.TextAreaSelection.setSelectedText ( @NotNull final String  selectedText)

Replaces the selection with the specified text.

Parameters
selectedTextthe replacement text for the selection

Definition at line 215 of file TextAreaSelection.java.

References net.sf.gridarta.textedit.textarea.SyntaxDocument.beginCompoundEdit(), net.sf.gridarta.textedit.textarea.SyntaxDocument.endCompoundEdit(), and net.sf.gridarta.textedit.textarea.TextAreaSelection.selectionEndLine.

Referenced by net.sf.gridarta.textedit.textarea.JEditTextArea.setSelectedText().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setSelection()

void net.sf.gridarta.textedit.textarea.TextAreaSelection.setSelection ( final int  newStart,
final int  newEnd,
final int  newStartLine,
final int  newEndLine,
final boolean  newBias 
)

Definition at line 114 of file TextAreaSelection.java.

Referenced by net.sf.gridarta.textedit.textarea.JEditTextArea.select().

+ Here is the caller graph for this function:

◆ setSelectionRectangular()

void net.sf.gridarta.textedit.textarea.TextAreaSelection.setSelectionRectangular ( final boolean  rectangleSelect)

Sets if the selection should be rectangular.

Parameters
rectangleSelecttrue if the selection should be rectangular, false otherwise

Definition at line 290 of file TextAreaSelection.java.

References net.sf.gridarta.textedit.textarea.TextAreaSelection.rectangleSelect.

Referenced by net.sf.gridarta.textedit.textarea.JEditTextArea.MouseHandler.doSingleClick(), and net.sf.gridarta.textedit.textarea.JEditTextArea.setSelectionRectangular().

+ Here is the caller graph for this function:

◆ setText()

void net.sf.gridarta.textedit.textarea.TextAreaSelection.setText ( @NotNull final String  text)

Sets the entire text of this text area.

Definition at line 393 of file TextAreaSelection.java.

References net.sf.gridarta.textedit.textarea.SyntaxDocument.beginCompoundEdit(), and net.sf.gridarta.textedit.textarea.SyntaxDocument.endCompoundEdit().

Referenced by net.sf.gridarta.textedit.textarea.JEditTextArea.setText().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ biasLeft

boolean net.sf.gridarta.textedit.textarea.TextAreaSelection.biasLeft
private

◆ document

final SyntaxDocument net.sf.gridarta.textedit.textarea.TextAreaSelection.document
private

◆ rectangleSelect

boolean net.sf.gridarta.textedit.textarea.TextAreaSelection.rectangleSelect
private

◆ selectionEnd

◆ selectionEndLine

◆ selectionStart

◆ selectionStartLine

int net.sf.gridarta.textedit.textarea.TextAreaSelection.selectionStartLine
private

The documentation for this class was generated from the following file: