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;

Variable Index

 o CPPSuffixes
 o CSuffixes
 o I_SYNTAX_COLOR
 o JavaSuffixes
 o L_LANG_MODE
 o P_LANG_MODE
 o P_SYNTAX_COLOR

Constructor Index

 o CodeEditor()
Constructs a new code text area with tool bar.
 o CodeEditor(boolean)
Constructs a new code text area with tool bar.
 o CodeEditor(int, int)
Constructs a new code text area with tool bar, with the specified number of rows and columns.
 o CodeEditor(int, int, boolean)
Constructs a new code text area with tool bar, with the specified number of rows and columns.
 o CodeEditor(int, int, boolean, ActionListener, ActionListener, ActionListener)
Constructs a new code text area with tool bar, with the specified number of rows and columns.

Method Index

 o getCommentColor()
Returns the font color for the comment tokens.
 o getConstantColor()
Returns the font color for the constant tokens.
 o getKeywordColor()
Returns the font color for the keyword tokens.
 o getLangMode()
Returns the language mode that is one of "Java", "C", and "C++".
 o getNormalColor()
Returns the font color for the normal tokens.
 o isCMode()
Checks if this component colors the syntax of the C language.
 o isCPPMode()
Checks if this component colors the syntax of the C++ language.
 o isJavaMode()
Checks if this component colors the syntax of the Java language.
 o isSyntaxColoringEnabled()
Tests if the syntax coloring is enabled.
 o itemStateChanged(ItemEvent)
Invoked when an item's state has been changed.
 o main(String[])
Executes the examples.
 o setCMode()
Makes this component colors the syntax of the C language.
 o setCommentColor(Color)
Sets the font color for the comment tokens.
 o setConstantColor(Color)
Sets the font color for the constant tokens.
 o setCPPMode()
Makes this component colors the syntax of the C++ language.
 o setFont(Font)
Sets the font of this component.
 o setJavaMode()
Makes this component colors the syntax of the Java language.
 o setKeywordColor(Color)
Sets the font color for the keyword tokens.
 o setNormalColor(Color)
Sets the font color for the normal tokens.
 o setSyntaxColoringEnabled(boolean)
Enables or disables the syntax coloring.

Variables

 o I_SYNTAX_COLOR
 public static final String I_SYNTAX_COLOR
 o L_LANG_MODE
 public static final String L_LANG_MODE
 o P_LANG_MODE
 public static final String P_LANG_MODE
 o P_SYNTAX_COLOR
 public static final String P_SYNTAX_COLOR
 o JavaSuffixes
 public static final Vector JavaSuffixes
 o CSuffixes
 public static final Vector CSuffixes
 o CPPSuffixes
 public static final Vector CPPSuffixes

Constructors

 o CodeEditor
 public CodeEditor()
Constructs a new code text area with tool bar. This code text area is created with vertical scroll bar.

 o 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.
 o 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.
 o 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.
 o 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.

Methods

 o setFont
 public void setFont(Font font)
Sets the font of this component.

Overrides:
setFont in class TextComponent
 o getLangMode
 public String getLangMode()
Returns the language mode that is one of "Java", "C", and "C++".

See Also:
isJavaMode, isCMode, isCPPMode
 o isJavaMode
 public boolean isJavaMode()
Checks if this component colors the syntax of the Java language.

See Also:
setJavaMode
 o setJavaMode
 public void setJavaMode()
Makes this component colors the syntax of the Java language.

See Also:
isJavaMode
 o isCMode
 public boolean isCMode()
Checks if this component colors the syntax of the C language.

See Also:
setCMode
 o setCMode
 public void setCMode()
Makes this component colors the syntax of the C language.

See Also:
isCMode
 o isCPPMode
 public boolean isCPPMode()
Checks if this component colors the syntax of the C++ language.

See Also:
setCPPMode
 o setCPPMode
 public void setCPPMode()
Makes this component colors the syntax of the C++ language.

See Also:
isCPPMode
 o isSyntaxColoringEnabled
 public boolean isSyntaxColoringEnabled()
Tests if the syntax coloring is enabled.

 o setSyntaxColoringEnabled
 public void setSyntaxColoringEnabled(boolean b)
Enables or disables the syntax coloring.

 o getNormalColor
 public Color getNormalColor()
Returns the font color for the normal tokens.

 o setNormalColor
 public void setNormalColor(Color color)
Sets the font color for the normal tokens.

 o getKeywordColor
 public Color getKeywordColor()
Returns the font color for the keyword tokens.

 o setKeywordColor
 public void setKeywordColor(Color color)
Sets the font color for the keyword tokens.

 o getConstantColor
 public Color getConstantColor()
Returns the font color for the constant tokens.

 o setConstantColor
 public void setConstantColor(Color color)
Sets the font color for the constant tokens.

 o getCommentColor
 public Color getCommentColor()
Returns the font color for the comment tokens.

 o setCommentColor
 public void setCommentColor(Color color)
Sets the font color for the comment tokens.

 o itemStateChanged
 public void itemStateChanged(ItemEvent e)
Invoked when an item's state has been changed.

Overrides:
itemStateChanged in class TextEditor
See Also:
ItemListener
 o main
 public static void main(String args[])
Executes the examples.


All Packages  Class Hierarchy  This Package  Previous  Next  Index