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 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 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)
PreferenceSetting
addGui
in interface PreferenceSetting
Boolean isRemoveColor(int row)
private void fixColorPrefixes()
public boolean ok()
PreferenceSetting
ok
in interface PreferenceSetting
public boolean isExpert()
PreferenceSetting
isExpert
in interface PreferenceSetting
public TabPreferenceSetting getTabPreferenceSetting(PreferenceTabbedPane gui)
SubPreferenceSetting
getTabPreferenceSetting
in interface SubPreferenceSetting