|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference 11g Release 1 (11.1.1) E13403-03 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface RowMap
A RowMap
is an interface for accessing the row
structure information of a BasicEditorPane
. This
allows clients to determine the row that an offset is on, the
starting and ending offset of a specific row, and the total number
of rows in the BasicEditorPane
. This interface is
somewhat analogous to the LineMap
interface for a
TextBuffer
, except that it applies to a visible "row"
of the editor view, instead of a "line" in the buffer model.
Client Usage Notes:
RowMap
as well as specified by the client.
For example, if there are 5 rows in the view, the rows will be
numbered 0 through 4, while getRowCount()
will return 5 rows.
getRowStartOffset(int)
are inclusive, while end offsets returned from
getRowEndOffset(int)
are exclusive. For example, if the first row of the view contains "abcd" followed followed by a newline (\n), then the start offset of the row will be 0, while the row offset will be 5. Note that the last character of a row may not necessarily be a line terminator, since buffer "lines" may span multiple view "rows".
getRowFromOffset(int)
, the offset given
has a forward bias. In the above example, offset 5
occurs between the newline (\n) of row 0 and the first
character of row 1. Since the bias is to the right,
getRowFromOffset( 5 )
will return row 1, not 0.
RowMap
tracks the underlying editor
view, it will be modified when the view receives notification
that the text buffer has been modified. To ensure data consistency,
clients must be sure to acquire at least a read lock on the
underlying buffer while accessing the RowMap
.
This is just a documented policy, and is not enforced
programmatically in order to not affect performance.
LineMap
,
BasicEditorPane
Method Summary | |
---|---|
BasicEditorPane |
getEditorPane()
Fetches the underlying BasicEditorPane that this row map
applies to. |
int |
getRowCount()
Fetches the number of rows in the view of this BasicEditorPane . |
int |
getRowEndOffset(int row)
Given a specified row in the editor view, returns the offset from the beginning of a TextBuffer that the row ends at. |
int |
getRowFromOffset(int offset)
Given an offset from the beginning of the underlying TextBuffer (data model), fetches the row number containing
that offset using a Forward bias. |
int |
getRowStartLine(int row)
Given a specified row in the editor view, returns the TextBuffer line which contains the starting offset
(Forward bias) of the row. |
int |
getRowStartOffset(int row)
Given a specified row in the editor view, returns the offset from the beginning of the TextBuffer (data model) for the start
of the row. |
Method Detail |
---|
BasicEditorPane getEditorPane()
BasicEditorPane
that this row map
applies to.
int getRowCount()
BasicEditorPane
. For example, a 5-row editor view has
rows 0 through 4.
int getRowFromOffset(int offset)
TextBuffer
(data model), fetches the row number containing
that offset using a Forward bias. This means if row A starts with
offset B, and previous row A-1 ends with offset B,
getRowFromOffset(B)
will return row A.
int getRowStartOffset(int row)
TextBuffer
(data model) for the start
of the row.
row
- a row in the editor view
int getRowEndOffset(int row)
TextBuffer
that the row ends at.
row
- a row in the editor viewthe
- ending offset of the specified rowint getRowStartLine(int row)
TextBuffer
line which contains the starting offset
(Forward bias) of the row.
row
- a row in the editor view
|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference 11g Release 1 (11.1.1) E13403-03 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |