net.atlanticbb.tantlinger.ui
Class UIUtils

java.lang.Object
  extended by net.atlanticbb.tantlinger.ui.UIUtils

public class UIUtils
extends java.lang.Object

A collection of static UI helper methods.

Author:
Bob Tantlinger

Field Summary
static java.lang.String MISC
          Misc icons that are unsized
static java.lang.String X16
          The 16 x 16 icon package
static java.lang.String X24
          The 24 x 24 icon package
static java.lang.String X32
          The 32 x 32 icon package
static java.lang.String X48
          The 48 x 48 icon package
 
Constructor Summary
UIUtils()
           
 
Method Summary
static javax.swing.JMenuItem addMenuItem(javax.swing.JMenu menu, javax.swing.Action action)
           
static javax.swing.JMenuItem addMenuItem(javax.swing.JPopupMenu menu, javax.swing.Action action)
           
static javax.swing.AbstractButton addToolBarButton(javax.swing.JToolBar tb, javax.swing.AbstractButton button)
           
static javax.swing.AbstractButton addToolBarButton(javax.swing.JToolBar tb, javax.swing.AbstractButton button, boolean focusable, boolean showIconOnly)
           
static javax.swing.AbstractButton addToolBarButton(javax.swing.JToolBar tb, javax.swing.Action a)
           
static javax.swing.AbstractButton addToolBarButton(javax.swing.JToolBar tb, javax.swing.Action a, boolean focusable, boolean showIconOnly)
           
static javax.swing.ImageIcon createImageIcon(java.lang.String path)
          Create an ImageIcon from the image at the specified path
static javax.swing.ImageIcon getIcon(java.lang.String path)
          Gets the icon at the specified path
static javax.swing.ImageIcon getIcon(java.lang.String _package, java.lang.String iconName)
          Gets the icon in the specified package with the specified name.
static void showError(java.awt.Component owner, java.lang.String msg)
          Shows an error message dialog
static void showError(java.awt.Component owner, java.lang.String title, java.lang.String msg)
          Shows an error message dialog
static void showError(java.awt.Component c, java.lang.Throwable ex)
           
static void showError(java.awt.Dialog owner, java.lang.String title, java.lang.Throwable th)
          Shows an exception dialog
static void showError(java.awt.Dialog owner, java.lang.Throwable th)
          Shows an exception dialog
static void showError(java.awt.Frame owner, java.lang.String title, java.lang.Throwable th)
          Shows an exception dialog
static void showError(java.awt.Frame owner, java.lang.Throwable th)
          Shows an exception dialog
static void showError(java.lang.String msg)
          Shows an error message dialog
static void showInfo(java.awt.Component owner, java.lang.String msg)
          Shows an info dialog
static void showInfo(java.awt.Component owner, java.lang.String title, java.lang.String msg)
          Shows an info dialog
static void showInfo(java.lang.String msg)
          Shows an info dialog
static void showWarning(java.awt.Component owner, java.lang.String msg)
          Shows a warning dialog
static void showWarning(java.awt.Component owner, java.lang.String title, java.lang.String msg)
          Shows a warning dialog
static void showWarning(java.lang.String msg)
          Shows a warning dialog
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

X16

public static final java.lang.String X16
The 16 x 16 icon package

See Also:
Constant Field Values

X24

public static final java.lang.String X24
The 24 x 24 icon package

See Also:
Constant Field Values

X32

public static final java.lang.String X32
The 32 x 32 icon package

See Also:
Constant Field Values

X48

public static final java.lang.String X48
The 48 x 48 icon package

See Also:
Constant Field Values

MISC

public static final java.lang.String MISC
Misc icons that are unsized

See Also:
Constant Field Values
Constructor Detail

UIUtils

public UIUtils()
Method Detail

getIcon

public static javax.swing.ImageIcon getIcon(java.lang.String _package,
                                            java.lang.String iconName)
Gets the icon in the specified package with the specified name. A package might be UIUtils.X16, UIUtils.X32, etc

Parameters:
_package -
iconName -
Returns:
The icon, or null if the icon doesn't exist

getIcon

public static javax.swing.ImageIcon getIcon(java.lang.String path)
Gets the icon at the specified path

Parameters:
path - The path of the icon
Returns:
The icon, or null if the icon file doesn't exist

createImageIcon

public static javax.swing.ImageIcon createImageIcon(java.lang.String path)
Create an ImageIcon from the image at the specified path

Parameters:
path - The path of the image
Returns:
The image icon, or null if the image doesn't exist

showError

public static void showError(java.lang.String msg)
Shows an error message dialog

Parameters:
msg -

showError

public static void showError(java.awt.Component c,
                             java.lang.Throwable ex)

showError

public static void showError(java.awt.Component owner,
                             java.lang.String msg)
Shows an error message dialog

Parameters:
owner -
msg -

showError

public static void showError(java.awt.Component owner,
                             java.lang.String title,
                             java.lang.String msg)
Shows an error message dialog

Parameters:
owner -
title -
msg -

showError

public static void showError(java.awt.Frame owner,
                             java.lang.String title,
                             java.lang.Throwable th)
Shows an exception dialog

Parameters:
owner -
title -
th -

showError

public static void showError(java.awt.Frame owner,
                             java.lang.Throwable th)
Shows an exception dialog

Parameters:
owner -
th -

showError

public static void showError(java.awt.Dialog owner,
                             java.lang.String title,
                             java.lang.Throwable th)
Shows an exception dialog

Parameters:
owner -
title -
th -

showError

public static void showError(java.awt.Dialog owner,
                             java.lang.Throwable th)
Shows an exception dialog

Parameters:
owner -
th -

showWarning

public static void showWarning(java.awt.Component owner,
                               java.lang.String title,
                               java.lang.String msg)
Shows a warning dialog

Parameters:
owner -
title -
msg -

showWarning

public static void showWarning(java.awt.Component owner,
                               java.lang.String msg)
Shows a warning dialog

Parameters:
owner -
msg -

showWarning

public static void showWarning(java.lang.String msg)
Shows a warning dialog

Parameters:
msg -

showInfo

public static void showInfo(java.awt.Component owner,
                            java.lang.String title,
                            java.lang.String msg)
Shows an info dialog

Parameters:
owner -
title -
msg -

showInfo

public static void showInfo(java.awt.Component owner,
                            java.lang.String msg)
Shows an info dialog

Parameters:
owner -
msg -

showInfo

public static void showInfo(java.lang.String msg)
Shows an info dialog

Parameters:
msg -

addToolBarButton

public static javax.swing.AbstractButton addToolBarButton(javax.swing.JToolBar tb,
                                                          javax.swing.Action a)

addToolBarButton

public static javax.swing.AbstractButton addToolBarButton(javax.swing.JToolBar tb,
                                                          javax.swing.Action a,
                                                          boolean focusable,
                                                          boolean showIconOnly)

addToolBarButton

public static javax.swing.AbstractButton addToolBarButton(javax.swing.JToolBar tb,
                                                          javax.swing.AbstractButton button)

addToolBarButton

public static javax.swing.AbstractButton addToolBarButton(javax.swing.JToolBar tb,
                                                          javax.swing.AbstractButton button,
                                                          boolean focusable,
                                                          boolean showIconOnly)

addMenuItem

public static javax.swing.JMenuItem addMenuItem(javax.swing.JMenu menu,
                                                javax.swing.Action action)

addMenuItem

public static javax.swing.JMenuItem addMenuItem(javax.swing.JPopupMenu menu,
                                                javax.swing.Action action)