public class ColorPreference extends ExtensibleTabPreferenceSetting implements ListSelectionListener, TableModelListener
NamedColorProperty
Modifier and Type | Class and Description |
---|---|
private static class |
ColorPreference.ColorEntry |
private static class |
ColorPreference.ColorTableModel |
static class |
ColorPreference.Factory
Factory used to create a new
ColorPreference . |
Modifier and Type | Field and Description |
---|---|
private JButton |
colorEdit |
private JTable |
colors |
private JButton |
defaultSet |
private JButton |
remove |
private ColorPreference.ColorTableModel |
tableModel |
Constructor and Description |
---|
ColorPreference() |
Modifier and Type | Method and Description |
---|---|
void |
addGui(PreferenceTabbedPane gui)
Add the GUI elements to the dialog.
|
private static void |
fixColorPrefixes()
Add all missing color entries.
|
private static int |
getCategoryPriority(String category) |
Map<String,ColorInfo> |
getColors()
Returns a map with the colors in the table (key = preference key, value = color info).
|
String |
getHelpContext()
Returns the help context for this preferences settings tab.
|
boolean |
isExpert()
Called to know if the preferences tab has only to be displayed in expert mode.
|
private static boolean |
isRemoveColor(ColorPreference.ColorEntry ce) |
boolean |
ok()
Called when OK is pressed to save the setting in the preferences file.
|
void |
setColors(Map<String,ColorInfo> colorMap)
Set the colors to be shown in the preference table.
|
void |
tableChanged(TableModelEvent e) |
private void |
updateEnabledState() |
void |
valueChanged(ListSelectionEvent e) |
addSubTab, addSubTab, canBeHidden, createPreferenceTabWithScrollPane, getDescription, getIconName, getSelectedSubTab, getSubTab, getTabPane, getTitle, getTooltip, registerSubTab, selectSubTab
saveBoolean, saveDouble, saveInt
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getIcon
private ColorPreference.ColorTableModel tableModel
private JButton defaultSet
ColorPreference()
public void setColors(Map<String,ColorInfo> colorMap)
colorMap
- the map holding the colors
(key = preference key, value = ColorInfo
instance)private static int getCategoryPriority(String category)
public Map<String,ColorInfo> getColors()
public void addGui(PreferenceTabbedPane gui)
PreferenceSetting
addGui
in interface PreferenceSetting
addGui
in class ExtensibleTabPreferenceSetting
gui
- the preferences tab paneprivate static boolean isRemoveColor(ColorPreference.ColorEntry ce)
private static void fixColorPrefixes()
public boolean ok()
PreferenceSetting
ok
in interface PreferenceSetting
true
if restart is requiredpublic boolean isExpert()
PreferenceSetting
isExpert
in interface PreferenceSetting
isExpert
in class DefaultPreferenceSetting
public void valueChanged(ListSelectionEvent e)
valueChanged
in interface ListSelectionListener
public void tableChanged(TableModelEvent e)
tableChanged
in interface TableModelListener
private void updateEnabledState()
public String getHelpContext()
TabPreferenceSetting
getHelpContext
in interface TabPreferenceSetting
getHelpContext
in class DefaultTabPreferenceSetting