|
Lines 10-80
Link Here
|
| 10 |
*******************************************************************************/ |
10 |
*******************************************************************************/ |
| 11 |
package org.eclipse.ui.internal; |
11 |
package org.eclipse.ui.internal; |
| 12 |
|
12 |
|
| 13 |
import org.eclipse.rwt.graphics.Graphics; |
13 |
//import org.eclipse.swt.graphics.Color; |
| 14 |
import org.eclipse.swt.graphics.Color; |
14 |
//import org.eclipse.swt.widgets.Display; |
| 15 |
import org.eclipse.swt.widgets.Display; |
|
|
| 16 |
|
15 |
|
| 17 |
/** |
16 |
/** |
| 18 |
* This class manages the common workbench colors. |
17 |
* This class manages the common workbench colors. |
| 19 |
*/ |
18 |
*/ |
| 20 |
public class WorkbenchColors { |
19 |
public class WorkbenchColors { |
| 21 |
static private boolean init = false; |
20 |
// static private boolean init = false; |
| 22 |
|
21 |
|
| 23 |
static private Color[] workbenchColors; |
22 |
// static private Color[] workbenchColors; |
| 24 |
|
23 |
|
| 25 |
/** |
24 |
// /** |
| 26 |
* Dispose all color pre-allocated by the workbench. |
25 |
// * Dispose all color pre-allocated by the workbench. |
| 27 |
*/ |
26 |
// */ |
| 28 |
private static void disposeWorkbenchColors() { |
27 |
// private static void disposeWorkbenchColors() { |
| 29 |
for (int i = 0; i < workbenchColors.length; i++) { |
28 |
// for (int i = 0; i < workbenchColors.length; i++) { |
| 30 |
// RAP [rh] Color#dispose() missing |
|
|
| 31 |
// workbenchColors[i].dispose(); |
29 |
// workbenchColors[i].dispose(); |
| 32 |
} |
30 |
// } |
| 33 |
workbenchColors = null; |
31 |
// workbenchColors = null; |
| 34 |
} |
32 |
// } |
| 35 |
|
33 |
|
| 36 |
/** |
34 |
// /** |
| 37 |
* Initialize all colors used in the workbench in case the OS is using |
35 |
// * Initialize all colors used in the workbench in case the OS is using |
| 38 |
* a 256 color palette making sure the workbench colors are allocated. |
36 |
// * a 256 color palette making sure the workbench colors are allocated. |
| 39 |
* |
37 |
// * |
| 40 |
* This list comes from the designers. |
38 |
// * This list comes from the designers. |
| 41 |
*/ |
39 |
// */ |
| 42 |
private static void initWorkbenchColors(Display d) { |
40 |
// private static void initWorkbenchColors(Display d) { |
| 43 |
if (workbenchColors != null) { |
41 |
// if (workbenchColors != null) { |
| 44 |
return; |
42 |
// return; |
| 45 |
} |
43 |
// } |
| 46 |
|
44 |
// |
| 47 |
// RAP [rh] Color constructor missing |
45 |
// workbenchColors = new Color[] { |
| 48 |
workbenchColors = new Color[] { |
46 |
// //Product pallet |
| 49 |
//Product pallet |
47 |
// new Color(d,255, 255, 255), new Color(d,255, 251, 240), |
| 50 |
Graphics.getColor(255, 255, 255), Graphics.getColor(255, 251, 240), |
48 |
// new Color(d,223, 223, 191), new Color(d,223, 191, 191), |
| 51 |
Graphics.getColor(223, 223, 191), Graphics.getColor(223, 191, 191), |
49 |
// new Color(d,192, 220, 192), new Color(d,192, 192, 192), |
| 52 |
Graphics.getColor(192, 220, 192), Graphics.getColor(192, 192, 192), |
50 |
// new Color(d,191, 191, 191), new Color(d,191, 191, 159), |
| 53 |
Graphics.getColor(191, 191, 191), Graphics.getColor(191, 191, 159), |
51 |
// new Color(d,191, 159, 191), new Color(d,160, 160, 164), |
| 54 |
Graphics.getColor(191, 159, 191), Graphics.getColor(160, 160, 164), |
52 |
// new Color(d,159, 159, 191), new Color(d,159, 159, 159), |
| 55 |
Graphics.getColor(159, 159, 191), Graphics.getColor(159, 159, 159), |
53 |
// new Color(d,159, 159, 127), new Color(d,159, 127, 159), |
| 56 |
Graphics.getColor(159, 159, 127), Graphics.getColor(159, 127, 159), |
54 |
// new Color(d,159, 127, 127), new Color(d,128, 128, 128), |
| 57 |
Graphics.getColor(159, 127, 127), Graphics.getColor(128, 128, 128), |
55 |
// new Color(d,127, 159, 159), new Color(d,127, 159, 127), |
| 58 |
Graphics.getColor(127, 159, 159), Graphics.getColor(127, 159, 127), |
56 |
// new Color(d,127, 127, 159), new Color(d,127, 127, 127), |
| 59 |
Graphics.getColor(127, 127, 159), Graphics.getColor(127, 127, 127), |
57 |
// new Color(d,127, 127, 95), new Color(d,127, 95, 127), |
| 60 |
Graphics.getColor(127, 127, 95), Graphics.getColor(127, 95, 127), |
58 |
// new Color(d,127, 95, 95), new Color(d,95, 127, 127), |
| 61 |
Graphics.getColor(127, 95, 95), Graphics.getColor(95, 127, 127), |
59 |
// new Color(d,95, 127, 95), new Color(d,95, 95, 127), |
| 62 |
Graphics.getColor(95, 127, 95), Graphics.getColor(95, 95, 127), |
60 |
// new Color(d,95, 95, 95), new Color(d,95, 95, 63), |
| 63 |
Graphics.getColor(95, 95, 95), Graphics.getColor(95, 95, 63), |
61 |
// new Color(d,95, 63, 95), new Color(d,95, 63, 63), |
| 64 |
Graphics.getColor(95, 63, 95), Graphics.getColor(95, 63, 63), |
62 |
// new Color(d,63, 95, 95), new Color(d,63, 95, 63), |
| 65 |
Graphics.getColor(63, 95, 95), Graphics.getColor(63, 95, 63), |
63 |
// new Color(d,63, 63, 95), new Color(d,0, 0, 0), |
| 66 |
Graphics.getColor(63, 63, 95), Graphics.getColor(0, 0, 0), |
64 |
// //wizban pallet |
| 67 |
//wizban pallet |
65 |
// new Color(d,195, 204, 224), new Color(d,214, 221, 235), |
| 68 |
Graphics.getColor(195, 204, 224), Graphics.getColor(214, 221, 235), |
66 |
// new Color(d,149, 168, 199), new Color(d,128, 148, 178), |
| 69 |
Graphics.getColor(149, 168, 199), Graphics.getColor(128, 148, 178), |
67 |
// new Color(d,106, 128, 158), new Color(d,255, 255, 255), |
| 70 |
Graphics.getColor(106, 128, 158), Graphics.getColor(255, 255, 255), |
68 |
// new Color(d,0, 0, 0), new Color(d,0, 0, 0), |
| 71 |
Graphics.getColor(0, 0, 0), Graphics.getColor(0, 0, 0), |
69 |
// //Perspective |
| 72 |
//Perspective |
70 |
// new Color(d,132, 130, 132), new Color(d,143, 141, 138), |
| 73 |
Graphics.getColor(132, 130, 132), Graphics.getColor(143, 141, 138), |
71 |
// new Color(d,171, 168, 165), |
| 74 |
Graphics.getColor(171, 168, 165), |
72 |
// //PreferenceDialog and TitleAreaDialog |
| 75 |
//PreferenceDialog and TitleAreaDialog |
73 |
// new Color(d,230, 226, 221) }; |
| 76 |
Graphics.getColor(230, 226, 221) }; |
74 |
// } |
| 77 |
} |
|
|
| 78 |
|
75 |
|
| 79 |
/** |
76 |
/** |
| 80 |
* Disposes of the colors. Ignore all |
77 |
* Disposes of the colors. Ignore all |
|
Lines 82-107
Link Here
|
| 82 |
* to be disposed. |
79 |
* to be disposed. |
| 83 |
*/ |
80 |
*/ |
| 84 |
static public void shutdown() { |
81 |
static public void shutdown() { |
| 85 |
if (!init) { |
82 |
// if (!init) { |
| 86 |
return; |
83 |
// return; |
| 87 |
} |
84 |
// } |
| 88 |
disposeWorkbenchColors(); |
85 |
// disposeWorkbenchColors(); |
| 89 |
init = false; |
86 |
// init = false; |
| 90 |
} |
87 |
} |
| 91 |
|
88 |
|
| 92 |
/** |
89 |
/** |
| 93 |
* Initializes the colors. |
90 |
* Initializes the colors. |
| 94 |
*/ |
91 |
*/ |
| 95 |
static public void startup() { |
92 |
static public void startup() { |
| 96 |
if (init) { |
93 |
// if (init) { |
| 97 |
return; |
94 |
// return; |
| 98 |
} |
95 |
// } |
| 99 |
|
96 |
// |
| 100 |
// Initialize the caches first. |
97 |
// // Initialize the caches first. |
| 101 |
init = true; |
98 |
// init = true; |
| 102 |
|
99 |
// |
| 103 |
Display display = Display.getDefault(); |
100 |
// Display display = Display.getDefault(); |
| 104 |
initWorkbenchColors(display); |
101 |
// initWorkbenchColors(display); |
| 105 |
} |
102 |
} |
| 106 |
|
103 |
|
| 107 |
} |
104 |
} |