Package adams.gui.scripting
Class SyntaxDocument
- java.lang.Object
-
- javax.swing.text.AbstractDocument
-
- javax.swing.text.DefaultStyledDocument
-
- adams.gui.scripting.SyntaxDocument
-
- All Implemented Interfaces:
Serializable
,Document
,StyledDocument
public class SyntaxDocument extends DefaultStyledDocument
Highlights syntax in a DefaultStyledDocument. Allows any number of keywords to be formatted in any number of user-defined styles. Multiple sets of keywords can be defined with a properties file, each with different colors. The first set of keywords is listed under the heading 'Keywords', with the corresponding color 'KeywordColor'. All subsequent sets use the same headings as the first but with their number attached: 'Keywords2', 'KeywordColor2'; 'Keywords3', KeywordColor3'; etc.- Author:
- Rob Camick (primary author; java sun forums user 'camickr'), David Underhill, FracPete (fracpete at waikato dot ac dot nz) - use of a properties file to setup syntax highlighting instead of hard-coded
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SyntaxDocument.ATTR_TYPE
The attribute type.-
Nested classes/interfaces inherited from class javax.swing.text.DefaultStyledDocument
DefaultStyledDocument.AttributeUndoableEdit, DefaultStyledDocument.ElementBuffer, DefaultStyledDocument.ElementSpec, DefaultStyledDocument.SectionElement
-
Nested classes/interfaces inherited from class javax.swing.text.AbstractDocument
AbstractDocument.AbstractElement, AbstractDocument.AttributeContext, AbstractDocument.BranchElement, AbstractDocument.Content, AbstractDocument.DefaultDocumentEvent, AbstractDocument.ElementEdit, AbstractDocument.LeafElement
-
-
Field Summary
Fields Modifier and Type Field Description static SimpleAttributeSet
DEFAULT_COMMENT
the attribute set for comments.static String
DEFAULT_FONT_FAMILY
the font family.static int
DEFAULT_FONT_SIZE
the font size.static SimpleAttributeSet
DEFAULT_KEYWORD
the attribute set for keywords.static SimpleAttributeSet
DEFAULT_NORMAL
the attribute set for normal code.static SimpleAttributeSet
DEFAULT_STRING
the attribute set for strings.protected boolean
m_AddMatchingEndBlocks
whether to add matching brackets.protected Color
m_BackgroundColor
the background color.protected String
m_BlockEnd
the end of a block.protected String
m_BlockStart
the start of a block.protected boolean
m_CaseSensitive
whether keywords are case-sensitive.protected String
m_Delimiters
the delimiters.protected String
m_FontName
the font name.protected int
m_FontSize
the font size.protected String
m_Indentation
the number of spaces used for indentation.protected boolean
m_InsideMultiLineComment
whether we're currently in a multi-line comment.protected HashMap<String,MutableAttributeSet>
m_Keywords
the keywords.protected boolean
m_MultiLineComment
whether multi-line comments are enabled.protected String
m_MultiLineCommentEnd
the multi-line comment end.protected String
m_MultiLineCommentStart
the multi-line comment start.protected String
m_QuoteDelimiters
the quote delimiter.protected String
m_QuoteEscape
the quote escape.protected Element
m_RootElement
the root element.protected DefaultStyledDocument
m_Self
the document.protected boolean
m_SingleLineComment
whether single-line comments are enabled.protected String
m_SingleLineCommentStart
the single-line comment start.protected boolean
m_UseBlanks
whether to use blanks instead of tabs.static int
MAX_TABS
the maximum number of tabs.-
Fields inherited from class javax.swing.text.DefaultStyledDocument
buffer, BUFFER_SIZE_DEFAULT
-
Fields inherited from class javax.swing.text.AbstractDocument
BAD_LOCATION, BidiElementName, ContentElementName, ElementNameAttribute, listenerList, ParagraphElementName, SectionElementName
-
Fields inherited from interface javax.swing.text.Document
StreamDescriptionProperty, TitleProperty
-
-
Constructor Summary
Constructors Constructor Description SyntaxDocument(Properties props)
Initializes the document.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addKeyword(String keyword, MutableAttributeSet attr)
Associates a keyword with a particular formatting style.void
addKeywords(String[] keywords, MutableAttributeSet attr)
Associates the keywords with a particular formatting style.protected String
addMatchingBlockEnd(int offset)
Adds the matching block end.protected void
applyHighlighting(String content, int line)
Parse the line to determine the appropriate highlighting.protected void
checkForTokens(String content, int startOffset, int endOffset)
Parse the line for tokens to highlight.protected void
commentLinesAfter(String content, int line)
Highlight comment lines to matching end delimiter.protected boolean
commentLinesBefore(String content, int line)
Highlight lines when a multi line comment is still 'open' (ie.protected boolean
endingMultiLineComment(String content, int startOffset, int endOffset)
Does this line contain the end delimiter of a multi-line comment.String
escapeQuote(String quoteDelimiter)
Escapes the quote delimiter.boolean
getAddMatchingEndBlocks()
Returns whether matching block ends are inserted or not.Color
getBackgroundColor()
Returns the background color.String
getBlockEnd()
Returns the end of a block.String
getBlockStart()
Returns the start of a block.boolean
getCaseSensitive()
Returns whether blanks are used instead of tabs.String
getDelimiters()
Returns the delimiter characters to use.String
getFontName()
gets the current font family.int
getFontSize()
gets the current font size.int
getIndentationSize()
Returns the number of blanks used for indentation.MutableAttributeSet
getKeywordFormatting(String keyword)
Gets the formatting for a keyword.protected String
getLine(String content, int offset)
Returns the line.boolean
getMultiLineComment()
Returns whether multi-line comments are enabled.String
getMultiLineCommentEnd()
Returns the end of a multi-line comment.String
getMultiLineCommentStart()
Returns the string that is the start of a multi-line comment.protected int
getOtherToken(String content, int startOffset, int endOffset)
Searches for a keyword token.String
getQuoteDelimiters()
Returns the quote delimiter characters to use.String
getQuoteEscape()
Returns the character for escaping a quote delimiter.protected int
getQuoteToken(String content, int startOffset, int endOffset)
Searches for a quote token.boolean
getSingleLineComment()
Returns whether single-line comments are enabled.String
getSingleLineCommentStart()
Retrusn the single line comment start string.boolean
getUseBlanks()
Returns whether blanks are used instead of tabs.protected void
highlightLinesAfter(String content, int line)
Highlight lines to start or end delimiter.protected int
indexOf(String content, String needle, int offset)
Assume the needle will the found at the start/end of the line.void
insertString(int offset, String str, AttributeSet a)
Override to apply syntax highlighting after the document has been updated.boolean
isDelimiter(String character)
Checks whether the character is a delimiter.protected boolean
isMultiLineComment()
We have found a start delimiter and are still searching for the end delimiter.boolean
isQuoteDelimiter(String character)
Checks whether the character is quote delimiter.protected int
lastIndexOf(String content, String needle, int offset)
Assume the needle will the found at the start/end of the line.void
processChangedLines(int offset, int length)
Determine how many lines have been changed, then apply highlighting to each line.void
remove(int offset, int length)
Applies syntax highlighting after the document has been updated.void
removeKeyword(String keyword)
Removes an association between a keyword with a particular formatting style.void
setAddMatchingEndBlocks(boolean value)
Sets whether matching block ends are inserted or not.void
setAttributeColor(SyntaxDocument.ATTR_TYPE attr, Color c)
Sets the foreground (font) color of the specified attribute.static void
setAttributeColor(MutableAttributeSet attr, Color c)
Sets the foreground (font) color of the specified attribute.void
setAttributeFont(SyntaxDocument.ATTR_TYPE attr, int style)
Sets the font of the specified attribute.static void
setAttributeFont(MutableAttributeSet attr, Font f)
Sets the font of the specified attribute.void
setBackgroundColor(Color value)
Sets the background color.void
setBlockEnd(String value)
Sets the string that is the end of a block.void
setBlockStart(String value)
Sets the string that is the start of a block.void
setCaseSensitive(boolean value)
Sets whether the keywords are case-sensitive or not.void
setDelimiters(String value)
Sets the delimiter characters to use.void
setFontName(String fontName)
sets the current font family (affects all built-in styles).void
setFontSize(int fontSize)
sets the current font size (affects all built-in styles).void
setIndentationSize(int value)
Sets the number of blanks to use for indentation.protected void
setInsideMultiLineComment(boolean value)
Sets whether we're currently within a multi-line comment or not.void
setMultiLineComment(boolean value)
Sets whether to enable multi-line comments.void
setMultiLineCommentEnd(String value)
Sets the string that is the end of a multi-line comment.void
setMultiLineCommentStart(String value)
Sets the string that is the start of a multi-line comment.void
setQuoteDelimiters(String value)
Sets the quote delimiter characters to use.void
setQuoteEscape(String value)
Sets the character to use for escaping a quote character.void
setSingleLineComment(boolean value)
Sets whether to enable single-line comments.void
setSingleLineCommentStart(String value)
Sets the string that is the start of a single-line comment.void
setTabs(int charactersPerTab)
sets the number of characters per tab.protected void
setup(Properties props)
Sets up the document according to the properties.void
setUseBlanks(boolean value)
Sets whether to use blanks instead of tabs.protected boolean
startingMultiLineComment(String content, int startOffset, int endOffset)
Does this line contain the start of a multi-line comment.-
Methods inherited from class javax.swing.text.DefaultStyledDocument
addDocumentListener, addStyle, create, createDefaultRoot, getBackground, getCharacterElement, getDefaultRootElement, getFont, getForeground, getLogicalStyle, getParagraphElement, getStyle, getStyleNames, insert, insertUpdate, removeDocumentListener, removeElement, removeStyle, removeUpdate, setCharacterAttributes, setLogicalStyle, setParagraphAttributes, styleChanged
-
Methods inherited from class javax.swing.text.AbstractDocument
addUndoableEditListener, createBranchElement, createLeafElement, createPosition, dump, fireChangedUpdate, fireInsertUpdate, fireRemoveUpdate, fireUndoableEditUpdate, getAsynchronousLoadPriority, getAttributeContext, getBidiRootElement, getContent, getCurrentWriter, getDocumentFilter, getDocumentListeners, getDocumentProperties, getEndPosition, getLength, getListeners, getProperty, getRootElements, getStartPosition, getText, getText, getUndoableEditListeners, postRemoveUpdate, putProperty, readLock, readUnlock, removeUndoableEditListener, render, replace, setAsynchronousLoadPriority, setDocumentFilter, setDocumentProperties, writeLock, writeUnlock
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface javax.swing.text.Document
addUndoableEditListener, createPosition, getEndPosition, getLength, getProperty, getRootElements, getStartPosition, getText, getText, putProperty, removeUndoableEditListener, render
-
-
-
-
Field Detail
-
MAX_TABS
public static final int MAX_TABS
the maximum number of tabs.- See Also:
- Constant Field Values
-
DEFAULT_FONT_FAMILY
public static final String DEFAULT_FONT_FAMILY
the font family.- See Also:
- Constant Field Values
-
DEFAULT_FONT_SIZE
public static final int DEFAULT_FONT_SIZE
the font size.- See Also:
- Constant Field Values
-
DEFAULT_NORMAL
public static final SimpleAttributeSet DEFAULT_NORMAL
the attribute set for normal code.
-
DEFAULT_COMMENT
public static final SimpleAttributeSet DEFAULT_COMMENT
the attribute set for comments.
-
DEFAULT_STRING
public static final SimpleAttributeSet DEFAULT_STRING
the attribute set for strings.
-
DEFAULT_KEYWORD
public static final SimpleAttributeSet DEFAULT_KEYWORD
the attribute set for keywords.
-
m_Self
protected DefaultStyledDocument m_Self
the document.
-
m_RootElement
protected Element m_RootElement
the root element.
-
m_InsideMultiLineComment
protected boolean m_InsideMultiLineComment
whether we're currently in a multi-line comment.
-
m_Keywords
protected HashMap<String,MutableAttributeSet> m_Keywords
the keywords.
-
m_Delimiters
protected String m_Delimiters
the delimiters.
-
m_QuoteDelimiters
protected String m_QuoteDelimiters
the quote delimiter.
-
m_QuoteEscape
protected String m_QuoteEscape
the quote escape.
-
m_MultiLineCommentStart
protected String m_MultiLineCommentStart
the multi-line comment start.
-
m_MultiLineCommentEnd
protected String m_MultiLineCommentEnd
the multi-line comment end.
-
m_SingleLineCommentStart
protected String m_SingleLineCommentStart
the single-line comment start.
-
m_BlockStart
protected String m_BlockStart
the start of a block.
-
m_BlockEnd
protected String m_BlockEnd
the end of a block.
-
m_FontSize
protected int m_FontSize
the font size.
-
m_FontName
protected String m_FontName
the font name.
-
m_BackgroundColor
protected Color m_BackgroundColor
the background color.
-
m_Indentation
protected String m_Indentation
the number of spaces used for indentation.
-
m_AddMatchingEndBlocks
protected boolean m_AddMatchingEndBlocks
whether to add matching brackets.
-
m_UseBlanks
protected boolean m_UseBlanks
whether to use blanks instead of tabs.
-
m_MultiLineComment
protected boolean m_MultiLineComment
whether multi-line comments are enabled.
-
m_SingleLineComment
protected boolean m_SingleLineComment
whether single-line comments are enabled.
-
m_CaseSensitive
protected boolean m_CaseSensitive
whether keywords are case-sensitive.
-
-
Constructor Detail
-
SyntaxDocument
public SyntaxDocument(Properties props)
Initializes the document.- Parameters:
props
- the properties to obtain the setup from
-
-
Method Detail
-
setup
protected void setup(Properties props)
Sets up the document according to the properties.- Parameters:
props
- the properties to use
-
setAttributeFont
public void setAttributeFont(SyntaxDocument.ATTR_TYPE attr, int style)
Sets the font of the specified attribute.- Parameters:
attr
- the attribute to apply this font to (normal, comment, string)style
- font style (Font.BOLD, Font.ITALIC, Font.PLAIN)
-
setAttributeFont
public static void setAttributeFont(MutableAttributeSet attr, Font f)
Sets the font of the specified attribute.- Parameters:
attr
- attribute to apply this font tof
- the font to use
-
setAttributeColor
public void setAttributeColor(SyntaxDocument.ATTR_TYPE attr, Color c)
Sets the foreground (font) color of the specified attribute.- Parameters:
attr
- the attribute to apply this font to (normal, comment, string)c
- the color to use
-
setAttributeColor
public static void setAttributeColor(MutableAttributeSet attr, Color c)
Sets the foreground (font) color of the specified attribute.- Parameters:
attr
- attribute to apply this color toc
- the color to use
-
addKeywords
public void addKeywords(String[] keywords, MutableAttributeSet attr)
Associates the keywords with a particular formatting style.- Parameters:
keywords
- the tokens or words to formatattr
- how to format the keywords
-
addKeyword
public void addKeyword(String keyword, MutableAttributeSet attr)
Associates a keyword with a particular formatting style.- Parameters:
keyword
- the token or word to formatattr
- how to format keyword
-
getKeywordFormatting
public MutableAttributeSet getKeywordFormatting(String keyword)
Gets the formatting for a keyword.- Parameters:
keyword
- the token or word to stop formatting- Returns:
- how keyword is formatted, or null if no formatting is applied to it
-
removeKeyword
public void removeKeyword(String keyword)
Removes an association between a keyword with a particular formatting style.- Parameters:
keyword
- the token or word to stop formatting
-
setTabs
public void setTabs(int charactersPerTab)
sets the number of characters per tab.- Parameters:
charactersPerTab
- the characters per tab
-
insertString
public void insertString(int offset, String str, AttributeSet a) throws BadLocationException
Override to apply syntax highlighting after the document has been updated.- Specified by:
insertString
in interfaceDocument
- Overrides:
insertString
in classAbstractDocument
- Parameters:
offset
- the offsetstr
- the string to inserta
- the attribute set, can be null- Throws:
BadLocationException
- if offset is invalid
-
remove
public void remove(int offset, int length) throws BadLocationException
Applies syntax highlighting after the document has been updated.- Specified by:
remove
in interfaceDocument
- Overrides:
remove
in classAbstractDocument
- Parameters:
offset
- the offset of the deletionlength
- the length of the deletion- Throws:
BadLocationException
- if offsets are invalid
-
processChangedLines
public void processChangedLines(int offset, int length) throws BadLocationException
Determine how many lines have been changed, then apply highlighting to each line.- Parameters:
offset
- the offset of the changed lineslength
- the length of the change- Throws:
BadLocationException
- if offset is invalid
-
commentLinesBefore
protected boolean commentLinesBefore(String content, int line)
Highlight lines when a multi line comment is still 'open' (ie. matching end delimiter has not yet been encountered).- Parameters:
content
- the content to checkline
- the line number- Returns:
- true if there are comment lines before
-
commentLinesAfter
protected void commentLinesAfter(String content, int line)
Highlight comment lines to matching end delimiter.- Parameters:
content
- the content to parseline
- the line number
-
highlightLinesAfter
protected void highlightLinesAfter(String content, int line) throws BadLocationException
Highlight lines to start or end delimiter.- Parameters:
content
- the content to parseline
- the line number- Throws:
BadLocationException
- if offsets are wrong
-
applyHighlighting
protected void applyHighlighting(String content, int line) throws BadLocationException
Parse the line to determine the appropriate highlighting.- Parameters:
content
- the content to parseline
- the line number- Throws:
BadLocationException
- if offsets are invalid
-
startingMultiLineComment
protected boolean startingMultiLineComment(String content, int startOffset, int endOffset) throws BadLocationException
Does this line contain the start of a multi-line comment.- Parameters:
content
- the content to searchstartOffset
- the start of the searchendOffset
- the end of the search- Returns:
- true if it contains the start delimiter
- Throws:
BadLocationException
- if offsets are invalid
-
endingMultiLineComment
protected boolean endingMultiLineComment(String content, int startOffset, int endOffset) throws BadLocationException
Does this line contain the end delimiter of a multi-line comment.- Parameters:
content
- the content to searchstartOffset
- the start of the searchendOffset
- the end of the search- Returns:
- true if the line contains the end delimiter
- Throws:
BadLocationException
- if offsets are invalid
-
isMultiLineComment
protected boolean isMultiLineComment()
We have found a start delimiter and are still searching for the end delimiter.- Returns:
- true if currently within a multi-line comment
-
setInsideMultiLineComment
protected void setInsideMultiLineComment(boolean value)
Sets whether we're currently within a multi-line comment or not.- Parameters:
value
- true if currently within a multi-line comment
-
checkForTokens
protected void checkForTokens(String content, int startOffset, int endOffset)
Parse the line for tokens to highlight.- Parameters:
content
- the content to parsestartOffset
- the start positionendOffset
- the end position
-
getQuoteToken
protected int getQuoteToken(String content, int startOffset, int endOffset)
Searches for a quote token.- Parameters:
content
- the content to searchstartOffset
- the start of the searchendOffset
- the end of the search- Returns:
- the new position
-
getOtherToken
protected int getOtherToken(String content, int startOffset, int endOffset)
Searches for a keyword token.- Parameters:
content
- the content to search instartOffset
- the position to start the search fromendOffset
- the position to end the search- Returns:
- the new position
-
indexOf
protected int indexOf(String content, String needle, int offset)
Assume the needle will the found at the start/end of the line.- Parameters:
content
- the content to searchneedle
- the string to look foroffset
- the offset to start at- Returns:
- the index
-
lastIndexOf
protected int lastIndexOf(String content, String needle, int offset)
Assume the needle will the found at the start/end of the line.- Parameters:
content
- the content searchneedle
- what to look foroffset
- the offset to start- Returns:
- the index
-
getLine
protected String getLine(String content, int offset)
Returns the line.- Parameters:
content
- the contentoffset
- the offset to start at- Returns:
- the line
-
isDelimiter
public boolean isDelimiter(String character)
Checks whether the character is a delimiter.- Parameters:
character
- the character to check- Returns:
- true if a delimiter
-
isQuoteDelimiter
public boolean isQuoteDelimiter(String character)
Checks whether the character is quote delimiter.- Parameters:
character
- the character to check- Returns:
- true if a quote delimiter
-
escapeQuote
public String escapeQuote(String quoteDelimiter)
Escapes the quote delimiter.- Parameters:
quoteDelimiter
- the string to escape- Returns:
- the escaped string
-
addMatchingBlockEnd
protected String addMatchingBlockEnd(int offset) throws BadLocationException
Adds the matching block end.- Parameters:
offset
- the offset- Returns:
- the string after adding the matching block end
- Throws:
BadLocationException
- if the offset is invalid
-
getFontSize
public int getFontSize()
gets the current font size.- Returns:
- the font size
-
setFontSize
public void setFontSize(int fontSize)
sets the current font size (affects all built-in styles).- Parameters:
fontSize
- the size
-
getFontName
public String getFontName()
gets the current font family.- Returns:
- the font name
-
setFontName
public void setFontName(String fontName)
sets the current font family (affects all built-in styles).- Parameters:
fontName
- the font name
-
setIndentationSize
public void setIndentationSize(int value)
Sets the number of blanks to use for indentation.- Parameters:
value
- the number of blanks
-
getIndentationSize
public int getIndentationSize()
Returns the number of blanks used for indentation.- Returns:
- the number of blanks
-
setDelimiters
public void setDelimiters(String value)
Sets the delimiter characters to use.- Parameters:
value
- the characters
-
getDelimiters
public String getDelimiters()
Returns the delimiter characters to use.- Returns:
- the characters
-
setQuoteDelimiters
public void setQuoteDelimiters(String value)
Sets the quote delimiter characters to use.- Parameters:
value
- the characters
-
getQuoteDelimiters
public String getQuoteDelimiters()
Returns the quote delimiter characters to use.- Returns:
- the characters
-
setQuoteEscape
public void setQuoteEscape(String value)
Sets the character to use for escaping a quote character.- Parameters:
value
- the character
-
getQuoteEscape
public String getQuoteEscape()
Returns the character for escaping a quote delimiter.- Returns:
- the character
-
setSingleLineCommentStart
public void setSingleLineCommentStart(String value)
Sets the string that is the start of a single-line comment.- Parameters:
value
- the string
-
getSingleLineCommentStart
public String getSingleLineCommentStart()
Retrusn the single line comment start string.- Returns:
- the start string
-
setMultiLineCommentStart
public void setMultiLineCommentStart(String value)
Sets the string that is the start of a multi-line comment.- Parameters:
value
- the string
-
getMultiLineCommentStart
public String getMultiLineCommentStart()
Returns the string that is the start of a multi-line comment.- Returns:
- the string
-
setMultiLineCommentEnd
public void setMultiLineCommentEnd(String value)
Sets the string that is the end of a multi-line comment.- Parameters:
value
- the string
-
getMultiLineCommentEnd
public String getMultiLineCommentEnd()
Returns the end of a multi-line comment.- Returns:
- the end string
-
setBlockStart
public void setBlockStart(String value)
Sets the string that is the start of a block.- Parameters:
value
- the string
-
getBlockStart
public String getBlockStart()
Returns the start of a block.- Returns:
- the end string
-
setBlockEnd
public void setBlockEnd(String value)
Sets the string that is the end of a block.- Parameters:
value
- the string
-
getBlockEnd
public String getBlockEnd()
Returns the end of a block.- Returns:
- the end string
-
setAddMatchingEndBlocks
public void setAddMatchingEndBlocks(boolean value)
Sets whether matching block ends are inserted or not.- Parameters:
value
- if true then matching block ends are inserted
-
getAddMatchingEndBlocks
public boolean getAddMatchingEndBlocks()
Returns whether matching block ends are inserted or not.- Returns:
- true if matching block ends are inserted
-
setUseBlanks
public void setUseBlanks(boolean value)
Sets whether to use blanks instead of tabs.- Parameters:
value
- if true then blanks are used instead of tabs
-
getUseBlanks
public boolean getUseBlanks()
Returns whether blanks are used instead of tabs.- Returns:
- true if blanks are used instead of tabs
-
setBackgroundColor
public void setBackgroundColor(Color value)
Sets the background color.- Parameters:
value
- the background color
-
getBackgroundColor
public Color getBackgroundColor()
Returns the background color.- Returns:
- the background color
-
setMultiLineComment
public void setMultiLineComment(boolean value)
Sets whether to enable multi-line comments.- Parameters:
value
- if true then multi-line comments are enabled
-
getMultiLineComment
public boolean getMultiLineComment()
Returns whether multi-line comments are enabled.- Returns:
- true if multi-line comments are enabled
-
setSingleLineComment
public void setSingleLineComment(boolean value)
Sets whether to enable single-line comments.- Parameters:
value
- if true then single-line comments are enabled
-
getSingleLineComment
public boolean getSingleLineComment()
Returns whether single-line comments are enabled.- Returns:
- true if single-line comments are enabled
-
setCaseSensitive
public void setCaseSensitive(boolean value)
Sets whether the keywords are case-sensitive or not.- Parameters:
value
- if true then keywords are treated case-sensitive
-
getCaseSensitive
public boolean getCaseSensitive()
Returns whether blanks are used instead of tabs.- Returns:
- true if keywords are case-sensitive
-
-