|
Lines 22-37
Link Here
|
| 22 |
|
22 |
|
| 23 |
static private Color[] workbenchColors; |
23 |
static private Color[] workbenchColors; |
| 24 |
|
24 |
|
| 25 |
/** |
25 |
// On RAP workbenchColors should not be disposed until the platform stops |
| 26 |
* Dispose all color pre-allocated by the workbench. |
26 |
// /** |
| 27 |
*/ |
27 |
// * Dispose all color pre-allocated by the workbench. |
| 28 |
private static void disposeWorkbenchColors() { |
28 |
// */ |
| 29 |
for (int i = 0; i < workbenchColors.length; i++) { |
29 |
// private static void disposeWorkbenchColors() { |
| 30 |
// RAP [rh] Color#dispose() missing |
30 |
// for (int i = 0; i < workbenchColors.length; i++) { |
| 31 |
// workbenchColors[i].dispose(); |
31 |
//// RAP [rh] Color#dispose() missing |
| 32 |
} |
32 |
//// workbenchColors[i].dispose(); |
| 33 |
workbenchColors = null; |
33 |
// } |
| 34 |
} |
34 |
// |
|
|
35 |
// workbenchColors = null; |
| 36 |
// } |
| 35 |
|
37 |
|
| 36 |
/** |
38 |
/** |
| 37 |
* Initialize all colors used in the workbench in case the OS is using |
39 |
* Initialize all colors used in the workbench in case the OS is using |
|
Lines 39-45
Link Here
|
| 39 |
* |
41 |
* |
| 40 |
* This list comes from the designers. |
42 |
* This list comes from the designers. |
| 41 |
*/ |
43 |
*/ |
| 42 |
private static void initWorkbenchColors(Display d) { |
44 |
// Should be synchronized because of multiple instances of Workbench allowed |
|
|
45 |
private synchronized static void initWorkbenchColors(Display d) { |
| 43 |
if (workbenchColors != null) { |
46 |
if (workbenchColors != null) { |
| 44 |
return; |
47 |
return; |
| 45 |
} |
48 |
} |
|
Lines 81-98
Link Here
|
| 81 |
* system colors as they do not need |
84 |
* system colors as they do not need |
| 82 |
* to be disposed. |
85 |
* to be disposed. |
| 83 |
*/ |
86 |
*/ |
| 84 |
static public void shutdown() { |
87 |
// Should be synchronized because of multiple instances of Workbench allowed |
| 85 |
if (!init) { |
88 |
static synchronized public void shutdown() { |
| 86 |
return; |
89 |
// do nothing because of RAP workbenchColors should not be disposed until the platform stops |
| 87 |
} |
90 |
// if (!init) { |
| 88 |
disposeWorkbenchColors(); |
91 |
// return; |
| 89 |
init = false; |
92 |
// } |
|
|
93 |
// disposeWorkbenchColors(); |
| 94 |
// init = false; |
| 90 |
} |
95 |
} |
| 91 |
|
96 |
|
| 92 |
/** |
97 |
/** |
| 93 |
* Initializes the colors. |
98 |
* Initializes the colors. |
| 94 |
*/ |
99 |
*/ |
| 95 |
static public void startup() { |
100 |
// Should be synchronized because of multiple instances of Workbench allowed |
|
|
101 |
static synchronized public void startup() { |
| 96 |
if (init) { |
102 |
if (init) { |
| 97 |
return; |
103 |
return; |
| 98 |
} |
104 |
} |