com.gridsystems.config.app
Class UI

java.lang.Object
  extended by com.gridsystems.config.app.UI
Direct Known Subclasses:
SwingUI

public abstract class UI
extends java.lang.Object

Root class and provider for user interface delegation. Each subclass is specialized in a specific type of user interface environment.

Version:
1.0
Author:
Rodrigo Ruiz Aguayo

Field Summary
protected static Configurator[] configurators
          The list of discovered configurators.
static int CONSOLE
          Specified the Console UI.
static int NONE
          Specifies the Null UI.
static int SWING
          Specifies the Swing UI.
 
Constructor Summary
UI()
          Default constructor.
 
Method Summary
abstract  boolean execute()
          UI specific execution.
static Configurator[] getConfigurators()
          Builds the list of Configutator implementations in the classpath through inspection of "configurator.txt" resources found via ClassLoader.
static java.lang.String getString(java.lang.String key)
          Gets the message corresponding to the specified key in the "base" bundle.
static boolean isExpertMode()
          Gets if the configurator is running in "expert mode".
static void main(java.lang.String[] args)
          Performs the execution of the appropriate UI implementation, according to the passed command-line arguments.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NONE

public static final int NONE
Specifies the Null UI.

See Also:
Constant Field Values

SWING

public static final int SWING
Specifies the Swing UI.

See Also:
Constant Field Values

CONSOLE

public static final int CONSOLE
Specified the Console UI.

See Also:
Constant Field Values

configurators

protected static Configurator[] configurators
The list of discovered configurators.

Constructor Detail

UI

public UI()
Default constructor.

Method Detail

execute

public abstract boolean execute()
UI specific execution.

Returns:
boolean

getString

public static java.lang.String getString(java.lang.String key)
Gets the message corresponding to the specified key in the "base" bundle.

This method is here to give easy access to the base bundle without knowledge of the bundle name or location.

Parameters:
key - The key of the message to retrieve
Returns:
The message

isExpertMode

public static boolean isExpertMode()
Gets if the configurator is running in "expert mode".

Returns:
true if the configurator is in expert mode

getConfigurators

public static Configurator[] getConfigurators()
Builds the list of Configutator implementations in the classpath through inspection of "configurator.txt" resources found via ClassLoader.

Each "configurator.txt" resource is expected to contain a list of Configurator classes.

Returns:
An array of Configurator instances

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Performs the execution of the appropriate UI implementation, according to the passed command-line arguments.

Parameters:
args - The command-line arguments
Throws:
java.lang.Exception - In case of an unhandled error


Copyright © 2007-2008 Grid Systems, S.A.. All Rights Reserved.