|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.fife.rtext.SyntaxFilters
public class SyntaxFilters
Manages a list of wildcard file filters and what syntax highlighting styles they map to.
Field Summary |
---|
Constructor Summary | |
---|---|
SyntaxFilters()
Creates a new SyntaxFilters with default values for
all filters. |
|
SyntaxFilters(java.lang.String filterStr)
Creates a new SyntaxFilters from the given string. |
Method Summary | |
---|---|
void |
addFileFilter(java.lang.String style,
java.lang.String filter)
Adds a file filter for a given syntax style. |
java.lang.String |
getFilterString(java.lang.String style)
Returns a list of all wildcard file filters associated with this syntax type, separated by spaces. |
java.lang.String |
getSyntaxStyleForFile(java.lang.String fileName,
boolean ignoreBackupExtensions)
Returns the type of syntax highlighting to use for the given text file based on its extension and the current filters. |
static boolean |
isValidFileFilterString(java.lang.String fileFilterString)
Returns true if and only if the file filter string passed
in is "valid". |
void |
restoreDefaultFileFilters()
Sets default values for syntax filters. |
void |
setFiltersForSyntaxStyle(java.lang.String style,
java.lang.String filterString)
Sets all file filters for a given syntax style. |
void |
setPreservingPluginAdded(SyntaxFilters filters)
Sets values for all the filters not added by plugins. |
java.lang.String |
toString()
Returns this object as a string. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public SyntaxFilters()
SyntaxFilters
with default values for
all filters.
public SyntaxFilters(java.lang.String filterStr)
SyntaxFilters
from the given string.
filterStr
- Must be a String
generated from
SyntaxFilter.toString()
. If its format is invalid,
then default filter strings are used for all syntax styles.Method Detail |
---|
public void addFileFilter(java.lang.String style, java.lang.String filter)
style
- The syntax style to add a file filter to.filter
- The filter to add. If null
, nothing will
be done.
java.lang.IllegalArgumentException
- If style
is invalid.public java.lang.String getFilterString(java.lang.String style)
*.cpp
and *.h
associated
with it, then getFilterString(SYNTAX_STYLE_CPLUSPLUS)
would return "*.cpp *.h"
.
style
- The syntax style to check.
java.lang.IllegalArgumentException
- If style
is invalid.public java.lang.String getSyntaxStyleForFile(java.lang.String fileName, boolean ignoreBackupExtensions)
fileName
- The file to syntax highlight.ignoreBackupExtensions
- Whether to ignore ".bak", ".old" and
".orig" extensions, if they exist.
SYNTAX_STYLE_JAVA
or
SYNTAX_STYLE_CPLUSPLUS
.RSyntaxTextArea
,
SyntaxConstants
public static boolean isValidFileFilterString(java.lang.String fileFilterString)
true
if and only if the file filter string passed
in is "valid". Currently valid file filter strings contain only the
following characters: A-Z, a-z, 0-9, '*', '?', '.', '-', '_', ' ', '$'.
fileFilterString
- The file filter string to test.
true
if the file filter string is valid, false
otherwise.public void restoreDefaultFileFilters()
public void setFiltersForSyntaxStyle(java.lang.String style, java.lang.String filterString)
style
- The syntax style to add a file filter to.filterString
- A string representing the file filters separated
by spaces. If null
, nothing happens.
java.lang.IllegalArgumentException
- If style
is invalid.public void setPreservingPluginAdded(SyntaxFilters filters)
filters
- The new values for filters.public java.lang.String toString()
toString
in class java.lang.Object
SyntaxFilters
.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |