Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.jext
Class GUIUtilities  view GUIUtilities download GUIUtilities.java

java.lang.Object
  extended byorg.jext.GUIUtilities

public class GUIUtilities
extends java.lang.Object

Contains a bunch of methods used to build the GUI.


Field Summary
private static java.awt.Image ICON_IMAGE
           
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(org.gjt.sp.jedit.syntax.SyntaxStyle style)
          Converts a style into it's string representation.
static void loadGeometry(java.awt.Window win, java.lang.String name)
          Load a window geometry from a propery file and apply it to the specified window.
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 org.gjt.sp.jedit.syntax.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.
static void saveGeometry(java.awt.Window win, java.lang.String name)
          Saves a window geometry
static void setScrollableTabbedPane(javax.swing.JTabbedPane pane)
          Sets the scrollable behavior of a JTabbedPane.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ICON_IMAGE

private static final java.awt.Image ICON_IMAGE

menuItemsActions

public static java.util.Hashtable menuItemsActions
Contains the action name and label of each menu item

Constructor Detail

GUIUtilities

public GUIUtilities()
Method Detail

getJextIconImage

public static final java.awt.Image getJextIconImage()
Returns the Jext environment icon.


setScrollableTabbedPane

public static void setScrollableTabbedPane(javax.swing.JTabbedPane pane)
Sets the scrollable behavior of a JTabbedPane.


requestFocus

public static void requestFocus(java.awt.Window win,
                                java.awt.Component comp)
Focuses on the specified component as soon as the window becomes active.


saveGeometry

public static void saveGeometry(java.awt.Window win,
                                java.lang.String name)
Saves a window geometry


loadGeometry

public static void loadGeometry(java.awt.Window win,
                                java.lang.String name)
Load a window geometry from a propery file and apply it to the specified window.


message

public static void message(java.awt.Frame frame,
                           java.lang.String name,
                           java.lang.Object[] args)
Displays a dialog box. The title of the dialog is fetched from the 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.


error

public static void error(java.awt.Frame frame,
                         java.lang.String name,
                         java.lang.Object[] args)
Displays an error dialog box. The title of the dialog is fetched from the 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.


parseColor

public static java.awt.Color parseColor(java.lang.String name)
Converts a hex color value prefixed with #, for example #ff0088.


getColorHexString

public static java.lang.String getColorHexString(java.awt.Color c)
Converts a color object to its hex value. The hex value prefixed is with #, for example #ff0088.


parseStyle

public static org.gjt.sp.jedit.syntax.SyntaxStyle parseStyle(java.lang.String str)
                                                      throws java.lang.IllegalArgumentException
Converts a style string to a style object.


getStyleString

public static java.lang.String getStyleString(org.gjt.sp.jedit.syntax.SyntaxStyle style)
Converts a style into it's string representation.


loadMenu

public static javax.swing.JMenu loadMenu(java.lang.String name)

loadMenu

public static javax.swing.JMenu loadMenu(java.lang.String name,
                                         boolean isLabel)
Loads a menu from the properties. The white space separated list of menu items is obtained from the property named name. The menu label is obtained from the name.label property.


loadMenuItem

public static javax.swing.JMenuItem loadMenuItem(java.lang.String action)
This method creates a new JMenuItem. This special version is targeted to be used with plugins.


loadMenuItem

public 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. See menus/XMenuHandler.class for more informations about its usage.


loadMenuItem

public 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. See menus/XMenuHandler.class for more informations about its usage.