Package megamek.client.ui.preferences
Class JTabbedPanePreference
java.lang.Object
megamek.client.ui.preferences.PreferenceElement
megamek.client.ui.preferences.JTabbedPanePreference
- All Implemented Interfaces:
EventListener,ChangeListener
JTabbedPanePreference monitors the selected tab of a JTabbedPane. It sets the saved value when a dialog is loaded and
changes it as it changes.
Call preferences.manage(new JTabbedPanePreference(JTabbedPane)) to use this preference, on a JTabbedPane that has called setName
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddispose()Cleans the preference resources.intprotected StringgetValue()Gets the current value for the preference.protected voidinitialize(String value) Sets the initial value for the preference.voidsetSelectedIndex(int selectedIndex) voidstateChanged(ChangeEvent evt) Methods inherited from class megamek.client.ui.preferences.PreferenceElement
getName
-
Constructor Details
-
JTabbedPanePreference
- Throws:
Exception
-
-
Method Details
-
getWeakReference
-
getSelectedIndex
public int getSelectedIndex() -
setSelectedIndex
public void setSelectedIndex(int selectedIndex) -
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
-
stateChanged
- Specified by:
stateChangedin interfaceChangeListener
-