satc
Class Syntax
java.lang.Object
|
+--satc.Syntax
- public class Syntax
- extends java.lang.Object
This class acts as a a portal to the SATC package, providing a collection
of utility methods that should cover the common usage of SATC.
Field Summary |
static boolean |
parseOnTheFly
Flag that enables the continuous reparsing of the text as it is typed. |
Method Summary |
static javax.swing.JTextArea |
createTextArea(java.lang.String syntaxName)
Returns a new textArea with syntax mode syntaxName . |
static java.lang.String |
getContentType(java.lang.String syntaxName)
Translates the syntax mode name to a MIME type. |
static void |
read(javax.swing.JTextArea textArea,
java.io.File f)
Load a textArea from a file. |
static void |
read(javax.swing.JTextArea textArea,
java.io.Reader in,
java.lang.String syntaxName)
Load a textArea from a Reader. |
static void |
register(SyntaxInfo info)
Register a new syntax mode. |
static void |
setFileFilters(javax.swing.JFileChooser fileChooser)
Installs file filters for all registered syntax modes. |
static void |
setSyntax(javax.swing.text.JTextComponent textArea,
java.lang.String syntaxName)
Set the syntax mode for a textArea. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
parseOnTheFly
public static boolean parseOnTheFly
- Flag that enables the continuous reparsing of the text as it is typed.
Default value is false, for reason of speed.
Syntax
public Syntax()
register
public static void register(SyntaxInfo info)
- Register a new syntax mode.
read
public static void read(javax.swing.JTextArea textArea,
java.io.Reader in,
java.lang.String syntaxName)
- Load a textArea from a Reader.
read
public static void read(javax.swing.JTextArea textArea,
java.io.File f)
- Load a textArea from a file.
createTextArea
public static javax.swing.JTextArea createTextArea(java.lang.String syntaxName)
- Returns a new textArea with syntax mode
syntaxName
.
setSyntax
public static void setSyntax(javax.swing.text.JTextComponent textArea,
java.lang.String syntaxName)
- Set the syntax mode for a textArea. The current content is preserved.
setFileFilters
public static void setFileFilters(javax.swing.JFileChooser fileChooser)
- Installs file filters for all registered syntax modes.
getContentType
public static java.lang.String getContentType(java.lang.String syntaxName)
- Translates the syntax mode name to a MIME type.