JIDE 3.5.15

com.jidesoft.editor.language
Class LanguageSpec

java.lang.Object
  extended by com.jidesoft.editor.language.LanguageSpec

public class LanguageSpec
extends Object

LanguageSpec defines the necessary properties for a language type. CodeEditor will use the information provided by this class.


Field Summary
static String PROPERTY_BLOCK_COMMENT_END
           
static String PROPERTY_BLOCK_COMMENT_START
           
static String PROPERTY_LINE_COMMENT
           
static String PROPERTY_NONWORD_DELIMITERS
           
 
Constructor Summary
LanguageSpec(String name, String suffixes, TokenMarker tokenMarker, String noWordDelimiters, String lineComment)
           
LanguageSpec(String name, String suffixes, TokenMarker tokenMarker, String noWordDelimiters, String lineComment, String blockCommentStart, String blockCommentEnd)
           
 
Method Summary
 void addSuffix(String suffix)
          Adds a new suffix to this language.
 void addSuffixes(String[] suffixes)
          Adds several new suffix to this language.
 void clearSuffixes()
          Removes all suffixes from this language.
 void configureCodeEditor(CodeEditor codeEditor)
          Configures the code editor to set the properties onto CodeEditor's Document as document properties.
 String getBlockCommentEnd()
          Gets the end string for block comment.
 String getBlockCommentStart()
          Gets the start string for block comment.
 Icon getIcon()
          Gets the icon associated with this language.
 String getLineComment()
          Gets string for the line comment.
 String getName()
          Gets the name of this language.
 String getNonwordDelimiters()
          Gets the characters that are not considered as a word delimiter.
 List<String> getSuffixes()
          Gets the suffixes of this language.
 TokenMarker getTokenMarker()
          Gets the token marker.
 void removeSuffix(String suffix)
          Removes the suffix from this language.
 void setBlockCommentEnd(String blockCommentEnd)
          Sets the end string for block comment.
 void setBlockCommentStart(String blockCommentStart)
          Sets the start string for block comment.
 void setIcon(Icon icon)
          Sets the icon associated with this language.
 void setLineComment(String lineComment)
          Sets the string for the line comment.
 void setNonwordDelimiters(String nonwordDelimiters)
          Sets the characters that are not considered as a word delimiter.
 void setTokenMarker(TokenMarker tokenMarker)
          Sets the token marker.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PROPERTY_NONWORD_DELIMITERS

public static final String PROPERTY_NONWORD_DELIMITERS
See Also:
Constant Field Values

PROPERTY_LINE_COMMENT

public static final String PROPERTY_LINE_COMMENT
See Also:
Constant Field Values

PROPERTY_BLOCK_COMMENT_START

public static final String PROPERTY_BLOCK_COMMENT_START
See Also:
Constant Field Values

PROPERTY_BLOCK_COMMENT_END

public static final String PROPERTY_BLOCK_COMMENT_END
See Also:
Constant Field Values
Constructor Detail

LanguageSpec

public LanguageSpec(String name,
                    String suffixes,
                    TokenMarker tokenMarker,
                    String noWordDelimiters,
                    String lineComment)
Parameters:
name - the name of the language, such as "Java", "C" etc.
suffixes - the suffix of file in the language, such as "java" for Java source code, "c" for C code.
tokenMarker - the token marker for the language
noWordDelimiters - the characters that are not considered as word delimiters. In most languages, "_" is the value to use.
lineComment - the string that is used to create a line comment. Most language uses "//", such as Java, C, JSP etc. Some use "#" such as Perl.

LanguageSpec

public LanguageSpec(String name,
                    String suffixes,
                    TokenMarker tokenMarker,
                    String noWordDelimiters,
                    String lineComment,
                    String blockCommentStart,
                    String blockCommentEnd)
Parameters:
name - the name of the language, such as "Java", "C" etc.
suffixes - the suffix of file in the language, such as "java" for Java source code, "c" for C code.
tokenMarker - the token marker for the language
noWordDelimiters - delimiters that are not considered as the end of a word. In most languages, "_" is the value to use.
lineComment - the string that is used to create a line comment. Most language uses "//", such as Java, C, JSP etc. Some use "#" such as Perl.
blockCommentStart - the string that indicates the starting of a block comments. Most languages use "/*.
blockCommentEnd - the string that indicates the end of a block comments. Most languages use "/*.
Method Detail

getName

public String getName()
Gets the name of this language.

Returns:
the name of this language.

getSuffixes

public List<String> getSuffixes()
Gets the suffixes of this language.

Returns:
the suffixes of this language.

addSuffix

public void addSuffix(String suffix)
Adds a new suffix to this language.

Parameters:
suffix -

addSuffixes

public void addSuffixes(String[] suffixes)
Adds several new suffix to this language.

Parameters:
suffixes -

removeSuffix

public void removeSuffix(String suffix)
Removes the suffix from this language.

Parameters:
suffix -

clearSuffixes

public void clearSuffixes()
Removes all suffixes from this language.


getIcon

public Icon getIcon()
Gets the icon associated with this language.

Returns:
the icon.

setIcon

public void setIcon(Icon icon)
Sets the icon associated with this language.

Parameters:
icon -

getTokenMarker

public TokenMarker getTokenMarker()
Gets the token marker.

Returns:
the token marker.

setTokenMarker

public void setTokenMarker(TokenMarker tokenMarker)
Sets the token marker.

Parameters:
tokenMarker -

getNonwordDelimiters

public String getNonwordDelimiters()
Gets the characters that are not considered as a word delimiter. By default, If Character.isLetterOrDigit return false, it will be considered as a word delimiter, unless it is in the string of this nonwordDelimiters.

Returns:
the characters that are not considered as a word delimiter.

setNonwordDelimiters

public void setNonwordDelimiters(String nonwordDelimiters)
Sets the characters that are not considered as a word delimiter.

Parameters:
nonwordDelimiters -
See Also:
setNonwordDelimiters(String)

getLineComment

public String getLineComment()
Gets string for the line comment.

Returns:
the string for the line comment.

setLineComment

public void setLineComment(String lineComment)
Sets the string for the line comment.

Parameters:
lineComment - the new string for the line comment.

getBlockCommentStart

public String getBlockCommentStart()
Gets the start string for block comment.

Returns:
the start string for block comment.

setBlockCommentStart

public void setBlockCommentStart(String blockCommentStart)
Sets the start string for block comment.

Parameters:
blockCommentStart -

getBlockCommentEnd

public String getBlockCommentEnd()
Gets the end string for block comment.

Returns:
the end string for block comment.

setBlockCommentEnd

public void setBlockCommentEnd(String blockCommentEnd)
Sets the end string for block comment.

Parameters:
blockCommentEnd -

configureCodeEditor

public void configureCodeEditor(CodeEditor codeEditor)
Configures the code editor to set the properties onto CodeEditor's Document as document properties. All those properties are defined in LanguageSpec as constants.

Parameters:
codeEditor -

toString

public String toString()
Overrides:
toString in class Object

JIDE 3.5.15