Package megamek.client.ui.preferences
Class JTablePreference
java.lang.Object
megamek.client.ui.preferences.PreferenceElement
megamek.client.ui.preferences.JTablePreference
- All Implemented Interfaces:
MouseListener,EventListener
JTablePreference monitors the latest sort column and sort order of a JTable. It sets the saved values when a dialog
is loaded and changes them as they change.
Call preferences.manage(new JTablePreference(JTable)) to use this preference, on a JTable 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.voidmouseClicked(MouseEvent evt) voidmouseEntered(MouseEvent evt) voidmouseExited(MouseEvent evt) voidmousePressed(MouseEvent evt) voidmouseReleased(MouseEvent evt) voidsetColumnIndex(int columnIndex) voidsetSortOrder(SortOrder sortOrder) Methods inherited from class megamek.client.ui.preferences.PreferenceElement
getName
-
Constructor Details
-
JTablePreference
- Throws:
Exception
-
-
Method Details
-
getWeakReference
-
getColumnIndex
public int getColumnIndex() -
setColumnIndex
public void setColumnIndex(int columnIndex) -
getSortOrder
-
setSortOrder
-
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
-
mouseClicked
- Specified by:
mouseClickedin interfaceMouseListener
-
mousePressed
- Specified by:
mousePressedin interfaceMouseListener
-
mouseReleased
- Specified by:
mouseReleasedin interfaceMouseListener
-
mouseEntered
- Specified by:
mouseEnteredin interfaceMouseListener
-
mouseExited
- Specified by:
mouseExitedin interfaceMouseListener
-