org.das2.jythoncompletion.Utilities

Utilities( )


getLineNumberForOffset

getLineNumberForOffset( javax.swing.JTextArea a, int offset ) → int

return the line number that contains the offset.

Parameters

a - a JTextArea
offset - an int

Returns:

the line number, zero is the first line.

[search for examples] [view on GitHub] [view on old javadoc] [view source]


getRowEnd

getRowEnd( javax.swing.text.JTextComponent editor, int pos ) → int

return the offset of the last character of the line.

Parameters

editor - a JTextComponent
pos - an int

Returns:

an int

[search for examples] [view on GitHub] [view on old javadoc] [view source]

getRowEnd( javax.swing.JTextArea a, int offset ) → int

getRowStart

getRowStart( javax.swing.text.JTextComponent editor, int pos ) → int

return the offset of the first character of the line. See javax.swing.text.Utilities, it's the same thing.

Parameters

editor - a JTextComponent
pos - an int

Returns:

an int

[search for examples] [view on GitHub] [view on old javadoc] [view source]

getRowStart( javax.swing.JTextArea a, int offset ) → int

getWordAt

getWordAt( javax.swing.JTextPane logTextArea, int caret ) → String

look for adjacent whitespace to identify the word at the location.

Parameters

logTextArea - a JTextPane
caret - an int

Returns:

a String

[search for examples] [view on GitHub] [view on old javadoc] [view source]