Class 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 Detail

      • okWasClicked

        protected boolean okWasClicked
      • 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
      • 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.