All Packages  Class Hierarchy  This Package  Next  

Class wingsoft.editor.Global

java.lang.Object
   |
   +----wingsoft.editor.Global

public class Global
extends Object
implements TokenConst
The Global class provides methods to access global information. The following information is considered as global in WingEditor,
     Edit window size: width/height
     Tab Size: 2/4/8
     Text Font
     Background Color
     Keyword Color
     Comment Color
     Compiling Options for compiling current file
     Class Paths for compiling current file
 
All these information are saved in $HOME/.WingEditor


Method Index

 o addLanguage(String, String[], String[], boolean)
Add a language to the WingEditor language menu under View MENU.
 o disableMenu(int)
Disable a specified Menu.
 o getBackgroundColor()
Get the color for background.
 o getCommentColor()
Get the color for Java comment.
 o getKeywordColor()
Get the color for keywords.
 o getTabSize()
Get the current tab size.
 o getTextFont()
Get the current text font for editor
 o getWindowHeight()
Get the current default height of editor window.
 o getWindowSize()
Get the current default size of editor window.
 o getWindowWidth()
Get the current default width of editor window.
 o menuEnabled(int)
Check whether a specified Menu is disabled.
 o readGlobals()
Read global information from $HOME/.WingEditor if the file exists.
 o saveGlobals()
Save the globals to $HOME/.WingEditor.
 o setBackgroundColor(Color)
Set the color for background.
 o setCommentColor(Color)
Set the color for Java comment.
 o setKeywordColor(Color)
Set the color for Java keyword.
 o setTabSize(int)
Set the tab size.
 o setTextFont(Font)
Set the text font for editor.
 o setWindowHeight(int)
Set the default height of editor window.
 o setWindowSize(Dimension)
Set the default size of editor window.
 o setWindowWidth(int)
Set the default width of editor window.

Methods

 o readGlobals
 public static void readGlobals()
Read global information from $HOME/.WingEditor if the file exists.

 o saveGlobals
 public static void saveGlobals()
Save the globals to $HOME/.WingEditor. It will overwrites the current file if it exists.

 o setTextFont
 public static void setTextFont(Font font)
Set the text font for editor.

Parameters:
font - the new font
 o getTextFont
 public static Font getTextFont()
Get the current text font for editor

 o setKeywordColor
 public static void setKeywordColor(Color kcolor)
Set the color for Java keyword.

Parameters:
kcolor - the new color
 o getKeywordColor
 public static Color getKeywordColor()
Get the color for keywords.

 o setCommentColor
 public static void setCommentColor(Color ccolor)
Set the color for Java comment.

Parameters:
ccolor - the new color
 o getCommentColor
 public static Color getCommentColor()
Get the color for Java comment.

 o setBackgroundColor
 public static void setBackgroundColor(Color bcolor)
Set the color for background.

Parameters:
bcolor - the new color
 o getBackgroundColor
 public static Color getBackgroundColor()
Get the color for background.

 o setTabSize
 public static void setTabSize(int size)
Set the tab size.

Parameters:
size - the new size - only acceptable values are 2/4/8.
 o getTabSize
 public static int getTabSize()
Get the current tab size.

 o setWindowSize
 public static void setWindowSize(Dimension size)
Set the default size of editor window.

Parameters:
size - the new size
 o getWindowSize
 public static Dimension getWindowSize()
Get the current default size of editor window.

 o setWindowWidth
 public static void setWindowWidth(int width)
Set the default width of editor window.

Parameters:
width - the new width
 o getWindowWidth
 public static int getWindowWidth()
Get the current default width of editor window.

 o setWindowHeight
 public static void setWindowHeight(int height)
Set the default height of editor window.

Parameters:
height - the new height
 o getWindowHeight
 public static int getWindowHeight()
Get the current default height of editor window.

 o disableMenu
 public static void disableMenu(int menu_index)
Disable a specified Menu.

Parameters:
menu_index - the Menu index
 o menuEnabled
 public static boolean menuEnabled(int menu_index)
Check whether a specified Menu is disabled.

Parameters:
menu_index - the Menu index
 o addLanguage
 public static void addLanguage(String languageName,
                                String fileExtension[],
                                String keyWords[],
                                boolean caseSensitive)
Add a language to the WingEditor language menu under View MENU. This method should be called before an editor window is opened.

Parameters:
languageName - the language name
fileExtension - the file extensions which mark the language
keyWords - the keywords in the language
caseSensitive - whether the keywords are case-sensitive.

All Packages  Class Hierarchy  This Package  Next