public class ConfirmActionListener
extends java.lang.Object
implements java.awt.event.ActionListener
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
dialogMessage |
protected java.lang.String |
dialogTitle |
Constructor and Description |
---|
ConfirmActionListener(java.awt.Component caller,
java.lang.String title,
java.lang.String message)
The listener must be created with some "parent" component.
|
Modifier and Type | Method and Description |
---|---|
void |
actionPerformed(java.awt.event.ActionEvent e)
Forwards the event to registered listeners, but only if the user confirms.
|
void |
addActionListener(java.awt.event.ActionListener listener)
Adds an ActionListener to this component that will be notified
if t
|
protected boolean |
confirm(java.lang.String title,
java.lang.String message)
Returns true if the user confirms the action.
|
protected void |
fireEvent(java.awt.event.ActionEvent event)
Forwards the event to the listener registered with this component.
|
protected java.lang.String dialogTitle
protected java.lang.String dialogMessage
public ConfirmActionListener(java.awt.Component caller, java.lang.String title, java.lang.String message)
caller
- parent component.title
- show as window title of the dialogue popupmessage
- message for the user.public void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed
in interface java.awt.event.ActionListener
e
- event to be forwardedpublic void addActionListener(java.awt.event.ActionListener listener)
listener
- protected boolean confirm(java.lang.String title, java.lang.String message)
title
- show as window title of the dialogue popupmessage
- message for the user.protected void fireEvent(java.awt.event.ActionEvent event)
event
- to be forwarded.