Class OKCancelListener
java.lang.Object
org.openjump.core.ui.swing.listener.OKCancelListener
- All Implemented Interfaces:
ActionListener, EventListener
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
FieldsModifier and TypeFieldDescriptionprotected JDialogprotected PersonalLoggerprotected booleanprotected ArrayList -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidactionPerformed(ActionEvent arg0) voidaddValueChecker(ValueChecker valChecker) The first invokation of this method enables value checking (enables/disables funtionality of the ok button)protected booleanvaluesOk()asks the existent value checkers (if any), if the values are okbooleanTells you, if ok was clicked to close the dialog
-
Field Details
-
okWasClicked
protected boolean okWasClicked -
dialog
-
logger
-
valueCheckers
-
-
Constructor Details
-
OKCancelListener
- Parameters:
dialog- dialog to be closed after ok or cancel was clicked.
-
-
Method Details
-
addValueChecker
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
- Specified by:
actionPerformedin 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.
-