Author: snjeza
Date: 2008-09-12 06:19:08 -0400 (Fri, 12 Sep 2008)
New Revision: 10218
Added:
trunk/vpe/plugins/org.jboss.tools.xulrunner.initializer/.classpath
trunk/vpe/plugins/org.jboss.tools.xulrunner.initializer/.project
trunk/vpe/plugins/org.jboss.tools.xulrunner.initializer/META-INF/
trunk/vpe/plugins/org.jboss.tools.xulrunner.initializer/META-INF/MANIFEST.MF
trunk/vpe/plugins/org.jboss.tools.xulrunner.initializer/bin/
trunk/vpe/plugins/org.jboss.tools.xulrunner.initializer/build.properties
trunk/vpe/plugins/org.jboss.tools.xulrunner.initializer/src/
trunk/vpe/plugins/org.jboss.tools.xulrunner.initializer/src/org/
trunk/vpe/plugins/org.jboss.tools.xulrunner.initializer/src/org/eclipse/
trunk/vpe/plugins/org.jboss.tools.xulrunner.initializer/src/org/eclipse/swt/
trunk/vpe/plugins/org.jboss.tools.xulrunner.initializer/src/org/eclipse/swt/browser/
trunk/vpe/plugins/org.jboss.tools.xulrunner.initializer/src/org/eclipse/swt/browser/XULRunnerInitializer.java
Log:
JBIDE-1096 - VPE loading is failed after eclipse HTML Wlcome Screen
Added: trunk/vpe/plugins/org.jboss.tools.xulrunner.initializer/.classpath
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.xulrunner.initializer/.classpath
(rev 0)
+++ trunk/vpe/plugins/org.jboss.tools.xulrunner.initializer/.classpath 2008-09-12 10:19:08
UTC (rev 10218)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con"
path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="con"
path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
Added: trunk/vpe/plugins/org.jboss.tools.xulrunner.initializer/.project
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.xulrunner.initializer/.project
(rev 0)
+++ trunk/vpe/plugins/org.jboss.tools.xulrunner.initializer/.project 2008-09-12 10:19:08
UTC (rev 10218)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.jboss.tools.xulrunner.initializer</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>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
Added: trunk/vpe/plugins/org.jboss.tools.xulrunner.initializer/META-INF/MANIFEST.MF
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.xulrunner.initializer/META-INF/MANIFEST.MF
(rev 0)
+++
trunk/vpe/plugins/org.jboss.tools.xulrunner.initializer/META-INF/MANIFEST.MF 2008-09-12
10:19:08 UTC (rev 10218)
@@ -0,0 +1,8 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: XULRunner Initializer
+Bundle-SymbolicName: org.jboss.tools.xulrunner.initializer
+Bundle-Version: 1.0.0
+Bundle-Vendor: Red Hat, Inc.
+Fragment-Host: org.eclipse.swt
+Require-Bundle: org.eclipse.core.runtime
Added: trunk/vpe/plugins/org.jboss.tools.xulrunner.initializer/build.properties
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.xulrunner.initializer/build.properties
(rev 0)
+++ trunk/vpe/plugins/org.jboss.tools.xulrunner.initializer/build.properties 2008-09-12
10:19:08 UTC (rev 10218)
@@ -0,0 +1,4 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .
Added:
trunk/vpe/plugins/org.jboss.tools.xulrunner.initializer/src/org/eclipse/swt/browser/XULRunnerInitializer.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.xulrunner.initializer/src/org/eclipse/swt/browser/XULRunnerInitializer.java
(rev 0)
+++
trunk/vpe/plugins/org.jboss.tools.xulrunner.initializer/src/org/eclipse/swt/browser/XULRunnerInitializer.java 2008-09-12
10:19:08 UTC (rev 10218)
@@ -0,0 +1,55 @@
+package org.eclipse.swt.browser;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.URL;
+
+import org.eclipse.core.runtime.FileLocator;
+import org.eclipse.core.runtime.Platform;
+import org.osgi.framework.Bundle;
+
+public class XULRunnerInitializer {
+
+ private static final String XULRUNNER_PATH =
"org.eclipse.swt.browser.XULRunnerPath";
+ private static final String XULRUNNER_ENTRY = "/xulrunner";
+
+ static {
+ String xulrunnerPath = System.getProperty(XULRUNNER_PATH);
+ if (xulrunnerPath != null) {
+ File xulrunnerFile = new File(xulrunnerPath);
+ if (!xulrunnerFile.exists()) {
+ xulrunnerPath = null;
+ }
+ }
+ if (xulrunnerPath == null) {
+ String XULRUNNER_BUNDLE = (new StringBuffer("org.mozilla.xulrunner"))
+ .append(".")
+ .append(Platform.getWS())
+ .append(".")
+ .append(Platform.getOS())
+ .append(Platform.OS_MACOSX.equals(Platform.getOS()) ? "" : (new
StringBuffer(".")).append(Platform.getOSArch()).toString())
+ .toString();
+ Bundle xulRunnerBundle = Platform.getBundle(XULRUNNER_BUNDLE);
+ if (xulRunnerBundle == null) {
+ System.out.println("Bundle " + XULRUNNER_BUNDLE + " is not
found.");
+ } else {
+ URL url = xulRunnerBundle.getEntry(XULRUNNER_ENTRY);
+ if (url == null) {
+ System.out.println("Bundle " + XULRUNNER_BUNDLE + " doesn't
contain " + XULRUNNER_ENTRY);
+ } else {
+ File xulrunnerFile;
+ try {
+ URL url1 = FileLocator.resolve(url);
+ xulrunnerFile = new File(FileLocator.toFileURL(url1)
+ .getFile());
+ xulrunnerPath = xulrunnerFile.getAbsolutePath();
+ System.setProperty(XULRUNNER_PATH, xulrunnerPath);
+ } catch (IOException ioe) {
+ System.out.println("Cannot get path to XULRunner from bundle " +
XULRUNNER_BUNDLE);
+ ioe.printStackTrace();
+ }
+ }
+ }
+ }
+ }
+}
Show replies by date