Author: svasilyev
Date: 2007-07-31 11:12:53 -0400 (Tue, 31 Jul 2007)
New Revision: 2766
Added:
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe.xulrunner.browser/.classpath
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe.xulrunner.browser/.project
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe.xulrunner.browser/META-INF/
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe.xulrunner.browser/META-INF/MANIFEST.MF
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe.xulrunner.browser/build.properties
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe.xulrunner.browser/src/
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe.xulrunner.browser/src/org/
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe.xulrunner.browser/src/org/jboss/
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe.xulrunner.browser/src/org/jboss/tools/
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe.xulrunner.browser/src/org/jboss/tools/vpe/
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe.xulrunner.browser/src/org/jboss/tools/vpe/xulrunner/
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe.xulrunner.browser/src/org/jboss/tools/vpe/xulrunner/BrowserPlugin.java
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe.xulrunner.browser/src/org/jboss/tools/vpe/xulrunner/XulRunnerException.java
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe.xulrunner.browser/src/org/jboss/tools/vpe/xulrunner/browser/
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe.xulrunner.browser/src/org/jboss/tools/vpe/xulrunner/browser/AppFileLocProvider.java
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe.xulrunner.browser/src/org/jboss/tools/vpe/xulrunner/browser/WindowCreator.java
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe.xulrunner.browser/src/org/jboss/tools/vpe/xulrunner/browser/XulRunnerBrowser.java
Log:
Browser founded on XulRunner
Added:
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe.xulrunner.browser/.classpath
===================================================================
---
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe.xulrunner.browser/.classpath
(rev 0)
+++
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe.xulrunner.browser/.classpath 2007-07-31
15:12:53 UTC (rev 2766)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con"
path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="con"
path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
Added:
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe.xulrunner.browser/.project
===================================================================
---
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe.xulrunner.browser/.project
(rev 0)
+++
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe.xulrunner.browser/.project 2007-07-31
15:12:53 UTC (rev 2766)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.jboss.tools.vpe.xulrunner.browser</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:
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe.xulrunner.browser/META-INF/MANIFEST.MF
===================================================================
---
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe.xulrunner.browser/META-INF/MANIFEST.MF
(rev 0)
+++
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe.xulrunner.browser/META-INF/MANIFEST.MF 2007-07-31
15:12:53 UTC (rev 2766)
@@ -0,0 +1,15 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Browser (XULRunner) Plug-in
+Bundle-SymbolicName: org.jboss.tools.vpe.xulrunner.browser;singleton:=true
+Bundle-Version: 1.0.0
+Bundle-Activator: org.jboss.tools.vpe.xulrunner.BrowserPlugin
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.jboss.tools.vpe.xulrunner;bundle-version="1.8.1.3",
+ org.mozilla.xpcom
+Eclipse-LazyStart: true
+Export-Package:
org.jboss.tools.vpe.xulrunner;uses:="org.eclipse.jface.resource,org.eclipse.ui.plugin,org.osgi.framework",
+
org.jboss.tools.vpe.xulrunner.browser;uses:="org.mozilla.interfaces,org.eclipse.swt.widgets,org.mozilla.xpcom"
+Bundle-ClassPath: .
+Bundle-Vendor: Red Hat, Inc.
Added:
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe.xulrunner.browser/build.properties
===================================================================
---
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe.xulrunner.browser/build.properties
(rev 0)
+++
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe.xulrunner.browser/build.properties 2007-07-31
15:12:53 UTC (rev 2766)
@@ -0,0 +1,4 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .
Added:
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe.xulrunner.browser/src/org/jboss/tools/vpe/xulrunner/BrowserPlugin.java
===================================================================
---
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe.xulrunner.browser/src/org/jboss/tools/vpe/xulrunner/BrowserPlugin.java
(rev 0)
+++
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe.xulrunner.browser/src/org/jboss/tools/vpe/xulrunner/BrowserPlugin.java 2007-07-31
15:12:53 UTC (rev 2766)
@@ -0,0 +1,61 @@
+package org.jboss.tools.vpe.xulrunner;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class BrowserPlugin extends AbstractUIPlugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID =
"org.jboss.tools.vpe.xulrunner.browser";
+
+ // The shared instance
+ private static BrowserPlugin plugin;
+
+ /**
+ * The constructor
+ */
+ public BrowserPlugin() {
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static BrowserPlugin getDefault() {
+ return plugin;
+ }
+
+ /**
+ * Returns an image descriptor for the image file at the given
+ * plug-in relative path
+ *
+ * @param path the path
+ * @return the image descriptor
+ */
+ public static ImageDescriptor getImageDescriptor(String path) {
+ return imageDescriptorFromPlugin(PLUGIN_ID, path);
+ }
+}
Added:
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe.xulrunner.browser/src/org/jboss/tools/vpe/xulrunner/XulRunnerException.java
===================================================================
---
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe.xulrunner.browser/src/org/jboss/tools/vpe/xulrunner/XulRunnerException.java
(rev 0)
+++
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe.xulrunner.browser/src/org/jboss/tools/vpe/xulrunner/XulRunnerException.java 2007-07-31
15:12:53 UTC (rev 2766)
@@ -0,0 +1,22 @@
+package org.jboss.tools.vpe.xulrunner;
+
+public class XulRunnerException extends Exception {
+ private static final long serialVersionUID = -7973228286977485907L;
+
+ public XulRunnerException() {
+ super();
+ }
+
+ public XulRunnerException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+ public XulRunnerException(String message) {
+ super(message);
+ }
+
+ public XulRunnerException(Throwable cause) {
+ super(cause);
+ }
+
+}
Added:
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe.xulrunner.browser/src/org/jboss/tools/vpe/xulrunner/browser/AppFileLocProvider.java
===================================================================
---
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe.xulrunner.browser/src/org/jboss/tools/vpe/xulrunner/browser/AppFileLocProvider.java
(rev 0)
+++
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe.xulrunner.browser/src/org/jboss/tools/vpe/xulrunner/browser/AppFileLocProvider.java 2007-07-31
15:12:53 UTC (rev 2766)
@@ -0,0 +1,49 @@
+package org.jboss.tools.vpe.xulrunner.browser;
+
+import java.io.File;
+
+import org.eclipse.core.runtime.Platform;
+import org.jboss.tools.vpe.xulrunner.BrowserPlugin;
+import org.mozilla.xpcom.IAppFileLocProvider;
+
+public class AppFileLocProvider implements IAppFileLocProvider {
+ private File xulRunnerPath;
+ private File userDataPath;
+
+ private final String PLUGINS_DIRECTORY = "plugins";
+ private final String HISTORY_FILE = "history.dat";
+ private final String COMPREG_FILE = "compreg.dat";
+ private final String XPTI_FILE = "xpti.dat";
+
+ public AppFileLocProvider(File xulRunnerPath) {
+ this.xulRunnerPath = xulRunnerPath;
+ this.userDataPath = Platform.getLocation().append(".metadata/.plugins")
+ .append(BrowserPlugin.PLUGIN_ID)
+ .append("xulrunner").toFile();
+ }
+
+ public File getFile(String prop, boolean[] persistent) {
+ persistent[0] = false;
+
+ if ("ProfD".equals(prop)) {
+ return userDataPath;
+ } else if ("UHist".equals(prop)) {
+ return new File(userDataPath, HISTORY_FILE);
+ } else if ("ComRegF".equals(prop)) {
+ return new File(userDataPath, COMPREG_FILE);
+ } else if ("XptiRegF".equals(prop)) {
+ return new File(userDataPath, XPTI_FILE);
+ }
+
+ return null;
+ }
+
+ public File[] getFiles(String prop) {
+ if("APluginsDL".equals(prop)) {
+ return new File[] {new File(xulRunnerPath, PLUGINS_DIRECTORY)};
+ }
+
+ return null;
+ }
+
+}
Added:
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe.xulrunner.browser/src/org/jboss/tools/vpe/xulrunner/browser/WindowCreator.java
===================================================================
---
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe.xulrunner.browser/src/org/jboss/tools/vpe/xulrunner/browser/WindowCreator.java
(rev 0)
+++
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe.xulrunner.browser/src/org/jboss/tools/vpe/xulrunner/browser/WindowCreator.java 2007-07-31
15:12:53 UTC (rev 2766)
@@ -0,0 +1,32 @@
+package org.jboss.tools.vpe.xulrunner.browser;
+
+import org.mozilla.interfaces.nsISupports;
+import org.mozilla.interfaces.nsIURI;
+import org.mozilla.interfaces.nsIWebBrowserChrome;
+import org.mozilla.interfaces.nsIWindowCreator;
+import org.mozilla.interfaces.nsIWindowCreator2;
+import org.mozilla.xpcom.Mozilla;
+
+public class WindowCreator implements nsIWindowCreator, nsIWindowCreator2 {
+
+ public nsIWebBrowserChrome createChromeWindow(nsIWebBrowserChrome arg0,
+ long arg1) {
+ // TODO Sergey Vasilyev implement
+ System.out.println("WindowCreator:createChromeWindow(" + arg0 +", "
+ arg1 + ")");
+ return arg0;
+ }
+
+ public nsISupports queryInterface(String arg0) {
+ // TODO Auto-generated method stub
+ return Mozilla.queryInterface(this, arg0);
+ }
+
+ public nsIWebBrowserChrome createChromeWindow2(nsIWebBrowserChrome arg0,
+ long arg1, long arg2, nsIURI arg3, boolean[] arg4) {
+ // TODO Sergey Vasilyev implement
+ System.out.println("WindowCreator:createChromeWindow2(" + arg0 +",
"
+ + arg1 + ", "+ arg2 + ", "+ (arg3 == null ? "null" :
arg3.getSpec()) +")");
+ return arg0;
+ }
+
+}
Added:
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe.xulrunner.browser/src/org/jboss/tools/vpe/xulrunner/browser/XulRunnerBrowser.java
===================================================================
---
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe.xulrunner.browser/src/org/jboss/tools/vpe/xulrunner/browser/XulRunnerBrowser.java
(rev 0)
+++
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe.xulrunner.browser/src/org/jboss/tools/vpe/xulrunner/browser/XulRunnerBrowser.java 2007-07-31
15:12:53 UTC (rev 2766)
@@ -0,0 +1,279 @@
+package org.jboss.tools.vpe.xulrunner.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.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Listener;
+import org.jboss.tools.vpe.xulrunner.XulRunnerException;
+import org.mozilla.interfaces.nsIBaseWindow;
+import org.mozilla.interfaces.nsIComponentManager;
+import org.mozilla.interfaces.nsISupports;
+import org.mozilla.interfaces.nsIWebBrowser;
+import org.mozilla.interfaces.nsIWebBrowserChrome;
+import org.mozilla.interfaces.nsIWebBrowserFocus;
+import org.mozilla.interfaces.nsIWebNavigation;
+import org.mozilla.xpcom.Mozilla;
+import org.osgi.framework.Bundle;
+
+public class XulRunnerBrowser extends Composite implements nsIWebBrowserChrome {
+ private static String xulRunnerBundle = "org.jboss.tools.vpe.xulrunner";
//$NON-NLS-1$
+
+ // TEMPORARY CODE (@see org.eclipse.swt.browser.Mozilla)
+ static final String XULRUNNER_INITIALIZED =
"org.eclipse.swt.browser.XULRunnerInitialized"; //$NON-NLS-1$
+ static final String XULRUNNER_PATH = "org.eclipse.swt.browser.XULRunnerPath";
//$NON-NLS-1$
+
+ private Mozilla mozilla = null;
+ private nsIWebBrowser webBrowser = null;
+ private long chrome_flags = nsIWebBrowserChrome.CHROME_ALL;
+
+ private boolean busyResizeFlag = false;
+
+ public XulRunnerBrowser(Composite parent) throws XulRunnerException {
+ super(parent, SWT.NONE);
+
+ mozilla = Mozilla.getInstance();
+
+ String xulRunnerPath = getXulRunnerPath();
+
+ Boolean isXulRunnerInitialized =
"true".equals(System.getProperty(XULRUNNER_INITIALIZED));
+ if (!isXulRunnerInitialized) {
+ File file = new File(xulRunnerPath);
+ mozilla.initialize(file);
+ mozilla.initEmbedding(file, file, new AppFileLocProvider(file));
+ System.setProperty(XULRUNNER_INITIALIZED, "true");
+ }
+
+ nsIComponentManager componentManager = mozilla.getComponentManager();
+ webBrowser = (nsIWebBrowser)
componentManager.createInstance("F1EAC761-87E9-11d3-AF80-00A024FFC08C", null,
nsIWebBrowser.NS_IWEBBROWSER_IID); //$NON-NLS-1$
+ webBrowser.setContainerWindow(this);
+ nsIBaseWindow baseWindow = (nsIBaseWindow)
webBrowser.queryInterface(nsIBaseWindow.NS_IBASEWINDOW_IID);
+
+ Rectangle rect = getClientArea();
+ if (rect.isEmpty()) {
+ rect.height = 1;
+ rect.width = 1;
+ }
+ baseWindow.initWindow(handle, 0, 0, 0, rect.height, rect.width);
+ baseWindow.create();
+ baseWindow.setVisibility(true);
+
+ Listener listener = new Listener(){
+ public void handleEvent (Event event) {
+ switch(event.type) {
+ case SWT.Dispose:
+ onDispose();
+ break;
+ case SWT.Activate:
+ case SWT.FocusIn:
+ onFocusGained();
+ break;
+ case SWT.Deactivate:
+ if (XulRunnerBrowser.this == event.display.getFocusControl()) {
+ onFocusLost();
+ }
+ break;
+ case SWT.Resize:
+ case SWT.Show:
+ /*
+ * Feature on GTK Mozilla. Mozilla does not show up when
+ * its container (a GTK fixed handle) is made visible
+ * after having been hidden. The workaround is to reset
+ * its size after the container has been made visible.
+ */
+ if (!busyResizeFlag) {
+ busyResizeFlag = true;
+ event.display.asyncExec(new Runnable() {
+ public void run() {
+ if (XulRunnerBrowser.this.isDisposed()) return;
+ onResize();
+ busyResizeFlag = false;
+ }
+ });
+ }
+ break;
+ case SWT.KeyDown:
+ onKeyDown();
+ break;
+ }
+ }
+ };
+
+ addListener(SWT.Dispose, listener);
+ addListener(SWT.Resize, listener);
+ addListener(SWT.FocusIn, listener);
+ addListener(SWT.KeyDown, listener);
+ addListener(SWT.Activate, listener);
+ addListener(SWT.Deactivate, listener);
+ addListener(SWT.Show, listener);
+ }
+
+ private void onDispose() {
+ nsIBaseWindow baseWindow = (nsIBaseWindow)
webBrowser.queryInterface(nsIBaseWindow.NS_IBASEWINDOW_IID);
+ baseWindow.destroy();
+ }
+
+ private void onFocusGained() {
+ nsIWebBrowserFocus webBrowserFocus = (nsIWebBrowserFocus)
webBrowser.queryInterface(nsIWebBrowserFocus.NS_IWEBBROWSERFOCUS_IID);
+ webBrowserFocus.activate();
+ }
+
+ private void onFocusLost() {
+ nsIWebBrowserFocus webBrowserFocus = (nsIWebBrowserFocus)
webBrowser.queryInterface(nsIWebBrowserFocus.NS_IWEBBROWSERFOCUS_IID);
+ webBrowserFocus.deactivate();
+ }
+
+ private void onResize() {
+ nsIBaseWindow baseWindow = (nsIBaseWindow)
webBrowser.queryInterface(nsIBaseWindow.NS_IBASEWINDOW_IID);
+
+ Rectangle rect = getClientArea();
+ if (rect.isEmpty()) {
+ rect.height = 1;
+ rect.width = 1;
+ }
+
+ baseWindow.setPositionAndSize(rect.x, rect.y, rect.width, rect.height, true);
+ }
+
+ private void onKeyDown() {
+ System.out.println("XulRunnerBrowser.onKeyDown()");
+ }
+
+ public static String getXulRunnerBundle() {
+ return xulRunnerBundle;
+ }
+
+ public static void setXulRunnerBundle(String xulRunnerBundle) {
+ XulRunnerBrowser.xulRunnerBundle = xulRunnerBundle;
+ }
+
+ private String getXulRunnerPath() throws XulRunnerException {
+ String xulRunnerPath = System.getProperty(XULRUNNER_PATH);
+ if (xulRunnerPath == null) {
+
+ Bundle fragment = Platform.getBundle(getXulRunnerBundle());
+ if (fragment == null) {
+ throw new XulRunnerException("Bundle " + getXulRunnerBundle() + " is
not found.");
+ }
+
+ URL url = fragment.getEntry("/xulrunner");
+ if (url == null) {
+ throw new XulRunnerException("Bundle " + getXulRunnerBundle() + "
doesn't contain /xulrunner");
+ }
+
+
+ try {
+ URL url1 = FileLocator.resolve(url);
+ File file = new File(FileLocator.toFileURL(url1).getFile());
+ xulRunnerPath = file.getAbsolutePath();
+ System.setProperty(XULRUNNER_PATH, xulRunnerPath);
+ } catch (IOException ioe) {
+ throw new XulRunnerException(ioe);
+ }
+ }
+
+ return xulRunnerPath;
+ }
+
+ public void setURL(String url) {
+ nsIWebNavigation webNavigation = (nsIWebNavigation)
webBrowser.queryInterface(nsIWebNavigation.NS_IWEBNAVIGATION_IID);
+ webNavigation.loadURI(url, nsIWebNavigation.LOAD_FLAGS_NONE, null, null, null);
+ }
+
+ public String getURL() {
+ nsIWebNavigation webNavigation = (nsIWebNavigation)
webBrowser.queryInterface(nsIWebNavigation.NS_IWEBNAVIGATION_IID);
+ return webNavigation.getCurrentURI().getSpec();
+ }
+
+ public void stop() {
+ nsIWebNavigation webNavigation = (nsIWebNavigation)
webBrowser.queryInterface(nsIWebNavigation.NS_IWEBNAVIGATION_IID);
+ webNavigation.stop(nsIWebNavigation.STOP_ALL);
+ }
+
+ public void reload() {
+ nsIWebNavigation webNavigation = (nsIWebNavigation)
webBrowser.queryInterface(nsIWebNavigation.NS_IWEBNAVIGATION_IID);
+ webNavigation.reload(nsIWebNavigation.LOAD_FLAGS_NONE);
+ }
+
+ public void goBack() {
+ nsIWebNavigation webNavigation = (nsIWebNavigation)
webBrowser.queryInterface(nsIWebNavigation.NS_IWEBNAVIGATION_IID);
+ webNavigation.goBack();
+ }
+
+ public void goForward() {
+ nsIWebNavigation webNavigation = (nsIWebNavigation)
webBrowser.queryInterface(nsIWebNavigation.NS_IWEBNAVIGATION_IID);
+ webNavigation.goForward();
+ }
+
+ /*
+ * nsISupports
+ *
+ * @see org.mozilla.interfaces.nsISupports#queryInterface(java.lang.String)
+ */
+ public nsISupports queryInterface(String arg0) {
+ return Mozilla.queryInterface(this, arg0);
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.mozilla.interfaces.nsIWebBrowserChrome#destroyBrowserWindow()
+ */
+ public void destroyBrowserWindow() {
+ // TODO Sergey Vasilyev implement
+ throw new RuntimeException("Not implemented");
+ }
+
+ public void exitModalEventLoop(long arg0) {
+ throw new RuntimeException("Not implemented");
+ }
+
+ public long getChromeFlags() {
+ return chrome_flags;
+ }
+
+ public nsIWebBrowser getWebBrowser() {
+ return webBrowser;
+ }
+
+ public boolean isWindowModal() {
+ // TODO Sergey Vasilyev implement
+ return false;
+ }
+
+ public void setChromeFlags(long arg0) {
+ chrome_flags = arg0;
+ }
+
+ public void setStatus(long arg0, String arg1) {
+ // TODO Sergey Vasilyev implement
+ throw new RuntimeException("Not implemented");
+ }
+
+ public void setWebBrowser(nsIWebBrowser arg0) {
+ webBrowser = arg0;
+ }
+
+ public void showAsModal() {
+ // TODO Sergey Vasilyev implement
+ throw new RuntimeException("Not implemented");
+ }
+
+ public void sizeBrowserTo(int arg0, int arg1) {
+ // TODO Sergey Vasilyev implement
+ throw new RuntimeException("Not implemented");
+ }
+
+ protected void finalize() throws Throwable {
+ if (mozilla != null) {
+ mozilla.termEmbedding();
+ }
+
+ super.finalize();
+ }
+}