aboutsummaryrefslogtreecommitdiffstats
path: root/org.openembedded.bc.ui/src/org/openembedded/bc/ui/decorators/ProjectDecorator.java
diff options
context:
space:
mode:
authorKen Gilmer <kgilmer@gmail.com>2010-05-18 21:53:22 -0400
committerKen Gilmer <kgilmer@gmail.com>2010-05-18 21:53:22 -0400
commita7e84830627e50adac5c81ae4dad69aa350933fb (patch)
tree219aa86f4d5f03b29d7bc56f8cdba2702d67082c /org.openembedded.bc.ui/src/org/openembedded/bc/ui/decorators/ProjectDecorator.java
parente27a6dcce13930bfa711a6e72992597a8d1d07c5 (diff)
downloadeclipsetools-a7e84830627e50adac5c81ae4dad69aa350933fb.tar.gz
eclipsetools-a7e84830627e50adac5c81ae4dad69aa350933fb.tar.bz2
eclipsetools-a7e84830627e50adac5c81ae4dad69aa350933fb.zip
org.openembedded.bc.ui: initial commit
Diffstat (limited to 'org.openembedded.bc.ui/src/org/openembedded/bc/ui/decorators/ProjectDecorator.java')
-rw-r--r--org.openembedded.bc.ui/src/org/openembedded/bc/ui/decorators/ProjectDecorator.java48
1 files changed, 48 insertions, 0 deletions
diff --git a/org.openembedded.bc.ui/src/org/openembedded/bc/ui/decorators/ProjectDecorator.java b/org.openembedded.bc.ui/src/org/openembedded/bc/ui/decorators/ProjectDecorator.java
new file mode 100644
index 0000000..6580f10
--- /dev/null
+++ b/org.openembedded.bc.ui/src/org/openembedded/bc/ui/decorators/ProjectDecorator.java
@@ -0,0 +1,48 @@
+package org.openembedded.bc.ui.decorators;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.viewers.IDecoration;
+import org.eclipse.jface.viewers.ILabelProviderListener;
+import org.eclipse.jface.viewers.ILightweightLabelDecorator;
+import org.openembedded.bc.ui.Activator;
+import org.openembedded.bc.ui.builder.BitbakeCommanderNature;
+
+
+public class ProjectDecorator implements ILightweightLabelDecorator {
+
+ private ImageDescriptor image;
+
+ public ProjectDecorator() {
+ image = Activator.getImageDescriptor("icons/oe_decorator.gif");
+ }
+
+
+ public void decorate(Object element, IDecoration decoration) {
+ IProject p = (IProject) element;
+
+ try {
+ if (p.isOpen() && p.hasNature(BitbakeCommanderNature.NATURE_ID)) {
+ decoration.addOverlay(image, IDecoration.TOP_RIGHT);
+ }
+ } catch (CoreException e) {
+ e.printStackTrace();
+ }
+ }
+
+ public void addListener(ILabelProviderListener arg0) {
+ }
+
+ public void dispose() {
+ }
+
+ public boolean isLabelProperty(Object arg0, String arg1) {
+ return false;
+ }
+
+
+ public void removeListener(ILabelProviderListener arg0) {
+ }
+
+}