issrg.acm.extensions
Class MultiChoiceSavingUtility

java.lang.Object
  extended by issrg.acm.SavingUtility
      extended by issrg.acm.DefaultSavingUtility
          extended by issrg.acm.extensions.MultiChoiceSavingUtility
All Implemented Interfaces:
Utility, java.awt.event.ItemListener, java.util.EventListener

public class MultiChoiceSavingUtility
extends DefaultSavingUtility
implements java.awt.event.ItemListener

This utility is used as the default utility. It has a list of saving utilities that the user can choose from. Then the drop-down list box can be used to pick the "location" - e.g. Disk or LDAP. Other implementations will be added to the list.


Field Summary
protected  java.util.Vector contentList
           
protected  javax.swing.JPanel contentPanel
           
protected  java.awt.Component current
           
protected  javax.swing.JComboBox jUtilList
           
protected  java.util.Vector utilList
           
 
Fields inherited from class issrg.acm.DefaultSavingUtility
dialog, dialogMode, LOAD_MODE, modal_result, REVOKE_MODE, SAVE_MODE
 
Constructor Summary
MultiChoiceSavingUtility()
           
MultiChoiceSavingUtility(Registry registry)
           
 
Method Summary
 void addUtility(java.lang.String label, DefaultSavingUtility ds)
           
 void delete()
          This method is invoked only after revoke().
 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.
protected  DefaultSavingUtility getSelected()
           
 void itemStateChanged(java.awt.event.ItemEvent e)
           
 AttributeCertificate load()
          This method returns an Attribute Certificate loaded by the utility, as specified by its controls.
 AttributeCertificate revoke()
          This method returns an Attribute Certificate loaded for revocation by the utility, as specified by its controls.
 void save(byte[] ac)
          This method saves the Attribute Certificate to the location, specified by the utility's controls.
 
Methods inherited from class issrg.acm.DefaultSavingUtility
approveSelection, attachControlButtons, cancelDialog, load, revoke, save
 
Methods inherited from class issrg.acm.SavingUtility
registerMe
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

utilList

protected java.util.Vector utilList

jUtilList

protected javax.swing.JComboBox jUtilList

contentList

protected java.util.Vector contentList

contentPanel

protected javax.swing.JPanel contentPanel

current

protected java.awt.Component current
Constructor Detail

MultiChoiceSavingUtility

public MultiChoiceSavingUtility()

MultiChoiceSavingUtility

public MultiChoiceSavingUtility(Registry registry)
Method Detail

addUtility

public void addUtility(java.lang.String label,
                       DefaultSavingUtility ds)

getSelected

protected DefaultSavingUtility getSelected()

load

public AttributeCertificate load()
                          throws ACCreationException
Description copied from class: DefaultSavingUtility
This method returns an Attribute Certificate loaded by the utility, as specified by its controls.

Specified by:
load in class DefaultSavingUtility
Returns:
issrg.ac.AttributeCertificate, loaded from the specified location; never null
Throws:
ACCreationException

save

public void save(byte[] ac)
          throws ACCreationException
Description copied from class: DefaultSavingUtility
This method saves the Attribute Certificate to the location, specified by the utility's controls.

Specified by:
save in class DefaultSavingUtility
Throws:
ACCreationException

revoke

public AttributeCertificate revoke()
                            throws ACCreationException
Description copied from class: DefaultSavingUtility
This method returns an Attribute Certificate loaded for revocation by the utility, as specified by its controls.

Specified by:
revoke in class DefaultSavingUtility
Returns:
issrg.ac.AttributeCertificate, loaded from the specified location; never null
Throws:
ACCreationException

delete

public void delete()
            throws ACCreationException
Description copied from class: SavingUtility
This method is invoked only after revoke(). It effectively tells the SavingUtility to delete the AC that has been selected during revoke() call.

Specified by:
delete in class SavingUtility
Throws:
ACCreationException - if anything went wrong and the AC could not be removed.

getContentPane

public java.awt.Component getContentPane(java.util.Map env,
                                         int dialogMode)
Description copied from class: DefaultSavingUtility
This method returns the Component that displays all the controls for the load/saving dialog. The boolean flag actually tells whether the operation is load or save.

Specified by:
getContentPane in class DefaultSavingUtility
Parameters:
env - - the environment that allows the component to initialise its fields and controls
dialogMode - - set to one of LOAD_MODE, SAVE_MODE or REVOKE_MODE, depending on the required content pane for the dialog
Returns:
java.awt.Component that contains all the necessary controls (without Load/Save/Cancel buttons)

itemStateChanged

public void itemStateChanged(java.awt.event.ItemEvent e)
Specified by:
itemStateChanged in interface java.awt.event.ItemListener