1 11 package org.eclipse.ui.internal; 12 13 import org.eclipse.swt.graphics.Color; 14 import org.eclipse.swt.widgets.Display; 15 16 19 public class WorkbenchColors { 20 static private boolean init = false; 21 22 static private Color[] workbenchColors; 23 24 27 private static void disposeWorkbenchColors() { 28 for (int i = 0; i < workbenchColors.length; i++) { 29 workbenchColors[i].dispose(); 30 } 31 workbenchColors = null; 32 } 33 34 40 private static void initWorkbenchColors(Display d) { 41 if (workbenchColors != null) { 42 return; 43 } 44 45 workbenchColors = new Color[] { 46 new Color(d, 255, 255, 255), new Color(d, 255, 251, 240), 48 new Color(d, 223, 223, 191), new Color(d, 223, 191, 191), 49 new Color(d, 192, 220, 192), new Color(d, 192, 192, 192), 50 new Color(d, 191, 191, 191), new Color(d, 191, 191, 159), 51 new Color(d, 191, 159, 191), new Color(d, 160, 160, 164), 52 new Color(d, 159, 159, 191), new Color(d, 159, 159, 159), 53 new Color(d, 159, 159, 127), new Color(d, 159, 127, 159), 54 new Color(d, 159, 127, 127), new Color(d, 128, 128, 128), 55 new Color(d, 127, 159, 159), new Color(d, 127, 159, 127), 56 new Color(d, 127, 127, 159), new Color(d, 127, 127, 127), 57 new Color(d, 127, 127, 95), new Color(d, 127, 95, 127), 58 new Color(d, 127, 95, 95), new Color(d, 95, 127, 127), 59 new Color(d, 95, 127, 95), new Color(d, 95, 95, 127), 60 new Color(d, 95, 95, 95), new Color(d, 95, 95, 63), 61 new Color(d, 95, 63, 95), new Color(d, 95, 63, 63), 62 new Color(d, 63, 95, 95), new Color(d, 63, 95, 63), 63 new Color(d, 63, 63, 95), new Color(d, 0, 0, 0), 64 new Color(d, 195, 204, 224), new Color(d, 214, 221, 235), 66 new Color(d, 149, 168, 199), new Color(d, 128, 148, 178), 67 new Color(d, 106, 128, 158), new Color(d, 255, 255, 255), 68 new Color(d, 0, 0, 0), new Color(d, 0, 0, 0), 69 new Color(d, 132, 130, 132), new Color(d, 143, 141, 138), 71 new Color(d, 171, 168, 165), 72 new Color(d, 230, 226, 221) }; 74 } 75 76 81 static public void shutdown() { 82 if (!init) { 83 return; 84 } 85 disposeWorkbenchColors(); 86 init = false; 87 } 88 89 92 static public void startup() { 93 if (init) { 94 return; 95 } 96 97 init = true; 99 100 Display display = Display.getDefault(); 101 initWorkbenchColors(display); 102 } 103 104 } 105 | Popular Tags |