Commits

Roman Dawydkin committed 33693ee Merge

Merge Release 1.3.2

  • Participants
  • Parent commits 279950d, 621fae7
  • Tags v1.3.2

Comments (0)

Files changed (11)

File EclipseRunner/META-INF/MANIFEST.MF

 Bundle-ManifestVersion: 2
 Bundle-Name: EclipseRunner
 Bundle-SymbolicName: EclipseRunner;singleton:=true
-Bundle-Version: 1.3.1.qualifier
+Bundle-Version: 1.3.2.qualifier
 Bundle-Activator: com.eclipserunner.RunnerPlugin
 Require-Bundle: org.eclipse.ui,
  org.eclipse.ui.ide;bundle-version="3.6.2",

File EclipseRunner/build.properties

 bin.includes = META-INF/,\
 			   plugin.xml,\
                icons/,\
-               .\
+               .
+src.excludes = test/

File EclipseRunner/plugin.xml

 	<extension point="org.eclipse.ui.perspectiveExtensions">
 		<perspectiveExtension targetID="org.eclipse.jdt.ui.JavaPerspective">
 			<view ratio="0.5" relative="org.eclipse.ui.views.TaskList"
-               relationship="right" id="com.eclipserunner.views.impl.RunnerView" />
+               relationship="right" id="com.eclipserunner.views.RunnerView" />
 		</perspectiveExtension>
 	</extension>
 	

File EclipseRunner/src/com/eclipserunner/RunnerPlugin.java

 import java.io.File;
 import java.util.HashMap;
 import java.util.Map;
-
 import org.eclipse.core.resources.ISaveContext;
 import org.eclipse.core.resources.ISaveParticipant;
 import org.eclipse.core.resources.ISavedState;
 import org.eclipse.core.runtime.IPath;
 import org.eclipse.core.runtime.Path;
 import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.resource.ImageRegistry;
+import org.eclipse.swt.graphics.Image;
 import org.eclipse.swt.widgets.Display;
 import org.eclipse.swt.widgets.Shell;
 import org.eclipse.ui.plugin.AbstractUIPlugin;
 
 /**
  * Eclipse runner plugin activator class.
- * 
+ *
  * @author bary, vachacz
+ * @author Michael Scharf &lt;michael_scharf_google@scharf.gr&gt; - patch idea
  */
 public class RunnerPlugin extends AbstractUIPlugin {
 
 		return imageDescriptor;
 	}
 
-	/**
+    public Image getImage(String imageFileName) {
+        final ImageRegistry registry = getImageRegistry();
+        Image image = registry.get(imageFileName);
+        if (image == null) {
+            image = getImageDescriptor(imageFileName).createImage();
+            registry.put(imageFileName, image);
+        }
+        return image;
+    }
+
+    /**
 	 * @return SWT active Shell.
 	 */
 	public static Shell getRunnerShell() {
 		return Display.getCurrent().getActiveShell();
 	}
-	
+
 	/**
 	 * @return Display instance
 	 */
 			RunnerStateExternalizer.readDefaultRunnerModel();
 		}
 	}
-
 }

File EclipseRunner/src/com/eclipserunner/views/impl/LaunchTreeLabelProvider.java

 package com.eclipserunner.views.impl;
 
+import com.eclipserunner.RunnerPlugin;
+import com.eclipserunner.model.ICategoryNode;
+import com.eclipserunner.model.ILaunchNode;
+import com.eclipserunner.model.ILaunchTypeNode;
+import com.eclipserunner.model.IRunnerModel;
 import org.eclipse.debug.ui.DebugUITools;
 import org.eclipse.debug.ui.IDebugModelPresentation;
 import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.resource.ImageRegistry;
 import org.eclipse.jface.viewers.DecorationOverlayIcon;
 import org.eclipse.jface.viewers.IDecoration;
 import org.eclipse.jface.viewers.LabelProvider;
 import org.eclipse.swt.graphics.Image;
 
-import com.eclipserunner.RunnerPlugin;
-import com.eclipserunner.model.ICategoryNode;
-import com.eclipserunner.model.ILaunchNode;
-import com.eclipserunner.model.ILaunchTypeNode;
-import com.eclipserunner.model.IRunnerModel;
-
 /**
  * Launch configuration tree decorator.
- * 
+ *
  * @author vachacz, bary
+ * @author Michael Scharf &lt;michael_scharf_google@scharf.gr&gt; - patch idea
  */
 public class LaunchTreeLabelProvider extends LabelProvider {
 
 	private static final String IMG_CATEGORY         = "category.gif";
 	private static final String IMG_DEFAULT_CATEGORY = "category-archive.gif";
 	private static final String IMG_DECORATION       = "star_min.gif";
+	private static final String MISSING_IMG_KEY      = "MISSING";
 
 	private IDebugModelPresentation debugModelPresentation;
 	private final IRunnerModel runnerModel;
 		else if (element instanceof ILaunchTypeNode) {
 			return getLaunchConfigurationTypeImage((ILaunchTypeNode) element);
 		}
-		return ImageDescriptor.getMissingImageDescriptor().createImage();
+		else {
+		    return getMissingImage();
+		}
 	}
 
+    private Image getMissingImage() {
+        final ImageRegistry imageRegistry = RunnerPlugin.getDefault().getImageRegistry();
+        Image image = imageRegistry.get(MISSING_IMG_KEY);
+        if (image == null) {
+            image = ImageDescriptor.getMissingImageDescriptor().createImage();
+            imageRegistry.put(MISSING_IMG_KEY, image);
+        }
+        return image;
+    }
+
 	private Image getCategoryImage(ICategoryNode launchConfigurationCategory) {
 		if (runnerModel.getDefaultCategoryNode() == launchConfigurationCategory) {
 			return createImage(IMG_DEFAULT_CATEGORY);
 		}
 		return image;
 	}
-	
+
 	private Image getLaunchConfigurationTypeImage(ILaunchTypeNode typeNode) {
 		return debugModelPresentation.getImage(typeNode.getLaunchConfigurationType());
 	}
-	
-	private Image createImage(String image) {
-		return RunnerPlugin.getDefault().getImageDescriptor(image).createImage();
-	}
 
-	private Image overlyBookmarkIcon(Image image, String decoration) {
-		ImageDescriptor decorationDescriptor = RunnerPlugin.getDefault().getImageDescriptor(decoration);
-		return new DecorationOverlayIcon(image, decorationDescriptor, IDecoration.TOP_RIGHT).createImage();
+	private Image createImage(String imageFileName) {
+		return RunnerPlugin.getDefault().getImage(imageFileName);
 	}
 
+	private Image overlyBookmarkIcon(Image sourceImage, String decorationFileName) {
+		final RunnerPlugin runnerPlugin = RunnerPlugin.getDefault();
+		final ImageRegistry imageRegistry = runnerPlugin.getImageRegistry();
+		final String key = sourceImage.toString() + "/" + decorationFileName;
+		Image image = imageRegistry.get(key);
+		if (image == null) {
+	        final ImageDescriptor decorationDescriptor = runnerPlugin.getImageDescriptor(decorationFileName);
+	        final DecorationOverlayIcon resultDescriptor =
+	                new DecorationOverlayIcon(sourceImage, decorationDescriptor, IDecoration.TOP_RIGHT);
+	        image = resultDescriptor.createImage();
+	        imageRegistry.put(key, image);
+        }
+		return image;
+	}
 }

File EclipseRunnerFeature/feature.xml

 <feature
       id="EclipseRunnerFeature"
       label="EclipseRunnerFeature"
-      version="1.3.1.qualifier"
+      version="1.3.2.qualifier"
       provider-name="EclipseRunner">
 
    <plugin

File EclipseRunnerSite/artifacts.jar

Binary file modified.

File EclipseRunnerSite/content.jar

Binary file modified.

File EclipseRunnerSite/features/EclipseRunnerFeature_1.3.2.201307172237.jar

Binary file added.

File EclipseRunnerSite/plugins/EclipseRunner_1.3.2.201307172237.jar

Binary file added.

File EclipseRunnerSite/site.xml

 <?xml version="1.0" encoding="UTF-8"?>
 <site>
-   <feature url="features/EclipseRunnerFeature_1.3.1.201307152336.jar" id="EclipseRunnerFeature" version="1.3.1.201307152336">
+   <feature url="features/EclipseRunnerFeature_1.3.2.201307172237.jar" id="EclipseRunnerFeature" version="1.3.2.201307172237">
       <category name="EclipseRunner"/>
    </feature>
    <category-def name="EclipseRunner" label="EclipseRunner"/>