public class ColorPreference extends Object implements SubPreferenceSetting
| Modifier and Type | Class and Description |
|---|---|
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 List<String> |
del |
private JButton |
remove |
private DefaultTableModel |
tableModel |
| Constructor and Description |
|---|
ColorPreference() |
| Modifier and Type | Method and Description |
|---|---|
private void |
addColorRows(Map<String,String> colorMap,
Map<String,String> keyMap) |
void |
addGui(PreferenceTabbedPane gui)
Add the GUI elements to the dialog.
|
private static void |
fixColorPrefixes()
Add all missing color entries.
|
Map<String,String> |
getColorModel()
Returns a map with the colors in the table (key = color name without prefix, value = html color code).
|
private static String |
getName(String o) |
TabPreferenceSetting |
getTabPreferenceSetting(PreferenceTabbedPane gui)
Returns the preference setting (displayed in the specified preferences tab pane) that contains this preference setting.
|
boolean |
isExpert()
Called to know if the preferences tab has only to be displayed in expert mode.
|
(package private) Boolean |
isRemoveColor(int row) |
boolean |
ok()
Called when OK is pressed to save the setting in the preferences file.
|
void |
setColorModel(Map<String,String> colorMap)
Set the colors to be shown in the preference table.
|
private DefaultTableModel tableModel
private JButton defaultSet
public ColorPreference()
public void setColorModel(Map<String,String> colorMap)
colorMap - the map holding the colors
(key = color id (without prefixes, so only background; not color.background),
value = html representation of the color.public Map<String,String> getColorModel()
public void addGui(PreferenceTabbedPane gui)
PreferenceSettingaddGui in interface PreferenceSettinggui - the preferences tab paneBoolean isRemoveColor(int row)
private static void fixColorPrefixes()
public boolean ok()
PreferenceSettingok in interface PreferenceSettingtrue if restart is requiredpublic boolean isExpert()
PreferenceSettingisExpert in interface PreferenceSettingpublic TabPreferenceSetting getTabPreferenceSetting(PreferenceTabbedPane gui)
SubPreferenceSettinggetTabPreferenceSetting in interface SubPreferenceSettinggui - preferences tabbed pane