summaryrefslogtreecommitdiffstats
path: root/plugins/org.yocto.bc.ui/src/org/yocto/bc/ui/decorators/ProjectDecorator.java
diff options
context:
space:
mode:
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}