Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bundles/tooling/org.eclipse.fx.ide.css.cssext.resolver.jdt/.classpath7
-rw-r--r--bundles/tooling/org.eclipse.fx.ide.css.cssext.resolver.jdt/.gitignore1
-rw-r--r--bundles/tooling/org.eclipse.fx.ide.css.cssext.resolver.jdt/.project33
-rw-r--r--bundles/tooling/org.eclipse.fx.ide.css.cssext.resolver.jdt/.settings/ca.ecliptical.pde.ds.prefs6
-rw-r--r--bundles/tooling/org.eclipse.fx.ide.css.cssext.resolver.jdt/.settings/org.eclipse.jdt.core.prefs7
-rw-r--r--bundles/tooling/org.eclipse.fx.ide.css.cssext.resolver.jdt/META-INF/MANIFEST.MF15
-rw-r--r--bundles/tooling/org.eclipse.fx.ide.css.cssext.resolver.jdt/OSGI-INF/services/org.eclipse.fx.ide.css.cssext.resolver.jdt.JDTClasspathCssExtResolver.xml8
-rw-r--r--bundles/tooling/org.eclipse.fx.ide.css.cssext.resolver.jdt/build.properties5
-rw-r--r--bundles/tooling/org.eclipse.fx.ide.css.cssext.resolver.jdt/src/org/eclipse/fx/ide/css/cssext/resolver/jdt/JDTClasspathCssExtResolver.java269
-rw-r--r--bundles/tooling/org.eclipse.fx.ide.css.cssext.resolver.osgi/.classpath7
-rw-r--r--bundles/tooling/org.eclipse.fx.ide.css.cssext.resolver.osgi/.gitignore1
-rw-r--r--bundles/tooling/org.eclipse.fx.ide.css.cssext.resolver.osgi/.project33
-rw-r--r--bundles/tooling/org.eclipse.fx.ide.css.cssext.resolver.osgi/.settings/ca.ecliptical.pde.ds.prefs6
-rw-r--r--bundles/tooling/org.eclipse.fx.ide.css.cssext.resolver.osgi/.settings/org.eclipse.jdt.core.prefs7
-rw-r--r--bundles/tooling/org.eclipse.fx.ide.css.cssext.resolver.osgi/META-INF/MANIFEST.MF13
-rw-r--r--bundles/tooling/org.eclipse.fx.ide.css.cssext.resolver.osgi/OSGI-INF/services/org.eclipse.fx.ide.css.cssext.resolver.osgi.OSGiBundlesCssExtResolver.xml8
-rw-r--r--bundles/tooling/org.eclipse.fx.ide.css.cssext.resolver.osgi/build.properties5
-rw-r--r--bundles/tooling/org.eclipse.fx.ide.css.cssext.resolver.osgi/src/org/eclipse/fx/ide/css/cssext/resolver/osgi/CssExtBundleTracker.java105
-rw-r--r--bundles/tooling/org.eclipse.fx.ide.css.cssext.resolver.osgi/src/org/eclipse/fx/ide/css/cssext/resolver/osgi/OSGiBundlesCssExtResolver.java44
-rw-r--r--bundles/tooling/org.eclipse.fx.ide.css.cssext.resolver.pde/.classpath7
-rw-r--r--bundles/tooling/org.eclipse.fx.ide.css.cssext.resolver.pde/.gitignore1
-rw-r--r--bundles/tooling/org.eclipse.fx.ide.css.cssext.resolver.pde/.project33
-rw-r--r--bundles/tooling/org.eclipse.fx.ide.css.cssext.resolver.pde/.settings/ca.ecliptical.pde.ds.prefs6
-rw-r--r--bundles/tooling/org.eclipse.fx.ide.css.cssext.resolver.pde/.settings/org.eclipse.jdt.core.prefs7
-rw-r--r--bundles/tooling/org.eclipse.fx.ide.css.cssext.resolver.pde/META-INF/MANIFEST.MF16
-rw-r--r--bundles/tooling/org.eclipse.fx.ide.css.cssext.resolver.pde/OSGI-INF/services/org.eclipse.fx.ide.css.cssext.resolver.pde.PDETargetCssExtResolver.xml8
-rw-r--r--bundles/tooling/org.eclipse.fx.ide.css.cssext.resolver.pde/build.properties5
-rw-r--r--bundles/tooling/org.eclipse.fx.ide.css.cssext.resolver.pde/src/org/eclipse/fx/ide/css/cssext/resolver/pde/PDETargetCssExtResolver.java160
-rw-r--r--bundles/tooling/org.eclipse.fx.ide.css.jfx2/META-INF/MANIFEST.MF1
-rwxr-xr-xbundles/tooling/org.eclipse.fx.ide.css.jfx2/META-INF/jfx2.cssext (renamed from bundles/tooling/org.eclipse.fx.ide.css.jfx2/src/jfx2.cssext)1
-rw-r--r--bundles/tooling/org.eclipse.fx.ide.css.jfx8/META-INF/MANIFEST.MF1
-rwxr-xr-xbundles/tooling/org.eclipse.fx.ide.css.jfx8/META-INF/jfx8.cssext (renamed from bundles/tooling/org.eclipse.fx.ide.css.jfx8/src/jfx8.cssext)4
-rw-r--r--bundles/tooling/org.eclipse.fx.ide.css.ui/src-gen/org/eclipse/fx/ide/css/ui/CssDslExecutableExtensionFactory.java6
-rw-r--r--bundles/tooling/org.eclipse.fx.ide.css/model/generated/CssDsl.genmodel2
34 files changed, 833 insertions, 5 deletions
diff --git a/bundles/tooling/org.eclipse.fx.ide.css.cssext.resolver.jdt/.classpath b/bundles/tooling/org.eclipse.fx.ide.css.cssext.resolver.jdt/.classpath
new file mode 100644
index 000000000..eca7bdba8
--- /dev/null
+++ b/bundles/tooling/org.eclipse.fx.ide.css.cssext.resolver.jdt/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/bundles/tooling/org.eclipse.fx.ide.css.cssext.resolver.jdt/.gitignore b/bundles/tooling/org.eclipse.fx.ide.css.cssext.resolver.jdt/.gitignore
new file mode 100644
index 000000000..ae3c17260
--- /dev/null
+++ b/bundles/tooling/org.eclipse.fx.ide.css.cssext.resolver.jdt/.gitignore
@@ -0,0 +1 @@
+/bin/
diff --git a/bundles/tooling/org.eclipse.fx.ide.css.cssext.resolver.jdt/.project b/bundles/tooling/org.eclipse.fx.ide.css.cssext.resolver.jdt/.project
new file mode 100644
index 000000000..3da90df8c
--- /dev/null
+++ b/bundles/tooling/org.eclipse.fx.ide.css.cssext.resolver.jdt/.project
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.fx.ide.css.cssext.resolver.jdt</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ds.core.builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/bundles/tooling/org.eclipse.fx.ide.css.cssext.resolver.jdt/.settings/ca.ecliptical.pde.ds.prefs b/bundles/tooling/org.eclipse.fx.ide.css.cssext.resolver.jdt/.settings/ca.ecliptical.pde.ds.prefs
new file mode 100644
index 000000000..7818b873d
--- /dev/null
+++ b/bundles/tooling/org.eclipse.fx.ide.css.cssext.resolver.jdt/.settings/ca.ecliptical.pde.ds.prefs
@@ -0,0 +1,6 @@
+classpath=true
+eclipse.preferences.version=1
+enabled=true
+path=OSGI-INF/services
+validationErrorLevel=error
+validationErrorLevel.missingImplicitUnbindMethod=error
diff --git a/bundles/tooling/org.eclipse.fx.ide.css.cssext.resolver.jdt/.settings/org.eclipse.jdt.core.prefs b/bundles/tooling/org.eclipse.fx.ide.css.cssext.resolver.jdt/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 000000000..0c68a61dc
--- /dev/null
+++ b/bundles/tooling/org.eclipse.fx.ide.css.cssext.resolver.jdt/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,7 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
+org.eclipse.jdt.core.compiler.compliance=1.8
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.8
diff --git a/bundles/tooling/org.eclipse.fx.ide.css.cssext.resolver.jdt/META-INF/MANIFEST.MF b/bundles/tooling/org.eclipse.fx.ide.css.cssext.resolver.jdt/META-INF/MANIFEST.MF
new file mode 100644
index 000000000..d39c0e7ce
--- /dev/null
+++ b/bundles/tooling/org.eclipse.fx.ide.css.cssext.resolver.jdt/META-INF/MANIFEST.MF
@@ -0,0 +1,15 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: CssExt JDT Resolver
+Bundle-SymbolicName: org.eclipse.fx.ide.css.cssext.resolver.jdt
+Bundle-Version: 1.0.0.qualifier
+Bundle-RequiredExecutionEnvironment: JavaSE-1.8
+Bundle-ActivationPolicy: lazy
+Require-Bundle: org.eclipse.fx.ide.css.cssext;bundle-version="2.2.0"
+Import-Package: org.eclipse.core.resources,
+ org.eclipse.core.runtime;version="3.5.0",
+ org.eclipse.fx.core;version="2.2.0",
+ org.eclipse.jdt.core,
+ org.eclipse.jdt.internal.core,
+ org.osgi.service.component.annotations;version="1.2.0";resolution:=optional
+Service-Component: OSGI-INF/services/org.eclipse.fx.ide.css.cssext.resolver.jdt.JDTClasspathCssExtResolver.xml
diff --git a/bundles/tooling/org.eclipse.fx.ide.css.cssext.resolver.jdt/OSGI-INF/services/org.eclipse.fx.ide.css.cssext.resolver.jdt.JDTClasspathCssExtResolver.xml b/bundles/tooling/org.eclipse.fx.ide.css.cssext.resolver.jdt/OSGI-INF/services/org.eclipse.fx.ide.css.cssext.resolver.jdt.JDTClasspathCssExtResolver.xml
new file mode 100644
index 000000000..3ca643b76
--- /dev/null
+++ b/bundles/tooling/org.eclipse.fx.ide.css.cssext.resolver.jdt/OSGI-INF/services/org.eclipse.fx.ide.css.cssext.resolver.jdt.JDTClasspathCssExtResolver.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" activate="activate" deactivate="deactivate" immediate="true" name="org.eclipse.fx.ide.css.cssext.resolver.jdt.JDTClasspathCssExtResolver">
+ <property name="context" value="org.eclipse.core.resources.IProject"/>
+ <service>
+ <provide interface="org.eclipse.fx.ide.css.cssext.extapi.registry.CssExtFileWatcher"/>
+ </service>
+ <implementation class="org.eclipse.fx.ide.css.cssext.resolver.jdt.JDTClasspathCssExtResolver"/>
+</scr:component> \ No newline at end of file
diff --git a/bundles/tooling/org.eclipse.fx.ide.css.cssext.resolver.jdt/build.properties b/bundles/tooling/org.eclipse.fx.ide.css.cssext.resolver.jdt/build.properties
new file mode 100644
index 000000000..c58ea2178
--- /dev/null
+++ b/bundles/tooling/org.eclipse.fx.ide.css.cssext.resolver.jdt/build.properties
@@ -0,0 +1,5 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ OSGI-INF/
diff --git a/bundles/tooling/org.eclipse.fx.ide.css.cssext.resolver.jdt/src/org/eclipse/fx/ide/css/cssext/resolver/jdt/JDTClasspathCssExtResolver.java b/bundles/tooling/org.eclipse.fx.ide.css.cssext.resolver.jdt/src/org/eclipse/fx/ide/css/cssext/resolver/jdt/JDTClasspathCssExtResolver.java
new file mode 100644
index 000000000..97a058f56
--- /dev/null
+++ b/bundles/tooling/org.eclipse.fx.ide.css.cssext.resolver.jdt/src/org/eclipse/fx/ide/css/cssext/resolver/jdt/JDTClasspathCssExtResolver.java
@@ -0,0 +1,269 @@
+package org.eclipse.fx.ide.css.cssext.resolver.jdt;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.function.Consumer;
+import java.util.jar.Manifest;
+import java.util.stream.Collectors;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IWorkspaceRoot;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.URIUtil;
+import org.eclipse.fx.core.Subscription;
+import org.eclipse.fx.ide.css.cssext.extapi.registry.CssExtFileWatcher;
+import org.eclipse.jdt.core.ElementChangedEvent;
+import org.eclipse.jdt.core.IClasspathEntry;
+import org.eclipse.jdt.core.IJavaElementDelta;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.IPackageFragmentRoot;
+import org.eclipse.jdt.core.JavaCore;
+import org.osgi.service.component.annotations.Activate;
+import org.osgi.service.component.annotations.Component;
+import org.osgi.service.component.annotations.Deactivate;
+
+@Component(service=CssExtFileWatcher.class, immediate=true, property={"context=org.eclipse.core.resources.IProject"})
+public class JDTClasspathCssExtResolver implements CssExtFileWatcher<IProject> {
+
+ private Map<IProject, List<Consumer<URI>>> addListener = new HashMap<>();
+ private Map<IProject, List<Consumer<URI>>> removeListener = new HashMap<>();
+ private Map<IProject, Set<URI>> cssExtURIs = new HashMap<>();
+
+
+ @Override
+ public String getId() {
+ return "jdt-classpath";
+ }
+
+ private Set<URI> findAllCssExtFiles(IProject context) {
+ Set<URI> result = new HashSet<>();
+ try {
+ if (context.hasNature(JavaCore.NATURE_ID)) {
+ IJavaProject project = JavaCore.create(context);
+ IClasspathEntry[] resolvedClasspath = project.getResolvedClasspath(true);
+
+ for (IClasspathEntry e : resolvedClasspath) {
+ System.err.println("entry " + e.getPath());
+ if (e.getEntryKind() == IClasspathEntry.CPE_LIBRARY) {
+ System.err.println("CPE_LIBRARY -> jar?");
+ System.err.println(" -> " + e.getPath());
+
+ if (!e.getPath().toString().endsWith(".jar")) {
+ System.err.println("not supported.");
+ continue;
+ }
+
+ try {
+ URI jarURI = URIUtil.fromString("file:" + e.getPath().toString());
+
+ String baseURI = e.getPath().toString().endsWith(".jar") ? "jar:" + jarURI.toString() + "!" : jarURI.toString();
+
+ URI manifestURI = new URI(baseURI + "/META-INF/MANIFEST.MF");
+
+ Manifest mf = null;
+ String cssExtDefs = null;
+ try (InputStream data = manifestURI.toURL().openStream()) {
+ mf = new Manifest(data);
+ cssExtDefs = mf.getMainAttributes().getValue("CssExt-Definition");
+ }
+ catch (IOException ex) {
+ ex.printStackTrace();
+ }
+
+ if (cssExtDefs != null) {
+ System.err.println("FOUND " + cssExtDefs);
+ for (String cssExtDef : cssExtDefs.split(",")) {
+ try {
+ URI extURI = new URI(baseURI + "/" + cssExtDef.trim());
+ System.err.println(" -> " + extURI);
+ result.add(extURI);
+ }
+ catch (URISyntaxException ex) {
+ ex.printStackTrace();
+ }
+ }
+ }
+ }
+ catch (URISyntaxException ex) {
+ ex.printStackTrace();
+ }
+
+ }
+ else if (e.getEntryKind() == IClasspathEntry.CPE_PROJECT) {
+ System.err.println("CPE_PROJECT");
+ System.err.println(" -> " + e.getOutputLocation());
+ }
+ }
+
+ }
+ }
+ catch (CoreException e) {
+ e.printStackTrace();
+ }
+
+ return result;
+ }
+
+ private void onElementChange(ElementChangedEvent event) {
+ System.err.println("on catchall change " + event);
+
+ IJavaElementDelta delta = event.getDelta();
+ for (IJavaElementDelta child : delta.getAffectedChildren()) {
+ if (child.getElement() instanceof IJavaProject) {
+ IJavaProject p = (IJavaProject) child.getElement();
+ IProject project = p.getProject();
+ System.err.println("Project " + p.getElementName() + " Change");
+ if ((child.getFlags() & IJavaElementDelta.F_RESOLVED_CLASSPATH_CHANGED) == IJavaElementDelta.F_RESOLVED_CLASSPATH_CHANGED) {
+ System.err.println(" -> classpath change");
+
+ for (IJavaElementDelta cc : child.getAffectedChildren()) {
+ if ((cc.getFlags() & IJavaElementDelta.F_ADDED_TO_CLASSPATH) == IJavaElementDelta.F_ADDED_TO_CLASSPATH ||
+ cc.getKind() == IJavaElementDelta.ADDED) {
+ System.err.println(" added " + cc.getElement());
+
+ if (cc.getElement() instanceof IPackageFragmentRoot) {
+ IPackageFragmentRoot f = (IPackageFragmentRoot) cc.getElement();
+ for (URI uri : findCssExt(f)) {
+ Set<URI> set = cssExtURIs.get(project);
+ if (set != null) {
+ set.add(uri);
+ for (Consumer<URI> l : addListener.get(project)) {
+ l.accept(uri);
+ }
+ }
+ }
+ }
+
+ }
+ if ((cc.getFlags() & IJavaElementDelta.F_REMOVED_FROM_CLASSPATH) == IJavaElementDelta.F_REMOVED_FROM_CLASSPATH ||
+ cc.getKind() == IJavaElementDelta.REMOVED) {
+ System.err.println(" removed " + cc.getElement());
+
+ if (cc.getElement() instanceof IPackageFragmentRoot) {
+ IPackageFragmentRoot f = (IPackageFragmentRoot) cc.getElement();
+ for (URI uri : findCssExt(f)) {
+ Set<URI> set = cssExtURIs.get(project);
+ if (set != null) {
+ set.remove(uri);
+ for (Consumer<URI> l : removeListener.get(project)) {
+ l.accept(uri);
+ }
+ }
+ }
+ }
+ }
+ }
+
+ }
+ }
+
+ }
+ }
+
+ private Set<URI> findCssExt(IPackageFragmentRoot f) {
+ System.err.println("external: " + f.isExternal());
+ System.err.println("path: " + f.getPath());
+
+ String baseURI;
+ if (f.isExternal()) {
+ baseURI = "file:" + f.getPath().toString();
+ }
+ else {
+ IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
+ IResource res = root.findMember(f.getPath());
+ baseURI = "file:" + res.getLocation().toString();
+ }
+
+ if (f.isArchive()) {
+ baseURI = "jar:" + baseURI.toString() + "!";
+ }
+
+ final String fBaseURI = baseURI;
+
+ System.err.println("baseURI = " + baseURI);
+
+ String manifestURI = baseURI + "/META-INF/MANIFEST.MF";
+
+ System.err.println("manifestURI = " + manifestURI);
+
+ String cssExtDefs = null;
+ try (InputStream in = new URI(manifestURI).toURL().openStream()) {
+ Manifest mf = new Manifest(in);
+ cssExtDefs = mf.getMainAttributes().getValue("CssExt-Definition");
+ }
+ catch (URISyntaxException | IOException e) {
+ e.printStackTrace();
+ }
+ if (cssExtDefs != null) {
+ System.err.println("FOUND " + cssExtDefs + " in " + manifestURI);
+
+ return Arrays.stream(cssExtDefs.split(","))
+ .map(cssExtDef -> URI.create(fBaseURI + (f.isArchive() ? "" : "/bin" ) + "/" + cssExtDef))
+ .collect(Collectors.toSet());
+ }
+ return Collections.emptySet();
+ }
+
+ @Activate
+ protected void activate() {
+ JavaCore.addElementChangedListener(this::onElementChange);
+ }
+
+ @Deactivate
+ protected void deactivate() {
+ JavaCore.removeElementChangedListener(this::onElementChange);
+ }
+
+ private void init(IProject context) {
+ if (!cssExtURIs.containsKey(context)) {
+ try {
+ if (context.hasNature(JavaCore.NATURE_ID)) {
+ addListener.put(context, new ArrayList<>());
+ removeListener.put(context, new ArrayList<>());
+ cssExtURIs.put(context, new HashSet<>());
+
+ // populate
+ cssExtURIs.get(context).addAll(findAllCssExtFiles(context));
+ }
+ }
+ catch (CoreException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+
+ @Override
+ public Subscription subscribe(IProject context, Consumer<URI> onAdd, Consumer<URI> onRemove) {
+ init(context);
+ addListener.get(context).add(onAdd);
+ removeListener.get(context).add(onRemove);
+
+ return new Subscription() {
+ @Override
+ public void dispose() {
+ addListener.get(context).remove(onAdd);
+ removeListener.get(context).remove(onRemove);
+
+ }
+ };
+ }
+
+ @Override
+ public Set<URI> getCurrent(IProject context) {
+ init(context);
+ return cssExtURIs.get(context);
+ }
+
+}
diff --git a/bundles/tooling/org.eclipse.fx.ide.css.cssext.resolver.osgi/.classpath b/bundles/tooling/org.eclipse.fx.ide.css.cssext.resolver.osgi/.classpath
new file mode 100644
index 000000000..eca7bdba8
--- /dev/null
+++ b/bundles/tooling/org.eclipse.fx.ide.css.cssext.resolver.osgi/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/bundles/tooling/org.eclipse.fx.ide.css.cssext.resolver.osgi/.gitignore b/bundles/tooling/org.eclipse.fx.ide.css.cssext.resolver.osgi/.gitignore
new file mode 100644
index 000000000..ae3c17260
--- /dev/null
+++ b/bundles/tooling/org.eclipse.fx.ide.css.cssext.resolver.osgi/.gitignore
@@ -0,0 +1 @@
+/bin/
diff --git a/bundles/tooling/org.eclipse.fx.ide.css.cssext.resolver.osgi/.project b/bundles/tooling/org.eclipse.fx.ide.css.cssext.resolver.osgi/.project
new file mode 100644
index 000000000..df4f14fae
--- /dev/null
+++ b/bundles/tooling/org.eclipse.fx.ide.css.cssext.resolver.osgi/.project
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.fx.ide.css.cssext.resolver.osgi</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ds.core.builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/bundles/tooling/org.eclipse.fx.ide.css.cssext.resolver.osgi/.settings/ca.ecliptical.pde.ds.prefs b/bundles/tooling/org.eclipse.fx.ide.css.cssext.resolver.osgi/.settings/ca.ecliptical.pde.ds.prefs
new file mode 100644
index 000000000..7818b873d
--- /dev/null
+++ b/bundles/tooling/org.eclipse.fx.ide.css.cssext.resolver.osgi/.settings/ca.ecliptical.pde.ds.prefs
@@ -0,0 +1,6 @@
+classpath=true
+eclipse.preferences.version=1
+enabled=true
+path=OSGI-INF/services
+validationErrorLevel=error
+validationErrorLevel.missingImplicitUnbindMethod=error
diff --git a/bundles/tooling/org.eclipse.fx.ide.css.cssext.resolver.osgi/.settings/org.eclipse.jdt.core.prefs b/bundles/tooling/org.eclipse.fx.ide.css.cssext.resolver.osgi/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 000000000..0c68a61dc
--- /dev/null
+++ b/bundles/tooling/org.eclipse.fx.ide.css.cssext.resolver.osgi/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,7 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
+org.eclipse.jdt.core.compiler.compliance=1.8
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.8
diff --git a/bundles/tooling/org.eclipse.fx.ide.css.cssext.resolver.osgi/META-INF/MANIFEST.MF b/bundles/tooling/org.eclipse.fx.ide.css.cssext.resolver.osgi/META-INF/MANIFEST.MF
new file mode 100644
index 000000000..c4010e4e1
--- /dev/null
+++ b/bundles/tooling/org.eclipse.fx.ide.css.cssext.resolver.osgi/META-INF/MANIFEST.MF
@@ -0,0 +1,13 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: CssExt OSGi Resolver
+Bundle-SymbolicName: org.eclipse.fx.ide.css.cssext.resolver.osgi
+Bundle-Version: 1.0.0.qualifier
+Bundle-RequiredExecutionEnvironment: JavaSE-1.8
+Bundle-ActivationPolicy: lazy
+Require-Bundle: org.eclipse.fx.ide.css.cssext;bundle-version="2.2.0"
+Service-Component: OSGI-INF/services/org.eclipse.fx.ide.css.cssext.resolver.osgi.OSGiBundlesCssExtResolver.xml
+Import-Package: org.eclipse.fx.core;version="2.2.0",
+ org.osgi.framework,
+ org.osgi.service.component.annotations;version="1.2.0";resolution:=optional,
+ org.osgi.util.tracker;version="1.5.1"
diff --git a/bundles/tooling/org.eclipse.fx.ide.css.cssext.resolver.osgi/OSGI-INF/services/org.eclipse.fx.ide.css.cssext.resolver.osgi.OSGiBundlesCssExtResolver.xml b/bundles/tooling/org.eclipse.fx.ide.css.cssext.resolver.osgi/OSGI-INF/services/org.eclipse.fx.ide.css.cssext.resolver.osgi.OSGiBundlesCssExtResolver.xml
new file mode 100644
index 000000000..11d4acdce
--- /dev/null
+++ b/bundles/tooling/org.eclipse.fx.ide.css.cssext.resolver.osgi/OSGI-INF/services/org.eclipse.fx.ide.css.cssext.resolver.osgi.OSGiBundlesCssExtResolver.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" activate="activate" deactivate="deactivate" name="org.eclipse.fx.ide.css.cssext.resolver.osgi.OSGiBundlesCssExtResolver">
+ <property name="context" value="java.lang.Void"/>
+ <service>
+ <provide interface="org.eclipse.fx.ide.css.cssext.extapi.registry.CssExtFileWatcher"/>
+ </service>
+ <implementation class="org.eclipse.fx.ide.css.cssext.resolver.osgi.OSGiBundlesCssExtResolver"/>
+</scr:component> \ No newline at end of file
diff --git a/bundles/tooling/org.eclipse.fx.ide.css.cssext.resolver.osgi/build.properties b/bundles/tooling/org.eclipse.fx.ide.css.cssext.resolver.osgi/build.properties
new file mode 100644
index 000000000..c58ea2178
--- /dev/null
+++ b/bundles/tooling/org.eclipse.fx.ide.css.cssext.resolver.osgi/build.properties
@@ -0,0 +1,5 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ OSGI-INF/
diff --git a/bundles/tooling/org.eclipse.fx.ide.css.cssext.resolver.osgi/src/org/eclipse/fx/ide/css/cssext/resolver/osgi/CssExtBundleTracker.java b/bundles/tooling/org.eclipse.fx.ide.css.cssext.resolver.osgi/src/org/eclipse/fx/ide/css/cssext/resolver/osgi/CssExtBundleTracker.java
new file mode 100644
index 000000000..9c86374e6
--- /dev/null
+++ b/bundles/tooling/org.eclipse.fx.ide.css.cssext.resolver.osgi/src/org/eclipse/fx/ide/css/cssext/resolver/osgi/CssExtBundleTracker.java
@@ -0,0 +1,105 @@
+package org.eclipse.fx.ide.css.cssext.resolver.osgi;
+
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+import java.util.function.Consumer;
+import java.util.stream.Collectors;
+
+import org.eclipse.fx.core.Subscription;
+import org.eclipse.fx.ide.css.cssext.extapi.registry.CssExtFileWatcher;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.BundleEvent;
+import org.osgi.util.tracker.BundleTracker;
+
+public class CssExtBundleTracker extends BundleTracker<Object> implements CssExtFileWatcher<Void> {
+
+ private Set<URI> cssExtURIs = new HashSet<>();
+ private List<Consumer<URI>> addListeners = Collections.synchronizedList(new ArrayList<>());
+ private List<Consumer<URI>> removeListeners = Collections.synchronizedList(new ArrayList<>());
+
+ @Override
+ public String getId() {
+ return "osgi-bundles";
+ }
+
+ public CssExtBundleTracker(BundleContext context) {
+ super(context, Bundle.INSTALLED | Bundle.RESOLVED | Bundle.ACTIVE | Bundle.STARTING | Bundle.STOPPING, null);
+ }
+
+ private static boolean notNull(Object o) {
+ return o != null;
+ }
+
+ private static URI toURI(URL url) {
+ try {
+ return url.toURI();
+ }
+ catch (URISyntaxException e) {
+
+ }
+ return null;
+ }
+
+ private Iterable<URI> getCssExt(Bundle bundle) {
+ String cssExtDefs = (String) bundle.getHeaders().get("CssExt-Definition");
+ if (cssExtDefs != null) {
+ return Arrays.stream(cssExtDefs.split(","))
+ .map(cssExtDef -> bundle.getResource(cssExtDef))
+ .filter(CssExtBundleTracker::notNull)
+ .map(CssExtBundleTracker::toURI)
+ .filter(CssExtBundleTracker::notNull)
+ .collect(Collectors.toSet());
+ }
+ return Collections.emptySet();
+ }
+
+ @Override
+ public Object addingBundle(Bundle bundle, BundleEvent event) {
+ for (URI extURI : getCssExt(bundle)) {
+ cssExtURIs.add(extURI);
+ for (Consumer<URI> onAdd : addListeners) {
+ onAdd.accept(extURI);
+ }
+ }
+ return super.addingBundle(bundle, event);
+ }
+
+ @Override
+ public void removedBundle(Bundle bundle, BundleEvent event, Object object) {
+ for (URI extURI : getCssExt(bundle)) {
+ cssExtURIs.remove(extURI);
+ for (Consumer<URI> onRemove : removeListeners) {
+ onRemove.accept(extURI);
+ }
+ }
+ super.removedBundle(bundle, event, object);
+ }
+
+ @Override
+ public Subscription subscribe(Void context, Consumer<URI> onAdd, Consumer<URI> onRemove) {
+ if (onAdd != null) addListeners.add(onAdd);
+ if (onRemove != null) removeListeners.add(onRemove);
+ return new Subscription() {
+ @Override
+ public void dispose() {
+ if (onAdd != null) addListeners.remove(onAdd);
+ if (onRemove != null) removeListeners.remove(onRemove);
+ }
+ };
+ }
+
+ @Override
+ public Set<URI> getCurrent(Void context) {
+ return cssExtURIs;
+ }
+
+
+}
diff --git a/bundles/tooling/org.eclipse.fx.ide.css.cssext.resolver.osgi/src/org/eclipse/fx/ide/css/cssext/resolver/osgi/OSGiBundlesCssExtResolver.java b/bundles/tooling/org.eclipse.fx.ide.css.cssext.resolver.osgi/src/org/eclipse/fx/ide/css/cssext/resolver/osgi/OSGiBundlesCssExtResolver.java
new file mode 100644
index 000000000..37f5a50a6
--- /dev/null
+++ b/bundles/tooling/org.eclipse.fx.ide.css.cssext.resolver.osgi/src/org/eclipse/fx/ide/css/cssext/resolver/osgi/OSGiBundlesCssExtResolver.java
@@ -0,0 +1,44 @@
+package org.eclipse.fx.ide.css.cssext.resolver.osgi;
+
+import java.net.URI;
+import java.util.Set;
+import java.util.function.Consumer;
+
+import org.eclipse.fx.core.Subscription;
+import org.eclipse.fx.ide.css.cssext.extapi.registry.CssExtFileWatcher;
+import org.osgi.framework.BundleContext;
+import org.osgi.service.component.annotations.Activate;
+import org.osgi.service.component.annotations.Component;
+import org.osgi.service.component.annotations.Deactivate;
+
+@Component(service=CssExtFileWatcher.class, property={"context=java.lang.Void"})
+public class OSGiBundlesCssExtResolver implements CssExtFileWatcher<Void> {
+
+ @Override
+ public String getId() {
+ return "osgi-bundles";
+ }
+
+ private CssExtBundleTracker tracker;
+
+ @Activate
+ protected void activate(BundleContext context) {
+ tracker = new CssExtBundleTracker(context);
+ tracker.open();
+ }
+
+ @Deactivate
+ protected void deactivate() {
+ tracker.close();
+ }
+
+ @Override
+ public Subscription subscribe(Void context, Consumer<URI> onAdd, Consumer<URI> onRemove) {
+ return tracker.subscribe(context, onAdd, onRemove);
+ }
+
+ @Override
+ public Set<URI> getCurrent(Void context) {
+ return tracker.getCurrent(context);
+ }
+}
diff --git a/bundles/tooling/org.eclipse.fx.ide.css.cssext.resolver.pde/.classpath b/bundles/tooling/org.eclipse.fx.ide.css.cssext.resolver.pde/.classpath
new file mode 100644
index 000000000..eca7bdba8
--- /dev/null
+++ b/bundles/tooling/org.eclipse.fx.ide.css.cssext.resolver.pde/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/bundles/tooling/org.eclipse.fx.ide.css.cssext.resolver.pde/.gitignore b/bundles/tooling/org.eclipse.fx.ide.css.cssext.resolver.pde/.gitignore
new file mode 100644
index 000000000..ae3c17260
--- /dev/null
+++ b/bundles/tooling/org.eclipse.fx.ide.css.cssext.resolver.pde/.gitignore
@@ -0,0 +1 @@
+/bin/
diff --git a/bundles/tooling/org.eclipse.fx.ide.css.cssext.resolver.pde/.project b/bundles/tooling/org.eclipse.fx.ide.css.cssext.resolver.pde/.project
new file mode 100644
index 000000000..b1ff9ff8e
--- /dev/null
+++ b/bundles/tooling/org.eclipse.fx.ide.css.cssext.resolver.pde/.project
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.fx.ide.css.cssext.resolver.pde</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ds.core.builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/bundles/tooling/org.eclipse.fx.ide.css.cssext.resolver.pde/.settings/ca.ecliptical.pde.ds.prefs b/bundles/tooling/org.eclipse.fx.ide.css.cssext.resolver.pde/.settings/ca.ecliptical.pde.ds.prefs
new file mode 100644
index 000000000..7818b873d
--- /dev/null
+++ b/bundles/tooling/org.eclipse.fx.ide.css.cssext.resolver.pde/.settings/ca.ecliptical.pde.ds.prefs
@@ -0,0 +1,6 @@
+classpath=true
+eclipse.preferences.version=1
+enabled=true
+path=OSGI-INF/services
+validationErrorLevel=error
+validationErrorLevel.missingImplicitUnbindMethod=error
diff --git a/bundles/tooling/org.eclipse.fx.ide.css.cssext.resolver.pde/.settings/org.eclipse.jdt.core.prefs b/bundles/tooling/org.eclipse.fx.ide.css.cssext.resolver.pde/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 000000000..0c68a61dc
--- /dev/null
+++ b/bundles/tooling/org.eclipse.fx.ide.css.cssext.resolver.pde/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,7 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
+org.eclipse.jdt.core.compiler.compliance=1.8
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.8
diff --git a/bundles/tooling/org.eclipse.fx.ide.css.cssext.resolver.pde/META-INF/MANIFEST.MF b/bundles/tooling/org.eclipse.fx.ide.css.cssext.resolver.pde/META-INF/MANIFEST.MF
new file mode 100644
index 000000000..ce5d42972
--- /dev/null
+++ b/bundles/tooling/org.eclipse.fx.ide.css.cssext.resolver.pde/META-INF/MANIFEST.MF
@@ -0,0 +1,16 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: CssExt PDE Resolver
+Bundle-SymbolicName: org.eclipse.fx.ide.css.cssext.resolver.pde
+Bundle-Version: 1.0.0.qualifier
+Bundle-RequiredExecutionEnvironment: JavaSE-1.8
+Bundle-ActivationPolicy: lazy
+Import-Package: org.eclipse.core.runtime,
+ org.eclipse.equinox.frameworkadmin;version="2.0.0",
+ org.eclipse.fx.core;version="2.2.0",
+ org.eclipse.fx.ide.css.cssext.extapi.registry,
+ org.eclipse.osgi.service.resolver;version="1.6.0",
+ org.eclipse.pde.core.target,
+ org.eclipse.pde.internal.core,
+ org.osgi.service.component.annotations;version="1.2.0";resolution:=optional
+Service-Component: OSGI-INF/services/org.eclipse.fx.ide.css.cssext.resolver.pde.PDETargetCssExtResolver.xml
diff --git a/bundles/tooling/org.eclipse.fx.ide.css.cssext.resolver.pde/OSGI-INF/services/org.eclipse.fx.ide.css.cssext.resolver.pde.PDETargetCssExtResolver.xml b/bundles/tooling/org.eclipse.fx.ide.css.cssext.resolver.pde/OSGI-INF/services/org.eclipse.fx.ide.css.cssext.resolver.pde.PDETargetCssExtResolver.xml
new file mode 100644
index 000000000..3ea9e959e
--- /dev/null
+++ b/bundles/tooling/org.eclipse.fx.ide.css.cssext.resolver.pde/OSGI-INF/services/org.eclipse.fx.ide.css.cssext.resolver.pde.PDETargetCssExtResolver.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" activate="activate" immediate="true" name="org.eclipse.fx.ide.css.cssext.resolver.pde.PDETargetCssExtResolver">
+ <property name="context" value="java.lang.Void"/>
+ <service>
+ <provide interface="org.eclipse.fx.ide.css.cssext.extapi.registry.CssExtFileWatcher"/>
+ </service>
+ <implementation class="org.eclipse.fx.ide.css.cssext.resolver.pde.PDETargetCssExtResolver"/>
+</scr:component> \ No newline at end of file
diff --git a/bundles/tooling/org.eclipse.fx.ide.css.cssext.resolver.pde/build.properties b/bundles/tooling/org.eclipse.fx.ide.css.cssext.resolver.pde/build.properties
new file mode 100644
index 000000000..c58ea2178
--- /dev/null
+++ b/bundles/tooling/org.eclipse.fx.ide.css.cssext.resolver.pde/build.properties
@@ -0,0 +1,5 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ OSGI-INF/
diff --git a/bundles/tooling/org.eclipse.fx.ide.css.cssext.resolver.pde/src/org/eclipse/fx/ide/css/cssext/resolver/pde/PDETargetCssExtResolver.java b/bundles/tooling/org.eclipse.fx.ide.css.cssext.resolver.pde/src/org/eclipse/fx/ide/css/cssext/resolver/pde/PDETargetCssExtResolver.java
new file mode 100644
index 000000000..81de62926
--- /dev/null
+++ b/bundles/tooling/org.eclipse.fx.ide.css.cssext.resolver.pde/src/org/eclipse/fx/ide/css/cssext/resolver/pde/PDETargetCssExtResolver.java
@@ -0,0 +1,160 @@
+package org.eclipse.fx.ide.css.cssext.resolver.pde;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+import java.util.function.Consumer;
+import java.util.jar.Manifest;
+import java.util.stream.Collectors;
+
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.fx.core.Subscription;
+import org.eclipse.fx.ide.css.cssext.extapi.registry.CssExtFileWatcher;
+import org.eclipse.osgi.service.resolver.BundleDescription;
+import org.eclipse.osgi.service.resolver.State;
+import org.eclipse.osgi.service.resolver.StateDelta;
+import org.eclipse.pde.core.target.ITargetDefinition;
+import org.eclipse.pde.core.target.TargetBundle;
+import org.eclipse.pde.internal.core.IStateDeltaListener;
+import org.eclipse.pde.internal.core.PDECore;
+import org.eclipse.pde.internal.core.TargetPlatformHelper;
+import org.osgi.service.component.annotations.Activate;
+import org.osgi.service.component.annotations.Component;
+
+@SuppressWarnings("restriction")
+@Component(service=CssExtFileWatcher.class, immediate=true, property={"context=java.lang.Void"})
+public class PDETargetCssExtResolver implements CssExtFileWatcher<Void> {
+
+ private Set<URI> cssExtURIs = new HashSet<>();
+ private List<Consumer<URI>> addListeners = Collections.synchronizedList(new ArrayList<>());
+ private List<Consumer<URI>> removeListeners = Collections.synchronizedList(new ArrayList<>());
+
+ @Override
+ public Subscription subscribe(Void context, Consumer<URI> onAdd, Consumer<URI> onRemove) {
+ if (onAdd != null) addListeners.add(onAdd);
+ if (onRemove != null) removeListeners.add(onRemove);
+ return new Subscription() {
+ @Override
+ public void dispose() {
+ if (onAdd != null) addListeners.remove(onAdd);
+ if (onRemove != null) removeListeners.remove(onRemove);
+ }
+ };
+ }
+
+ @Override
+ public String getId() {
+ return "pde-target";
+ }
+
+ private Set<BundleDescription> currentBundles = new HashSet<>();
+
+ private Set<URI> findCssExt(String bundleLocation) {
+// System.err.println("find " + bundleLocation);
+ String baseLocation = (bundleLocation.endsWith(".jar") ? "jar:" : "") + (bundleLocation.startsWith("file:") ? "" : "file:") + bundleLocation + (bundleLocation.endsWith(".jar") ? "!" : "");
+
+ String manifestLocation = baseLocation + "/META-INF/MANIFEST.MF";
+
+// System.err.println(manifestLocation);
+
+ String cssExtDefs = null;
+ try (InputStream in = new URI(manifestLocation).toURL().openStream()) {
+ Manifest mf = new Manifest(in);
+ cssExtDefs = mf.getMainAttributes().getValue("CssExt-Definition");
+ }
+ catch (URISyntaxException | IOException e) {
+ e.printStackTrace();
+ }
+ if (cssExtDefs != null) {
+ System.err.println("FOUND " + cssExtDefs + " in " + bundleLocation);
+
+ return Arrays.stream(cssExtDefs.split(","))
+ .map(cssExtDef -> URI.create(baseLocation + (bundleLocation.endsWith(".jar") ? "" : "/bin" ) + "/" + cssExtDef))
+ .filter(PDETargetCssExtResolver::notNull)
+ .collect(Collectors.toSet());
+ }
+ return Collections.emptySet();
+ }
+
+ private static boolean notNull(Object o) {
+ return o != null;
+ }
+
+ private void checkBundles(Set<BundleDescription> currentBundles) {
+ Set<BundleDescription> oldBundles = this.currentBundles;
+
+ Set<BundleDescription> removedBundles = new HashSet<>(oldBundles);
+ removedBundles.removeAll(currentBundles);
+
+ Set<BundleDescription> addedBundles = new HashSet<>(currentBundles);
+ addedBundles.removeAll(oldBundles);
+
+ for (BundleDescription b : addedBundles) {
+ for (URI cssExt : findCssExt(b.getLocation())) {
+ cssExtURIs.add(cssExt);
+ for (Consumer<URI> onAdd : addListeners) {
+ onAdd.accept(cssExt);
+ }
+ }
+ }
+
+ for (BundleDescription b : removedBundles) {
+ for (URI cssExt : findCssExt(b.getLocation())) {
+ cssExtURIs.remove(cssExt);
+ for (Consumer<URI> onRemove : removeListeners) {
+ onRemove.accept(cssExt);
+ }
+ }
+ }
+
+ this.currentBundles = currentBundles;
+ }
+
+ @Activate
+ protected void activate() {
+ try {
+ // install listener
+ PDECore.getDefault().getModelManager().addStateDeltaListener(new IStateDeltaListener() {
+
+ @Override
+ public void stateResolved(StateDelta delta) {
+ System.err.println("stateResolved " + delta);
+ }
+
+ @Override
+ public void stateChanged(State newState) {
+ System.err.println("stateChanged " + Arrays.toString(newState.getBundles()));
+ checkBundles(new HashSet<>(Arrays.asList(newState.getResolvedBundles())));
+ }
+ });
+
+ // initial load
+ ITargetDefinition target = TargetPlatformHelper.getWorkspaceTargetResolved(new NullProgressMonitor());
+ TargetBundle[] bundles = target.getBundles();
+ for (TargetBundle b : bundles) {
+ for (URI cssExt : findCssExt(b.getBundleInfo().getLocation().toString())) {
+ cssExtURIs.add(cssExt);
+ for (Consumer<URI> onAdd : addListeners) {
+ onAdd.accept(cssExt);
+ }
+ }
+ }
+ }
+ catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ @Override
+ public Set<URI> getCurrent(Void context) {
+ return cssExtURIs;
+ }
+
+}
diff --git a/bundles/tooling/org.eclipse.fx.ide.css.jfx2/META-INF/MANIFEST.MF b/bundles/tooling/org.eclipse.fx.ide.css.jfx2/META-INF/MANIFEST.MF
index d96859267..e73a2f4c4 100644
--- a/bundles/tooling/org.eclipse.fx.ide.css.jfx2/META-INF/MANIFEST.MF
+++ b/bundles/tooling/org.eclipse.fx.ide.css.jfx2/META-INF/MANIFEST.MF
@@ -6,3 +6,4 @@ Bundle-Version: 2.2.0.qualifier
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Bundle-ActivationPolicy: lazy
Bundle-Vendor: Eclipse.org
+CssExt-Definition: META-INF/jfx2.cssext
diff --git a/bundles/tooling/org.eclipse.fx.ide.css.jfx2/src/jfx2.cssext b/bundles/tooling/org.eclipse.fx.ide.css.jfx2/META-INF/jfx2.cssext
index 33d5d3946..3d2cce29a 100755
--- a/bundles/tooling/org.eclipse.fx.ide.css.jfx2/src/jfx2.cssext
+++ b/bundles/tooling/org.eclipse.fx.ide.css.jfx2/META-INF/jfx2.cssext
@@ -1,3 +1,4 @@
+namespace "javafx/2"
package javafx {
boolean = true | false;
diff --git a/bundles/tooling/org.eclipse.fx.ide.css.jfx8/META-INF/MANIFEST.MF b/bundles/tooling/org.eclipse.fx.ide.css.jfx8/META-INF/MANIFEST.MF
index 52f97fc39..3f9512edc 100644
--- a/bundles/tooling/org.eclipse.fx.ide.css.jfx8/META-INF/MANIFEST.MF
+++ b/bundles/tooling/org.eclipse.fx.ide.css.jfx8/META-INF/MANIFEST.MF
@@ -6,3 +6,4 @@ Bundle-Version: 2.2.0.qualifier
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Bundle-ActivationPolicy: lazy
Bundle-Vendor: Eclipse.org
+CssExt-Definition: META-INF/jfx8.cssext
diff --git a/bundles/tooling/org.eclipse.fx.ide.css.jfx8/src/jfx8.cssext b/bundles/tooling/org.eclipse.fx.ide.css.jfx8/META-INF/jfx8.cssext
index aa2a955de..1d2da4f88 100755
--- a/bundles/tooling/org.eclipse.fx.ide.css.jfx8/src/jfx8.cssext
+++ b/bundles/tooling/org.eclipse.fx.ide.css.jfx8/META-INF/jfx8.cssext
@@ -1,3 +1,5 @@
+namespace "javafx/8"
+
package javafx {
boolean = true | false;
@@ -717,7 +719,7 @@ package javafx {
* </code>
* </p>
*/
- looked-up-color = reference_to_other_color_property; // TODO howto implement?!
+ looked-up-color = @PROPERTY_REF(<color>);
/**
* The format of an RGB value in hexadecimal notation is a ‘#’ immediately followed by either three or six hexadecimal characters. The three-digit RGB notation (#rgb) is converted into six-digit form (#rrggbb) by replicating digits, not by adding zeros. For example, #fb0 expands to #ffbb00. This ensures that white (#ffffff) can be specified with the short notation (#fff) and removes any dependencies on the color depth of the display.
diff --git a/bundles/tooling/org.eclipse.fx.ide.css.ui/src-gen/org/eclipse/fx/ide/css/ui/CssDslExecutableExtensionFactory.java b/bundles/tooling/org.eclipse.fx.ide.css.ui/src-gen/org/eclipse/fx/ide/css/ui/CssDslExecutableExtensionFactory.java
index c514ed854..74229f418 100644
--- a/bundles/tooling/org.eclipse.fx.ide.css.ui/src-gen/org/eclipse/fx/ide/css/ui/CssDslExecutableExtensionFactory.java
+++ b/bundles/tooling/org.eclipse.fx.ide.css.ui/src-gen/org/eclipse/fx/ide/css/ui/CssDslExecutableExtensionFactory.java
@@ -11,7 +11,7 @@ import com.google.inject.Injector;
/**
* This class was generated. Customizations should only happen in a newly
- * introduced subclass.
+ * introduced subclass.
*/
public class CssDslExecutableExtensionFactory extends AbstractGuiceAwareExecutableExtensionFactory {
@@ -19,10 +19,10 @@ public class CssDslExecutableExtensionFactory extends AbstractGuiceAwareExecutab
protected Bundle getBundle() {
return CssActivator.getInstance().getBundle();
}
-
+
@Override
protected Injector getInjector() {
return CssActivator.getInstance().getInjector(CssActivator.ORG_ECLIPSE_FX_IDE_CSS_CSSDSL);
}
-
+
}
diff --git a/bundles/tooling/org.eclipse.fx.ide.css/model/generated/CssDsl.genmodel b/bundles/tooling/org.eclipse.fx.ide.css/model/generated/CssDsl.genmodel
index 32bf1f325..77b34ae9a 100644
--- a/bundles/tooling/org.eclipse.fx.ide.css/model/generated/CssDsl.genmodel
+++ b/bundles/tooling/org.eclipse.fx.ide.css/model/generated/CssDsl.genmodel
@@ -3,7 +3,7 @@
xmlns:genmodel="http://www.eclipse.org/emf/2002/GenModel" copyrightText="generated by Xtext 2.9.0" modelDirectory="/org.eclipse.fx.ide.css/src-gen"
modelPluginID="org.eclipse.fx.ide.css" forceOverwrite="true" modelName="CssDsl"
updateClasspath="false" rootExtendsClass="org.eclipse.emf.ecore.impl.MinimalEObjectImpl$Container"
- complianceLevel="6.0" copyrightFields="false" runtimeVersion="2.10">
+ complianceLevel="6.0" copyrightFields="false" runtimeVersion="2.11">
<genPackages prefix="CssDsl" basePackage="org.eclipse.fx.ide.css" disposableProviderFactory="true"
fileExtensions="css" ecorePackage="CssDsl.ecore#/">
<genClasses ecoreClass="CssDsl.ecore#//Stylesheet">

Back to the top