Package megamek.client.ui.preferences
Class JTextFieldPreference
java.lang.Object
megamek.client.ui.preferences.PreferenceElement
megamek.client.ui.preferences.JTextFieldPreference
- All Implemented Interfaces:
EventListener,DocumentListener
JTextFieldPreference monitors the text value of a JTextField. It sets the saved value when a dialog is loaded and
changes it as it changes.
Call preferences.manage(new JTextFieldPreference(JTextField)) to use this preference, on a JTextField that has called setName
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class megamek.client.ui.preferences.PreferenceElement
getName
-
Constructor Details
-
JTextFieldPreference
- Throws:
Exception
-
-
Method Details
-
getWeakReference
-
getText
-
setText
-
getValue
Description copied from class:PreferenceElementGets the current value for the preference.- Specified by:
getValuein classPreferenceElement- Returns:
- the value of the preference.
-
initialize
Description copied from class:PreferenceElementSets the initial value for the preference.- Specified by:
initializein classPreferenceElement- Parameters:
value- initial value.- Throws:
Exception- if there's an error during initialization
-
dispose
protected void dispose()Description copied from class:PreferenceElementCleans the preference resources.- Specified by:
disposein classPreferenceElement
-
insertUpdate
- Specified by:
insertUpdatein interfaceDocumentListener
-
removeUpdate
- Specified by:
removeUpdatein interfaceDocumentListener
-
changedUpdate
- Specified by:
changedUpdatein interfaceDocumentListener
-