summaryrefslogtreecommitdiffstats
path: root/plugins/org.yocto.bc.ui/src/org/yocto/bc/ui/decorators/ProjectDecorator.java
diff options
context:
space:
mode:
authorAdrian Dudau <adrian.dudau@enea.com>2013-12-12 13:36:50 +0100
committerAdrian Dudau <adrian.dudau@enea.com>2013-12-12 15:25:03 +0100
commit41ac47d732eed8392d60d0f6773e5a279d49b999 (patch)
treecf19d099db9cfdb8d73aa21c31e7aa1cc86ff860 /plugins/org.yocto.bc.ui/src/org/yocto/bc/ui/decorators/ProjectDecorator.java
downloadeclipse-poky-juno-41ac47d732eed8392d60d0f6773e5a279d49b999.tar.gz
initial commit of Enea Linux 3.1HEADmaster
Migrated from the internal git server on the dora-enea branch Signed-off-by: Adrian Dudau <adrian.dudau@enea.com>
Diffstat (limited to 'plugins/org.yocto.bc.ui/src/org/yocto/bc/ui/decorators/ProjectDecorator.java')
-rw-r--r--plugins/org.yocto.bc.ui/src/org/yocto/bc/ui/decorators/ProjectDecorator.java48
1 files changed, 48 insertions, 0 deletions
diff --git a/plugins/org.yocto.bc.ui/src/org/yocto/bc/ui/decorators/ProjectDecorator.java b/plugins/org.yocto.bc.ui/src/org/yocto/bc/ui/decorators/ProjectDecorator.java
new file mode 100644
index 0000000..5901ee1
--- /dev/null
+++ b/plugins/org.yocto.bc.ui/src/org/yocto/bc/ui/decorators/ProjectDecorator.java
@@ -0,0 +1,48 @@
1package org.yocto.bc.ui.decorators;
2
3import org.eclipse.core.resources.IProject;
4import org.eclipse.core.runtime.CoreException;
5import org.eclipse.jface.resource.ImageDescriptor;
6import org.eclipse.jface.viewers.IDecoration;
7import org.eclipse.jface.viewers.ILabelProviderListener;
8import org.eclipse.jface.viewers.ILightweightLabelDecorator;
9
10import org.yocto.bc.ui.Activator;
11import org.yocto.bc.ui.builder.BitbakeCommanderNature;
12
13public class ProjectDecorator implements ILightweightLabelDecorator {
14
15 private ImageDescriptor image;
16
17 public ProjectDecorator() {
18 image = Activator.getImageDescriptor("icons/oe_decorator.gif");
19 }
20
21
22 public void decorate(Object element, IDecoration decoration) {
23 IProject p = (IProject) element;
24
25 try {
26 if (p.isOpen() && p.hasNature(BitbakeCommanderNature.NATURE_ID)) {
27 decoration.addOverlay(image, IDecoration.TOP_RIGHT);
28 }
29 } catch (CoreException e) {
30 e.printStackTrace();
31 }
32 }
33
34 public void addListener(ILabelProviderListener arg0) {
35 }
36
37 public void dispose() {
38 }
39
40 public boolean isLabelProperty(Object arg0, String arg1) {
41 return false;
42 }
43
44
45 public void removeListener(ILabelProviderListener arg0) {
46 }
47
48}