Package org.eclipse.jface.viewers

Examples of org.eclipse.jface.viewers.IColorProvider


    given(valueProvider.shouldPaint(cell.getElement())).willReturn(TRUE);

    Display display = PlatformUI.getWorkbench().getDisplay();
    Color foreground = display.getSystemColor(SWT.COLOR_CYAN);
    Color background = display.getSystemColor(SWT.COLOR_BLUE);
    IColorProvider colors = mock(IColorProvider.class);
    given(colors.getForeground(cell.getElement())).willReturn(foreground);
    given(colors.getBackground(cell.getElement())).willReturn(background);

    TreePathDurationLabelProvider labelProvider =
        new TreePathDurationLabelProvider(valueProvider, colors);

    labelProvider.update(cell);
View Full Code Here


    given(valueProvider.shouldPaint(cell.getElement())).willReturn(TRUE);

    Display display = PlatformUI.getWorkbench().getDisplay();
    Color foreground = display.getSystemColor(SWT.COLOR_CYAN);
    Color background = display.getSystemColor(SWT.COLOR_BLUE);
    IColorProvider colors = mock(IColorProvider.class);
    given(colors.getForeground(cell.getElement())).willReturn(foreground);
    given(colors.getBackground(cell.getElement())).willReturn(background);

    TreePathIntLabelProvider labelProvider =
        new TreePathIntLabelProvider(valueProvider, colors);

    labelProvider.update(cell);
View Full Code Here

         */
        public Color getBackground(Object element) {
            if (element instanceof AdaptableFeature) {
                AdaptableFeature feature = (AdaptableFeature) element;
                LayerImpl layer = (LayerImpl) feature.getAdapter(ILayer.class);
                IColorProvider colorProvider = (IColorProvider) layer.getAdapter(IColorProvider.class);
                if (colorProvider == null) return null;
                return colorProvider.getBackground(layer);
            }           
            return null;
        }
View Full Code Here

         */
        public Color getForeground(Object element) {
            if (element instanceof AdaptableFeature) {
                AdaptableFeature feature = (AdaptableFeature) element;
                LayerImpl layer = (LayerImpl) feature.getAdapter(ILayer.class);
                IColorProvider colorProvider = (IColorProvider) layer.getAdapter(IColorProvider.class);
                if (colorProvider == null) return null;
                return colorProvider.getForeground(layer);
            }
            return null;
        }
View Full Code Here

        if (labelProviderAtt != null) {
            try {
                IBaseLabelProvider baseProvider = (IBaseLabelProvider) extension
                        .createExecutableExtension(LABEL_PROVIDER_ATT);
                if (baseProvider instanceof IColorProvider) {
                    IColorProvider labelProvider = (IColorProvider) baseProvider;
                    color = labelProvider.getForeground(backingObject);
                }
            } catch (CoreException e) {
                // not good log this
                ProjectEditPlugin.log("Unable to load the LabelProvider for Element: "
                        + extensionId, e);
View Full Code Here

        if (labelProviderAtt != null) {
            try {
                IBaseLabelProvider baseProvider = (IBaseLabelProvider) extension
                        .createExecutableExtension(LABEL_PROVIDER_ATT);
                if (baseProvider instanceof IColorProvider) {
                    IColorProvider labelProvider = (IColorProvider) baseProvider;
                    color = labelProvider.getBackground(backingObject);
                }
            } catch (CoreException e) {
                // not good log this
                ProjectEditPlugin.log("Unable to load the LabelProvider for Element: "
                        + extensionId, e);
View Full Code Here

        }

        public Color getForeground(Object object) {
             // Get the adapter from the factory.
            //
            IColorProvider colorProvider = (IColorProvider)adapterFactory.adapt(object, IColorProvider.class);
            if( colorProvider!=null ){
                return colorProvider.getForeground(object);
            }

            IItemLabelProvider itemLabelProvider = (IItemLabelProvider)adapterFactory.adapt(object, IItemLabelProvider.class);
            if( itemLabelProvider instanceof IColorProvider ){
                colorProvider=(IColorProvider) itemLabelProvider;
                return colorProvider.getForeground(object);
            }
            return null;
        }
View Full Code Here

        }

        public Color getBackground(Object object) {
             // Get the adapter from the factory.
            //
            IColorProvider colorProvider = (IColorProvider)adapterFactory.adapt(object, IColorProvider.class);
            if( colorProvider!=null ){
                return colorProvider.getBackground(object);
            }

            IItemLabelProvider itemLabelProvider = (IItemLabelProvider)adapterFactory.adapt(object, IItemLabelProvider.class);
            if( itemLabelProvider instanceof IColorProvider ){
                colorProvider=(IColorProvider) itemLabelProvider;
                return colorProvider.getBackground(object);
            }
            return null;
        }
View Full Code Here

TOP

Related Classes of org.eclipse.jface.viewers.IColorProvider

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.