nl.lxtreme.ols.tool.base
Class ToolUtils

java.lang.Object
  extended by nl.lxtreme.ols.tool.base.ToolUtils

public class ToolUtils
extends Object


Nested Class Summary
static interface ToolUtils.RestorableAction
          Provides an action that can be restored to a particular (initial) state.
 
Constructor Summary
ToolUtils()
           
 
Method Summary
static JButton createCloseButton()
          Convenience method to create a close button that closes this dialog.
static JButton createExportButton(ExportAware<?> aToolDialog)
          Factory method for creating an "export" button that -upon execution- calls the methods #storeToCsvFile(File, Object) or #storeToHtmlFile(File, Object).
static JButton createRunAnalysisButton(ToolDialog aToolDialog)
          Factory method for creating a "run analysis" button that -upon execution- creates and starts the tool worker.
static void setComboBoxIndex(JComboBox aComboBox, int aIndex)
           
static void showErrorMessage(Window aParent, String aMessage)
          Convenience method to show an error message.
static void showMessage(Window aParent, String aMessage)
          Convenience method to show a (information) message.
static void showWarningMessage(Window aParent, String aMessage)
          Convenience method to show a warning message.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ToolUtils

public ToolUtils()
Method Detail

createCloseButton

public static JButton createCloseButton()
Convenience method to create a close button that closes this dialog.

Returns:
a button with a StandardActionFactory.CloseAction instance, never null.

createExportButton

public static JButton createExportButton(ExportAware<?> aToolDialog)
Factory method for creating an "export" button that -upon execution- calls the methods #storeToCsvFile(File, Object) or #storeToHtmlFile(File, Object).

Returns:
an "export" button, with keyboard shortcuts enabled, never null.

createRunAnalysisButton

public static JButton createRunAnalysisButton(ToolDialog aToolDialog)
Factory method for creating a "run analysis" button that -upon execution- creates and starts the tool worker.

Returns:
a "run analysis" button, with keyboard shortcuts enabled, never null.

setComboBoxIndex

public static void setComboBoxIndex(JComboBox aComboBox,
                                    int aIndex)
Parameters:
aComboBox -
aIndex -

showErrorMessage

public static void showErrorMessage(Window aParent,
                                    String aMessage)
Convenience method to show an error message.

Parameters:
aParent - the parent window to use, can be null;
aMessage - the error message to show, cannot be null.

showMessage

public static void showMessage(Window aParent,
                               String aMessage)
Convenience method to show a (information) message.

Parameters:
aParent - the parent window to use, can be null;
aMessage - the message to show, cannot be null.

showWarningMessage

public static void showWarningMessage(Window aParent,
                                      String aMessage)
Convenience method to show a warning message.

Parameters:
aParent - the parent window to use, can be null;
aMessage - the warning message to show, cannot be null.


Copyright © 2012 L'Xtreme IT consultancy. All Rights Reserved.