org.cishell.service.guibuilder
Interface GUIBuilderService


public interface GUIBuilderService

A service for creating simple GUIs for user interaction. This service provides several methods for popping up dialog boxes to get or give very simple information and a more flexible way to create GUIs using a standard OSGi MetaTypeProvider. The MetaTypeProvider basically lists what input is needed (String, Integer, Float, etc...), a description of the input, and a way to validate input. See the CIShell Specification 1.0 for documentation on creating GUIs with this service. Algorithm writers are encouraged to use this service if they need to get additional input from the user rather than creating their own GUI. This is to ensure a consistent user input method and so that the GUI can easily be routed to the user when running remotely.

Author:
Bruce Herr (bh2@bh2.net)

Method Summary
 GUI createGUI(String id, MetaTypeProvider parameters)
          Creates a GUI for user interaction
 Dictionary createGUIandWait(String id, MetaTypeProvider parameters)
          Creates a GUI, gets data from the user, and returns what they entered.
 boolean showConfirm(String title, String message, String detail)
          Pops up a confirmation box to the user with an 'Ok' and 'Cancel' button
 void showError(String title, String message, String detail)
          Pops up an error box to the user.
 void showError(String title, String message, Throwable error)
          Pops up an error box to the user.
 void showInformation(String title, String message, String detail)
          Pops up an information box to the user.
 boolean showQuestion(String title, String message, String detail)
          Pops up a question box to the user with a 'Yes' and 'No' button
 void showWarning(String title, String message, String detail)
          Pops up a warning box to the user.
 

Method Detail

createGUI

GUI createGUI(String id,
              MetaTypeProvider parameters)
Creates a GUI for user interaction

Parameters:
id - The id to use to get the correct ObjectClassDefinition from the provided MetaTypeProvider
parameters - Provides the parameters needed to get information from the user
Returns:
The created GUI

createGUIandWait

Dictionary createGUIandWait(String id,
                            MetaTypeProvider parameters)
Creates a GUI, gets data from the user, and returns what they entered. This is a convenience method that first creates a GUI from the provided MetaTypeProvider, then pops the GUI up to the user, who then enters in the needed information, which is then taken and put into a Dictionary, and is given to this method's caller.

Parameters:
id - The id to use to get the correct ObjectClassDefinition from the provided MetaTypeProvider
parameters - Provides the parameters needed to get information from the user
Returns:
The data the user entered or null if the operation was cancelled

showConfirm

boolean showConfirm(String title,
                    String message,
                    String detail)
Pops up a confirmation box to the user with an 'Ok' and 'Cancel' button

Parameters:
title - The title of the pop-up
message - The message to display
detail - Additional details
Returns:
If they clicked "Ok," true, otherwise false

showQuestion

boolean showQuestion(String title,
                     String message,
                     String detail)
Pops up a question box to the user with a 'Yes' and 'No' button

Parameters:
title - The title of the pop-up
message - The question to display
detail - Additional details
Returns:
If they clicked "Yes," true, otherwise false

showInformation

void showInformation(String title,
                     String message,
                     String detail)
Pops up an information box to the user. This should only be used sparingly. Algorithms should try to use the LogService instead.

Parameters:
title - The title of the pop-up
message - The message to display
detail - Additional details

showWarning

void showWarning(String title,
                 String message,
                 String detail)
Pops up a warning box to the user. This should only be used sparingly. Algorithms should try to use the LogService instead.

Parameters:
title - The title of the pop-up
message - The message to display
detail - Additional details

showError

void showError(String title,
               String message,
               String detail)
Pops up an error box to the user. This should only be used sparingly. Algorithms should try to use the LogService instead.

Parameters:
title - The title of the pop-up
message - The message to display
detail - Additional details

showError

void showError(String title,
               String message,
               Throwable error)
Pops up an error box to the user. This should only be used sparingly. Algorithms should try to use the LogService instead.

Parameters:
title - The title of the pop-up
message - The message to display
error - The actual exception that was thrown