All Packages Class Hierarchy This Package Previous Next Index
Class jp.kyasu.editor.CodeEditor
java.lang.Object
|
+----java.awt.Component
|
+----java.awt.Container
|
+----jp.kyasu.awt.KContainer
|
+----jp.kyasu.awt.EventProxyContainer
|
+----jp.kyasu.awt.TextComponent
|
+----jp.kyasu.editor.TextEditor
|
+----jp.kyasu.editor.CodeEditor
- public class CodeEditor
- extends TextEditor
A CodeEditor
object is a multi-line area that displays text.
It is suited for coding and it supports the syntax coloring of
C
, C++
, and Java
.
It is created with tool bar.
- Version:
- 20 Jun 1998
- Author:
- Kazuki YASUMATSU
- See Also:
- JavaSyntaxColoringModel;
-
CPPSuffixes
-
-
CSuffixes
-
-
I_SYNTAX_COLOR
-
-
JavaSuffixes
-
-
L_LANG_MODE
-
-
P_LANG_MODE
-
-
P_SYNTAX_COLOR
-
-
CodeEditor()
- Constructs a new code text area with tool bar.
-
CodeEditor(boolean)
- Constructs a new code text area with tool bar.
-
CodeEditor(int, int)
- Constructs a new code text area with tool bar, with the specified
number of rows and columns.
-
CodeEditor(int, int, boolean)
- Constructs a new code text area with tool bar, with the specified
number of rows and columns.
-
CodeEditor(int, int, boolean, ActionListener, ActionListener, ActionListener)
- Constructs a new code text area with tool bar, with the specified
number of rows and columns.
-
getCommentColor()
- Returns the font color for the comment tokens.
-
getConstantColor()
- Returns the font color for the constant tokens.
-
getKeywordColor()
- Returns the font color for the keyword tokens.
-
getLangMode()
- Returns the language mode that is one of "Java", "C", and "C++".
-
getNormalColor()
- Returns the font color for the normal tokens.
-
isCMode()
- Checks if this component colors the syntax of the C language.
-
isCPPMode()
- Checks if this component colors the syntax of the C++ language.
-
isJavaMode()
- Checks if this component colors the syntax of the Java language.
-
isSyntaxColoringEnabled()
- Tests if the syntax coloring is enabled.
-
itemStateChanged(ItemEvent)
- Invoked when an item's state has been changed.
-
main(String[])
- Executes the examples.
-
setCMode()
- Makes this component colors the syntax of the C language.
-
setCommentColor(Color)
- Sets the font color for the comment tokens.
-
setConstantColor(Color)
- Sets the font color for the constant tokens.
-
setCPPMode()
- Makes this component colors the syntax of the C++ language.
-
setFont(Font)
- Sets the font of this component.
-
setJavaMode()
- Makes this component colors the syntax of the Java language.
-
setKeywordColor(Color)
- Sets the font color for the keyword tokens.
-
setNormalColor(Color)
- Sets the font color for the normal tokens.
-
setSyntaxColoringEnabled(boolean)
- Enables or disables the syntax coloring.
I_SYNTAX_COLOR
public static final String I_SYNTAX_COLOR
L_LANG_MODE
public static final String L_LANG_MODE
P_LANG_MODE
public static final String P_LANG_MODE
P_SYNTAX_COLOR
public static final String P_SYNTAX_COLOR
JavaSuffixes
public static final Vector JavaSuffixes
CSuffixes
public static final Vector CSuffixes
CPPSuffixes
public static final Vector CPPSuffixes
CodeEditor
public CodeEditor()
- Constructs a new code text area with tool bar.
This code text area is created with vertical scroll bar.
CodeEditor
public CodeEditor(boolean showToolBar)
- Constructs a new code text area with tool bar. If
showToolBar
is true, then shows the tool bar initially;
otherwise hides.
This code text area is created with vertical scroll bar.
- Parameters:
- showToolBar - if true, then shows the tool bar initially;
otherwise hides.
CodeEditor
public CodeEditor(int rows,
int columns)
- Constructs a new code text area with tool bar, with the specified
number of rows and columns.
This code text area is created with vertical scroll bar.
- Parameters:
- rows - the number of rows
- columns - the number of columns.
CodeEditor
public CodeEditor(int rows,
int columns,
boolean showToolBar)
- Constructs a new code text area with tool bar, with the specified
number of rows and columns. If
showToolBar
is true,
then shows the tool bar initially; otherwise hidden.
This code text area is created with vertical scroll bar.
- Parameters:
- rows - the number of rows
- columns - the number of columns.
- showToolBar - if true, then shows the tool bar initially;
otherwise hides.
CodeEditor
public CodeEditor(int rows,
int columns,
boolean showToolBar,
ActionListener openActionListener,
ActionListener saveActionListener,
ActionListener printActionListener)
- Constructs a new code text area with tool bar, with the specified
number of rows and columns. If
showToolBar
is true,
then shows the tool bar initially; otherwise hidden.
This code text area is created with vertical scroll bar.
- Parameters:
- rows - the number of rows
- columns - the number of columns.
- showToolBar - if true, then shows the tool bar initially;
otherwise hides.
- openActionListener - the action listener that receives action
events from the open button in tool bar.
- saveActionListener - the action listener that receives action
events from the save button in tool bar.
- printActionListener - the action listener that receives action
events from the print button in tool bar.
setFont
public void setFont(Font font)
- Sets the font of this component.
- Overrides:
- setFont in class TextComponent
getLangMode
public String getLangMode()
- Returns the language mode that is one of "Java", "C", and "C++".
- See Also:
- isJavaMode, isCMode, isCPPMode
isJavaMode
public boolean isJavaMode()
- Checks if this component colors the syntax of the Java language.
- See Also:
- setJavaMode
setJavaMode
public void setJavaMode()
- Makes this component colors the syntax of the Java language.
- See Also:
- isJavaMode
isCMode
public boolean isCMode()
- Checks if this component colors the syntax of the C language.
- See Also:
- setCMode
setCMode
public void setCMode()
- Makes this component colors the syntax of the C language.
- See Also:
- isCMode
isCPPMode
public boolean isCPPMode()
- Checks if this component colors the syntax of the C++ language.
- See Also:
- setCPPMode
setCPPMode
public void setCPPMode()
- Makes this component colors the syntax of the C++ language.
- See Also:
- isCPPMode
isSyntaxColoringEnabled
public boolean isSyntaxColoringEnabled()
- Tests if the syntax coloring is enabled.
setSyntaxColoringEnabled
public void setSyntaxColoringEnabled(boolean b)
- Enables or disables the syntax coloring.
getNormalColor
public Color getNormalColor()
- Returns the font color for the normal tokens.
setNormalColor
public void setNormalColor(Color color)
- Sets the font color for the normal tokens.
getKeywordColor
public Color getKeywordColor()
- Returns the font color for the keyword tokens.
setKeywordColor
public void setKeywordColor(Color color)
- Sets the font color for the keyword tokens.
getConstantColor
public Color getConstantColor()
- Returns the font color for the constant tokens.
setConstantColor
public void setConstantColor(Color color)
- Sets the font color for the constant tokens.
getCommentColor
public Color getCommentColor()
- Returns the font color for the comment tokens.
setCommentColor
public void setCommentColor(Color color)
- Sets the font color for the comment tokens.
itemStateChanged
public void itemStateChanged(ItemEvent e)
- Invoked when an item's state has been changed.
- Overrides:
- itemStateChanged in class TextEditor
- See Also:
- ItemListener
main
public static void main(String args[])
- Executes the examples.
All Packages Class Hierarchy This Package Previous Next Index