JBoss Tools SVN: r35854 - in workspace/yradtsevich/browsersim: swt-webkit-browsersim and 37 other directories.
by jbosstools-commits@lists.jboss.org
Author: yradtsevich
Date: 2011-10-20 13:25:03 -0400 (Thu, 20 Oct 2011)
New Revision: 35854
Added:
workspace/yradtsevich/browsersim/swt-webkit-browsersim/
workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.webkit.gtk.linux.x86/
workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.webkit.gtk.linux.x86/.classpath
workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.webkit.gtk.linux.x86/.project
workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.webkit.gtk.linux.x86/.settings/
workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.webkit.gtk.linux.x86/.settings/org.eclipse.jdt.core.prefs
workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.webkit.gtk.linux.x86/.settings/org.eclipse.pde.core.prefs
workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.webkit.gtk.linux.x86/META-INF/
workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.webkit.gtk.linux.x86/META-INF/MANIFEST.MF
workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.webkit.gtk.linux.x86/build.properties
workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.webkit.gtk.linux.x86/src/
workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.webkit.gtk.linux.x86/src/org/
workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.webkit.gtk.linux.x86/src/org/jboss/
workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.webkit.gtk.linux.x86/src/org/jboss/tools/
workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.webkit.gtk.linux.x86/src/org/jboss/tools/browsersim/
workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.webkit.gtk.linux.x86/src/org/jboss/tools/browsersim/webkit/
workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.webkit.gtk.linux.x86/src/org/jboss/tools/browsersim/webkit/WebKitBrowser.java
workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.webkit.win32.win32.x86/
workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.webkit.win32.win32.x86/.classpath
workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.webkit.win32.win32.x86/.project
workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.webkit.win32.win32.x86/.settings/
workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.webkit.win32.win32.x86/.settings/org.eclipse.jdt.core.prefs
workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.webkit.win32.win32.x86/.settings/org.eclipse.pde.core.prefs
workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.webkit.win32.win32.x86/META-INF/
workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.webkit.win32.win32.x86/META-INF/MANIFEST.MF
workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.webkit.win32.win32.x86/build.properties
workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.webkit.win32.win32.x86/src/
workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.webkit.win32.win32.x86/src/org/
workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.webkit.win32.win32.x86/src/org/jboss/
workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.webkit.win32.win32.x86/src/org/jboss/tools/
workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.webkit.win32.win32.x86/src/org/jboss/tools/browsersim/
workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.webkit.win32.win32.x86/src/org/jboss/tools/browsersim/webkit/
workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.webkit.win32.win32.x86/src/org/jboss/tools/browsersim/webkit/WebKitBrowser.java
workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.webkit/
workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.webkit/.classpath
workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.webkit/.project
workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.webkit/.settings/
workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.webkit/.settings/org.eclipse.jdt.core.prefs
workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.webkit/.settings/org.eclipse.pde.core.prefs
workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.webkit/META-INF/
workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.webkit/META-INF/MANIFEST.MF
workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.webkit/build.properties
workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.webkit/src/
workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.webkit/src/org/
workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.webkit/src/org/jboss/
workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.webkit/src/org/jboss/tools/
workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.webkit/src/org/jboss/tools/browsersim/
workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.webkit/src/org/jboss/tools/browsersim/webkit/
workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.webkit/src/org/jboss/tools/browsersim/webkit/AbstractWebKitBrowser.java
workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim/
workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim/.classpath
workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim/.project
workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim/.settings/
workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim/.settings/org.eclipse.jdt.core.prefs
workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim/.settings/org.eclipse.pde.core.prefs
workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim/META-INF/
workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim/META-INF/MANIFEST.MF
workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim/build.properties
workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim/resources/
workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim/resources/icons/
workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim/resources/icons/nav_backward.gif
workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim/resources/icons/nav_forward.gif
workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim/resources/icons/nav_go.gif
workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim/resources/icons/nav_home.gif
workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim/resources/icons/nav_print.gif
workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim/resources/icons/nav_refresh.gif
workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim/resources/icons/nav_stop.gif
workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim/resources/icons/synced.gif
workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim/src/
workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim/src/org/
workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim/src/org/jboss/
workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim/src/org/jboss/tools/
workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim/src/org/jboss/tools/browsersim/
workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim/src/org/jboss/tools/browsersim/Activator.java
workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim/src/org/jboss/tools/browsersim/BrowserSim.java
workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim/src/org/jboss/tools/browsersim/Device.java
workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim/src/org/jboss/tools/browsersim/DevicesManager.java
workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim/src/org/jboss/tools/browsersim/IWebViewProxy.java
Log:
https://issues.jboss.org/browse/JBIDE-9539 : Browsersim app for testing mobile/desktop web apps
- initial commit: SWT and WebKit-based Browsersim application
Property changes on: workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim
___________________________________________________________________
Added: svn:ignore
+ bin
Added: workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim/.classpath
===================================================================
--- workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim/.classpath (rev 0)
+++ workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim/.classpath 2011-10-20 17:25:03 UTC (rev 35854)
@@ -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.6"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
Added: workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim/.project
===================================================================
--- workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim/.project (rev 0)
+++ workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim/.project 2011-10-20 17:25:03 UTC (rev 35854)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.jboss.tools.browsersim</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: workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim/.settings/org.eclipse.jdt.core.prefs (rev 0)
+++ workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim/.settings/org.eclipse.jdt.core.prefs 2011-10-20 17:25:03 UTC (rev 35854)
@@ -0,0 +1,8 @@
+#Fri Oct 14 17:25:22 EEST 2011
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.6
Added: workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim/.settings/org.eclipse.pde.core.prefs
===================================================================
--- workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim/.settings/org.eclipse.pde.core.prefs (rev 0)
+++ workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim/.settings/org.eclipse.pde.core.prefs 2011-10-20 17:25:03 UTC (rev 35854)
@@ -0,0 +1,4 @@
+#Fri Oct 14 17:25:23 EEST 2011
+eclipse.preferences.version=1
+pluginProject.extensions=false
+resolve.requirebundle=false
Added: workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim/META-INF/MANIFEST.MF
===================================================================
--- workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim/META-INF/MANIFEST.MF (rev 0)
+++ workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim/META-INF/MANIFEST.MF 2011-10-20 17:25:03 UTC (rev 35854)
@@ -0,0 +1,11 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: BrowserSim
+Bundle-SymbolicName: org.jboss.tools.browsersim
+Bundle-Version: 1.0.0.qualifier
+Bundle-Activator: org.jboss.tools.browsersim.Activator
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Import-Package: org.osgi.framework;version="1.3.0"
+Require-Bundle: org.eclipse.swt;bundle-version="3.7.0",
+ org.jboss.tools.browsersim.webkit;bundle-version="1.0.0"
Added: workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim/build.properties
===================================================================
--- workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim/build.properties (rev 0)
+++ workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim/build.properties 2011-10-20 17:25:03 UTC (rev 35854)
@@ -0,0 +1,4 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .
Added: workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim/resources/icons/nav_backward.gif
===================================================================
(Binary files differ)
Property changes on: workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim/resources/icons/nav_backward.gif
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim/resources/icons/nav_forward.gif
===================================================================
(Binary files differ)
Property changes on: workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim/resources/icons/nav_forward.gif
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim/resources/icons/nav_go.gif
===================================================================
(Binary files differ)
Property changes on: workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim/resources/icons/nav_go.gif
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim/resources/icons/nav_home.gif
===================================================================
(Binary files differ)
Property changes on: workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim/resources/icons/nav_home.gif
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim/resources/icons/nav_print.gif
===================================================================
(Binary files differ)
Property changes on: workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim/resources/icons/nav_print.gif
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim/resources/icons/nav_refresh.gif
===================================================================
(Binary files differ)
Property changes on: workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim/resources/icons/nav_refresh.gif
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim/resources/icons/nav_stop.gif
===================================================================
(Binary files differ)
Property changes on: workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim/resources/icons/nav_stop.gif
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim/resources/icons/synced.gif
===================================================================
(Binary files differ)
Property changes on: workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim/resources/icons/synced.gif
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim/src/org/jboss/tools/browsersim/Activator.java
===================================================================
--- workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim/src/org/jboss/tools/browsersim/Activator.java (rev 0)
+++ workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim/src/org/jboss/tools/browsersim/Activator.java 2011-10-20 17:25:03 UTC (rev 35854)
@@ -0,0 +1,36 @@
+/*******************************************************************************
+ * 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;
+
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+
+/**
+ * @author Yahor Radtsevich (yradtsevich)
+ */
+public class Activator implements BundleActivator {
+
+ /*
+ * (non-Javadoc)
+ * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ new BrowserSim().run();
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext context) throws Exception {
+ }
+
+}
Added: workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim/src/org/jboss/tools/browsersim/BrowserSim.java
===================================================================
--- workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim/src/org/jboss/tools/browsersim/BrowserSim.java (rev 0)
+++ workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim/src/org/jboss/tools/browsersim/BrowserSim.java 2011-10-20 17:25:03 UTC (rev 35854)
@@ -0,0 +1,314 @@
+/*******************************************************************************
+ * 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;
+
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.SWTError;
+import org.eclipse.swt.browser.LocationEvent;
+import org.eclipse.swt.browser.LocationListener;
+import org.eclipse.swt.browser.ProgressEvent;
+import org.eclipse.swt.browser.ProgressListener;
+import org.eclipse.swt.browser.StatusTextEvent;
+import org.eclipse.swt.browser.StatusTextListener;
+import org.eclipse.swt.events.DisposeEvent;
+import org.eclipse.swt.events.DisposeListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.MenuItem;
+import org.eclipse.swt.widgets.ProgressBar;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.swt.widgets.ToolBar;
+import org.eclipse.swt.widgets.ToolItem;
+import org.jboss.tools.browsersim.webkit.WebKitBrowser;
+
+/**
+ * @author Yahor Radtsevich (yradtsevich)
+ */
+public class BrowserSim implements Runnable {
+ private WebKitBrowser browser;
+ private Display display;
+ private Shell shell;
+ private Text locationText;
+ private Label statusLabel;
+ private ProgressBar progressBar;
+ private List<MenuItem> deviceMenuItems = new ArrayList<MenuItem>();
+
+ public static void main(String[] args) {
+ new BrowserSim().run();
+ }
+
+ @Override
+ public void run() {
+ display = new Display();
+ shell = new Shell(display);
+ GridLayout gridLayout = new GridLayout();
+ gridLayout.numColumns = 3;
+ shell.setLayout(gridLayout);
+ Menu appMenuBar = display.getMenuBar();
+ if (appMenuBar == null) {
+ appMenuBar = new Menu(shell, SWT.BAR);
+ shell.setMenuBar(appMenuBar);
+ }
+
+ ToolBar toolbar = createControlBar();
+ GridData data = new GridData();
+ data.horizontalSpan = 3;
+ toolbar.setLayoutData(data);
+
+ Label labelAddress = new Label(shell, SWT.NONE);
+ labelAddress.setText("Address");
+
+ locationText = new Text(shell, SWT.BORDER);
+ data = new GridData();
+ data.horizontalAlignment = GridData.FILL;
+ data.horizontalSpan = 2;
+ data.grabExcessHorizontalSpace = true;
+ data.widthHint = 0;
+ locationText.setLayoutData(data);
+
+ try {
+ browser = new WebKitBrowser(shell, SWT.NONE);
+ } catch (SWTError e) {
+ System.out.println("Could not instantiate Browser: " + e.getMessage());
+ display.dispose();
+ return;
+ }
+
+ data = new GridData();
+ data.horizontalAlignment = GridData.FILL;
+ data.verticalAlignment = GridData.FILL;
+ data.horizontalSpan = 3;
+ data.grabExcessHorizontalSpace = true;
+ data.grabExcessVerticalSpace = true;
+ browser.setLayoutData(data);
+
+ statusLabel = new Label(shell, SWT.NONE);
+ data = new GridData(GridData.FILL_HORIZONTAL);
+ data.horizontalSpan = 2;
+ data.widthHint = 0;
+ statusLabel.setLayoutData(data);
+
+ progressBar = new ProgressBar(shell, SWT.NONE);
+ data = new GridData();
+ data.horizontalAlignment = GridData.END;
+ progressBar.setLayoutData(data);
+
+ browser.addProgressListener(new ProgressListener() {
+ public void changed(ProgressEvent event) {
+ if (event.total == 0) return;
+ int ratio = event.current * 100 / event.total;
+ progressBar.setSelection(ratio);
+ }
+ public void completed(ProgressEvent event) {
+ progressBar.setSelection(0);
+ }
+ });
+ browser.addStatusTextListener(new StatusTextListener() {
+ public void changed(StatusTextEvent event) {
+ statusLabel.setText(event.text);
+ }
+ });
+ browser.addLocationListener(new LocationListener() {
+ public void changed(LocationEvent event) {
+ if (event.top) locationText.setText(event.location);
+ }
+ public void changing(LocationEvent event) {
+ }
+ });
+
+ fillMenuBar(appMenuBar);
+
+ locationText.addListener(SWT.DefaultSelection, new Listener() {
+ public void handleEvent(Event e) {
+ browser.setUrl(locationText.getText());
+ }
+ });
+
+ if (!DevicesManager.getInstance().getDevices().isEmpty()) {
+ setDevice(DevicesManager.getInstance().getDevices().get(0));
+ }
+ shell.open();
+ browser.setUrl("file:///C:/doc/prj/JavaScript/user-agent.html");
+
+ while (!shell.isDisposed()) {
+ if (!display.readAndDispatch())
+ display.sleep();
+ }
+ display.dispose();
+ }
+
+ public ToolBar createControlBar() {
+ ToolBar toolbar = new ToolBar(shell, SWT.NONE);
+ ToolItem itemBack = new ToolItem(toolbar, SWT.PUSH);
+// itemBack.setText("Back");
+ itemBack.addListener(SWT.Selection, new Listener() {
+ public void handleEvent(Event event) {
+ browser.back();
+ }
+ });
+
+ ToolItem itemForward = new ToolItem(toolbar, SWT.PUSH);
+// itemForward.setText("Forward");
+ itemForward.addListener(SWT.Selection, new Listener() {
+ public void handleEvent(Event event) {
+ browser.forward();
+ }
+ });
+
+ ToolItem itemStop = new ToolItem(toolbar, SWT.PUSH);
+// itemStop.setText("Stop");
+ itemStop.addListener(SWT.Selection, new Listener() {
+ public void handleEvent(Event event) {
+ browser.stop();
+ }
+ });
+
+ ToolItem itemRefresh = new ToolItem(toolbar, SWT.PUSH);
+// itemRefresh.setText("Refresh");
+ itemRefresh.addListener(SWT.Selection, new Listener() {
+ public void handleEvent(Event event) {
+ browser.refresh();
+ }
+ });
+
+ ToolItem itemGo = new ToolItem(toolbar, SWT.PUSH);
+// itemGo.setText("Go");
+ itemGo.addListener(SWT.Selection, new Listener() {
+ public void handleEvent(Event event) {
+ browser.setUrl(locationText.getText());
+ }
+ });
+
+ final Image imageBack = new Image(display, getResourceAsStream("/resources/icons/nav_backward.gif"));
+ final Image imageForward = new Image(display, getResourceAsStream("/resources/icons/nav_forward.gif"));
+ final Image imageStop = new Image(display, getResourceAsStream("/resources/icons/nav_stop.gif"));
+ final Image imageRefresh = new Image(display, getResourceAsStream("/resources/icons/nav_refresh.gif"));
+ final Image imageGo = new Image(display, getResourceAsStream("/resources/icons/nav_go.gif"));
+
+ itemBack.setImage(imageBack);
+ itemForward.setImage(imageForward);
+ itemStop.setImage(imageStop);
+ itemRefresh.setImage(imageRefresh);
+ itemGo.setImage(imageGo);
+ shell.addDisposeListener(new DisposeListener() {
+ public void widgetDisposed(DisposeEvent e) {
+ imageBack.dispose();
+ imageForward.dispose();
+ imageStop.dispose();
+ imageRefresh.dispose();
+ imageGo.dispose();
+ }
+ });
+
+ itemForward.setImage(imageForward);
+
+
+ return toolbar;
+ }
+
+ private InputStream getResourceAsStream(String name) {
+ return this.getClass().getResourceAsStream(name);
+ }
+
+ public void fillMenuBar(Menu appMenuBar) {
+ Menu file = createDropDownMenu(appMenuBar, "File");
+ MenuItem exit = new MenuItem(file, SWT.PUSH);
+ exit.setText("Exit");
+ exit.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ display.dispose();
+ };
+ });
+
+ Menu devicesMenu = createDropDownMenu(appMenuBar, "Devices");
+ for (Device device : DevicesManager.getInstance().getDevices()) {
+ MenuItem deviceMenuItem = new MenuItem(devicesMenu, SWT.RADIO);
+ deviceMenuItem.setText(device.getName());
+ deviceMenuItem.setData(device);
+ deviceMenuItem.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ MenuItem menuItem = (MenuItem)e.widget;
+ if (menuItem.getSelection()) {
+ setDevice((Device) menuItem.getData());
+ }
+ };
+ });
+
+ deviceMenuItems.add(deviceMenuItem);
+ deviceMenuItem.addDisposeListener(new DisposeListener() {
+ public void widgetDisposed(DisposeEvent e) {
+ deviceMenuItems.remove(e.widget);
+ }
+ });
+ }
+ }
+
+ private Menu createDropDownMenu(Menu menuBar, String name) {
+ MenuItem manuItem = new MenuItem(menuBar, SWT.CASCADE);
+ manuItem.setText(name);
+ Menu dropdown = new Menu(menuBar);
+ manuItem.setMenu(dropdown);
+ return dropdown;
+ }
+
+ public void setDevice(final Device device) {
+ for (MenuItem deviceMenuItem : deviceMenuItems) {
+ deviceMenuItem.setSelection(deviceMenuItem.getData() == device);
+ }
+
+ browser.setDefaultUserAgent(device.getUserAgent());
+ GridData data = (GridData) browser.getLayoutData();
+ data.widthHint = device.getWidth();
+ data.heightHint = device.getHeight();
+ Point shellSize = shell.computeSize(SWT.DEFAULT, SWT.DEFAULT);
+ Rectangle clientArea = display.getClientArea();
+ shellSize.x = Math.min(shellSize.x, clientArea.width);
+ shellSize.y = Math.min(shellSize.y, clientArea.height);
+ shell.setSize(shellSize);
+
+ Rectangle shellBounds = shell.getBounds();
+ int bottomOverlap = shellBounds.y + shellBounds.height - (clientArea.y + clientArea.height);
+ if (bottomOverlap > 0) {
+ if (shellBounds.y > bottomOverlap) {
+ shellBounds.y -= bottomOverlap;
+ } else {
+ shellBounds.y = 0;
+ }
+ }
+
+ int rightOverlap = shellBounds.x + shellBounds.width - (clientArea.x + clientArea.width);
+ if (rightOverlap > 0) {
+ if (shellBounds.x > rightOverlap) {
+ shellBounds.x -= rightOverlap;
+ } else {
+ shellBounds.x = 0;
+ }
+ }
+
+ shell.setBounds(shellBounds);
+ browser.refresh();
+ }
+}
Added: workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim/src/org/jboss/tools/browsersim/Device.java
===================================================================
--- workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim/src/org/jboss/tools/browsersim/Device.java (rev 0)
+++ workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim/src/org/jboss/tools/browsersim/Device.java 2011-10-20 17:25:03 UTC (rev 35854)
@@ -0,0 +1,62 @@
+/*******************************************************************************
+ * 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;
+
+/**
+ * @author Yahor Radtsevich (yradtsevich)
+ */
+public class Device {
+ public static final int DEFAULT_SIZE = -1;
+
+ private String name;
+ private int width;
+ private int height;
+ private String userAgent;
+
+ public Device(String name, int width, int height, String userAgent) {
+ this.name = name;
+ this.width = width;
+ this.height = height;
+ this.userAgent = userAgent;
+ }
+
+ public int getWidth() {
+ return width;
+ }
+
+ public void setWidth(int width) {
+ this.width = width;
+ }
+
+ public int getHeight() {
+ return height;
+ }
+
+ public void setHeight(int height) {
+ this.height = height;
+ }
+
+ public String getUserAgent() {
+ return userAgent;
+ }
+
+ public void setUserAgent(String userAgent) {
+ this.userAgent = userAgent;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+}
Added: workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim/src/org/jboss/tools/browsersim/DevicesManager.java
===================================================================
--- workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim/src/org/jboss/tools/browsersim/DevicesManager.java (rev 0)
+++ workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim/src/org/jboss/tools/browsersim/DevicesManager.java 2011-10-20 17:25:03 UTC (rev 35854)
@@ -0,0 +1,43 @@
+/*******************************************************************************
+ * 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;
+
+import java.util.ArrayList;
+import java.util.List;
+
+
+/**
+ * @author Yahor Radtsevich (yradtsevich)
+ */
+public class DevicesManager {
+ private static DevicesManager instance;
+ private List<Device> devices;
+ public static final String IPHONE_OS_4_0_USER_AGENT = "Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_0 like Mac OS X; en-us) AppleWebKit/532.9 (KHTML, like Gecko) Version/4.0.5 Mobile/8A293 Safari/6531.22.7";
+
+ protected DevicesManager() {
+ devices = new ArrayList<Device>();
+ devices.add(new Device("iPhone 3", 320, 480, IPHONE_OS_4_0_USER_AGENT));
+ devices.add(new Device("iPhone 4", 640, 960, IPHONE_OS_4_0_USER_AGENT));
+ devices.add(new Device("BlackBerry Bold Touch 9900", 640, 480, "Mozilla/5.0 (BlackBerry; U; BlackBerry 9900; en-US) AppleWebKit/534.1+ (KHTML, like Gecko) Version/6.0.0.246 Mobile Safari/534.1+"));
+ devices.add(new Device("Samsung GT-I9100 (Galaxy S II)", 640, 800, "Mozilla/5.0 (Linux; U; Android 2.3; en-us; GT-I9100 Build/GRH78) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1"));
+ }
+
+ public static DevicesManager getInstance() {
+ if (instance == null) {
+ instance = new DevicesManager();
+ }
+ return instance;
+ }
+
+ public List<Device> getDevices() {
+ return devices;
+ }
+}
Added: workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim/src/org/jboss/tools/browsersim/IWebViewProxy.java
===================================================================
--- workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim/src/org/jboss/tools/browsersim/IWebViewProxy.java (rev 0)
+++ workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim/src/org/jboss/tools/browsersim/IWebViewProxy.java 2011-10-20 17:25:03 UTC (rev 35854)
@@ -0,0 +1,134 @@
+/*******************************************************************************
+ * 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;
+//import org.eclipse.swt.internal.ole.win32.COM;
+//import org.eclipse.swt.internal.ole.win32.GUID;
+//import org.eclipse.swt.internal.webkit.IWebView;
+//import org.eclipse.swt.internal.win32.RECT;
+//
+///**
+// * @author Yahor Radtsevich (yradtsevich)
+// */
+//public class IWebViewProxy extends IWebView {
+// private IWebView webView;
+// private int defaultUserAgent;
+//
+// public void setDefaultUserAgent(String defaultUserAgentString) {
+// if (defaultUserAgentString == null) {
+// this.defaultUserAgent = 0;
+// } else {
+// char[] data = (defaultUserAgentString + '\0').toCharArray ();
+// this.defaultUserAgent = COM.SysAllocString(data);
+// }
+// setCustomUserAgent(this.defaultUserAgent);
+// }
+//
+// public int setCustomUserAgent(int valueString) {
+// if (valueString == 0) {
+// return webView.setCustomUserAgent(defaultUserAgent);
+// } else {
+// return webView.setCustomUserAgent(valueString);
+// }
+// }
+//
+// public IWebViewProxy(IWebView webView) {
+// super(webView.getAddress());
+// this.webView = webView;
+// }
+//
+// public int AddRef() {
+// return webView.AddRef();
+// }
+//
+// public int getAddress() {
+// return webView.getAddress();
+// }
+//
+// public int canShowMIMEType(int mimeType, int[] canShow) {
+// return webView.canShowMIMEType(mimeType, canShow);
+// }
+//
+// public int QueryInterface(GUID riid, int[] ppvObject) {
+// return webView.QueryInterface(riid, ppvObject);
+// }
+//
+// public int initWithFrame(RECT frame, int frameName, int groupName) {
+// return webView.initWithFrame(frame, frameName, groupName);
+// }
+//
+// public int Release() {
+// return webView.Release();
+// }
+//
+// public int setUIDelegate(int delegate) {
+// return webView.setUIDelegate(delegate);
+// }
+//
+// public int setResourceLoadDelegate(int delegate) {
+// return webView.setResourceLoadDelegate(delegate);
+// }
+//
+// public int setDownloadDelegate(int delegate) {
+// return webView.setDownloadDelegate(delegate);
+// }
+//
+// public int setFrameLoadDelegate(int delegate) {
+// return webView.setFrameLoadDelegate(delegate);
+// }
+//
+// public int setPolicyDelegate(int delegate) {
+// return webView.setPolicyDelegate(delegate);
+// }
+//
+// public int hashCode() {
+// return webView.hashCode();
+// }
+//
+// public int mainFrame(int[] frame) {
+// return webView.mainFrame(frame);
+// }
+//
+// public int goBack(int[] succeeded) {
+// return webView.goBack(succeeded);
+// }
+//
+// public int goForward(int[] succeeded) {
+// return webView.goForward(succeeded);
+// }
+//
+// public int setPreferences(int prefs) {
+// return webView.setPreferences(prefs);
+// }
+//
+// public int preferences(int[] prefs) {
+// return webView.preferences(prefs);
+// }
+//
+// public int setHostWindow(int window) {
+// return webView.setHostWindow(window);
+// }
+//
+// public int hostWindow(int[] window) {
+// return webView.hostWindow(window);
+// }
+//
+// public int estimatedProgress(int estimatedProgress) {
+// return webView.estimatedProgress(estimatedProgress);
+// }
+//
+// public boolean equals(Object obj) {
+// return webView.equals(obj);
+// }
+//
+// public String toString() {
+// return webView.toString();
+// }
+//}
Property changes on: workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.webkit
___________________________________________________________________
Added: svn:ignore
+ bin
Added: workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.webkit/.classpath
===================================================================
--- workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.webkit/.classpath (rev 0)
+++ workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.webkit/.classpath 2011-10-20 17:25:03 UTC (rev 35854)
@@ -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.6"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
Added: workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.webkit/.project
===================================================================
--- workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.webkit/.project (rev 0)
+++ workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.webkit/.project 2011-10-20 17:25:03 UTC (rev 35854)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.jboss.tools.browsersim.webkit</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: workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.webkit/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.webkit/.settings/org.eclipse.jdt.core.prefs (rev 0)
+++ workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.webkit/.settings/org.eclipse.jdt.core.prefs 2011-10-20 17:25:03 UTC (rev 35854)
@@ -0,0 +1,8 @@
+#Wed Oct 19 14:50:32 EEST 2011
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.6
Added: workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.webkit/.settings/org.eclipse.pde.core.prefs
===================================================================
--- workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.webkit/.settings/org.eclipse.pde.core.prefs (rev 0)
+++ workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.webkit/.settings/org.eclipse.pde.core.prefs 2011-10-20 17:25:03 UTC (rev 35854)
@@ -0,0 +1,4 @@
+#Wed Oct 19 14:50:32 EEST 2011
+eclipse.preferences.version=1
+pluginProject.extensions=false
+resolve.requirebundle=false
Added: workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.webkit/META-INF/MANIFEST.MF
===================================================================
--- workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.webkit/META-INF/MANIFEST.MF (rev 0)
+++ workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.webkit/META-INF/MANIFEST.MF 2011-10-20 17:25:03 UTC (rev 35854)
@@ -0,0 +1,9 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: WebKit
+Bundle-SymbolicName: org.jboss.tools.browsersim.webkit
+Bundle-Version: 1.0.0.qualifier
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Eclipse-ExtensibleAPI: true
+Export-Package: org.jboss.tools.browsersim.webkit
+Require-Bundle: org.eclipse.swt;bundle-version="3.7.0"
Added: workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.webkit/build.properties
===================================================================
--- workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.webkit/build.properties (rev 0)
+++ workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.webkit/build.properties 2011-10-20 17:25:03 UTC (rev 35854)
@@ -0,0 +1,4 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .
Added: workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.webkit/src/org/jboss/tools/browsersim/webkit/AbstractWebKitBrowser.java
===================================================================
--- workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.webkit/src/org/jboss/tools/browsersim/webkit/AbstractWebKitBrowser.java (rev 0)
+++ workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.webkit/src/org/jboss/tools/browsersim/webkit/AbstractWebKitBrowser.java 2011-10-20 17:25:03 UTC (rev 35854)
@@ -0,0 +1,46 @@
+/*******************************************************************************
+ * 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.webkit;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.browser.Browser;
+import org.eclipse.swt.widgets.Composite;
+
+/**
+ * @author Yahor Radtsevich (yradtsevich)
+ */
+public abstract class AbstractWebKitBrowser extends Browser {
+
+ private String defaultUserAgent;
+
+ public AbstractWebKitBrowser(Composite parent, int style) {
+ super(parent, style | SWT.WEBKIT);
+ }
+
+ @Override
+ protected void checkSubclass() {
+ }
+
+ @Override
+ public boolean setUrl(String url, String postData, String[] headers) {
+ setCustomUserAgent(defaultUserAgent);
+ boolean result = super.setUrl(url, postData, headers);
+ setCustomUserAgent(defaultUserAgent);
+ return result;
+ }
+
+ public void setDefaultUserAgent(String defaultUserAgent) {
+ this.defaultUserAgent = defaultUserAgent;
+ setCustomUserAgent(defaultUserAgent);
+ }
+
+ protected abstract void setCustomUserAgent(String userAgent);
+}
Property changes on: workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.webkit.gtk.linux.x86
___________________________________________________________________
Added: svn:ignore
+ bin
Added: workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.webkit.gtk.linux.x86/.classpath
===================================================================
--- workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.webkit.gtk.linux.x86/.classpath (rev 0)
+++ workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.webkit.gtk.linux.x86/.classpath 2011-10-20 17:25:03 UTC (rev 35854)
@@ -0,0 +1,8 @@
+<?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.6"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry combineaccessrules="false" kind="src" path="/org.eclipse.swt"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
Added: workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.webkit.gtk.linux.x86/.project
===================================================================
--- workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.webkit.gtk.linux.x86/.project (rev 0)
+++ workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.webkit.gtk.linux.x86/.project 2011-10-20 17:25:03 UTC (rev 35854)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.jboss.tools.browsersim.webkit.gtk.linux.x86</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: workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.webkit.gtk.linux.x86/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.webkit.gtk.linux.x86/.settings/org.eclipse.jdt.core.prefs (rev 0)
+++ workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.webkit.gtk.linux.x86/.settings/org.eclipse.jdt.core.prefs 2011-10-20 17:25:03 UTC (rev 35854)
@@ -0,0 +1,8 @@
+#Thu Oct 20 00:05:13 EEST 2011
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.6
Added: workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.webkit.gtk.linux.x86/.settings/org.eclipse.pde.core.prefs
===================================================================
--- workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.webkit.gtk.linux.x86/.settings/org.eclipse.pde.core.prefs (rev 0)
+++ workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.webkit.gtk.linux.x86/.settings/org.eclipse.pde.core.prefs 2011-10-20 17:25:03 UTC (rev 35854)
@@ -0,0 +1,4 @@
+#Thu Oct 20 00:05:13 EEST 2011
+eclipse.preferences.version=1
+pluginProject.extensions=false
+resolve.requirebundle=false
Added: workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.webkit.gtk.linux.x86/META-INF/MANIFEST.MF
===================================================================
--- workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.webkit.gtk.linux.x86/META-INF/MANIFEST.MF (rev 0)
+++ workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.webkit.gtk.linux.x86/META-INF/MANIFEST.MF 2011-10-20 17:25:03 UTC (rev 35854)
@@ -0,0 +1,8 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: WebKit
+Bundle-SymbolicName: org.jboss.tools.browsersim.webkit.gtk.linux.x86
+Bundle-Version: 1.0.0.qualifier
+Fragment-Host: org.jboss.tools.browsersim.webkit;bundle-version="1.0.0"
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Eclipse-PlatformFilter: (& (osgi.ws=gtk)(osgi.os=linux)(osgi.arch=x86))
Added: workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.webkit.gtk.linux.x86/build.properties
===================================================================
--- workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.webkit.gtk.linux.x86/build.properties (rev 0)
+++ workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.webkit.gtk.linux.x86/build.properties 2011-10-20 17:25:03 UTC (rev 35854)
@@ -0,0 +1,4 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .
Added: workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.webkit.gtk.linux.x86/src/org/jboss/tools/browsersim/webkit/WebKitBrowser.java
===================================================================
--- workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.webkit.gtk.linux.x86/src/org/jboss/tools/browsersim/webkit/WebKitBrowser.java (rev 0)
+++ workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.webkit.gtk.linux.x86/src/org/jboss/tools/browsersim/webkit/WebKitBrowser.java 2011-10-20 17:25:03 UTC (rev 35854)
@@ -0,0 +1,55 @@
+/*******************************************************************************
+ * 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.webkit;
+
+import java.lang.reflect.Field;
+
+import org.eclipse.swt.browser.Browser;
+import org.eclipse.swt.internal.Converter;
+import org.eclipse.swt.internal.gtk.OS;
+import org.eclipse.swt.internal.webkit.WebKitGTK;
+import org.eclipse.swt.widgets.Composite;
+
+/**
+ * @author Yahor Radtsevich (yradtsevich)
+ */
+public class WebKitBrowser extends AbstractWebKitBrowser {
+ public WebKitBrowser(Composite parent, int style) {
+ super(parent, style);
+ }
+
+ protected void setCustomUserAgent(String userAgent) {
+ try {
+ Field webBrowserField = Browser.class.getDeclaredField("webBrowser");
+ webBrowserField.setAccessible(true);
+ Object webKit = webBrowserField.get(this);
+
+ Field webViewField = webKit.getClass().getDeclaredField("webView");
+ webViewField.setAccessible(true);
+ int webView = (Integer) webViewField.get(webKit);
+ int settings = WebKitGTK.webkit_web_view_get_settings(webView);
+ if (userAgent != null) {
+ byte[] bytes = Converter.wcsToMbcs(null, userAgent, true);
+ OS.g_object_set(settings, WebKitGTK.user_agent, bytes, 0);
+ } else {
+ OS.g_object_set(settings, WebKitGTK.user_agent, 0, 0);
+ }
+ } catch (SecurityException e) {
+ e.printStackTrace();
+ } catch (NoSuchFieldException e) {
+ e.printStackTrace();
+ } catch (IllegalArgumentException e) {
+ e.printStackTrace();
+ } catch (IllegalAccessException e) {
+ e.printStackTrace();
+ }
+ }
+}
Property changes on: workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.webkit.win32.win32.x86
___________________________________________________________________
Added: svn:ignore
+ bin
Added: workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.webkit.win32.win32.x86/.classpath
===================================================================
--- workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.webkit.win32.win32.x86/.classpath (rev 0)
+++ workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.webkit.win32.win32.x86/.classpath 2011-10-20 17:25:03 UTC (rev 35854)
@@ -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.6"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
Added: workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.webkit.win32.win32.x86/.project
===================================================================
--- workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.webkit.win32.win32.x86/.project (rev 0)
+++ workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.webkit.win32.win32.x86/.project 2011-10-20 17:25:03 UTC (rev 35854)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.jboss.tools.browsersim.webkit.win32.win32.x86</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: workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.webkit.win32.win32.x86/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.webkit.win32.win32.x86/.settings/org.eclipse.jdt.core.prefs (rev 0)
+++ workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.webkit.win32.win32.x86/.settings/org.eclipse.jdt.core.prefs 2011-10-20 17:25:03 UTC (rev 35854)
@@ -0,0 +1,8 @@
+#Wed Oct 19 14:51:26 EEST 2011
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.6
Added: workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.webkit.win32.win32.x86/.settings/org.eclipse.pde.core.prefs
===================================================================
--- workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.webkit.win32.win32.x86/.settings/org.eclipse.pde.core.prefs (rev 0)
+++ workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.webkit.win32.win32.x86/.settings/org.eclipse.pde.core.prefs 2011-10-20 17:25:03 UTC (rev 35854)
@@ -0,0 +1,4 @@
+#Wed Oct 19 14:51:26 EEST 2011
+eclipse.preferences.version=1
+pluginProject.extensions=false
+resolve.requirebundle=false
Added: workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.webkit.win32.win32.x86/META-INF/MANIFEST.MF
===================================================================
--- workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.webkit.win32.win32.x86/META-INF/MANIFEST.MF (rev 0)
+++ workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.webkit.win32.win32.x86/META-INF/MANIFEST.MF 2011-10-20 17:25:03 UTC (rev 35854)
@@ -0,0 +1,9 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: WebKit
+Bundle-SymbolicName: org.jboss.tools.browsersim.webkit.win32.win32.x86
+Bundle-Version: 1.0.0.qualifier
+Fragment-Host: org.jboss.tools.browsersim.webkit;bundle-version="1.0.0"
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Require-Bundle: org.eclipse.swt;bundle-version="3.7.0"
+Eclipse-PlatformFilter: (& (osgi.ws=win32)(osgi.os=win32)(osgi.arch=x86))
Added: workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.webkit.win32.win32.x86/build.properties
===================================================================
--- workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.webkit.win32.win32.x86/build.properties (rev 0)
+++ workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.webkit.win32.win32.x86/build.properties 2011-10-20 17:25:03 UTC (rev 35854)
@@ -0,0 +1,4 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .
Added: workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.webkit.win32.win32.x86/src/org/jboss/tools/browsersim/webkit/WebKitBrowser.java
===================================================================
--- workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.webkit.win32.win32.x86/src/org/jboss/tools/browsersim/webkit/WebKitBrowser.java (rev 0)
+++ workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.webkit.win32.win32.x86/src/org/jboss/tools/browsersim/webkit/WebKitBrowser.java 2011-10-20 17:25:03 UTC (rev 35854)
@@ -0,0 +1,67 @@
+/*******************************************************************************
+ * 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.webkit;
+
+import java.lang.reflect.Field;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+
+import org.eclipse.swt.browser.Browser;
+import org.eclipse.swt.internal.ole.win32.COM;
+import org.eclipse.swt.widgets.Composite;
+
+/**
+ * @author Yahor Radtsevich (yradtsevich)
+ */
+public class WebKitBrowser extends AbstractWebKitBrowser {
+ public WebKitBrowser(Composite parent, int style) {
+ super(parent, style);
+ }
+
+ protected void setCustomUserAgent(String userAgent) {
+ int userAgentValue;
+ if (userAgent != null) {
+ char[] data = (userAgent + '\0').toCharArray ();
+ userAgentValue = COM.SysAllocString(data);
+ } else {
+ userAgentValue = 0;
+ }
+
+ try {
+ Field webBrowserField = Browser.class.getDeclaredField("webBrowser");
+ webBrowserField.setAccessible(true);
+ Object webKit = webBrowserField.get(this);
+
+ Field webViewField = webKit.getClass().getDeclaredField("webView");
+ webViewField.setAccessible(true);
+ Object webView = webViewField.get(webKit);
+
+ Method setCustomUserAgentMethod = webView.getClass().getDeclaredMethod("setCustomUserAgent", int.class);
+ setCustomUserAgentMethod.invoke(webView, userAgentValue);
+ } catch (IllegalArgumentException e) {
+ e.printStackTrace();
+ } catch (IllegalAccessException e) {
+ e.printStackTrace();
+ } catch (SecurityException e) {
+ e.printStackTrace();
+ } catch (NoSuchFieldException e) {
+ e.printStackTrace();
+ } catch (NoSuchMethodException e) {
+ e.printStackTrace();
+ } catch (InvocationTargetException e) {
+ e.printStackTrace();
+ }
+
+ if (userAgent != null) {
+ COM.SysFreeString(userAgentValue);
+ }
+ }
+}
14 years, 5 months
JBoss Tools SVN: r35853 - trunk/central/plugins/org.jboss.tools.central.discovery.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2011-10-20 13:01:37 -0400 (Thu, 20 Oct 2011)
New Revision: 35853
Added:
trunk/central/plugins/org.jboss.tools.central.discovery/src/
Modified:
trunk/central/plugins/org.jboss.tools.central.discovery/.classpath
Log:
source folder added to fix build errors related to source plugins generation
Modified: trunk/central/plugins/org.jboss.tools.central.discovery/.classpath
===================================================================
--- trunk/central/plugins/org.jboss.tools.central.discovery/.classpath 2011-10-20 16:58:28 UTC (rev 35852)
+++ trunk/central/plugins/org.jboss.tools.central.discovery/.classpath 2011-10-20 17:01:37 UTC (rev 35853)
@@ -1,6 +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.6"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
14 years, 5 months
JBoss Tools SVN: r35852 - trunk/forge/plugins/org.jboss.tools.forge.runtime.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2011-10-20 12:58:28 -0400 (Thu, 20 Oct 2011)
New Revision: 35852
Added:
trunk/forge/plugins/org.jboss.tools.forge.runtime/src/
Modified:
trunk/forge/plugins/org.jboss.tools.forge.runtime/.classpath
Log:
added src folder to fix source gathering related errors
Modified: trunk/forge/plugins/org.jboss.tools.forge.runtime/.classpath
===================================================================
--- trunk/forge/plugins/org.jboss.tools.forge.runtime/.classpath 2011-10-20 16:55:39 UTC (rev 35851)
+++ trunk/forge/plugins/org.jboss.tools.forge.runtime/.classpath 2011-10-20 16:58:28 UTC (rev 35852)
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
+ <classpathentry kind="src" path="src"/>
<classpathentry exported="true" kind="lib" path="modules/org/jboss/forge/shell-api/main/forge-shell-api.jar"/>
<classpathentry exported="true" kind="lib" path="modules/javax/enterprise/cdi-api/main/cdi-api.jar"/>
<classpathentry exported="true" kind="lib" path="modules/javax/enterprise/cdi-api/main/javax.inject.jar"/>
14 years, 5 months
JBoss Tools SVN: r35851 - in trunk/documentation/whatsnew/esb: images and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: bfitzpat
Date: 2011-10-20 12:55:39 -0400 (Thu, 20 Oct 2011)
New Revision: 35851
Added:
trunk/documentation/whatsnew/esb/esb-news-1.5.1.M4.html
trunk/documentation/whatsnew/esb/images/esb-project-wizard-4.10.jpg
Log:
JBIDE-9961 - Added ESB N&N for 3.3 M4
Added: trunk/documentation/whatsnew/esb/esb-news-1.5.1.M4.html
===================================================================
--- trunk/documentation/whatsnew/esb/esb-news-1.5.1.M4.html (rev 0)
+++ trunk/documentation/whatsnew/esb/esb-news-1.5.1.M4.html 2011-10-20 16:55:39 UTC (rev 35851)
@@ -0,0 +1,61 @@
+ <p><a href="smooks/smooks-news-1.1.0.CR1.html">Smooks Tools</a></p> <?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Language" content="en-us" />
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+<link rel="stylesheet" href="../whatsnew.css"/>
+<title>ESB tools 1.5.1 M4 What's New</title>
+<script type="text/javascript">
+
+ var _gaq = _gaq || [];
+ _gaq.push(['_setAccount', 'UA-17645367-5']);
+ _gaq.push(['_trackPageview']);
+
+ (function() {
+ var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
+ ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
+ var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
+ })();
+
+</script></head>
+<body>
+<h1>ESB tools 1.5.1 M4 What's New</h1>
+
+<p align="right"><a href="../index.html">< Main Index</a> <a href="../modeshape/modeshape-news-3.2.0.Beta2.html">Modeshape Tools ></a></p>
+
+<table border="0" cellpadding="10" cellspacing="0" width="80%">
+
+ <tr>
+ <td colspan="2">
+ <hr/>
+ <h3>Runtimes</h3>
+ <hr/>
+ </td>
+ </tr>
+
+ <tr>
+ <td valign="top" align="right"><a name="itemname3" id="itemname3"></a><b>ESB 4.10 Support</b></td>
+ <td valign="top">
+ <p>With JBoss ESB 4.10 recently released to the public, we've added it as a supported type to the JBoss ESB project configuration. If installed in the selected runtime (i.e. JBoss AS, EAP, SOA-P), the highest supported version is set automatically.</p>
+ <img src="./images/esb-project-wizard-4.10.jpg" alt=""/>
+ <p><small>Related Jira: <a href="https://jira.jboss.org/browse/JBIDE-9770">JBIDE-9770</a></small></p>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ <hr/>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ <hr/>
+ </td>
+ </tr>
+</table>
+</body>
+
+</html>
+
+
Property changes on: trunk/documentation/whatsnew/esb/esb-news-1.5.1.M4.html
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/documentation/whatsnew/esb/images/esb-project-wizard-4.10.jpg
===================================================================
(Binary files differ)
Property changes on: trunk/documentation/whatsnew/esb/images/esb-project-wizard-4.10.jpg
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
14 years, 5 months
JBoss Tools SVN: r35850 - in trunk: jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/jsfHyperlinkTests/WebContent/JBIDE-9930 and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: vrubezhny
Date: 2011-10-20 11:44:11 -0400 (Thu, 20 Oct 2011)
New Revision: 35850
Added:
trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/jsfHyperlinkTests/WebContent/JBIDE-9930/
trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/jsfHyperlinkTests/WebContent/JBIDE-9930/elInTagBody.jsp
trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/src/org/jboss/tools/jsf/text/ext/test/JSPELHyperlinkTestForELInTagBodyTest.java
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/src/org/jboss/tools/jsf/text/ext/test/JsfTextExtAllTests.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/PageContextFactory.java
Log:
JBIDE-9930 OpenOns for ELs don't work in text nodes of JSP
Issue is fixed. JUnit test is created
Added: trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/jsfHyperlinkTests/WebContent/JBIDE-9930/elInTagBody.jsp
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/jsfHyperlinkTests/WebContent/JBIDE-9930/elInTagBody.jsp (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/jsfHyperlinkTests/WebContent/JBIDE-9930/elInTagBody.jsp 2011-10-20 15:44:11 UTC (rev 35850)
@@ -0,0 +1,13 @@
+<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
+<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
+
+<html>
+ <head>
+ <title></title>
+ </head>
+ <body>
+ <f:view>
+ #{bean1.property1}
+ </f:view>
+ </body>
+</html>
Property changes on: trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/projects/jsfHyperlinkTests/WebContent/JBIDE-9930/elInTagBody.jsp
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/src/org/jboss/tools/jsf/text/ext/test/JSPELHyperlinkTestForELInTagBodyTest.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/src/org/jboss/tools/jsf/text/ext/test/JSPELHyperlinkTestForELInTagBodyTest.java (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/src/org/jboss/tools/jsf/text/ext/test/JSPELHyperlinkTestForELInTagBodyTest.java 2011-10-20 15:44:11 UTC (rev 35850)
@@ -0,0 +1,106 @@
+/*******************************************************************************
+ * Copyright (c) 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
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jsf.text.ext.test;
+
+import junit.framework.TestCase;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.FindReplaceDocumentAdapter;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.Region;
+import org.eclipse.jface.text.hyperlink.IHyperlink;
+import org.eclipse.jface.text.source.ISourceViewer;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
+import org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditor;
+import org.jboss.tools.jst.text.ext.hyperlink.ELHyperlinkDetector;
+import org.jboss.tools.test.util.WorkbenchUtils;
+
+/**
+ * The JUnit test cases for JBIDE-5385 issue
+ *
+ * @author Victor Rubezhny
+ */
+public class JSPELHyperlinkTestForELInTagBodyTest extends TestCase {
+ private static final String PROJECT_NAME = "jsfHyperlinkTests";
+ private static final String PAGE_NAME = PROJECT_NAME+"/WebContent/JBIDE-9930/elInTagBody.jsp";
+ private static final String[] TEXT_TO_FIND = new String [] {"bean1", "bean1.property1"};
+ private static final String[] RESULT_EDITORS = new String [] {"Bean1.java", "Bean1.java"};
+
+ public IProject project = null;
+ public String naturesCheckProperty;
+ private ELHyperlinkDetector elHyperlinkDetector = new ELHyperlinkDetector();
+
+
+ protected void setUp() {
+ naturesCheckProperty = System.getProperty("org.jboss.tools.vpe.ENABLE_PROJECT_NATURES_CHECKER"); //$NON-NLS-1$ //$NON-NLS-2$
+ System.setProperty("org.jboss.tools.vpe.ENABLE_PROJECT_NATURES_CHECKER", "false"); //$NON-NLS-1$ //$NON-NLS-2$
+ project = ResourcesPlugin.getWorkspace().getRoot().getProject(
+ PROJECT_NAME);
+ PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().closeAllEditors(false);
+ }
+
+ protected void tearDown() {
+ PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().closeAllEditors(false);
+ System.setProperty("org.jboss.tools.vpe.ENABLE_PROJECT_NATURES_CHECKER", naturesCheckProperty == null ? "null" : naturesCheckProperty); //$NON-NLS-1$
+ }
+
+ public JSPELHyperlinkTestForELInTagBodyTest() {
+ super("JSP EL In Tag Body OpenOn test");
+ }
+
+
+ public void testJSPELHyperlinkTestForELInTagBody() throws PartInitException, BadLocationException {
+ try {
+ for (int i = 0; i < TEXT_TO_FIND.length; i++) {
+ doJSPELHyperlinkTestForELInTagBodyTest(TEXT_TO_FIND[i], RESULT_EDITORS[i]);
+ }
+ } finally {
+ WorkbenchUtils.closeAllEditors();
+ }
+ }
+
+ private void doJSPELHyperlinkTestForELInTagBodyTest(String template, String editorName) throws BadLocationException {
+ IEditorPart editor = WorkbenchUtils.openEditor(PAGE_NAME);
+ assertTrue(editor instanceof JSPMultiPageEditor);
+ JSPMultiPageEditor jspMultyPageEditor = (JSPMultiPageEditor) editor;
+ ISourceViewer viewer = jspMultyPageEditor.getSourceEditor().getTextViewer();
+ assertNotNull("Viewer couldn't be found for " + PAGE_NAME, viewer);
+ IDocument document = viewer.getDocument();
+ IRegion reg = new FindReplaceDocumentAdapter(document).find(0,
+ template, true, true, false, false);
+ assertNotNull("Text: "+ template +" not found",reg);
+
+ IHyperlink[] links = elHyperlinkDetector.detectHyperlinks(viewer, new Region(reg.getOffset() + reg.getLength() - 1, 0), true);
+
+ assertNotNull("Hyperlinks for EL:#{" + template + "} are not found",links);
+
+ assertTrue("Hyperlinks for EL: #{" + template + "} are not found",links.length!=0);
+
+ boolean found = false;
+ for(IHyperlink link : links){
+ assertNotNull(link.toString());
+
+ link.open();
+
+ IEditorPart resultEditor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
+ if(editorName.equals(resultEditor.getTitle())){
+ found = true;
+ return;
+ }
+ }
+ assertTrue("OpenOn have not opened "+editorName+" editor",found);
+ }
+}
\ No newline at end of file
Property changes on: trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/src/org/jboss/tools/jsf/text/ext/test/JSPELHyperlinkTestForELInTagBodyTest.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/src/org/jboss/tools/jsf/text/ext/test/JsfTextExtAllTests.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/src/org/jboss/tools/jsf/text/ext/test/JsfTextExtAllTests.java 2011-10-20 15:23:49 UTC (rev 35849)
+++ trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/src/org/jboss/tools/jsf/text/ext/test/JsfTextExtAllTests.java 2011-10-20 15:44:11 UTC (rev 35850)
@@ -40,6 +40,12 @@
"org.jboss.tools.jsf.text.ext.test",
new String[]{"projects/jsfHyperlinkTests"},
new String[]{"jsfHyperlinkTests"}));
+
+ suite.addTest(new ProjectImportTestSetup(new TestSuite(
+ JSPELHyperlinkTestForELInTagBodyTest.class),
+ "org.jboss.tools.jsf.text.ext.test",
+ new String[]{"projects/jsfHyperlinkTests"},
+ new String[]{"jsfHyperlinkTests"}));
return suite;
}
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/PageContextFactory.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/PageContextFactory.java 2011-10-20 15:23:49 UTC (rev 35849)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/PageContextFactory.java 2011-10-20 15:44:11 UTC (rev 35850)
@@ -435,11 +435,6 @@
}
private void fillContextForNode(IDocument document, IDOMNode node, ELContext context, List<String> parents) {
- if (context instanceof JspContextImpl && !(context instanceof FaceletPageContextImpl) && !(node instanceof IDOMElement)) {
- // There is no any useful info for JSP in text nodes
- return;
- }
-
if (context instanceof XmlContextImpl) {
XmlContextImpl xmlContext = (XmlContextImpl)context;
fillElReferencesForNode(document, node, xmlContext);
@@ -487,39 +482,51 @@
}
private static void fillElReferencesForNode(IDocument document, IDOMNode node, XmlContextImpl context) {
- if(Node.ELEMENT_NODE == node.getNodeType() || Node.TEXT_NODE == node.getNodeType()) {
- IStructuredDocumentRegion regionNode = node.getFirstStructuredDocumentRegion();
- if (regionNode == null)
- return;
- ITextRegionList regions = regionNode.getRegions();
- for(int i=0; i<regions.size(); i++) {
- ITextRegion region = regions.get(i);
- if(region.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE || region.getType() == DOMRegionContext.XML_CONTENT) {
- String text = regionNode.getFullText(region);
- if(text.indexOf('{')>-1 && (text.indexOf("#{") > -1 || text.indexOf("${") > -1)) { //$NON-NLS-1$
- int offset = regionNode.getStartOffset() + region.getStart();
- ELParser parser = ELParserUtil.getJbossFactory().createParser();
- ELModel model = parser.parse(text);
- List<ELInstance> is = model.getInstances();
- ELReference elReference = new ValidationELReference();
- elReference.setResource(context.getResource());
- elReference.setEl(is);
- elReference.setLength(text.length());
- elReference.setStartPosition(offset);
- try {
- if(Node.TEXT_NODE == node.getNodeType()) {
- if(is.size()==1) {
- elReference.setLineNumber(document.getLineOfOffset(elReference.getStartPossitionOfFirstEL()) + 1);
- }
- } else {
- elReference.setLineNumber(document.getLineOfOffset(offset) + 1);
+ if(Node.ELEMENT_NODE != node.getNodeType() && Node.TEXT_NODE != node.getNodeType())
+ return;
+
+ IStructuredDocumentRegion regionNode = node.getFirstStructuredDocumentRegion();
+ if (regionNode == null)
+ return;
+
+ IStructuredDocumentRegion lastRegionNode = node.getLastStructuredDocumentRegion();
+ for (; regionNode != null && regionNode != lastRegionNode; regionNode = regionNode.getNext()) {
+ fillElReferencesForRegionNode(document, node, regionNode, context);
+ }
+ if (lastRegionNode != null) {
+ fillElReferencesForRegionNode(document, node, lastRegionNode, context);
+ }
+ }
+
+ private static void fillElReferencesForRegionNode(IDocument document, IDOMNode node, IStructuredDocumentRegion regionNode, XmlContextImpl context) {
+ ITextRegionList regions = regionNode.getRegions();
+ for(int i=0; i<regions.size(); i++) {
+ ITextRegion region = regions.get(i);
+ if(region.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE || region.getType() == DOMRegionContext.XML_CONTENT) {
+ String text = regionNode.getFullText(region);
+ if(text.indexOf('{')>-1 && (text.indexOf("#{") > -1 || text.indexOf("${") > -1)) { //$NON-NLS-1$
+ int offset = regionNode.getStartOffset() + region.getStart();
+ ELParser parser = ELParserUtil.getJbossFactory().createParser();
+ ELModel model = parser.parse(text);
+ List<ELInstance> is = model.getInstances();
+ ELReference elReference = new ValidationELReference();
+ elReference.setResource(context.getResource());
+ elReference.setEl(is);
+ elReference.setLength(text.length());
+ elReference.setStartPosition(offset);
+ try {
+ if(Node.TEXT_NODE == node.getNodeType()) {
+ if(is.size()==1) {
+ elReference.setLineNumber(document.getLineOfOffset(elReference.getStartPossitionOfFirstEL()) + 1);
}
- } catch (BadLocationException e) {
- WebKbPlugin.getDefault().logError(e);
+ } else {
+ elReference.setLineNumber(document.getLineOfOffset(offset) + 1);
}
- elReference.setSyntaxErrors(model.getSyntaxErrors());
- context.addELReference(elReference);
+ } catch (BadLocationException e) {
+ WebKbPlugin.getDefault().logError(e);
}
+ elReference.setSyntaxErrors(model.getSyntaxErrors());
+ context.addELReference(elReference);
}
}
}
14 years, 5 months
JBoss Tools SVN: r35849 - branches/jbosstools-3.3.0.M4/build/aggregate/site.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2011-10-20 11:23:49 -0400 (Thu, 20 Oct 2011)
New Revision: 35849
Modified:
branches/jbosstools-3.3.0.M4/build/aggregate/site/site.xsl
Log:
file is now called jbosstools-directory.xml, so update the link in the index.html page
Modified: branches/jbosstools-3.3.0.M4/build/aggregate/site/site.xsl
===================================================================
--- branches/jbosstools-3.3.0.M4/build/aggregate/site/site.xsl 2011-10-20 15:20:04 UTC (rev 35848)
+++ branches/jbosstools-3.3.0.M4/build/aggregate/site/site.xsl 2011-10-20 15:23:49 UTC (rev 35849)
@@ -120,7 +120,7 @@
</td>
<td class="rowLine" colspan="1">
::
- <a href="directory.xml" style="font-size:x-small">directory.xml</a>
+ <a href="jbosstools-directory.xml" style="font-size:x-small">jbosstools-directory.xml</a>
</td>
</tr>
</table>
14 years, 5 months
JBoss Tools SVN: r35848 - trunk/build/aggregate/site.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2011-10-20 11:20:04 -0400 (Thu, 20 Oct 2011)
New Revision: 35848
Modified:
trunk/build/aggregate/site/site.xsl
Log:
JBIDE-9907 file listed in index.html should now be jbosstools-directory.xml
Modified: trunk/build/aggregate/site/site.xsl
===================================================================
--- trunk/build/aggregate/site/site.xsl 2011-10-20 15:10:32 UTC (rev 35847)
+++ trunk/build/aggregate/site/site.xsl 2011-10-20 15:20:04 UTC (rev 35848)
@@ -120,7 +120,7 @@
</td>
<td class="rowLine" colspan="1">
::
- <a href="directory.xml" style="font-size:x-small">directory.xml</a>
+ <a href="jbosstools-directory.xml" style="font-size:x-small">jbosstools-directory.xml</a>
</td>
</tr>
</table>
14 years, 5 months