|
Eclipse Platform Release 3.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, consecutive 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. | |
TextPresentation(int sizeHint)
Creates a new empty text presentation. | |
TextPresentation(IRegion extent,
int sizeHint)
Creates a new empty text presentation with the given extent. |
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. |
IRegion | getExtent()
Returns the extent of this presentation clipped by the presentation's result window. |
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 | mergeStyleRange(StyleRange range)
Merges the given range into this presentation. |
void | mergeStyleRanges(StyleRange[] ranges)
Merges the given ranges into this presentation. |
void | replaceStyleRange(StyleRange range)
Replaces the given range in this presentation. |
void | replaceStyleRanges(StyleRange[] ranges)
Replaces the given ranges in this presentation. |
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()
public TextPresentation(int sizeHint)
public TextPresentation(IRegion extent, int sizeHint)
Method Detail |
public static void applyTextPresentation(TextPresentation presentation, StyledText text)
public void setResultWindow(IRegion resultWindow)
public void setDefaultStyleRange(StyleRange range)
public StyleRange getDefaultStyleRange()
public void addStyleRange(StyleRange range)
public void replaceStyleRange(StyleRange range)
public void mergeStyleRange(StyleRange range)
public void replaceStyleRanges(StyleRange[] ranges)
public void mergeStyleRanges(StyleRange[] ranges)
public Iterator getNonDefaultStyleRangeIterator()
public Iterator getAllStyleRangeIterator()
public boolean isEmpty()
public int getDenumerableRanges()
public StyleRange getFirstStyleRange()
public StyleRange getLastStyleRange()
public IRegion getCoverage()
public IRegion getExtent()
public void clear()
|
Eclipse Platform Release 3.0 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Guidelines for using Eclipse APIs.
Copyright (c) IBM Corp. and others 2000, 2004. All rights reserved.