|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.eclipse.swt.custom.DefaultLineStyler
Field Summary | |
(package private) StyledTextContent |
content
|
(package private) Color[] |
lineBackgrounds
|
(package private) int |
lineCount
|
(package private) int |
lineExpandExp
|
(package private) int |
styleCount
|
(package private) int |
styleExpandExp
|
(package private) StyleRange[] |
styles
|
Constructor Summary | |
DefaultLineStyler(StyledTextContent content)
Creates a new default line styler. |
Method Summary | |
(package private) void |
clearStyle(StyleRange clearStyle)
Removes style information that is defined for the range of text in clearStyle . |
(package private) void |
deleteStyle(int index)
Deletes the style at index . |
(package private) void |
deleteStyles(int index,
int count)
Delete count styles starting at index . |
(package private) void |
expandLinesBy(int numLines)
Increases the linebackgrounds array to accomodate new line background
information. |
(package private) Color |
getLineBackground(int index)
Returns the background color of a line. |
(package private) Point |
getOverlappingStyles(int start,
int length)
Returns the indexes of the styles that overlap the given range. |
(package private) StyleRange |
getStyleRangeAtOffset(int offset)
Returns the style for the character at offset . |
(package private) StyleRange[] |
getStyleRanges()
Returns the styles that are defined. |
(package private) StyleRange[] |
getStyleRangesFor(int offset,
int length)
Returns the styles for the given range. |
(package private) boolean |
insertMergeStyle(StyleRange style,
int index)
Inserts a style, merging it with adjacent styles if possible. |
(package private) void |
insertStyle(StyleRange style,
int index)
Inserts a style at the given location. |
(package private) void |
insertStyles(StyleRange[] insertStyles,
int index)
Insert the styles at the given location. |
void |
lineGetBackground(LineBackgroundEvent event)
Handles the get line background color callback. |
void |
lineGetStyle(LineStyleEvent event)
Handles the get line style information callback. |
(package private) void |
linesChanging(int start,
int delta)
|
(package private) boolean |
mergeStyleAfter(StyleRange style,
int index)
Merges the style with the style after it if possible. |
(package private) boolean |
mergeStyleBefore(StyleRange style,
int index)
Merges the style with the style before it if possible. |
(package private) void |
replaceStyleRanges(int start,
int length,
StyleRange[] ranges)
Replace the styles for the given range. |
(package private) int |
searchForStyle(int start,
int end)
Searches for the first style in the start - end range. |
(package private) void |
setLineBackground(int startLine,
int count,
Color background)
Updates the line background colors to reflect a new color. |
(package private) void |
setStyleRange(StyleRange newStyle)
Update the styles to reflect the new style. |
(package private) void |
setStyleRanges(StyleRange[] styles)
Sets the array of styles and discards old styles. |
(package private) void |
textChanging(int start,
int delta)
|
void |
textChanging(TextChangingEvent event)
Updates the style ranges and line backgrounds to reflect a pending text change. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
StyledTextContent content
StyleRange[] styles
int styleCount
int styleExpandExp
int lineExpandExp
int lineCount
Color[] lineBackgrounds
Constructor Detail |
public DefaultLineStyler(StyledTextContent content)
content
- the text to which the styles applyMethod Detail |
void insertStyle(StyleRange style, int index)
style
- the new styleindex
- the index at which to insert the style (the new style
will reside at this index)void insertStyles(StyleRange[] insertStyles, int index)
insertStyles
- the new stylesindex
- the index at which to insert the styles (the first new style
will reside at this index)boolean insertMergeStyle(StyleRange style, int index)
style
- the new styleindex
- the index at which to insert the style (the new style
will reside at this index)
boolean mergeStyleBefore(StyleRange style, int index)
style
- the new styleindex
- the index at which to attempt the merge.
boolean mergeStyleAfter(StyleRange style, int index)
style
- the new styleindex
- the index at which to attempt the merge.
void clearStyle(StyleRange clearStyle)
clearStyle
.
clearStyle
- the style information to use for clearingvoid expandLinesBy(int numLines)
linebackgrounds
array to accomodate new line background
information.
numLines
- the number to increase the array byvoid deleteStyle(int index)
index
.
index
- the index of the style to be deletedvoid deleteStyles(int index, int count)
index
.
index
- the index of the style to be deletedcount
- the number of styles to be deletedStyleRange[] getStyleRanges()
public void lineGetBackground(LineBackgroundEvent event)
lineGetBackground
in interface LineBackgroundListener
public void lineGetStyle(LineStyleEvent event)
lineGetStyle
in interface LineStyleListener
int searchForStyle(int start, int end)
start
- end
range.
void setLineBackground(int startLine, int count, Color background)
startLine
- index of the first line to colorbackground
- the background color for the linesvoid setStyleRange(StyleRange newStyle)
newStyle
will
replace any old style for the range. When this method is called, the
DefaultLineStyler may merge the new style with an existing style (if possible).
Called by StyledText when a style is added. Called by StyledText.
newStyle
- the new style information.void replaceStyleRanges(int start, int length, StyleRange[] ranges)
void setStyleRanges(StyleRange[] styles)
styles
- the new styles, must be in order and non-overlappingpublic void textChanging(TextChangingEvent event)
event
- the event with the text change informationvoid linesChanging(int start, int delta)
void textChanging(int start, int delta)
Point getOverlappingStyles(int start, int length)
Color getLineBackground(int index)
index
- the line index
StyleRange getStyleRangeAtOffset(int offset)
offset
. Called by StyledText.
Returns a new style. Does not return the existing style.
offset
- the character position in the text
StyleRange[] getStyleRangesFor(int offset, int length)
offset
- the start position of the text rangelength
- the length of the text range
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |