|
Extension SDK 10.1.2 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object oracle.javatools.editor.Utilities
The Utilities
just defines convenient utility routines.
Constructor Summary | |
Utilities()
|
Method Summary | |
static int |
clearBit(int value,
int flag)
Returns the value with the indicated bit flag off. |
static int |
getColumnFromOffset(TextBuffer textBuffer,
int offset,
int tabSize)
Fetches the column (0-based) of the given offset in the buffer based on a certain tab size. |
static int |
getColumnFromOffset(TextBuffer textBuffer,
int line,
int offset,
int tabSize)
Fetches the column (0-based) of the given offset in the buffer based on a certain tab size. |
static int |
getNextTabStop(int tabSize,
int startColumn)
Fetches the next tab stop (column) based on the given tab size and start column. |
static int |
getNextWordEnd(BasicDocument document,
int offset)
Determines the next occurrence of the end of a word for the given location. |
static int |
getNextWordStart(BasicDocument document,
int offset)
Determines the next occurrence of the start of a word for the given location. |
static int |
getOffsetFromColumn(TextBuffer textBuffer,
int line,
int column,
int tabSize)
Fetches the offset corresponding to a given line and column (both 0-based) and given tab size. |
static int |
getPreviousWordEnd(BasicDocument document,
int offset)
Determines the previous occurrence of the end of a word for the given location. |
static int |
getPreviousWordStart(BasicDocument document,
int offset)
Determines the previous occurrence of the start of a word for the given location. |
static int |
getRowEnd(BasicDocument document,
int offset)
Determines the ending row model position of the row that contains the specified model position. |
static int |
getRowStart(BasicDocument document,
int offset)
Determines the starting row model position of the row that contains the specified model position. |
static int |
getTextWidth(TextBuffer textBuffer,
int startOffset,
int endOffset,
int tabSize,
int startColumn)
Fetches the width of the given range of text in the text buffer in columns (not pixels.) This will take into account any tabs in the text and what the specified tab size is. |
static int |
getWordEnd(BasicDocument document,
int offset)
Determines the end of a word for the given location. |
static int |
getWordStart(BasicDocument document,
int offset)
Determines the start of a word for the given model location. |
static int |
setBit(int value,
int flag)
Returns the value with the indicated bit flag on. |
static boolean |
testBit(int value,
int flag)
Determines whether the given bit flag (i.e., 0x0001000) is set in the value. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Utilities()
Method Detail |
public static int getTextWidth(TextBuffer textBuffer, int startOffset, int endOffset, int tabSize, int startColumn)
textBuffer
- the text buffer the data is instartOffset
- the start of the range of text (inclusive)endOffset
- the end of the range of text (exclusive)tabSize
- the tab size or tab stop (i.e., tab size 4)startColumn
- the current column that startOffset corresponds to
public static int getNextTabStop(int tabSize, int startColumn)
tabSize
- the current tab sizestartColumn
- the starting columnpublic static int getColumnFromOffset(TextBuffer textBuffer, int offset, int tabSize)
textBuffer
- the text buffer of the dataoffset
- the offset to maptabSize
- the current tab size
public static int getColumnFromOffset(TextBuffer textBuffer, int line, int offset, int tabSize)
textBuffer
- the text buffer of the dataline
- the line the data is contained onoffset
- the offset to maptabSize
- the current tab size
public static int getOffsetFromColumn(TextBuffer textBuffer, int line, int column, int tabSize)
textBuffer
- the text buffer of the dataline
- the line the text is on (which we are trying to map)column
- the column we are trying to maptabSize
- the current tab sizepublic static int getRowStart(BasicDocument document, int offset)
document
- the documentoffset
- the offset in the document >= 0
public static int getRowEnd(BasicDocument document, int offset)
document
- the documentoffset
- the offset in the document >= 0
public static int getWordStart(BasicDocument document, int offset)
document
- the documentoffset
- offset in the document >= 0public static int getWordEnd(BasicDocument document, int offset)
document
- the documentoffset
- offset in the document >= 0public static int getNextWordStart(BasicDocument document, int offset)
document
- the documentoffset
- offset in the document >= 0public static int getNextWordEnd(BasicDocument document, int offset)
document
- the documentoffset
- offset in the document >= 0public static int getPreviousWordStart(BasicDocument document, int offset)
document
- the documentoffset
- offset in the document >= 0
public static int getPreviousWordEnd(BasicDocument document, int offset)
document
- the documentoffset
- offset in the document >= 0public static boolean testBit(int value, int flag)
value
- value to testflag
- the bit flag to test for
public static int setBit(int value, int flag)
value
- value to set the bit inflag
- the bit flag to turn on
public static int clearBit(int value, int flag)
value
- value to clear the bit inflag
- the bit flag to clear
|
Extension SDK | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 1997, 2004, Oracle. All rights reserved.