|
Eclipse Platform 2.0 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.eclipse.jface.text.TextPresentation
Describes the presentation styles for a section of an indexed text such as a document or string. A text presentation defines a default style for the whole section and in addition style differences for individual subsections. Text presentations can be narrowed down to a particular result window. All methods are result window aware, i.e. ranges outside the result window are always ignored.
All iterators provided by a text presentation assume that they enumerate
non overlapping, consequtive ranges inside the default range. Thus, all
these iterators do not include the default range. The default style range
must be explicitly asked for using getDefaultStyleRange
.
Constructor Summary | |
TextPresentation()
Creates a new empty text presentation. |
Method Summary | |
void |
addStyleRange(StyleRange range)
Add the given range to the presentation. |
static void |
applyTextPresentation(TextPresentation presentation,
StyledText text)
Applies the given presentation to the given text widget. |
void |
clear()
Clears this presentation by resetting all applied changes. |
Iterator |
getAllStyleRangeIterator()
Returns an iterator which enumerates all style ranges of this presentation except the default style range. |
IRegion |
getCoverage()
Returns the coverage of this presentation as clipped by the presentation's result window. |
StyleRange |
getDefaultStyleRange()
Returns this presentation's default style range. |
int |
getDenumerableRanges()
Returns the number of style ranges in the presentation not counting the default style range. |
StyleRange |
getFirstStyleRange()
Returns the style range with the smallest offset ignoring the default style range or null if the presentation is empty. |
StyleRange |
getLastStyleRange()
Returns the style range with the highest offset ignoring the default style range. |
Iterator |
getNonDefaultStyleRangeIterator()
Returns an iterator which enumerates all style ranged which define a style different from the presentation's default style range. |
boolean |
isEmpty()
Returns whether this collection contains any style range including the default style range. |
void |
setDefaultStyleRange(StyleRange range)
Set the default style range of this presentation. |
void |
setResultWindow(IRegion resultWindow)
Sets the result window for this presentation. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public TextPresentation()
Method Detail |
public static void applyTextPresentation(TextPresentation presentation, StyledText text)
presentation
- the style informationpublic void setResultWindow(IRegion resultWindow)
resultWindow
- the result windowpublic void setDefaultStyleRange(StyleRange range)
range
- the range decribing the default regionpublic StyleRange getDefaultStyleRange()
StyleRange
is relative to the start of the result window.
public void addStyleRange(StyleRange range)
range
- the range to be addedpublic Iterator getNonDefaultStyleRangeIterator()
public Iterator getAllStyleRangeIterator()
StyleRange
s
are relative to the start of the presentation's result window.
public boolean isEmpty()
true
if there is no style range in this presentationpublic int getDenumerableRanges()
public StyleRange getFirstStyleRange()
public StyleRange getLastStyleRange()
public IRegion getCoverage()
public void clear()
|
Eclipse Platform 2.0 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |