|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.gridsystems.config.Configurator
public abstract class Configurator
Plugin Configurator base class. Subclasses will act as controllers in an MVC pattern.
| Field Summary | |
|---|---|
static int |
MODE_CONSOLE
This mode forces ConsoleUI to be used. |
static int |
MODE_SILENT
This mode forces NullUI to be used. |
static int |
MODE_SWING
This mode forces SwingUI to be used. |
| Constructor Summary | |
|---|---|
Configurator(java.util.ResourceBundle bundle,
java.lang.String keyBase)
Constructor. |
|
Configurator(java.lang.String bundleName,
java.lang.String keyBase)
Constructor. |
|
| Method Summary | |
|---|---|
void |
apply()
Saves the view values into the model, and applies it. |
protected abstract ConfiguratorModel |
createModel()
Creates a new model instance. |
void |
discard()
Cancels the current view changes, and reloads the model values into it. |
java.util.ResourceBundle |
getBundle()
Gets the resource bundle associated to this configuration instance. |
protected abstract ConsoleConfiguratorView |
getConsoleView()
Gets a view for MODE_CONSOLE. |
static java.lang.String |
getContextDir()
Gets the path to the kernel context directory. |
ConfiguratorModel |
getModel()
Gets a reference to the model of this configurator. |
java.lang.String |
getName()
Gets a name for this instance. |
java.lang.String |
getPath()
Gets a path for this instance. |
protected abstract SwingConfiguratorView |
getSwingView()
Gets a view for MODE_SWING. |
static java.lang.String |
getUsername()
Gets the username. |
ConfiguratorView |
getView()
Gets the view corresponding to the current view mode, or null if no suitable view is available. |
static int |
getViewMode()
Gets the current global view mode. |
boolean |
hasView()
Gets if a view exists for the current mode. |
static boolean |
isClosing()
Tells if the configurator is being closed. |
static void |
setClosing(boolean closing)
Sets if the configurator is being closed. |
void |
setErrorListener(ErrorListener listener)
Sets the error listener of this configurator. |
void |
setModel(ConfiguratorModel model)
Sets the model of this configurator. |
static void |
setUsername(java.lang.String newUsername)
Sets the username. |
static void |
setViewMode(int mode)
Sets the global view mode. |
void |
updateError(java.lang.String id,
java.lang.String message,
boolean add)
Notifies the listener about an error. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int MODE_SILENT
public static final int MODE_SWING
public static final int MODE_CONSOLE
| Constructor Detail |
|---|
public Configurator(java.lang.String bundleName,
java.lang.String keyBase)
bundleName - The name of the bundle to usekeyBase - The root of the bundle keys
public Configurator(java.util.ResourceBundle bundle,
java.lang.String keyBase)
bundle - The bundle to usekeyBase - The root of the bundle keys| Method Detail |
|---|
public java.lang.String getName()
keyBase + ".name"
public java.lang.String getPath()
keyBase + ".path".
The path syntax is its path in the menu tree, with nodes separated by dot (.) characters.
public java.util.ResourceBundle getBundle()
public ConfiguratorModel getModel()
public void setModel(ConfiguratorModel model)
model - The modelpublic static void setViewMode(int mode)
mode - The new view modepublic static int getViewMode()
public static void setUsername(java.lang.String newUsername)
newUsername - the new usernamepublic static java.lang.String getUsername()
public static java.lang.String getContextDir()
../webapps/kernel as its default value. The user can
specify an alternate path by adding -Dkernel.context=[path] to
the command line.
public ConfiguratorView getView()
public boolean hasView()
true if this instance defines a view for the current modeprotected abstract SwingConfiguratorView getSwingView()
MODE_SWING.
protected abstract ConsoleConfiguratorView getConsoleView()
MODE_CONSOLE.
protected abstract ConfiguratorModel createModel()
public void apply()
throws java.lang.Exception
java.lang.Exception - In case of error during model applypublic void discard()
public void setErrorListener(ErrorListener listener)
listener - The listener
public void updateError(java.lang.String id,
java.lang.String message,
boolean add)
id - The error identifiermessage - The error messageadd - The error action flagpublic static void setClosing(boolean closing)
closing - true if and only if the configurator is being closed.public static boolean isClosing()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||