Package megamek.client.ui.preferences
Class PreferenceElement
java.lang.Object
megamek.client.ui.preferences.PreferenceElement
- Direct Known Subclasses:
- JComboBoxPreference,- JDoubleNumberSpinnerPreference,- JIntNumberSpinnerPreference,- JListPreference,- JSplitPanePreference,- JTabbedPanePreference,- JTablePreference,- JTextFieldPreference,- JToggleButtonPreference,- JWindowPreference
Represents the set of information needed to be part of the user preferences system for MegaMek.
 
A preference is a value that the user can set anywhere in MegaMek and that will be persisted between user sessions.
 PreferenceElements are contained inside PreferencesNodes, forming a tree. You can imagine a PreferenceElement
 as a field, and a PreferencesNode as a class.
 
This class is not thread-safe.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprotected abstract voiddispose()Cleans the preference resources.protected StringgetName()Name for this preference.protected abstract StringgetValue()Gets the current value for the preference.protected abstract voidinitialize(String value) Sets the initial value for the preference.
- 
Constructor Details- 
PreferenceElement- Throws:
- Exception
 
 
- 
- 
Method Details- 
getNameName for this preference. The name has to be unique for this node.- Returns:
- the name of the preference.
 
- 
getValueGets the current value for the preference.- Returns:
- the value of the preference.
 
- 
initializeSets the initial value for the preference.- Parameters:
- value- initial value.
- Throws:
- Exception- if there's an error during initialization
 
- 
disposeprotected abstract void dispose()Cleans the preference resources.
 
-