suncertify.common
Class ConfigSetter

java.lang.Object
  |
  +--suncertify.common.ConfigSetter
All Implemented Interfaces:
java.awt.event.ActionListener, java.util.EventListener

public class ConfigSetter
extends java.lang.Object
implements java.awt.event.ActionListener

Class that represents GUI for changing the configuration. It implments ActionListener interface so it may be easy attached to button and menu. All configurable values are displayed in no modable dependent window. Depending on the mode it runs (server, local client, remote client) some of them are editable and some none. User may change values and accept the changes (modifying properties file), cancel or request restore of default values. The window contains the fields:

See Also:
PropertiesWrapper

Field Summary
static int LOCAL_CLIENT_MODE
          local client mode - only database file name field is enabled
static int REMOTE_CLIENT_MODE
          remote client mode - only host name, port and login are enabled
static int SERVER_MODE
          server mode - only host name, port, databse file name fields are enabled
 
Constructor Summary
ConfigSetter(javax.swing.JFrame frame, int mode, ConfigChangeListener listener)
          Construct the ConfigSetter, sets all the data pqssed in constructor and gets reference to the PropertiesWrapper singleton
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
          Implmentation of the interface actionPerformed method.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SERVER_MODE

public static final int SERVER_MODE
server mode - only host name, port, databse file name fields are enabled

See Also:
Constant Field Values

LOCAL_CLIENT_MODE

public static final int LOCAL_CLIENT_MODE
local client mode - only database file name field is enabled

See Also:
Constant Field Values

REMOTE_CLIENT_MODE

public static final int REMOTE_CLIENT_MODE
remote client mode - only host name, port and login are enabled

See Also:
Constant Field Values
Constructor Detail

ConfigSetter

public ConfigSetter(javax.swing.JFrame frame,
                    int mode,
                    ConfigChangeListener listener)
Construct the ConfigSetter, sets all the data pqssed in constructor and gets reference to the PropertiesWrapper singleton

Parameters:
frame - - the parent frame for the configuration dialog
mode - - mode to work in (server, local client, remote client)
listener - - the configuration changes listener - will be notify when user finishes making changes and save them
Method Detail

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Implmentation of the interface actionPerformed method. Sets all the needed components, makes them enable according to the mode specified in constructor and opens the dialog.

Specified by:
actionPerformed in interface java.awt.event.ActionListener
Parameters:
e - - event details (required by the interface spec., not used in implementation)
See Also:
ActionListener.actionPerformed(ActionEvent)