Class PortTextField

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

public final class PortTextField extends Observable implements Observer
Text field in which will be written the desired SMTP port.
Since:
1.0
Author:
Nilhcem
  • Constructor Details

    • PortTextField

      public PortTextField()
      Creates the port field object and adds a listener on change to alert the presentation model.

      The default port's value is defined in the configuration.properties file.
      Each time the port is modified, the port from the UIModel will be reset.

  • Method Details

    • get

      public JTextField get()
      Returns the JTextField object.
      Returns:
      the JTextField object.
    • setText

      public void setText(String portStr)
      Sets the specified port in the text field only if this latter is not null.
      Parameters:
      portStr - the port to set.
    • update

      public void update(Observable o, Object arg)
      Enables or disables the port text field.

      When the element will receive an action from the StartServerButton object, it will enable or disable the port, so that the user can't modify it when the server is already launched.

      Specified by:
      update in interface Observer
      Parameters:
      o - the observable element which will notify this class.
      arg - optional parameters (not used).