public class ColorPreference extends Object implements SubPreferenceSetting
Modifier and Type | Class and Description |
---|---|
static class |
ColorPreference.Factory |
Modifier and Type | Field and Description |
---|---|
(package private) JButton |
colorEdit |
private JTable |
colors |
(package private) JButton |
defaultSet |
private List<String> |
del |
(package private) JButton |
remove |
private DefaultTableModel |
tableModel |
Constructor and Description |
---|
ColorPreference() |
Modifier and Type | Method and Description |
---|---|
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
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