|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectgnu.GUIUtilities
public class GUIUtilities
Contains a bunch of methods used to build the GUI.
| Field Summary | |
|---|---|
static java.util.Hashtable |
menuItemsActions
Contains the action name and label of each menu item |
| Constructor Summary | |
|---|---|
GUIUtilities()
|
|
| Method Summary | |
|---|---|
static void |
error(java.awt.Frame frame,
java.lang.String name,
java.lang.Object[] args)
Displays an error dialog box. |
static java.lang.String |
getColorHexString(java.awt.Color c)
Converts a color object to its hex value. |
static java.awt.Image |
getJextIconImage()
Returns the Jext environment icon. |
static java.lang.String |
getStyleString(SyntaxStyle style)
Converts a style into it's string representation. |
static javax.swing.JMenu |
loadMenu(java.lang.String name)
|
static javax.swing.JMenu |
loadMenu(java.lang.String name,
boolean isLabel)
Loads a menu from the properties. |
static javax.swing.JMenuItem |
loadMenuItem(java.lang.String action)
This method creates a new JMenuItem. |
static javax.swing.JMenuItem |
loadMenuItem(java.lang.String label,
java.lang.String action,
java.lang.String picture,
boolean enabled)
This method creates a new JMenuItem. |
static javax.swing.JMenuItem |
loadMenuItem(java.lang.String label,
java.lang.String action,
java.lang.String picture,
boolean enabled,
boolean list)
This method creates a new JMenuItem. |
static void |
message(java.awt.Frame frame,
java.lang.String name,
java.lang.Object[] args)
Displays a dialog box. |
static java.awt.Color |
parseColor(java.lang.String name)
Converts a hex color value prefixed with #, for example #ff0088. |
static SyntaxStyle |
parseStyle(java.lang.String str)
Converts a style string to a style object. |
static void |
requestFocus(java.awt.Window win,
java.awt.Component comp)
Focuses on the specified component as soon as the window becomes active. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static java.util.Hashtable menuItemsActions
| Constructor Detail |
|---|
public GUIUtilities()
| Method Detail |
|---|
public static final java.awt.Image getJextIconImage()
public static void requestFocus(java.awt.Window win,
java.awt.Component comp)
win - The windowcomp - The component
public static void message(java.awt.Frame frame,
java.lang.String name,
java.lang.Object[] args)
name.title property. The message is fetched
from the name.message property. The message
is formatted by the property manager with args as
positional parameters.
frame - The frame to display the dialog forname - The name of the dialogargs - Positional parameters to be substituted into the
message text
public static void error(java.awt.Frame frame,
java.lang.String name,
java.lang.Object[] args)
name.title property. The message is fetched
from the name.message property. The message
is formatted by the property manager with args as
positional parameters.
frame - The frame to display the dialog forname - The name of the dialogargs - Positional parameters to be substituted into the
message textpublic static java.awt.Color parseColor(java.lang.String name)
name - The color valuepublic static java.lang.String getColorHexString(java.awt.Color c)
c - The color object
public static SyntaxStyle parseStyle(java.lang.String str)
throws java.lang.IllegalArgumentException
str - The style string
java.lang.IllegalArgumentException - if the style is invalidpublic static java.lang.String getStyleString(SyntaxStyle style)
style - The stylepublic static javax.swing.JMenu loadMenu(java.lang.String name)
public static javax.swing.JMenu loadMenu(java.lang.String name,
boolean isLabel)
name. The menu label is
obtained from the name.label property.
name - The menu nameisLabel - True if name is label, toopublic static javax.swing.JMenuItem loadMenuItem(java.lang.String action)
action - Plugin action name
JMenuItem
public static javax.swing.JMenuItem loadMenuItem(java.lang.String label,
java.lang.String action,
java.lang.String picture,
boolean enabled)
label - The menu item labelaction - The name of the action, specified in JextkeyStroke - The keystroke used as acceleratorpicture - Relative path to an iconenabled - Disable the item if false
JMenuItem
public static javax.swing.JMenuItem loadMenuItem(java.lang.String label,
java.lang.String action,
java.lang.String picture,
boolean enabled,
boolean list)
label - The menu item labelaction - The name of the action, specified in JextkeyStroke - The keystroke used as acceleratorpicture - Relative path to an iconenabled - Disable the item if falselist - If true adds item info to a list
JMenuItem
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||