Class OKCancelListener
- java.lang.Object
-
- org.openjump.core.ui.swing.listener.OKCancelListener
-
- All Implemented Interfaces:
ActionListener
,EventListener
public class OKCancelListener extends Object implements ActionListener
Class that implements a default Action Listener behavior for an OKCancelButtonPanel. It remembers if ok was clicked and closes a given dialog.- Version:
- $Rev: 856 $
- Author:
- Ole Rahn
FH Osnabrück - University of Applied Sciences Osnabrück,
Project: PIROL (2005),
Subproject: Daten- und Wissensmanagement
-
-
Field Summary
Fields Modifier and Type Field Description protected JDialog
dialog
protected PersonalLogger
logger
protected boolean
okWasClicked
protected ArrayList
valueCheckers
-
Constructor Summary
Constructors Constructor Description OKCancelListener(JDialog dialog)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
actionPerformed(ActionEvent arg0)
void
addValueChecker(ValueChecker valChecker)
The first invokation of this method enables value checking (enables/disables funtionality of the ok button)protected boolean
valuesOk()
asks the existent value checkers (if any), if the values are okboolean
wasOkClicked()
Tells you, if ok was clicked to close the dialog
-
-
-
Field Detail
-
okWasClicked
protected boolean okWasClicked
-
dialog
protected JDialog dialog
-
logger
protected PersonalLogger logger
-
valueCheckers
protected ArrayList valueCheckers
-
-
Constructor Detail
-
OKCancelListener
public OKCancelListener(JDialog dialog)
- Parameters:
dialog
- dialog to be closed after ok or cancel was clicked.
-
-
Method Detail
-
addValueChecker
public void addValueChecker(ValueChecker valChecker)
The first invokation of this method enables value checking (enables/disables funtionality of the ok button)- Parameters:
valChecker
- object that checks if the given value are ok or not
-
actionPerformed
public void actionPerformed(ActionEvent arg0)
- Specified by:
actionPerformed
in interfaceActionListener
-
valuesOk
protected boolean valuesOk()
asks the existent value checkers (if any), if the values are ok- Returns:
- true if values are ok, else false
-
wasOkClicked
public boolean wasOkClicked()
Tells you, if ok was clicked to close the dialog- Returns:
- Returns the okWasClicked.
-
-