Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom Schindl2013-07-29 17:27:14 -0400
committerTom Schindl2013-07-29 17:27:14 -0400
commitdc91b4c030d14f145b7a61851217957872f92665 (patch)
treee7ea2e8ceb41750a0fc281358801f273b133dba4
parentb4f1a14c19a7a61bf1ce00ee2f4f4d46f17e60d7 (diff)
downloadorg.eclipse.efxclipse-dc91b4c030d14f145b7a61851217957872f92665.tar.gz
org.eclipse.efxclipse-dc91b4c030d14f145b7a61851217957872f92665.tar.xz
org.eclipse.efxclipse-dc91b4c030d14f145b7a61851217957872f92665.zip
Bug 413905 - Add Support for SVG icons
-rwxr-xr-xbundles/runtime/org.eclipse.fx.ui.services/META-INF/MANIFEST.MF14
-rwxr-xr-xbundles/runtime/org.eclipse.fx.ui.workbench.fx/META-INF/MANIFEST.MF5
-rwxr-xr-xbundles/runtime/org.eclipse.fx.ui.workbench.fx/build.properties13
-rwxr-xr-xbundles/runtime/org.eclipse.fx.ui.workbench.fx/src/org/eclipse/fx/ui/workbench/fx/E4Application.java34
-rwxr-xr-xbundles/tooling/org.eclipse.fx.ide.pde.ui.e4/generator-tasks/e4App.rtask1
-rwxr-xr-xbundles/tooling/org.eclipse.fx.ide.pde.ui.e4/generator-tasks/mediaSample.rtask1
6 files changed, 31 insertions, 37 deletions
diff --git a/bundles/runtime/org.eclipse.fx.ui.services/META-INF/MANIFEST.MF b/bundles/runtime/org.eclipse.fx.ui.services/META-INF/MANIFEST.MF
index ca0a2d906..af9ed065c 100755
--- a/bundles/runtime/org.eclipse.fx.ui.services/META-INF/MANIFEST.MF
+++ b/bundles/runtime/org.eclipse.fx.ui.services/META-INF/MANIFEST.MF
@@ -6,7 +6,17 @@ Bundle-Version: 0.9.0.qualifier
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Export-Package: org.eclipse.fx.ui.services,
org.eclipse.fx.ui.services.commands,
+ org.eclipse.fx.ui.services.resources,
org.eclipse.fx.ui.services.theme
Bundle-Vendor: %Bundle-Vendor
-Import-Package: javafx.scene;version="2.0.0"
-Require-Bundle: org.eclipse.e4.core.di;bundle-version="1.3.0"
+Import-Package: javafx.scene;version="2.0.0",
+ javafx.scene.image;version="2.0.0",
+ javax.inject;version="1.0.0"
+Require-Bundle: org.eclipse.e4.core.di;bundle-version="1.3.0",
+ org.eclipse.emf.common;bundle-version="2.9.0",
+ org.eclipse.fx.core;bundle-version="0.9.0",
+ org.eclipse.fx.osgi.util,
+ org.eclipse.osgi;bundle-version="3.9.0",
+ org.eclipse.core.runtime;bundle-version="3.9.0"
+Service-Component: OSGI-INF/imageprovider.xml
+Bundle-ActivationPolicy: lazy
diff --git a/bundles/runtime/org.eclipse.fx.ui.workbench.fx/META-INF/MANIFEST.MF b/bundles/runtime/org.eclipse.fx.ui.workbench.fx/META-INF/MANIFEST.MF
index 70ca198f1..cedb60a28 100755
--- a/bundles/runtime/org.eclipse.fx.ui.workbench.fx/META-INF/MANIFEST.MF
+++ b/bundles/runtime/org.eclipse.fx.ui.workbench.fx/META-INF/MANIFEST.MF
@@ -25,13 +25,16 @@ Require-Bundle: javax.inject;bundle-version="1.0.0",
org.eclipse.emf.ecore;bundle-version="2.9.0"
Import-Package: javafx.application;version="2.0.0",
javafx.event;version="2.0.0",
+ javafx.scene;version="2.0.0",
javafx.scene.image;version="2.0.0",
javafx.scene.input;version="2.0.0",
javafx.stage;version="2.0.0",
+ org.apache.commons.lang.text;version="2.6.0",
org.eclipse.osgi.service.environment;version="1.3.0",
org.osgi.framework;version="1.6.0",
org.osgi.service.event;version="1.3.0"
Export-Package: org.eclipse.fx.ui.workbench.fx.key
Bundle-Activator: org.eclipse.fx.ui.workbench.fx.internal.WorkbenchJFXActivator
Bundle-ActivationPolicy: lazy
-Service-Component: OSGI-INF/keylookup.xml
+Service-Component: OSGI-INF/keylookup.xml,
+ OSGI-INF/provider.xml
diff --git a/bundles/runtime/org.eclipse.fx.ui.workbench.fx/build.properties b/bundles/runtime/org.eclipse.fx.ui.workbench.fx/build.properties
index 60a43cb13..d0dc9fa91 100755
--- a/bundles/runtime/org.eclipse.fx.ui.workbench.fx/build.properties
+++ b/bundles/runtime/org.eclipse.fx.ui.workbench.fx/build.properties
@@ -1,6 +1,7 @@
-source.. = src/
-bin.includes = META-INF/,\
- .,\
- plugin.xml,\
- OSGI-INF/
-output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.xml,\
+ OSGI-INF/,\
+ OSGI-INF/provider.xml
+output.. = bin/
+source.. = src/
diff --git a/bundles/runtime/org.eclipse.fx.ui.workbench.fx/src/org/eclipse/fx/ui/workbench/fx/E4Application.java b/bundles/runtime/org.eclipse.fx.ui.workbench.fx/src/org/eclipse/fx/ui/workbench/fx/E4Application.java
index faf4fc50a..3e2ebfaab 100755
--- a/bundles/runtime/org.eclipse.fx.ui.workbench.fx/src/org/eclipse/fx/ui/workbench/fx/E4Application.java
+++ b/bundles/runtime/org.eclipse.fx.ui.workbench.fx/src/org/eclipse/fx/ui/workbench/fx/E4Application.java
@@ -14,14 +14,10 @@ import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
-import java.io.InputStream;
import java.io.OutputStream;
-import java.lang.ref.WeakReference;
-import java.net.MalformedURLException;
import java.net.URL;
import java.util.Locale;
import java.util.Properties;
-import java.util.WeakHashMap;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.FutureTask;
import java.util.concurrent.RunnableFuture;
@@ -70,6 +66,8 @@ import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.equinox.app.IApplicationContext;
import org.eclipse.fx.osgi.util.AbstractJFXApplication;
import org.eclipse.fx.osgi.util.LoggerCreator;
+import org.eclipse.fx.ui.services.resources.GraphicsLoader;
+import org.eclipse.fx.ui.workbench.fx.internal.GraphicsLoaderImpl;
import org.eclipse.fx.ui.workbench.fx.internal.LoggerProviderImpl;
import org.eclipse.fx.ui.workbench.fx.internal.WorkbenchJFXActivator;
import org.eclipse.osgi.service.datalocation.Location;
@@ -145,7 +143,7 @@ public class E4Application extends AbstractJFXApplication {
public E4Workbench createE4Workbench(IApplicationContext applicationContext, Application jfxApplication, Stage primaryStage) {
args = (String[]) applicationContext.getArguments().get(IApplicationContext.APPLICATION_ARGS);
- IEclipseContext appContext = createDefaultContext();
+ final IEclipseContext appContext = createDefaultContext();
ContextInjectionFactory.setDefault(appContext);
appContext.set(Application.class, jfxApplication);
@@ -181,31 +179,11 @@ public class E4Application extends AbstractJFXApplication {
}
});
appContext.set(IApplicationContext.class, applicationContext);
+ appContext.set(GraphicsLoader.class,ContextInjectionFactory.make(GraphicsLoaderImpl.class, appContext));
appContext.set(IResourceUtilities.class, new IResourceUtilities<Image>() {
- private WeakHashMap<URI, WeakReference<Image>> imageCache = new WeakHashMap<URI, WeakReference<Image>>();
-
public Image imageDescriptorFromURI(URI iconPath) {
- WeakReference<Image> r = imageCache.get(iconPath);
- Image img = null;
- if( r != null ) {
- img = r.get();
- }
-
- if( img == null ) {
- try {
- InputStream in = new URL(iconPath.toString()).openStream();
- img = new Image(in);
- in.close();
- imageCache.put(iconPath, new WeakReference<Image>(img));
- } catch (MalformedURLException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- } catch (IOException e) {
- logger.warning("could not find icon at: " + iconPath,e);
- }
- }
-
- return img;
+ GraphicsLoader l = appContext.get(GraphicsLoader.class);
+ return l.getImage(iconPath);
}
});
diff --git a/bundles/tooling/org.eclipse.fx.ide.pde.ui.e4/generator-tasks/e4App.rtask b/bundles/tooling/org.eclipse.fx.ide.pde.ui.e4/generator-tasks/e4App.rtask
index 9cd6a7357..822918d52 100755
--- a/bundles/tooling/org.eclipse.fx.ide.pde.ui.e4/generator-tasks/e4App.rtask
+++ b/bundles/tooling/org.eclipse.fx.ide.pde.ui.e4/generator-tasks/e4App.rtask
@@ -218,6 +218,7 @@ RobotTask {
"javax.inject",
"javax.xml",
"org.apache.commons.logging",
+ "org.apache.commons.lang",
"org.eclipse.core.commands",
"org.eclipse.core.contenttype",
"org.eclipse.core.databinding",
diff --git a/bundles/tooling/org.eclipse.fx.ide.pde.ui.e4/generator-tasks/mediaSample.rtask b/bundles/tooling/org.eclipse.fx.ide.pde.ui.e4/generator-tasks/mediaSample.rtask
index c5ea672eb..daa6c659b 100755
--- a/bundles/tooling/org.eclipse.fx.ide.pde.ui.e4/generator-tasks/mediaSample.rtask
+++ b/bundles/tooling/org.eclipse.fx.ide.pde.ui.e4/generator-tasks/mediaSample.rtask
@@ -256,6 +256,7 @@ RobotTask {
"javax.inject",
"javax.xml",
"org.apache.commons.logging",
+ "org.apache.commons.lang",
"org.eclipse.core.commands",
"org.eclipse.core.contenttype",
"org.eclipse.core.databinding",

Back to the top