Author: yradtsevich
Date: 2011-11-14 13:21:44 -0500 (Mon, 14 Nov 2011)
New Revision: 36328
Added:
workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.eclipse/src/org/jboss/tools/browsersim/eclipse/BrowserSimFactory.java
Modified:
workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.eclipse/META-INF/MANIFEST.MF
workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.eclipse/plugin.xml
Log:
https://issues.jboss.org/browse/JBIDE-9539 : Browsersim app for testing mobile/desktop web
apps
- added BrowserSim as exsternal Web Browser to Eclipse
Modified:
workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.eclipse/META-INF/MANIFEST.MF
===================================================================
---
workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.eclipse/META-INF/MANIFEST.MF 2011-11-14
18:18:51 UTC (rev 36327)
+++
workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.eclipse/META-INF/MANIFEST.MF 2011-11-14
18:21:44 UTC (rev 36328)
@@ -10,6 +10,7 @@
org.eclipse.core.resources,
org.eclipse.jface.text,
org.eclipse.ui.editors,
- org.eclipse.ui.ide
+ org.eclipse.ui.ide,
+ org.eclipse.ui.browser
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Modified:
workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.eclipse/plugin.xml
===================================================================
---
workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.eclipse/plugin.xml 2011-11-14
18:18:51 UTC (rev 36327)
+++
workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.eclipse/plugin.xml 2011-11-14
18:21:44 UTC (rev 36328)
@@ -54,4 +54,16 @@
name="BrowserSim">
</editor>
</extension>
+ <extension point="org.eclipse.ui.browser.browsers">
+ <browser
+ executable=""
+
factoryclass="org.jboss.tools.browsersim.eclipse.BrowserSimFactory"
+ id="org.jboss.tools.browsersim.eclipse"
+ name="BrowserSim"
+ os="Win32,linux,MacOSX">
+ <location>
+ .
+ </location>
+ </browser>
+ </extension>
</plugin>
Added:
workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.eclipse/src/org/jboss/tools/browsersim/eclipse/BrowserSimFactory.java
===================================================================
---
workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.eclipse/src/org/jboss/tools/browsersim/eclipse/BrowserSimFactory.java
(rev 0)
+++
workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.eclipse/src/org/jboss/tools/browsersim/eclipse/BrowserSimFactory.java 2011-11-14
18:21:44 UTC (rev 36328)
@@ -0,0 +1,45 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2011 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.browsersim.eclipse;
+
+import java.net.URL;
+
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.browser.BrowserFactory;
+import org.eclipse.ui.browser.IWebBrowser;
+import org.jboss.tools.browsersim.eclipse.util.BrowserSimLauncher;
+
+/**
+ * Contribution to the {@code org.eclipse.ui.editors} extension point
+ *
+ * @author "Yahor Radtsevich (yradtsevich)"
+ */
+public class BrowserSimFactory extends BrowserFactory {
+ @Override
+ public IWebBrowser createBrowser(final String id, String location,
+ String parameters) {
+ return new IWebBrowser() {
+ @Override
+ public void openURL(URL url) throws PartInitException {
+ BrowserSimLauncher.launchBrowserSim(url.toString());
+ }
+ @Override
+ public String getId() {
+ return id;
+ }
+ @Override
+ public boolean close() {
+ return false;
+ }
+ };
+ }
+
+}