~ubuntu-branches/debian/sid/eclipse-cdt/sid

« back to all changes in this revision

Viewing changes to results/plugins/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/viewsupport/DecoratingCLabelProvider.java

  • Committer: Package Import Robot
  • Author(s): Jakub Adam
  • Date: 2011-10-06 21:15:04 UTC
  • mfrom: (1.1.4)
  • Revision ID: package-import@ubuntu.com-20111006211504-8dutmljjih0zikfv
Tags: 8.0.1-1
* New upstream release.
* Split the JNI packages into a separate architecture dependent
  package and made eclipse-cdt architecture independent.
* Install JNI libraries into multiarch aware location
* Bumped Standards-Version to 3.9.2.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*******************************************************************************
2
 
 * Copyright (c) 2000, 2009 IBM Corporation and others.
3
 
 * All rights reserved. This program and the accompanying materials
4
 
 * are made available under the terms of the Eclipse Public License v1.0
5
 
 * which accompanies this distribution, and is available at
6
 
 * http://www.eclipse.org/legal/epl-v10.html
7
 
 *
8
 
 * Contributors:
9
 
 *     IBM Corporation - initial API and implementation
10
 
 *******************************************************************************/
11
 
package org.eclipse.cdt.internal.ui.viewsupport;
12
 
 
13
 
import org.eclipse.jface.viewers.DecoratingLabelProvider;
14
 
import org.eclipse.jface.viewers.IColorProvider;
15
 
import org.eclipse.swt.graphics.Color;
16
 
import org.eclipse.ui.PlatformUI;
17
 
 
18
 
public class DecoratingCLabelProvider extends DecoratingLabelProvider {
19
 
        
20
 
        /**
21
 
         * Decorating label provider for C/C++. Combines a CUILabelProvider
22
 
         * with problem and override indicator with the workbench decorator (label
23
 
         * decorator extension point).
24
 
         */
25
 
        public DecoratingCLabelProvider(CUILabelProvider labelProvider) {
26
 
                this(labelProvider, true);
27
 
        }
28
 
 
29
 
        /**
30
 
         * Decorating label provider for C/C++. Combines a CUILabelProvider
31
 
         * (if enabled with problem indicator) with the workbench
32
 
         * decorator (label decorator extension point).
33
 
         */
34
 
        public DecoratingCLabelProvider(CUILabelProvider labelProvider, boolean errorTick) {
35
 
                super(labelProvider, PlatformUI.getWorkbench().getDecoratorManager().getLabelDecorator());
36
 
                if (errorTick) {
37
 
                        labelProvider.addLabelDecorator(new ProblemsLabelDecorator(null));
38
 
                }
39
 
        }
40
 
 
41
 
        /* (non-Javadoc)
42
 
         * @see org.eclipse.jface.viewers.IColorProvider#getForeground(java.lang.Object)
43
 
         */
44
 
        @Override
45
 
        public Color getForeground(Object element) {
46
 
                // label provider is a JavaUILabelProvider
47
 
                return ((IColorProvider) getLabelProvider()).getForeground(element);
48
 
        }
49
 
 
50
 
        /* (non-Javadoc)
51
 
         * @see org.eclipse.jface.viewers.IColorProvider#getBackground(java.lang.Object)
52
 
         */
53
 
        @Override
54
 
        public Color getBackground(Object element) {
55
 
                // label provider is a JavaUILabelProvider
56
 
                return ((IColorProvider) getLabelProvider()).getBackground(element);
57
 
        }
58
 
 
59
 
}