Class ClearAllButton

java.lang.Object
java.util.Observable
com.nilhcem.fakesmtp.gui.info.ClearAllButton
All Implemented Interfaces:
Observer

public final class ClearAllButton extends Observable implements Observer
Button to clear all the information from the main panel.

The button will ask the user if he wants to delete the received emails or not.
If yes, emails will be deleted from file system.

Since:
1.0
Author:
Nilhcem
  • Constructor Details

    • ClearAllButton

      public ClearAllButton()
      Creates the "clear all" button"

      The button will be disabled by default, since no email is received when the application starts.
      The button will display a confirmation dialog to know if it needs to delete the received emails or not.
      If yes, emails will be deleted from the file system.

  • Method Details

    • get

      public JButton get()
      Returns the JButton object.
      Returns:
      the JButton object.
    • update

      public void update(Observable o, Object arg)
      Enables the button, so that the user can clear/delete emails.

      This method will be called by a MailSaver object when an email will be received.

      Specified by:
      update in interface Observer