Package org.eclipse.ui.console
Interface IConsoleDocumentPartitionerExtension
-
public interface IConsoleDocumentPartitionerExtension
Extension interface forIConsoleDocumentPartitioner
.It adds more possibilities to query read-only regions of the partitioned document.
- Since:
- 3.9
- See Also:
IConsoleDocumentPartitioner
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ITypedRegion[]
computeReadOnlyPartitions()
Returns all partitions which are read-only.ITypedRegion[]
computeReadOnlyPartitions(int offset, int length)
Returns all read-only partitions in given range.ITypedRegion[]
computeWritablePartitions()
Returns all partitions which are writable.ITypedRegion[]
computeWritablePartitions(int offset, int length)
Returns all writable partitions in given range.boolean
containsReadOnly(int offset, int length)
Returns whether this partitioner's document is read-only at any point in the specified range.int
getNextOffsetByState(int offset, boolean searchWritable)
Get this offset or the nearest offset after which is, depending on argument, writable or read-only.int
getPreviousOffsetByState(int offset, boolean searchWritable)
Get this offset or the nearest offset before which is, depending on argument, writable or read-only.boolean
isReadOnly(int offset, int length)
Returns whether this partitioner's document is read-only in the specified range.
-
-
-
Method Detail
-
computeReadOnlyPartitions
ITypedRegion[] computeReadOnlyPartitions()
Returns all partitions which are read-only.- Returns:
- all read-only partitions. Ordered by offset and never
null
.
-
computeReadOnlyPartitions
ITypedRegion[] computeReadOnlyPartitions(int offset, int length)
Returns all read-only partitions in given range.- Parameters:
offset
- the offset of the range of interestlength
- the length of the range of interest- Returns:
- read-only partitions in given range. Ordered by offset and never
null
. Returned regions may start and/or end outside given range.
-
computeWritablePartitions
ITypedRegion[] computeWritablePartitions()
Returns all partitions which are writable.- Returns:
- all writable partitions. Ordered by offset and never
null
.
-
computeWritablePartitions
ITypedRegion[] computeWritablePartitions(int offset, int length)
Returns all writable partitions in given range.- Parameters:
offset
- the offset of the range of interestlength
- the length of the range of interest- Returns:
- writable partitions in given range. Ordered by offset and never
null
. Returned regions may start and/or end outside given range.
-
isReadOnly
boolean isReadOnly(int offset, int length)
Returns whether this partitioner's document is read-only in the specified range. Only returnstrue
if the whole range is read-only.- Parameters:
offset
- document offsetlength
- range length- Returns:
- whether this partitioner's document is read-only in the specific range
-
containsReadOnly
boolean containsReadOnly(int offset, int length)
Returns whether this partitioner's document is read-only at any point in the specified range.- Parameters:
offset
- document offsetlength
- range length- Returns:
- returns
true
if any offset in the given range is read-only
-
getPreviousOffsetByState
int getPreviousOffsetByState(int offset, boolean searchWritable)
Get this offset or the nearest offset before which is, depending on argument, writable or read-only.- Parameters:
offset
- the offset of interestsearchWritable
- iftrue
return the nearest writable offset. Iffalse
return the nearest read-only offset.- Returns:
- the given offset if it has the requested read-only/writable state or
the nearest offset before with requested state. Returns
-1
if there is no offset with requested state before requested offset.
-
getNextOffsetByState
int getNextOffsetByState(int offset, boolean searchWritable)
Get this offset or the nearest offset after which is, depending on argument, writable or read-only.- Parameters:
offset
- the offset of interestsearchWritable
- iftrue
return the nearest writable offset. Iffalse
return the nearest read-only offset.- Returns:
- the given offset if it has the requested read-only/writable state or the nearest offset after with requested state. Returns the document length if there is no offset with requested state after requested offset.
-
-