Class CustomColorManager
- java.lang.Object
-
- com._1c.g5.v8.dt.common.ui.colors.CustomColorManager
-
public class CustomColorManager extends Object
This class managed the custom user colors. Save the custom color to persistent storageIEclipsePreferences
-
-
Field Summary
Fields Modifier and Type Field Description static int
NUMBER_OF_CUSTOM_COLORS
-
Constructor Summary
Constructors Constructor Description CustomColorManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.eclipse.swt.graphics.RGB
get(int index)
Get Color by indexList<org.eclipse.swt.graphics.RGB>
getAll()
Gets all the custom user colorsprotected String
getKey(int idx)
Figures out the name, under which the color is stored in preferencesorg.eclipse.swt.graphics.RGB
remove(int index)
Remove element by indexvoid
save()
Save all the custom colors to storagevoid
set(int index, org.eclipse.swt.graphics.RGB color)
Set to storage color
-
-
-
Field Detail
-
NUMBER_OF_CUSTOM_COLORS
public static final int NUMBER_OF_CUSTOM_COLORS
- See Also:
- Constant Field Values
-
-
Method Detail
-
set
public void set(int index, org.eclipse.swt.graphics.RGB color)
Set to storage color- Parameters:
index
- the indexcolor
- theRGB
color- Throws:
IndexOutOfBoundsException
- if the index does not fall to interval
-
get
public org.eclipse.swt.graphics.RGB get(int index)
Get Color by index- Parameters:
index
- index of the returned color.- Returns:
- the
RGB
color - Throws:
IndexOutOfBoundsException
- if the index does not fall to interval
-
getAll
public List<org.eclipse.swt.graphics.RGB> getAll()
Gets all the custom user colors- Returns:
- all custom colors
-
save
public void save() throws org.osgi.service.prefs.BackingStoreException
Save all the custom colors to storage- Throws:
org.osgi.service.prefs.BackingStoreException
- if class does not save colors
-
remove
public org.eclipse.swt.graphics.RGB remove(int index)
Remove element by index- Parameters:
index
- the index- Returns:
- removed color
- Throws:
IndexOutOfBoundsException
- if the index does not fall to interval
-
getKey
protected String getKey(int idx)
Figures out the name, under which the color is stored in preferences- Parameters:
idx
- the index of the color in the array- Returns:
- the key in preferences for color with index idx
-
-