|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object issrg.acm.SavingUtility issrg.acm.DefaultSavingUtility
public abstract class DefaultSavingUtility
This class defines the default behaviour of the Saving Utilities. It defines two specialised load/save methods, which are non-graphical anymore. Instead, it added an abstract getContentPanel method, which should return the panel with the graphical controls (apart from the load/save/cancel buttons). This panel will be displayed in a consistent manner, and if load/save button is pressed, the load/save method will be called. If cancel is pressed, no action is taken.
Field Summary | |
---|---|
protected static javax.swing.JDialog |
dialog
|
int |
dialogMode
|
static int |
LOAD_MODE
|
protected static int[] |
modal_result
|
static int |
REVOKE_MODE
|
static int |
SAVE_MODE
|
Constructor Summary | |
---|---|
DefaultSavingUtility()
|
Method Summary | |
---|---|
void |
approveSelection()
This method should check, if the currently selected location is OK with the user (e.g. |
java.awt.Component |
attachControlButtons(java.awt.Component content,
int dialogMode)
This method allows to attach two control buttons at the bottom of the control panel, so the dialogs will have generic look. |
void |
cancelDialog()
|
abstract java.awt.Component |
getContentPane(java.util.Map env,
int dialogMode)
This method returns the Component that displays all the controls for the load/saving dialog. |
abstract AttributeCertificate |
load()
This method returns an Attribute Certificate loaded by the utility, as specified by its controls. |
AttributeCertificate |
load(java.awt.Frame frame,
java.util.Map env)
This is the default loading behaviour: this method gets the Content Pane of the concrete instance of the Saving Utility, then displays a dialog with this pane, and two buttons: Load and Cancel. |
abstract AttributeCertificate |
revoke()
This method returns an Attribute Certificate loaded for revocation by the utility, as specified by its controls. |
AttributeCertificate |
revoke(java.awt.Frame frame,
java.util.Map env)
This is the default revocation behaviour: this method gets the Content Pane of the concrete instance of the Saving Utility, then displays a dialog with this pane, and two buttons: Revoke and Cancel. |
abstract void |
save(byte[] ac)
This method saves the Attribute Certificate to the location, specified by the utility's controls. |
void |
save(java.awt.Frame frame,
byte[] ac,
java.util.Map env)
This is the default saving behaviour: this method gets the Content Pane of the concrete instance of the Saving Utility, then displays a dialog with this pane, and two buttons: Save and Cancel. |
Methods inherited from class issrg.acm.SavingUtility |
---|
delete, registerMe |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int LOAD_MODE
public static final int SAVE_MODE
public static final int REVOKE_MODE
protected static javax.swing.JDialog dialog
protected static int[] modal_result
public int dialogMode
Constructor Detail |
---|
public DefaultSavingUtility()
Method Detail |
---|
public abstract java.awt.Component getContentPane(java.util.Map env, int dialogMode)
env
- - the environment that allows the component to initialise its
fields and controlsdialogMode
- - set to one of LOAD_MODE, SAVE_MODE or REVOKE_MODE,
depending on the required content pane for the dialog
public abstract AttributeCertificate load() throws ACCreationException
ACCreationException,
- if loading or parsing the data failed
ACCreationException
public abstract AttributeCertificate revoke() throws ACCreationException
ACCreationException,
- if loading or parsing the data failed
ACCreationException
public abstract void save(byte[] ac) throws ACCreationException
ACCreationException,
- if saving the data failed
ACCreationException
public void approveSelection()
Override to ask questions or display error messages.
public void cancelDialog()
public void save(java.awt.Frame frame, byte[] ac, java.util.Map env) throws ACCreationException
save
in class SavingUtility
frame
- the java.awt.Frame, to which this utility can display a
modal windowac
- a correctly encoded Attribute Certificate to save; the utility
may want to check whether it is an AC (or get particular values from
it, like Holder DN) by calling a BER decoder. For security reasons
you should not assume you could save anything.env
- a java.util.Map with environmental variables there; the
implementation is expected to get useful configuration information from
there.
ACCreationException
public AttributeCertificate load(java.awt.Frame frame, java.util.Map env) throws ACCreationException
load
in class SavingUtility
frame
- the java.awt.Frame, to which this utility can display a
modal windowenv
- a java.util.Map with environmental variables there; the
intention is to let the method know any configuration parameters it
may want to know
ACCreationException
public AttributeCertificate revoke(java.awt.Frame frame, java.util.Map env) throws ACCreationException
revoke
in class SavingUtility
frame
- the java.awt.Frame, to which this utility can display a
modal windowenv
- a java.util.Map with environmental variables there; the
intention is to let the method know any configuration parameters it
may want to know
ACCreationException
public java.awt.Component attachControlButtons(java.awt.Component content, int dialogMode)
content
- - the component with all the controls, but the OK/Cancel buttonsdialogMode
- - the variable, specifying whether Load, Save or Revoke should be used to name the OK button
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |