private void inititalizeColors() { if (getSite().getShell().isDisposed()) return; Display display= getSite().getShell().getDisplay(); if (display == null || display.isDisposed()) return; setForeground(display.getSystemColor(SWT.COLOR_INFO_FOREGROUND)); ColorRegistry registry= JFaceResources.getColorRegistry(); registry.addListener(this); fBackgroundColorRGB= registry.getRGB(getBackgroundColorKey()); Color bgColor; if (fBackgroundColorRGB == null) { bgColor= display.getSystemColor(SWT.COLOR_INFO_BACKGROUND); fBackgroundColorRGB= bgColor.getRGB(); } else { bgColor= new Color(display, fBackgroundColorRGB); fBackgroundColor= bgColor; } setBackground(bgColor); }
private void inititalizeColors() { if (getSite().getShell().isDisposed()) return; Display display= getSite().getShell().getDisplay(); if (display == null || display.isDisposed()) return; setForeground(display.getSystemColor(SWT.COLOR_INFO_FOREGROUND)); ColorRegistry registry= JFaceResources.getColorRegistry(); registry.addListener(this); fBackgroundColorRGB= registry.getRGB(getBackgroundColorKey()); Color bgColor; if (fBackgroundColorRGB == null) { bgColor= display.getSystemColor(SWT.COLOR_INFO_BACKGROUND); fBackgroundColorRGB= bgColor.getRGB(); } else { bgColor= new Color(display, fBackgroundColorRGB); fBackgroundColor= bgColor; } setBackground(bgColor); }
private void inititalizeColors() { if (getSite().getShell().isDisposed()) return; Display display= getSite().getShell().getDisplay(); if (display == null || display.isDisposed()) return; ColorRegistry registry= JFaceResources.getColorRegistry(); registry.addListener(this); Color fgColor; fForegroundColorRGB = (getForegroundColorKey() != null) ? registry.getRGB(getForegroundColorKey()) : null; if (fForegroundColorRGB == null) { fgColor = display.getSystemColor(SWT.COLOR_INFO_FOREGROUND); fForegroundColorRGB= fgColor.getRGB(); } else { fgColor = new Color(display, fForegroundColorRGB); fForegroundColor= fgColor; } setForeground(fgColor); fBackgroundColorRGB= registry.getRGB(getBackgroundColorKey()); Color bgColor; if (fBackgroundColorRGB == null) { bgColor= display.getSystemColor(SWT.COLOR_INFO_BACKGROUND); fBackgroundColorRGB= bgColor.getRGB(); } else { bgColor= new Color(display, fBackgroundColorRGB); fBackgroundColor= bgColor; } setBackground(bgColor); }