Class MailsListPane

java.lang.Object
com.nilhcem.fakesmtp.gui.tab.MailsListPane
All Implemented Interfaces:
Observer

public final class MailsListPane extends Object implements Observer
Scrolled table where will be displayed every received email (one line for each email).

The user can double-click on any row to see the selected email.

Since:
1.0
Author:
Nilhcem
  • Constructor Details

    • MailsListPane

      public MailsListPane()
      Creates the table and sets its cells as non editable.

      Adds some mouse events on the table, to display emails, when a user clicks on a specific row.
      If the email can't be found, an error message will be displayed.
      The table will reset the size of its column every time the size of the table changed (for example when the user maximizes the window).

  • Method Details

    • get

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

      public void update(Observable o, Object arg)
      Updates the content of the table.

      This method will be called by an observable element.

      • If the observable is a MailSaver object, a new row will be added to the table, and the UIModel will be updated;
      • If the observable is a ClearAllButton object, all the cells of the table will be removed, and the UIModel will be updated.
      Specified by:
      update in interface Observer
      Parameters:
      o - the observable element which will notify this class.
      arg - optional parameters (an EmailModel object, for the case of a MailSaver observable) containing all the information about the email.