Example usage for org.eclipse.jface.resource ColorRegistry ColorRegistry

List of usage examples for org.eclipse.jface.resource ColorRegistry ColorRegistry

Introduction

In this page you can find the example usage for org.eclipse.jface.resource ColorRegistry ColorRegistry.

Prototype

public ColorRegistry(Display display, boolean cleanOnDisplayDisposal) 

Source Link

Document

Create a new instance of the receiver.

Usage

From source file:ch.elexis.core.ui.UiDesk.java

License:Open Source License

public static ColorRegistry getColorRegistry() {

    if (theColorRegistry == null) {
        theColorRegistry = new ColorRegistry(getDisplay(), true);
    }//from ww w  .ja v a 2 s  .c  om
    return theColorRegistry;
}

From source file:de.volanakis.ribbonide.internal.Activator.java

License:Open Source License

public static Color getSharedColor(RGB key) {
    if (colorReg == null) {
        Display display = Display.getCurrent();
        Assert.isNotNull(display);/*w w  w  .  j ava  2s  . c  o m*/
        colorReg = new ColorRegistry(display, true);
    }
    Color result = colorReg.get(key.toString());
    if (result == null) {
        colorReg.put(key.toString(), key);
        result = colorReg.get(key.toString());
    }
    return result;
}

From source file:org.kalypso.model.wspm.ui.view.chart.color.DefaultProfilColorRegistryFactory.java

License:Open Source License

/**
 * Erzeugt die Registry, diese muss vom aufrufenden zerstrt (dispose) werden.
 * /*from w w  w .ja  v a  2 s.co  m*/
 * @param display
 */
public static ColorRegistry createColorRegistry(final Display display) {
    final ColorRegistry registry = new ColorRegistry(display, true);

    registry.put(IProfilColorSet.COLOUR, new RGB(0, 0, 0));
    registry.put(IProfilColorSet.COLOUR_GELAENDE_MARKED, new RGB(200, 50, 0));
    registry.put(IProfilColorSet.COLOUR_AXIS_FOREGROUND, new RGB(0, 0, 0));
    registry.put(IProfilColorSet.COLOUR_AXIS_BACKGROUND, new RGB(255, 255, 255));
    registry.put(IProfilColorSet.COLOUR_STATIONS, new RGB(128, 128, 128));
    registry.put(IProfilColorSet.COLOUR_WSP, new RGB(0, 128, 255));

    return registry;
}

From source file:org.springframework.tooling.ls.eclipse.commons.LanguageServerCommonsActivator.java

License:Open Source License

@Override
public void start(BundleContext context) throws Exception {
    instance = this;
    super.start(context);
    getImageRegistry().put(BOOT_KEY, getImageDescriptor("icons/boot.png"));

    UIJob uiJob = new UIJob("Setup color registry") {
        {// ww  w .j a v a  2  s.c o m
            setSystem(true);
        }

        @Override
        public IStatus runInUIThread(IProgressMonitor arg0) {
            colorRegistry = new ColorRegistry(PlatformUI.getWorkbench().getDisplay(), true);
            RGB prefsColor = PreferenceConverter.getColor(EditorsPlugin.getDefault().getPreferenceStore(),
                    PreferenceConstants.HIGHLIGHT_RANGE_COLOR_PREFS);
            colorRegistry.put(PreferenceConstants.HIGHLIGHT_RANGE_COLOR_PREFS,
                    convertRGBtoNonTransparent(prefsColor));
            getPreferenceStore().addPropertyChangeListener(PROPERTY_LISTENER);
            EditorsPlugin.getDefault().getPreferenceStore().addPropertyChangeListener(PROPERTY_LISTENER);
            return Status.OK_STATUS;
        }
    };
    uiJob.schedule();
}