ActionListener, ItemListener, Serializable, Cloneable, EventListener, Action, ListSelectionListenerActionChangeBrowser, ActionExport, ActionInstall, ActionMakeDefault, ActionRenew, ActionRevoke, ActionShowDetails, ActionViewRequest, ActionViewVerificationFormpublic abstract class CertificateAction extends AbstractAction implements ListSelectionListener, ItemListener
Actions that operate on a CertificatePair.
It provides a default logger and keeps track of the currently selected certificate which can be retrieved by {#linkplain #getCertificate}.
The action has to be bound to a CertificateSelection by the caller of the
CertificateAction if you want the certificate to be updated when the
selection changes.
| Modifier and Type | Field | Description |
|---|---|---|
protected CertificatePair |
certificatePair |
|
protected boolean |
isWantEnabled |
|
protected static Logger |
logger |
|
protected JFrame |
parent |
|
protected CertificateSelection |
selection |
changeSupport, enabledACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, DISPLAYED_MNEMONIC_INDEX_KEY, LARGE_ICON_KEY, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SELECTED_KEY, SHORT_DESCRIPTION, SMALL_ICON| Constructor | Description |
|---|---|
CertificateAction(JFrame parent) |
|
CertificateAction(JFrame parent,
CertificateSelection s) |
| Modifier and Type | Method | Description |
|---|---|---|
abstract void |
actionPerformed(ActionEvent e) |
The actual handler when the action is performed
|
static Window |
findWindow(Component c) |
|
static Window |
findWindow(Object c) |
|
protected CertificatePair |
getCertificatePair() |
Get the certificate to operate on.
|
void |
itemStateChanged(ItemEvent e) |
Catch it when the certificate itself is changed, needed for
wantsEnabled() depending on the certificate state.
|
void |
setCertificatePair(CertificatePair cert) |
Set the certificate on which the action will be performed
|
void |
setEnabled(boolean e) |
Sets the enabled state of this CertificateAction.
|
void |
valueChanged(ListSelectionEvent e) |
Catch it when the certificate selection is changed
|
protected boolean |
wantsEnabled() |
Returns whether this action should be enabled or not.
|
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListenerprotected static Logger logger
protected CertificatePair certificatePair
protected CertificateSelection selection
protected JFrame parent
protected boolean isWantEnabled
public CertificateAction(JFrame parent, CertificateSelection s)
public CertificateAction(JFrame parent)
public void setCertificatePair(CertificatePair cert)
protected boolean wantsEnabled()
This is called when the selection changes and updates the enabled-state. It is not possible to just override the AbstractAction.isEnabled() method Swing gets confused about the enabled-ness of connected components when AbstractAction.isEnabled() is modified. By default it just returns isEnabled(), so the behaviour is unchanged from an ordinary Action.
public void setEnabled(boolean e)
Note that when no CertificatePair is currently selected, the action is always disabled. TODO explain better
setEnabled in interface ActionsetEnabled in class AbstractActionAbstractAction.setEnabled(boolean)public void valueChanged(ListSelectionEvent e)
valueChanged in interface ListSelectionListenerpublic void itemStateChanged(ItemEvent e)
itemStateChanged in interface ItemListenerprotected CertificatePair getCertificatePair()
public abstract void actionPerformed(ActionEvent e)
actionPerformed in interface ActionListenerCopyright © 2010-2018 Nikhef / Stichting FOM. All Rights Reserved.