public final class PortTextField extends Observable implements Observer
Constructor and Description |
---|
PortTextField()
Creates the port field object and adds a listener on change to alert the presentation model.
|
Modifier and Type | Method and Description |
---|---|
JTextField |
get()
Returns the JTextField object.
|
void |
setText(String portStr)
Sets the specified port in the text field only if this latter is not
null . |
void |
update(Observable o,
Object arg)
Enables or disables the port text field.
|
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
public PortTextField()
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.
public JTextField get()
public void setText(String portStr)
null
.portStr
- the port to set.public void update(Observable o, Object arg)
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.
Copyright © 2015. All rights reserved.