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
-
addLanguage(String, String[], String[], boolean)
- Add a language to the WingEditor language menu under View MENU.
-
disableMenu(int)
- Disable a specified Menu.
-
getBackgroundColor()
- Get the color for background.
-
getCommentColor()
- Get the color for Java comment.
-
getKeywordColor()
- Get the color for keywords.
-
getTabSize()
- Get the current tab size.
-
getTextFont()
- Get the current text font for editor
-
getWindowHeight()
- Get the current default height of editor window.
-
getWindowSize()
- Get the current default size of editor window.
-
getWindowWidth()
- Get the current default width of editor window.
-
menuEnabled(int)
- Check whether a specified Menu is disabled.
-
readGlobals()
- Read global information from $HOME/.WingEditor
if the file exists.
-
saveGlobals()
- Save the globals to $HOME/.WingEditor.
-
setBackgroundColor(Color)
- Set the color for background.
-
setCommentColor(Color)
- Set the color for Java comment.
-
setKeywordColor(Color)
- Set the color for Java keyword.
-
setTabSize(int)
- Set the tab size.
-
setTextFont(Font)
- Set the text font for editor.
-
setWindowHeight(int)
- Set the default height of editor window.
-
setWindowSize(Dimension)
- Set the default size of editor window.
-
setWindowWidth(int)
- Set the default width of editor window.
readGlobals
public static void readGlobals()
- Read global information from $HOME/.WingEditor
if the file exists.
saveGlobals
public static void saveGlobals()
- Save the globals to $HOME/.WingEditor. It will overwrites
the current file if it exists.
setTextFont
public static void setTextFont(Font font)
- Set the text font for editor.
- Parameters:
- font - the new font
getTextFont
public static Font getTextFont()
- Get the current text font for editor
setKeywordColor
public static void setKeywordColor(Color kcolor)
- Set the color for Java keyword.
- Parameters:
- kcolor - the new color
getKeywordColor
public static Color getKeywordColor()
- Get the color for keywords.
setCommentColor
public static void setCommentColor(Color ccolor)
- Set the color for Java comment.
- Parameters:
- ccolor - the new color
getCommentColor
public static Color getCommentColor()
- Get the color for Java comment.
setBackgroundColor
public static void setBackgroundColor(Color bcolor)
- Set the color for background.
- Parameters:
- bcolor - the new color
getBackgroundColor
public static Color getBackgroundColor()
- Get the color for background.
setTabSize
public static void setTabSize(int size)
- Set the tab size.
- Parameters:
- size - the new size - only acceptable values
are 2/4/8.
getTabSize
public static int getTabSize()
- Get the current tab size.
setWindowSize
public static void setWindowSize(Dimension size)
- Set the default size of editor window.
- Parameters:
- size - the new size
getWindowSize
public static Dimension getWindowSize()
- Get the current default size of editor window.
setWindowWidth
public static void setWindowWidth(int width)
- Set the default width of editor window.
- Parameters:
- width - the new width
getWindowWidth
public static int getWindowWidth()
- Get the current default width of editor window.
setWindowHeight
public static void setWindowHeight(int height)
- Set the default height of editor window.
- Parameters:
- height - the new height
getWindowHeight
public static int getWindowHeight()
- Get the current default height of editor window.
disableMenu
public static void disableMenu(int menu_index)
- Disable a specified Menu.
- Parameters:
- menu_index - the Menu index
menuEnabled
public static boolean menuEnabled(int menu_index)
- Check whether a specified Menu is disabled.
- Parameters:
- menu_index - the Menu index
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