diff options
author | Adrian Dudau <adrian.dudau@enea.com> | 2014-06-26 13:23:09 +0200 |
---|---|---|
committer | Adrian Dudau <adrian.dudau@enea.com> | 2014-06-26 13:24:09 +0200 |
commit | c7da892cb23d50d4d85746c9a0b6b14bf570989d (patch) | |
tree | e7136073f386d6156f51766c498c52c30c8df85f /plugins/org.yocto.bc.ui/src/org/yocto/bc/ui/decorators/ProjectDecorator.java | |
download | eclipse-poky-kepler-c7da892cb23d50d4d85746c9a0b6b14bf570989d.tar.gz |
initial commit for Enea Linux 4.0daisy
Migrated from the internal git server on the daisy-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.java | 48 |
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 @@ | |||
1 | package org.yocto.bc.ui.decorators; | ||
2 | |||
3 | import org.eclipse.core.resources.IProject; | ||
4 | import org.eclipse.core.runtime.CoreException; | ||
5 | import org.eclipse.jface.resource.ImageDescriptor; | ||
6 | import org.eclipse.jface.viewers.IDecoration; | ||
7 | import org.eclipse.jface.viewers.ILabelProviderListener; | ||
8 | import org.eclipse.jface.viewers.ILightweightLabelDecorator; | ||
9 | |||
10 | import org.yocto.bc.ui.Activator; | ||
11 | import org.yocto.bc.ui.builder.BitbakeCommanderNature; | ||
12 | |||
13 | public 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 | } | ||