Author: yradtsevich
Date: 2011-10-25 12:02:06 -0400 (Tue, 25 Oct 2011)
New Revision: 35985
Modified:
workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim/src/org/jboss/tools/browsersim/BrowserSim.java
Log:
https://issues.jboss.org/browse/JBIDE-9539 : Browsersim app for testing mobile/desktop web
apps
- a page which shows current user-agent header is set as the home page
Modified:
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 2011-10-25
16:02:05 UTC (rev 35984)
+++
workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim/src/org/jboss/tools/browsersim/BrowserSim.java 2011-10-25
16:02:06 UTC (rev 35985)
@@ -10,6 +10,8 @@
******************************************************************************/
package org.jboss.tools.browsersim;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.List;
@@ -154,7 +156,7 @@
setDevice(DevicesManager.getInstance().getDevices().get(0));
}
shell.open();
- browser.setUrl("file:///C:/doc/prj/JavaScript/user-agent.html");
+
browser.setUrl("http://www.w3schools.com/js/tryit_view.asp?filename=...;
while (!shell.isDisposed()) {
if (!display.readAndDispatch())
@@ -205,11 +207,11 @@
}
});
- 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"));
+ 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);
@@ -233,6 +235,14 @@
}
private InputStream getResourceAsStream(String name) {
+ if (true) {
+ try {
+ return new FileInputStream(name);
+ } catch (FileNotFoundException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
return this.getClass().getResourceAsStream(name);
}