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 void
dispose()
Cleans the preference resources.int
protected String
getValue()
Gets the current value for the preference.protected void
initialize
(String value) Sets the initial value for the preference.void
mouseClicked
(MouseEvent evt) void
mouseEntered
(MouseEvent evt) void
mouseExited
(MouseEvent evt) void
mousePressed
(MouseEvent evt) void
mouseReleased
(MouseEvent evt) void
setColumnIndex
(int columnIndex) void
setSortOrder
(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:PreferenceElement
Gets the current value for the preference.- Specified by:
getValue
in classPreferenceElement
- Returns:
- the value of the preference.
-
initialize
Description copied from class:PreferenceElement
Sets the initial value for the preference.- Specified by:
initialize
in classPreferenceElement
- Parameters:
value
- initial value.- Throws:
Exception
- if there's an error during initialization
-
dispose
protected void dispose()Description copied from class:PreferenceElement
Cleans the preference resources.- Specified by:
dispose
in classPreferenceElement
-
mouseClicked
- Specified by:
mouseClicked
in interfaceMouseListener
-
mousePressed
- Specified by:
mousePressed
in interfaceMouseListener
-
mouseReleased
- Specified by:
mouseReleased
in interfaceMouseListener
-
mouseEntered
- Specified by:
mouseEntered
in interfaceMouseListener
-
mouseExited
- Specified by:
mouseExited
in interfaceMouseListener
-