Bug 428903 - Having a common 'debug' window for all spies
Fix a problem on Icon in E4 window toolbar (Url path was not well
computed) and remove import warnings.
Change-Id: I7200d85c0663fe273d77357b9bfb48c0b8e6975c
Signed-off-by: Olivier Prouvost <olivier.prouvost@opcoach.com>
diff --git a/bundles/org.eclipse.e4.tools.spy/src/org/eclipse/e4/tools/spy/SpyHandler.java b/bundles/org.eclipse.e4.tools.spy/src/org/eclipse/e4/tools/spy/SpyHandler.java
index c60aadd..bc09774 100644
--- a/bundles/org.eclipse.e4.tools.spy/src/org/eclipse/e4/tools/spy/SpyHandler.java
+++ b/bundles/org.eclipse.e4.tools.spy/src/org/eclipse/e4/tools/spy/SpyHandler.java
@@ -15,16 +15,12 @@
import javax.inject.Named;
-import org.eclipse.e4.core.contexts.ContextInjectionFactory;
-import org.eclipse.e4.core.contexts.IEclipseContext;
import org.eclipse.e4.core.di.annotations.Execute;
import org.eclipse.e4.core.di.annotations.Optional;
-import org.eclipse.e4.ui.di.Focus;
import org.eclipse.e4.ui.model.application.MApplication;
import org.eclipse.e4.ui.model.application.commands.MCommand;
import org.eclipse.e4.ui.model.application.commands.MParameter;
import org.eclipse.e4.ui.model.application.descriptor.basic.MPartDescriptor;
-import org.eclipse.e4.ui.model.application.ui.advanced.MPlaceholder;
import org.eclipse.e4.ui.model.application.ui.basic.MPart;
import org.eclipse.e4.ui.model.application.ui.basic.MPartStack;
import org.eclipse.e4.ui.model.application.ui.basic.MTrimBar;
diff --git a/bundles/org.eclipse.e4.tools.spy/src/org/eclipse/e4/tools/spy/SpyProcessor.java b/bundles/org.eclipse.e4.tools.spy/src/org/eclipse/e4/tools/spy/SpyProcessor.java
index c78b521..7d7cacb 100644
--- a/bundles/org.eclipse.e4.tools.spy/src/org/eclipse/e4/tools/spy/SpyProcessor.java
+++ b/bundles/org.eclipse.e4.tools.spy/src/org/eclipse/e4/tools/spy/SpyProcessor.java
@@ -11,7 +11,6 @@
*******************************************************************************/
package org.eclipse.e4.tools.spy;
-import java.net.URL;
import java.util.List;
import javax.inject.Inject;
@@ -82,7 +81,7 @@
bindSpyKeyBinding(shortCut, command, partID);
// Add the descriptor in application
- addSpyPartDescriptor(partID, partName, b.getEntry(iconPath), partClass);
+ addSpyPartDescriptor(partID, partName, iconPath, partClass);
} catch (InvalidRegistryObjectException e1)
{
@@ -250,7 +249,7 @@
}
- public void addSpyPartDescriptor(String partId, String partLabel, URL iconPath, Class<?> spyPartClass)
+ public void addSpyPartDescriptor(String partId, String partLabel, String iconPath, Class<?> spyPartClass)
{
for (MPartDescriptor mp : application.getDescriptors())
{
@@ -271,11 +270,11 @@
descriptor.setLabel(partLabel);
descriptor.setCloseable(true);
- String bundle = FrameworkUtil.getBundle(spyPartClass).getSymbolicName();
- descriptor.setContributionURI("bundleclass://" + bundle + "/" + spyPartClass.getCanonicalName());
- String contributorURI = "platform:/plugin/" + FrameworkUtil.getBundle(spyPartClass).getSymbolicName();
+ String bundleId = FrameworkUtil.getBundle(spyPartClass).getSymbolicName();
+ descriptor.setContributionURI("bundleclass://" + bundleId + "/" + spyPartClass.getCanonicalName());
+ String contributorURI = "platform:/plugin/" + bundleId;
descriptor.setContributorURI(contributorURI);
- descriptor.setIconURI(iconPath.toString());
+ descriptor.setIconURI(contributorURI + "/" + iconPath);
application.getDescriptors().add(descriptor);
}