net.sf.genuine.organizer
Interface HelperService

All Known Subinterfaces:
InternalHelperService
All Known Implementing Classes:
DefaultHelperService

public interface HelperService

The helper service provides various services to modules that are not implemented anywhere else. These services include:

The helper service instance can be accessed using the module manager's method ModuleManager.getHelperService().

Author:
Tim Wellhausen

Method Summary
 void showException(java.lang.Exception exception)
          Shows the reason for an exception in a message box and prints the stack trace in the console.
 java.lang.String showMessage(ResourceItem resourceItem)
          Shows an message that is defined by the given resource item.
 java.lang.String showMessage(ResourceItem resourceItem, java.lang.Object[] parameters)
          See showMessage(ResourceItem) for general information about showing a message.
 java.lang.String showMessage(java.lang.String resourceItemName)
          Shows an message that is defined by the given resource item.
 java.lang.String showMessage(java.lang.String resourceItemName, java.lang.Object[] parameters)
          See showMessage(ResourceItem) for general information about showing a message.
 

Method Detail

showException

public void showException(java.lang.Exception exception)
Shows the reason for an exception in a message box and prints the stack trace in the console.

Parameters:
exception - The exception to be shown.

showMessage

public java.lang.String showMessage(java.lang.String resourceItemName)
Shows an message that is defined by the given resource item. If the 'type' property of the resource item is "status", the message will be shown in the application status bar. If the type of the resource type is "info", "warning", or "error", a modal message box is shown.

The message that is shown is defined by the 'text' property of the resource item. If you call this method, no parameters are expected.

A message box contains a number of buttons that are defined by the 'choices' property. That property takes a comma-separated list of resource item names. For each resource item in that list, a button is initialized with the resource item. The title of the message box is defined by the 'title' property.

Parameters:
resourceItemName - The name of a resource item that is fetched using the ResourceManager. The resource item has to contain the properties of the message to be shown
Returns:
If a status message was shown, null is returned. If a message box was shown, the name of the resource item that is associated with the button the user has pressed is returned.

showMessage

public java.lang.String showMessage(ResourceItem resourceItem)
Shows an message that is defined by the given resource item. If the 'type' property of the resource item is "status", the message will be shown in the application status bar. If the type of the resource type is "info", "warning", or "error", a modal message box is shown.

The message that is shown is defined by the 'text' property of the resource item. If you call this method, no parameters are expected.

A message box contains a number of buttons that are defined by the 'choices' property. That property takes a comma-separated list of resource item names. For each resource item in that list, a button is initialized with the resource item. The title of the message box is defined by the 'title' property.

Parameters:
resourceItem - A resource item that contains the properties of the message to be shown
Returns:
If a status message was shown, null is returned. If a message box was shown, the name of the resource item that is associated with the button the user has pressed is returned.

showMessage

public java.lang.String showMessage(java.lang.String resourceItemName,
                                    java.lang.Object[] parameters)
See showMessage(ResourceItem) for general information about showing a message. This method additionally takes an array of objects that is inserted into the message text as parameters. See MessageFormat for details.

Parameters:
resourceItemName - The name of a resource item that is fetched using the ResourceManager. The resource item has to contain the properties of the message to be shown
parameters - An array of objects that is inserted into the message as parameters as defined by MessageFormat.
Returns:
If a status message was shown, null is returned. If a message box was shown, the name of the resource item that is associated with the button the user has pressed is returned.

showMessage

public java.lang.String showMessage(ResourceItem resourceItem,
                                    java.lang.Object[] parameters)
See showMessage(ResourceItem) for general information about showing a message. This method additionally takes an array of objects that is inserted into the message text as parameters. See MessageFormat for details.

Parameters:
resourceItem - A resource item that contains the properties of the message to be shown
parameters - An array of objects that is inserted into the message as parameters as defined by MessageFormat.
Returns:
If a status message was shown, null is returned. If a message box was shown, the name of the resource item that is associated with the button the user has pressed is returned.