|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.colorer.swt.TextColorer
public class TextColorer
StyledText listener implementation with syntax highlighting support using Colorer library. http://colorer.sf.net/
Field Summary | |
---|---|
static int |
HLS_OUTLINE
|
static int |
HLS_OUTLINE2
|
static int |
HLS_XOR
|
Constructor Summary | |
---|---|
TextColorer(ParserFactory pf,
ColorManager cm)
Common TextColorer creation constructor. |
Method Summary | |
---|---|
void |
addRegionHandler(RegionHandler rh)
Installs specified handler into parse process. |
void |
attach(StyledText parent)
Installs this highlighter into the specified StyledText object. |
FileType |
chooseFileType(java.lang.String filename)
Selects and installs coloring style (filetype) according to filename string and current first line of text. |
void |
detach()
Removes this object from the corresponding StyledText widget. |
BaseEditor |
getBaseEditor()
Returns current low-level BaseEditor object implementation |
LineRegion |
getCaretRegion()
Retrieves current LineRegion under caret. |
FileType |
getFileType()
Returns currently used file type. |
ParserFactory |
getParserFactory()
Returns currently used ParserFactory object |
int |
getVisibleEnd()
Returns visible text end line |
int |
getVisibleStart()
Returns visible text start line |
boolean |
matchPair()
Moves caret to the position of currently active pair. |
void |
modifyEvent(int lno)
Tells parser that there were some modifications in source text. |
boolean |
pairAvailable()
Checks if caret positioned on highlighted pair. |
void |
removeRegionHandler(RegionHandler rh)
Removes specified handler from the parse process. |
boolean |
selectContentPair()
Selects an internal part of the currently selected paired content |
boolean |
selectPair()
Selects a content of the currently positioned pair. |
void |
setCross(boolean horz,
boolean vert)
Specifies visibility of cross at the cursor position. |
void |
setFileType(FileType typename)
Selects and installs specified file type. |
void |
setFullBackground(boolean full)
Inlined languages background coloring. |
void |
setPairsPainter(boolean paint,
int style)
Paint paired constructions or not. |
void |
setRegionMapper(RegionMapper regionMapper,
boolean useBackground)
Changes style/coloring scheme into the specified. |
void |
setRegionMapper(java.lang.String hrdName,
boolean useBackground)
Changes style/coloring scheme into the specified. |
void |
stateChanged()
Informs colorer about visible state change of the editor |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int HLS_XOR
public static final int HLS_OUTLINE
public static final int HLS_OUTLINE2
Constructor Detail |
---|
public TextColorer(ParserFactory pf, ColorManager cm)
pf
- Parser factory, used to create all coloring text parsers.cm
- Color Manager, used to store cached color objectsMethod Detail |
---|
public void attach(StyledText parent)
public void detach()
public FileType chooseFileType(java.lang.String filename)
filename
- File name to be used to autodetect filetypepublic void setFileType(FileType typename)
typename
- Name or description of HRC filetype.public FileType getFileType()
public ParserFactory getParserFactory()
public BaseEditor getBaseEditor()
public void setRegionMapper(RegionMapper regionMapper, boolean useBackground)
regionMapper
- External RegionMapper objectuseBackground
- If true, native HRD background properties would be assigned to
colored StyledText.public void setRegionMapper(java.lang.String hrdName, boolean useBackground)
name
- Name of color scheme (HRD name).useBackground
- If true, native HRD background properties would be assigned to
colored StyledText.public void setFullBackground(boolean full)
full
- If true, background color of other language insertions (jsp,
php) would be painted till end of line. If false, only text
will be painted with marked color.public void setCross(boolean horz, boolean vert)
vert
- Not usedpublic void setPairsPainter(boolean paint, int style)
paint
- Paint Matched pairs or not.style
- One of TextColorer.HLS_XOR, TextColorer.HLS_OUTLINE or
TextColorer.HLS_OUTLINE2public boolean pairAvailable()
public boolean matchPair()
public boolean selectPair()
public boolean selectContentPair()
public int getVisibleStart()
public int getVisibleEnd()
public LineRegion getCaretRegion()
public void addRegionHandler(RegionHandler rh)
public void removeRegionHandler(RegionHandler rh)
public void stateChanged()
public void modifyEvent(int lno)
lno
- Modified line number
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |