org.merlotxml.merlot
Class MerlotUtils

java.lang.Object
  extended byorg.merlotxml.merlot.MerlotUtils
All Implemented Interfaces:
MerlotConstants

public class MerlotUtils
extends java.lang.Object
implements MerlotConstants

Utilities for Merlot

Author:
Kelly A. Campbell

Nested Class Summary
static class MerlotUtils.ToolbarButtonMouseListener
           
 
Field Summary
static java.lang.String MNEMONIC_KEY
           
 
Fields inherited from interface org.merlotxml.merlot.MerlotConstants
ACTION_MENU_ACCELERATOR, ACTION_MENU_ICON, ACTION_NAME, ACTION_SHORT_DESCRIPTION, ACTION_SMALL_ICON, AFTER, BEFORE, ERR, INTO, UI, XML
 
Constructor Summary
MerlotUtils()
           
 
Method Summary
static void addActionToMenu(javax.swing.Action a, javax.swing.MenuElement m)
          add an action to a menu.
static void addActionToMenu(javax.swing.Action a, javax.swing.MenuElement m, int position)
          Add an action to a menu at a specific position
static void addActionToToolBar(javax.swing.Action a, javax.swing.JToolBar toolbar)
          Add an action to a toolbar
static void addActionToToolBar(javax.swing.Action a, javax.swing.JToolBar toolbar, int position)
          Add an action to a toolbar at a specific location if the action is null a separator is added
static void copyFile(java.io.File from, java.io.File to)
          copy a file to a different file
static javax.swing.JMenuItem createActionMenuItem(javax.swing.Action a)
           
static javax.swing.JButton createButtonFromAction(javax.swing.Action a)
           
static javax.swing.JPanel createMultiLineLabel(java.lang.String s, int cols)
          creates a wrapped mulit-line label from several labels
static void loadActionResources(javax.swing.Action a, java.lang.String bundle, java.lang.String keyprefix)
          loads up the resources for an action
static java.lang.String wrapLines(java.lang.String s, int cols)
          Wraps lines at the given number of columns
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MNEMONIC_KEY

public static final java.lang.String MNEMONIC_KEY
See Also:
Constant Field Values
Constructor Detail

MerlotUtils

public MerlotUtils()
Method Detail

addActionToToolBar

public static void addActionToToolBar(javax.swing.Action a,
                                      javax.swing.JToolBar toolbar)
Add an action to a toolbar


addActionToToolBar

public static void addActionToToolBar(javax.swing.Action a,
                                      javax.swing.JToolBar toolbar,
                                      int position)
Add an action to a toolbar at a specific location if the action is null a separator is added


addActionToMenu

public static void addActionToMenu(javax.swing.Action a,
                                   javax.swing.MenuElement m)
add an action to a menu. Swing sucks


addActionToMenu

public static void addActionToMenu(javax.swing.Action a,
                                   javax.swing.MenuElement m,
                                   int position)
Add an action to a menu at a specific position


createActionMenuItem

public static javax.swing.JMenuItem createActionMenuItem(javax.swing.Action a)

loadActionResources

public static void loadActionResources(javax.swing.Action a,
                                       java.lang.String bundle,
                                       java.lang.String keyprefix)
loads up the resources for an action


copyFile

public static void copyFile(java.io.File from,
                            java.io.File to)
                     throws java.io.IOException
copy a file to a different file

Throws:
java.io.IOException

createButtonFromAction

public static javax.swing.JButton createButtonFromAction(javax.swing.Action a)

wrapLines

public static java.lang.String wrapLines(java.lang.String s,
                                         int cols)
Wraps lines at the given number of columns


createMultiLineLabel

public static javax.swing.JPanel createMultiLineLabel(java.lang.String s,
                                                      int cols)
creates a wrapped mulit-line label from several labels