summaryrefslogtreecommitdiffstats
path: root/bundles/org.eclipse.swt/Eclipse SWT Browser/common/org/eclipse/swt
diff options
context:
space:
mode:
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT Browser/common/org/eclipse/swt')
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Browser/common/org/eclipse/swt/browser/AuthenticationEvent.java69
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Browser/common/org/eclipse/swt/browser/AuthenticationListener.java56
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT Browser/common/org/eclipse/swt/browser/Browser.java992
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Browser/common/org/eclipse/swt/browser/BrowserFunction.java192
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Browser/common/org/eclipse/swt/browser/CloseWindowListener.java49
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Browser/common/org/eclipse/swt/browser/LocationAdapter.java33
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Browser/common/org/eclipse/swt/browser/LocationEvent.java71
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Browser/common/org/eclipse/swt/browser/LocationListener.java65
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Browser/common/org/eclipse/swt/browser/OpenWindowListener.java60
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Browser/common/org/eclipse/swt/browser/ProgressAdapter.java33
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Browser/common/org/eclipse/swt/browser/ProgressEvent.java58
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Browser/common/org/eclipse/swt/browser/ProgressListener.java63
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Browser/common/org/eclipse/swt/browser/StatusTextEvent.java55
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Browser/common/org/eclipse/swt/browser/StatusTextListener.java45
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Browser/common/org/eclipse/swt/browser/TitleEvent.java54
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Browser/common/org/eclipse/swt/browser/TitleListener.java45
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Browser/common/org/eclipse/swt/browser/VisibilityWindowAdapter.java33
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Browser/common/org/eclipse/swt/browser/VisibilityWindowListener.java91
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Browser/common/org/eclipse/swt/browser/WebBrowser.java598
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Browser/common/org/eclipse/swt/browser/WindowEvent.java218
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Browser/common/org/eclipse/swt/browser/package.html15
21 files changed, 0 insertions, 2895 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Browser/common/org/eclipse/swt/browser/AuthenticationEvent.java b/bundles/org.eclipse.swt/Eclipse SWT Browser/common/org/eclipse/swt/browser/AuthenticationEvent.java
deleted file mode 100644
index 9feeec1c71..0000000000
--- a/bundles/org.eclipse.swt/Eclipse SWT Browser/common/org/eclipse/swt/browser/AuthenticationEvent.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.swt.browser;
-
-import org.eclipse.swt.widgets.*;
-import org.eclipse.swt.events.*;
-
-/**
- * An <code>AuthenticationEvent</code> is sent by a {@link Browser}
- * to {@link AuthenticationListener}'s when the <code>Browser</code>
- * navigates to a page that requires authentication. This event allows
- * a client to either supply authentication credentials, cancel the
- * authentication, or do nothing (which causes an authentication prompter
- * to be shown to the user).
- *
- * @since 3.5
- */
-public class AuthenticationEvent extends TypedEvent {
- /** The location that triggered the authentication challenge */
- public String location;
-
- /** The user name to authenticate with */
- public String user;
-
- /** The password to authenticate with */
- public String password;
-
- /**
- * A flag indicating whether the authentication should proceed.
- * Setting this field to <code>false</code> will cancel the operation.
- */
- public boolean doit = true;
-
- static final long serialVersionUID = -8322331206780057921L;
-
-/**
- * Constructs a new instance of this class.
- *
- * @param widget the widget that fired the event
- *
- * @since 3.5
- */
-public AuthenticationEvent(Widget widget) {
- super(widget);
-}
-
-/**
- * Returns a string containing a concise, human-readable
- * description of the receiver.
- *
- * @return a string representation of the event
- */
-public String toString() {
- String string = super.toString ();
- return string.substring (0, string.length() - 1) // remove trailing '}'
- + " name=" + user
- + " password=" + password
- + " location=" + location
- + "}";
-}
-}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Browser/common/org/eclipse/swt/browser/AuthenticationListener.java b/bundles/org.eclipse.swt/Eclipse SWT Browser/common/org/eclipse/swt/browser/AuthenticationListener.java
deleted file mode 100644
index 4f8d342c33..0000000000
--- a/bundles/org.eclipse.swt/Eclipse SWT Browser/common/org/eclipse/swt/browser/AuthenticationListener.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.swt.browser;
-
-import org.eclipse.swt.internal.SWTEventListener;
-
-/**
- * This listener interface may be implemented in order to receive
- * an {@link AuthenticationEvent} notification when the {@link Browser}
- * encounters a page that requires authentication.
- *
- * @see Browser#addAuthenticationListener(AuthenticationListener)
- * @see Browser#removeAuthenticationListener(AuthenticationListener)
- *
- * @since 3.5
- */
-public interface AuthenticationListener extends SWTEventListener {
-
-/**
- * This method is called when a page is navigated to that requires
- * authentication.
- * <p>
- * Setting both the event's <code>user</code> and <code>password</code>
- * fields causes these values to be used as credentials for authentication.
- * Leaving one or both of these fields as <code>null</code> indicates
- * that credentials are not known, so an authentication prompter should
- * be shown to the user. Otherwise, setting the event's <code>doit</code>
- * field to <code>false</code> cancels the authentication challenge, and
- * the page will not be loaded.
- * <p>
- *
- * <p>The following fields in the <code>AuthenticationEvent</code> apply:
- * <ul>
- * <li>(in) widget the <code>Browser</code> that is attempting to show the
- * page that requires authentication
- * <li>(in) location the location issuing the authentication challenge
- * <li>(in/out) doit can be set to <code>false</code> to cancel the
- * authentication challenge
- * <li>(out) user the user name to authenticate with
- * <li>(out) password the password to authenticate with
- * </ul>
- *
- * @param event the <code>AuthenticationEvent</code> that can be used to
- * either supply authentication credentials, defer credential input to
- * an authentication prompter, or cancel an authentication challenge.
- */
-public void authenticate(AuthenticationEvent event);
-}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Browser/common/org/eclipse/swt/browser/Browser.java b/bundles/org.eclipse.swt/Eclipse SWT Browser/common/org/eclipse/swt/browser/Browser.java
deleted file mode 100755
index 05fcc056e3..0000000000
--- a/bundles/org.eclipse.swt/Eclipse SWT Browser/common/org/eclipse/swt/browser/Browser.java
+++ /dev/null
@@ -1,992 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.swt.browser;
-
-import org.eclipse.swt.*;
-import org.eclipse.swt.widgets.*;
-
-/**
- * Instances of this class implement the browser user interface
- * metaphor. It allows the user to visualize and navigate through
- * HTML documents.
- * <p>
- * Note that although this class is a subclass of <code>Composite</code>,
- * it does not make sense to set a layout on it.
- * </p>
- * <dl>
- * <dt><b>Styles:</b></dt>
- * <dd>MOZILLA</dd>
- * <dt><b>Events:</b></dt>
- * <dd>CloseWindowListener, LocationListener, OpenWindowListener, ProgressListener, StatusTextListener, TitleListener, VisibilityWindowListener</dd>
- * </dl>
- * <p>
- * IMPORTANT: This class is <em>not</em> intended to be subclassed.
- * </p>
- *
- * @see <a href="http://www.eclipse.org/swt/snippets/#browser">Browser snippets</a>
- * @see <a href="http://www.eclipse.org/swt/examples.php">SWT Examples: ControlExample, BrowserExample</a>
- * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
- *
- * @since 3.0
- * @noextend This class is not intended to be subclassed by clients.
- */
-
-public class Browser extends Composite {
- WebBrowser webBrowser;
- int userStyle;
-
- static final String PACKAGE_PREFIX = "org.eclipse.swt.browser."; //$NON-NLS-1$
- static final String NO_INPUT_METHOD = "org.eclipse.swt.internal.gtk.noInputMethod"; //$NON-NLS-1$
-
-/**
- * Constructs a new instance of this class given its parent
- * and a style value describing its behavior and appearance.
- * <p>
- * The style value is either one of the style constants defined in
- * class <code>SWT</code> which is applicable to instances of this
- * class, or must be built by <em>bitwise OR</em>'ing together
- * (that is, using the <code>int</code> "|" operator) two or more
- * of those <code>SWT</code> style constants. The class description
- * lists the style constants that are applicable to the class.
- * Style bits are also inherited from superclasses.
- * </p>
- *
- * @param parent a widget which will be the parent of the new instance (cannot be null)
- * @param style the style of widget to construct
- *
- * @exception IllegalArgumentException <ul>
- * <li>ERROR_NULL_ARGUMENT - if the parent is null</li>
- * </ul>
- * @exception SWTException <ul>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent</li>
- * </ul>
- * @exception SWTError <ul>
- * <li>ERROR_NO_HANDLES if a handle could not be obtained for browser creation</li>
- * </ul>
- *
- * @see Widget#getStyle
- *
- * @since 3.0
- */
-public Browser (Composite parent, int style) {
- super (checkParent (parent), checkStyle (style));
- userStyle = style;
-
- String platform = SWT.getPlatform ();
- Display display = parent.getDisplay ();
- if ("gtk".equals (platform)) display.setData (NO_INPUT_METHOD, null); //$NON-NLS-1$
- String className = null;
- if ((style & SWT.MOZILLA) != 0) {
- className = "org.eclipse.swt.browser.Mozilla"; //$NON-NLS-1$
- } else {
- if ("win32".equals (platform) || "wpf".equals (platform)) { //$NON-NLS-1$ $NON-NLS-2$
- className = "org.eclipse.swt.browser.IE"; //$NON-NLS-1$
- } else if ("motif".equals (platform)) { //$NON-NLS-1$
- className = "org.eclipse.swt.browser.Mozilla"; //$NON-NLS-1$
- } else if ("gtk".equals (platform)) { //$NON-NLS-1$
- className = "org.eclipse.swt.browser.Mozilla"; //$NON-NLS-1$
- } else if ("carbon".equals (platform) || "cocoa".equals (platform)) { //$NON-NLS-1$
- className = "org.eclipse.swt.browser.Safari"; //$NON-NLS-1$
- } else if ("photon".equals (platform)) { //$NON-NLS-1$
- className = "org.eclipse.swt.browser.Voyager"; //$NON-NLS-1$
- } else {
- dispose ();
- SWT.error (SWT.ERROR_NO_HANDLES);
- }
- }
-
- try {
- Class clazz = Class.forName (className);
- webBrowser = (WebBrowser)clazz.newInstance ();
- } catch (ClassNotFoundException e) {
- } catch (IllegalAccessException e) {
- } catch (InstantiationException e) {
- }
- if (webBrowser == null) {
- dispose ();
- SWT.error (SWT.ERROR_NO_HANDLES);
- }
-
- webBrowser.setBrowser (this);
- webBrowser.create (parent, style);
-}
-
-static Composite checkParent (Composite parent) {
- String platform = SWT.getPlatform ();
- if (!"gtk".equals (platform)) return parent; //$NON-NLS-1$
-
- /*
- * Note. Mozilla provides all IM support needed for text input in web pages.
- * If SWT creates another input method context for the widget it will cause
- * indeterminate results to happen (hangs and crashes). The fix is to prevent
- * SWT from creating an input method context for the Browser widget.
- */
- if (parent != null && !parent.isDisposed ()) {
- Display display = parent.getDisplay ();
- if (display != null) {
- if (display.getThread () == Thread.currentThread ()) {
- display.setData (NO_INPUT_METHOD, "true"); //$NON-NLS-1$
- }
- }
- }
- return parent;
-}
-
-static int checkStyle(int style) {
- String platform = SWT.getPlatform ();
- if ((style & SWT.MOZILLA) != 0) {
- if ("carbon".equals (platform)) return style | SWT.EMBEDDED; //$NON-NLS-1$
- if ("motif".equals (platform)) return style | SWT.EMBEDDED; //$NON-NLS-1$
- return style;
- }
-
- if ("win32".equals (platform)) { //$NON-NLS-1$
- /*
- * For IE on win32 the border is supplied by the embedded browser, so remove
- * the style so that the parent Composite will not draw a second border.
- */
- return style & ~SWT.BORDER;
- } else if ("motif".equals (platform)) { //$NON-NLS-1$
- return style | SWT.EMBEDDED;
- }
- return style;
-}
-
-protected void checkWidget () {
- super.checkWidget ();
-}
-
-/**
- * Clears all session cookies from all current Browser instances.
- *
- * @since 3.2
- */
-public static void clearSessions () {
- WebBrowser.clearSessions ();
-}
-
-/**
- * Returns the value of a cookie that is associated with a URL.
- * Note that cookies are shared amongst all Browser instances.
- *
- * @param name the cookie name
- * @param url the URL that the cookie is associated with
- * @return the cookie value, or <code>null</code> if no such cookie exists
- *
- * @exception IllegalArgumentException <ul>
- * <li>ERROR_NULL_ARGUMENT - if the name is null</li>
- * <li>ERROR_NULL_ARGUMENT - if the url is null</li>
- * </ul>
- *
- * @since 3.5
- */
-public static String getCookie (String name, String url) {
- if (name == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
- if (url == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
- return WebBrowser.GetCookie (name, url);
-}
-
-/**
- * Sets a cookie on a URL. Note that cookies are shared amongst all Browser instances.
- *
- * The <code>value</code> parameter must be a cookie header string that
- * complies with <a href="http://www.ietf.org/rfc/rfc2109.txt">RFC 2109</code>.
- * The value is passed through to the native browser unchanged.
- * <p>
- * Example value strings:
- * <code>foo=bar</code> (basic session cookie)
- * <code>foo=bar; path=/; domain=.eclipse.org</code> (session cookie)
- * <code>foo=bar; expires=Thu, 01-Jan-2030 00:00:01 GMT</code> (persistent cookie)
- * <code>foo=; expires=Thu, 01-Jan-1970 00:00:01 GMT</code> (deletes cookie <code>foo</code>)
- *
- * @param value the cookie value
- * @param url the URL to associate the cookie with
- * @return <code>true</code> if the cookie was successfully set and <code>false</code> otherwise
- *
- * @exception IllegalArgumentException <ul>
- * <li>ERROR_NULL_ARGUMENT - if the value is null</li>
- * <li>ERROR_NULL_ARGUMENT - if the url is null</li>
- * </ul>
- *
- * @since 3.5
- */
-public static boolean setCookie (String value, String url) {
- if (value == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
- if (url == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
- return WebBrowser.SetCookie (value, url);
-}
-
-/**
- * Adds the listener to the collection of listeners who will be
- * notified when authentication is required.
- * <p>
- * This notification occurs when a page requiring authentication is
- * encountered.
- * </p>
- *
- * @param listener the listener which should be notified
- *
- * @exception IllegalArgumentException <ul>
- * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
- * </ul>
- *
- * @exception SWTException <ul>
- * <li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread</li>
- * <li>ERROR_WIDGET_DISPOSED when the widget has been disposed</li>
- * </ul>
- *
- * @since 3.5
- */
-public void addAuthenticationListener (AuthenticationListener listener) {
- checkWidget();
- if (listener == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
- webBrowser.addAuthenticationListener (listener);
-}
-
-/**
- * Adds the listener to the collection of listeners who will be
- * notified when the window hosting the receiver should be closed.
- * <p>
- * This notification occurs when a javascript command such as
- * <code>window.close</code> gets executed by a <code>Browser</code>.
- * </p>
- *
- * @param listener the listener which should be notified
- *
- * @exception IllegalArgumentException <ul>
- * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
- * </ul>
- *
- * @exception SWTException <ul>
- * <li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread</li>
- * <li>ERROR_WIDGET_DISPOSED when the widget has been disposed</li>
- * </ul>
- *
- * @since 3.0
- */
-public void addCloseWindowListener (CloseWindowListener listener) {
- checkWidget();
- if (listener == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
- webBrowser.addCloseWindowListener (listener);
-}
-
-/**
- * Adds the listener to the collection of listeners who will be
- * notified when the current location has changed or is about to change.
- * <p>
- * This notification typically occurs when the application navigates
- * to a new location with {@link #setUrl(String)} or when the user
- * activates a hyperlink.
- * </p>
- *
- * @param listener the listener which should be notified
- *
- * @exception IllegalArgumentException <ul>
- * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
- * </ul>
- *
- * @exception SWTException <ul>
- * <li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread</li>
- * <li>ERROR_WIDGET_DISPOSED when the widget has been disposed</li>
- * </ul>
- *
- * @since 3.0
- */
-public void addLocationListener (LocationListener listener) {
- checkWidget();
- if (listener == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
- webBrowser.addLocationListener (listener);
-}
-
-/**
- * Adds the listener to the collection of listeners who will be
- * notified when a new window needs to be created.
- * <p>
- * This notification occurs when a javascript command such as
- * <code>window.open</code> gets executed by a <code>Browser</code>.
- * </p>
- *
- * @param listener the listener which should be notified
- *
- * @exception IllegalArgumentException <ul>
- * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
- * </ul>
- *
- * @exception SWTException <ul>
- * <li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread</li>
- * <li>ERROR_WIDGET_DISPOSED when the widget has been disposed</li>
- * </ul>
- *
- * @since 3.0
- */
-public void addOpenWindowListener (OpenWindowListener listener) {
- checkWidget();
- if (listener == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
- webBrowser.addOpenWindowListener (listener);
-}
-
-/**
- * Adds the listener to the collection of listeners who will be
- * notified when a progress is made during the loading of the current
- * URL or when the loading of the current URL has been completed.
- *
- * @param listener the listener which should be notified
- *
- * @exception IllegalArgumentException <ul>
- * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
- * </ul>
- *
- * @exception SWTException <ul>
- * <li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread</li>
- * <li>ERROR_WIDGET_DISPOSED when the widget has been disposed</li>
- * </ul>
- *
- * @since 3.0
- */
-public void addProgressListener (ProgressListener listener) {
- checkWidget();
- if (listener == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
- webBrowser.addProgressListener (listener);
-}
-
-/**
- * Adds the listener to the collection of listeners who will be
- * notified when the status text is changed.
- * <p>
- * The status text is typically displayed in the status bar of
- * a browser application.
- * </p>
- *
- * @param listener the listener which should be notified
- *
- * @exception IllegalArgumentException <ul>
- * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
- * </ul>
- *
- * @exception SWTException <ul>
- * <li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread</li>
- * <li>ERROR_WIDGET_DISPOSED when the widget has been disposed</li>
- * </ul>
- *
- * @since 3.0
- */
-public void addStatusTextListener (StatusTextListener listener) {
- checkWidget();
- if (listener == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
- webBrowser.addStatusTextListener (listener);
-}
-
-/**
- * Adds the listener to the collection of listeners who will be
- * notified when the title of the current document is available
- * or has changed.
- *
- * @param listener the listener which should be notified
- *
- * @exception IllegalArgumentException <ul>
- * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
- * </ul>
- *
- * @exception SWTException <ul>
- * <li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread</li>
- * <li>ERROR_WIDGET_DISPOSED when the widget has been disposed</li>
- * </ul>
- *
- * @since 3.0
- */
-public void addTitleListener (TitleListener listener) {
- checkWidget();
- if (listener == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
- webBrowser.addTitleListener (listener);
-}
-
-/**
- * Adds the listener to the collection of listeners who will be
- * notified when a window hosting the receiver needs to be displayed
- * or hidden.
- *
- * @param listener the listener which should be notified
- *
- * @exception IllegalArgumentException <ul>
- * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
- * </ul>
- *
- * @exception SWTException <ul>
- * <li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread</li>
- * <li>ERROR_WIDGET_DISPOSED when the widget has been disposed</li>
- * </ul>
- *
- * @since 3.0
- */
-public void addVisibilityWindowListener (VisibilityWindowListener listener) {
- checkWidget();
- if (listener == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
- webBrowser.addVisibilityWindowListener (listener);
-}
-
-/**
- * Navigate to the previous session history item.
- *
- * @return <code>true</code> if the operation was successful and <code>false</code> otherwise
- *
- * @exception SWTException <ul>
- * <li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread</li>
- * <li>ERROR_WIDGET_DISPOSED when the widget has been disposed</li>
- * </ul>
- *
- * @see #forward
- *
- * @since 3.0
- */
-public boolean back () {
- checkWidget();
- return webBrowser.back ();
-}
-
-protected void checkSubclass () {
- String name = getClass ().getName ();
- int index = name.lastIndexOf ('.');
- if (!name.substring (0, index + 1).equals (PACKAGE_PREFIX)) {
- SWT.error (SWT.ERROR_INVALID_SUBCLASS);
- }
-}
-
-/**
- * Executes the specified script.
- * <p>
- * Executes a script containing javascript commands in the context of the current document.
- * If document-defined functions or properties are accessed by the script then this method
- * should not be invoked until the document has finished loading (<code>ProgressListener.completed()</code>
- * gives notification of this).
- *
- * @param script the script with javascript commands
- *
- * @return <code>true</code> if the operation was successful and <code>false</code> otherwise
- *
- * @exception IllegalArgumentException <ul>
- * <li>ERROR_NULL_ARGUMENT - if the script is null</li>
- * </ul>
- *
- * @exception SWTException <ul>
- * <li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread</li>
- * <li>ERROR_WIDGET_DISPOSED when the widget has been disposed</li>
- * </ul>
- *
- * @see ProgressListener#completed(ProgressEvent)
- *
- * @since 3.1
- */
-public boolean execute (String script) {
- checkWidget();
- if (script == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
- return webBrowser.execute (script);
-}
-
-/**
- * Returns the result, if any, of executing the specified script.
- * <p>
- * Evaluates a script containing javascript commands in the context of
- * the current document. If document-defined functions or properties
- * are accessed by the script then this method should not be invoked
- * until the document has finished loading (<code>ProgressListener.completed()</code>
- * gives notification of this).
- * </p><p>
- * If the script returns a value with a supported type then a java
- * representation of the value is returned. The supported
- * javascript -> java mappings are:
- * <ul>
- * <li>javascript null or undefined -> <code>null</code></li>
- * <li>javascript number -> <code>java.lang.Double</code></li>
- * <li>javascript string -> <code>java.lang.String</code></li>
- * <li>javascript boolean -> <code>java.lang.Boolean</code></li>
- * <li>javascript array whose elements are all of supported types -> <code>java.lang.Object[]</code></li>
- * </ul>
- *
- * An <code>SWTException</code> is thrown if the return value has an
- * unsupported type, or if evaluating the script causes a javascript
- * error to be thrown.
- *
- * @param script the script with javascript commands
- *
- * @return the return value, if any, of executing the script
- *
- * @exception IllegalArgumentException <ul>
- * <li>ERROR_NULL_ARGUMENT - if the script is null</li>
- * </ul>
- *
- * @exception SWTException <ul>
- * <li>ERROR_FAILED_EVALUATE when the script evaluation causes a javascript error to be thrown</li>
- * <li>ERROR_INVALID_RETURN_VALUE when the script returns a value of unsupported type</li>
- * <li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread</li>
- * <li>ERROR_WIDGET_DISPOSED when the widget has been disposed</li>
- * </ul>
- *
- * @see ProgressListener#completed(ProgressEvent)
- *
- * @since 3.5
- */
-public Object evaluate (String script) throws SWTException {
- checkWidget();
- if (script == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
- return webBrowser.evaluate (script);
-}
-
-/**
- * Navigate to the next session history item.
- *
- * @return <code>true</code> if the operation was successful and <code>false</code> otherwise
- *
- * @exception SWTException <ul>
- * <li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread</li>
- * <li>ERROR_WIDGET_DISPOSED when the widget has been disposed</li>
- * </ul>
- *
- * @see #back
- *
- * @since 3.0
- */
-public boolean forward () {
- checkWidget();
- return webBrowser.forward ();
-}
-
-/**
- * Returns the type of native browser being used by this instance.
- * Examples: "mozilla", "ie", "safari", "voyager"
- *
- * @return the type of the native browser
- *
- * @since 3.5
- */
-public String getBrowserType () {
- checkWidget();
- return webBrowser.getBrowserType ();
-}
-
-/**
- * Returns <code>true</code> if javascript will be allowed to run in pages
- * subsequently viewed in the receiver, and <code>false</code> otherwise.
- *
- * @return the receiver's javascript enabled state
- *
- * @exception SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- *
- * @see #setJavascriptEnabled
- *
- * @since 3.5
- */
-public boolean getJavascriptEnabled () {
- checkWidget();
- return webBrowser.jsEnabled;
-}
-
-public int getStyle () {
- /*
- * If SWT.BORDER was specified at creation time then getStyle() should answer
- * it even though it is removed for IE on win32 in checkStyle().
- */
- return super.getStyle () | (userStyle & SWT.BORDER);
-}
-
-/**
- * Returns a string with HTML that represents the content of the current page.
- *
- * @return HTML representing the current page or an empty <code>String</code>
- * if this is empty
- *
- * @exception SWTException <ul>
- * <li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread</li>
- * <li>ERROR_WIDGET_DISPOSED when the widget has been disposed</li>
- * </ul>
- *
- * @since 3.4
- */
-public String getText () {
- checkWidget();
- return webBrowser.getText ();
-}
-
-/**
- * Returns the current URL.
- *
- * @return the current URL or an empty <code>String</code> if there is no current URL
- *
- * @exception SWTException <ul>
- * <li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread</li>
- * <li>ERROR_WIDGET_DISPOSED when the widget has been disposed</li>
- * </ul>
- *
- * @see #setUrl
- *
- * @since 3.0
- */
-public String getUrl () {
- checkWidget();
- return webBrowser.getUrl ();
-}
-
-/**
- * Returns the JavaXPCOM <code>nsIWebBrowser</code> for the receiver, or <code>null</code>
- * if it is not available. In order for an <code>nsIWebBrowser</code> to be returned all
- * of the following must be true: <ul>
- * <li>the receiver's style must be <code>SWT.MOZILLA</code></li>
- * <li>the classes from JavaXPCOM &gt;= 1.8.1.2 must be resolvable at runtime</li>
- * <li>the version of the underlying XULRunner must be &gt;= 1.8.1.2</li>
- * </ul>
- *
- * @return the receiver's JavaXPCOM <code>nsIWebBrowser</code> or <code>null</code>
- *
- * @since 3.3
- */
-public Object getWebBrowser () {
- checkWidget();
- return webBrowser.getWebBrowser ();
-}
-
-/**
- * Returns <code>true</code> if the receiver can navigate to the
- * previous session history item, and <code>false</code> otherwise.
- *
- * @return the receiver's back command enabled state
- *
- * @exception SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- *
- * @see #back
- */
-public boolean isBackEnabled () {
- checkWidget();
- return webBrowser.isBackEnabled ();
-}
-
-public boolean isFocusControl () {
- checkWidget();
- if (webBrowser.isFocusControl ()) return true;
- return super.isFocusControl ();
-}
-
-/**
- * Returns <code>true</code> if the receiver can navigate to the
- * next session history item, and <code>false</code> otherwise.
- *
- * @return the receiver's forward command enabled state
- *
- * @exception SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- *
- * @see #forward
- */
-public boolean isForwardEnabled () {
- checkWidget();
- return webBrowser.isForwardEnabled ();
-}
-
-/**
- * Refresh the current page.
- *
- * @exception SWTException <ul>
- * <li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread</li>
- * <li>ERROR_WIDGET_DISPOSED when the widget has been disposed</li>
- * </ul>
- *
- * @since 3.0
- */
-public void refresh () {
- checkWidget();
- webBrowser.refresh ();
-}
-
-/**
- * Removes the listener from the collection of listeners who will
- * be notified when authentication is required.
- *
- * @param listener the listener which should no longer be notified
- *
- * @exception IllegalArgumentException <ul>
- * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
- * </ul>
- *
- * @exception SWTException <ul>
- * <li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread</li>
- * <li>ERROR_WIDGET_DISPOSED when the widget has been disposed</li>
- * </ul>
- *
- * @since 3.5
- */
-public void removeAuthenticationListener (AuthenticationListener listener) {
- checkWidget();
- if (listener == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
- webBrowser.removeAuthenticationListener (listener);
-}
-
-/**
- * Removes the listener from the collection of listeners who will
- * be notified when the window hosting the receiver should be closed.
- *
- * @param listener the listener which should no longer be notified
- *
- * @exception IllegalArgumentException <ul>
- * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
- * </ul>
- *
- * @exception SWTException <ul>
- * <li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread</li>
- * <li>ERROR_WIDGET_DISPOSED when the widget has been disposed</li>
- * </ul>
- *
- * @since 3.0
- */
-public void removeCloseWindowListener (CloseWindowListener listener) {
- checkWidget();
- if (listener == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
- webBrowser.removeCloseWindowListener (listener);
-}
-
-/**
- * Removes the listener from the collection of listeners who will
- * be notified when the current location is changed or about to be changed.
- *
- * @param listener the listener which should no longer be notified
- *
- * @exception IllegalArgumentException <ul>
- * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
- * </ul>
- *
- * @exception SWTException <ul>
- * <li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread</li>
- * <li>ERROR_WIDGET_DISPOSED when the widget has been disposed</li>
- * </ul>
- *
- * @since 3.0
- */
-public void removeLocationListener (LocationListener listener) {
- checkWidget();
- if (listener == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
- webBrowser.removeLocationListener (listener);
-}
-
-/**
- * Removes the listener from the collection of listeners who will
- * be notified when a new window needs to be created.
- *
- * @param listener the listener which should no longer be notified
- *
- * @exception IllegalArgumentException <ul>
- * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
- * </ul>
- *
- * @exception SWTException <ul>
- * <li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread</li>
- * <li>ERROR_WIDGET_DISPOSED when the widget has been disposed</li>
- * </ul>
- *
- * @since 3.0
- */
-public void removeOpenWindowListener (OpenWindowListener listener) {
- checkWidget();
- if (listener == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
- webBrowser.removeOpenWindowListener (listener);
-}
-
-/**
- * Removes the listener from the collection of listeners who will
- * be notified when a progress is made during the loading of the current
- * URL or when the loading of the current URL has been completed.
- *
- * @param listener the listener which should no longer be notified
- *
- * @exception IllegalArgumentException <ul>
- * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
- * </ul>
- *
- * @exception SWTException <ul>
- * <li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread</li>
- * <li>ERROR_WIDGET_DISPOSED when the widget has been disposed</li>
- * </ul>
- *
- * @since 3.0
- */
-public void removeProgressListener (ProgressListener listener) {
- checkWidget();
- if (listener == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
- webBrowser.removeProgressListener (listener);
-}
-
-/**
- * Removes the listener from the collection of listeners who will
- * be notified when the status text is changed.
- *
- * @param listener the listener which should no longer be notified
- *
- * @exception IllegalArgumentException <ul>
- * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
- * </ul>
- *
- * @exception SWTException <ul>
- * <li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread</li>
- * <li>ERROR_WIDGET_DISPOSED when the widget has been disposed</li>
- * </ul>
- *
- * @since 3.0
- */
-public void removeStatusTextListener (StatusTextListener listener) {
- checkWidget();
- if (listener == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
- webBrowser.removeStatusTextListener (listener);
-}
-
-/**
- * Removes the listener from the collection of listeners who will
- * be notified when the title of the current document is available
- * or has changed.
- *
- * @param listener the listener which should no longer be notified
- *
- * @exception IllegalArgumentException <ul>
- * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
- * </ul>
- *
- * @exception SWTException <ul>
- * <li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread</li>
- * <li>ERROR_WIDGET_DISPOSED when the widget has been disposed</li>
- * </ul>
- *
- * @since 3.0
- */
-public void removeTitleListener (TitleListener listener) {
- checkWidget();
- if (listener == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
- webBrowser.removeTitleListener (listener);
-}
-
-/**
- * Removes the listener from the collection of listeners who will
- * be notified when a window hosting the receiver needs to be displayed
- * or hidden.
- *
- * @param listener the listener which should no longer be notified
- *
- * @exception IllegalArgumentException <ul>
- * <li>ERROR_NULL_ARGUMENT - if the listener is null</li>
- * </ul>
- *
- * @exception SWTException <ul>
- * <li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread</li>
- * <li>ERROR_WIDGET_DISPOSED when the widget has been disposed</li>
- * </ul>
- *
- * @since 3.0
- */
-public void removeVisibilityWindowListener (VisibilityWindowListener listener) {
- checkWidget();
- if (listener == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
- webBrowser.removeVisibilityWindowListener (listener);
-}
-
-/**
- * Sets whether javascript will be allowed to run in pages subsequently
- * viewed in the receiver. Note that setting this value does not affect
- * the running of javascript in the current page.
- *
- * @param enabled the receiver's new javascript enabled state
- *
- * @exception SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- *
- * @since 3.5
- */
-public void setJavascriptEnabled (boolean enabled) {
- checkWidget();
- webBrowser.jsEnabled = enabled;
- webBrowser.jsEnabledChanged = true;
-}
-
-/**
- * Renders a string containing HTML. The rendering of the content occurs asynchronously.
- *
- * <p>
- * The html parameter is Unicode encoded since it is a java <code>String</code>.
- * As a result, the HTML meta tag charset should not be set. The charset is implied
- * by the <code>String</code> itself.
- *
- * @param html the HTML content to be rendered
- *
- * @return true if the operation was successful and false otherwise.
- *
- * @exception IllegalArgumentException <ul>
- * <li>ERROR_NULL_ARGUMENT - if the html is null</li>
- * </ul>
- *
- * @exception SWTException <ul>
- * <li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread</li>
- * <li>ERROR_WIDGET_DISPOSED when the widget has been disposed</li>
- * </ul>
- *
- * @see #setUrl
- *
- * @since 3.0
- */
-public boolean setText (String html) {
- checkWidget();
- if (html == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
- return webBrowser.setText (html);
-}
-
-/**
- * Begins loading a URL. The loading of its content occurs asynchronously.
- *
- * @param url the URL to be loaded
- *
- * @return true if the operation was successful and false otherwise.
- *
- * @exception IllegalArgumentException <ul>
- * <li>ERROR_NULL_ARGUMENT - if the url is null</li>
- * </ul>
- *
- * @exception SWTException <ul>
- * <li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread</li>
- * <li>ERROR_WIDGET_DISPOSED when the widget has been disposed</li>
- * </ul>
- *
- * @see #getUrl
- *
- * @since 3.0
- */
-public boolean setUrl (String url) {
- checkWidget();
- if (url == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
- return webBrowser.setUrl (url);
-}
-
-/**
- * Stop any loading and rendering activity.
- *
- * @exception SWTException <ul>
- * <li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread</li>
- * <li>ERROR_WIDGET_DISPOSED when the widget has been disposed</li>
- * </ul>
- *
- * @since 3.0
- */
-public void stop () {
- checkWidget();
- webBrowser.stop ();
-}
-}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Browser/common/org/eclipse/swt/browser/BrowserFunction.java b/bundles/org.eclipse.swt/Eclipse SWT Browser/common/org/eclipse/swt/browser/BrowserFunction.java
deleted file mode 100644
index f87aef0d47..0000000000
--- a/bundles/org.eclipse.swt/Eclipse SWT Browser/common/org/eclipse/swt/browser/BrowserFunction.java
+++ /dev/null
@@ -1,192 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.swt.browser;
-
-import org.eclipse.swt.*;
-
-/**
- * Instances of this class represent java-side "functions" that
- * are invokable from javascript. Browser clients define these
- * functions by subclassing <code>BrowserFunction</code> and
- * overriding its <code>function(Object[])</code> method. This
- * method will be invoked whenever javascript running in the
- * Browser makes a call with the function's name.
- *
- * <p>
- * Application code must explicitly invoke the
- * <code>BrowserFunction.dispose()</code> method to release the
- * resources managed by each instance when those instances are no
- * longer required. Since there is usually a correlation between
- * the registering of BrowserFunction(s) in a Browser and the
- * loading of a page in the Browser that is aware of these
- * functions, the <code>LocationListener.changed()</code> listener
- * is often a good place to do this.
- * </p><p>
- * Note that disposing a Browser automatically disposes all
- * BrowserFunctions associated with it.
- * </p>
- *
- * @see #dispose()
- * @see #function(Object[])
- * @see org.eclipse.swt.browser.LocationListener#changed(LocationEvent)
- *
- * @since 3.5
- */
-public class BrowserFunction {
- Browser browser;
- String name;
- String functionString;
- int index;
- boolean isEvaluate;
-
-/**
- * Constructs a new instance of this class, which will be invokable
- * by javascript running in the specified Browser.
- * <p>
- * You must dispose the BrowserFunction when it is no longer required.
- * A common place to do this is in a <code>LocationListener.changed()</code>
- * listener.
- * </p>
- * @param browser the browser whose javascript can invoke this function
- * @param name the name that javascript will use to invoke this function
- *
- * @exception IllegalArgumentException <ul>
- * <li>ERROR_NULL_ARGUMENT - if the browser is null</li>
- * <li>ERROR_NULL_ARGUMENT - if the name is null</li>
- * </ul>
- *
- * @exception SWTException <ul>
- * <li>ERROR_WIDGET_DISPOSED - if the browser has been disposed</li>
- * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
- * </ul>
- *
- * @see #dispose()
- * @see org.eclipse.swt.browser.LocationListener#changed(LocationEvent)
- */
-public BrowserFunction (Browser browser, String name) {
- this (browser, name, true);
-}
-
-BrowserFunction (Browser browser, String name, boolean create) {
- super ();
- if (browser == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
- if (name == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
- if (browser.isDisposed ()) SWT.error (SWT.ERROR_WIDGET_DISPOSED);
- browser.checkWidget ();
- this.browser = browser;
- this.name = name;
- if (create) browser.webBrowser.createFunction (this);
-}
-
-/**
- * Disposes of the resources associated with this BrowserFunction.
- * Applications must dispose of all BrowserFunctions that they create.
- * </p><p>
- * Note that disposing a Browser automatically disposes all
- * BrowserFunctions associated with it.
- * </p>
- */
-public void dispose () {
- dispose (true);
-}
-
-void dispose (boolean remove) {
- if (index < 0) return;
- if (remove) browser.webBrowser.destroyFunction (this);
- browser = null;
- name = functionString = null;
- index = -1;
-}
-
-/**
- * Subclasses should override this method. This method is invoked when
- * the receiver's function is called from javascript. If all of the
- * arguments that are passed to the javascript function call are of
- * supported types then this method is invoked with the argument values
- * converted as follows:
- *
- * javascript null or undefined -> <code>null</code>
- * javascript number -> <code>java.lang.Double</code>
- * javascript string -> <code>java.lang.String</code>
- * javascript boolean -> <code>java.lang.Boolean</code>
- * javascript array whose elements are all of supported types -> <code>java.lang.Object[]</code>
- *
- * If any of the Javascript arguments are of unsupported types then the
- * function invocation will fail and this method will not be called.
- *
- * This method must return a value with one of these supported types to
- * the javascript caller (note that any subclass of <code>java.lang.Number</code>
- * will be successfully converted to a javascript number).
- *
- * @param arguments the javascript arguments converted to java equivalents
- * @return the value to return to the javascript caller
- *
- * @exception SWTException <ul>
- * <li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread</li>
- * <li>ERROR_FUNCTION_DISPOSED when the BrowserFunction has been disposed</li>
- * </ul>
- */
-public Object function (Object[] arguments) {
- if (index < 0) SWT.error (SWT.ERROR_FUNCTION_DISPOSED);
- browser.checkWidget ();
- return null;
-}
-
-/**
- * Returns the Browser whose pages can invoke this BrowserFunction.
- *
- * @return the Browser associated with this BrowserFunction
- *
- * @exception SWTException <ul>
- * <li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread</li>
- * <li>ERROR_FUNCTION_DISPOSED when the BrowserFunction has been disposed</li>
- * </ul>
- */
-public Browser getBrowser () {
- if (index < 0) SWT.error (SWT.ERROR_FUNCTION_DISPOSED);
- browser.checkWidget ();
- return browser;
-}
-
-/**
- * Returns the name that javascript can use to invoke this BrowserFunction.
- *
- * @return the BrowserFunction's name
- *
- * @exception SWTException <ul>
- * <li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread</li>
- * <li>ERROR_FUNCTION_DISPOSED when the BrowserFunction has been disposed</li>
- * </ul>
- */
-public String getName () {
- if (index < 0) SWT.error (SWT.ERROR_FUNCTION_DISPOSED);
- browser.checkWidget ();
- return name;
-}
-
-/**
- * Returns <code>true</code> if this BrowserFunction has been disposed
- * and <code>false</code> otherwise.
- * <p>
- * This method gets the dispose state for the BrowserFunction.
- * When a BrowserFunction has been disposed it is an error to
- * invoke any of its methods.
- * </p><p>
- * Note that disposing a Browser automatically disposes all
- * BrowserFunctions associated with it.
- * </p>
- * @return <code>true</code> if this BrowserFunction has been disposed
- * and <code>false</code> otherwise
- */
-public boolean isDisposed () {
- return index < 0;
-}
-}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Browser/common/org/eclipse/swt/browser/CloseWindowListener.java b/bundles/org.eclipse.swt/Eclipse SWT Browser/common/org/eclipse/swt/browser/CloseWindowListener.java
deleted file mode 100644
index b545054e7c..0000000000
--- a/bundles/org.eclipse.swt/Eclipse SWT Browser/common/org/eclipse/swt/browser/CloseWindowListener.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.swt.browser;
-
-import org.eclipse.swt.internal.SWTEventListener;
-
-/**
- * This listener interface may be implemented in order to receive
- * a {@link WindowEvent} notification when a {@link Browser} is
- * about to be closed and when its host window should be closed
- * by the application.
- *
- * @see Browser#addCloseWindowListener(CloseWindowListener)
- * @see Browser#removeCloseWindowListener(CloseWindowListener)
- * @see OpenWindowListener
- * @see VisibilityWindowListener
- *
- * @since 3.0
- */
-public interface CloseWindowListener extends SWTEventListener {
-
-/**
- * This method is called when the window hosting a {@link Browser} should be closed.
- * Application would typically close the {@link org.eclipse.swt.widgets.Shell} that
- * hosts the <code>Browser</code>. The <code>Browser</code> is disposed after this
- * notification.
- *
- * <p>The following fields in the <code>WindowEvent</code> apply:
- * <ul>
- * <li>(in) widget the <code>Browser</code> that is going to be disposed
- * </ul></p>
- *
- * @param event the <code>WindowEvent</code> that specifies the <code>Browser</code>
- * that is going to be disposed
- *
- * @see org.eclipse.swt.widgets.Shell#close()
- *
- * @since 3.0
- */
-public void close(WindowEvent event);
-}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Browser/common/org/eclipse/swt/browser/LocationAdapter.java b/bundles/org.eclipse.swt/Eclipse SWT Browser/common/org/eclipse/swt/browser/LocationAdapter.java
deleted file mode 100644
index 1583f43faa..0000000000
--- a/bundles/org.eclipse.swt/Eclipse SWT Browser/common/org/eclipse/swt/browser/LocationAdapter.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.swt.browser;
-
-/**
- * This adapter class provides default implementations for the
- * methods described by the {@link LocationListener} interface.
- * <p>
- * Classes that wish to deal with {@link LocationEvent}'s can
- * extend this class and override only the methods which they are
- * interested in.
- * </p>
- *
- * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
- *
- * @since 3.0
- */
-public abstract class LocationAdapter implements LocationListener {
-
-public void changing(LocationEvent event) {
-}
-
-public void changed(LocationEvent event) {
-}
-}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Browser/common/org/eclipse/swt/browser/LocationEvent.java b/bundles/org.eclipse.swt/Eclipse SWT Browser/common/org/eclipse/swt/browser/LocationEvent.java
deleted file mode 100644
index 0fed868b06..0000000000
--- a/bundles/org.eclipse.swt/Eclipse SWT Browser/common/org/eclipse/swt/browser/LocationEvent.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.swt.browser;
-
-import org.eclipse.swt.widgets.*;
-import org.eclipse.swt.events.*;
-
-/**
- * A <code>LocationEvent</code> is sent by a {@link Browser} to
- * {@link LocationListener}'s when the <code>Browser</code>
- * navigates to a different URL. This notification typically
- * occurs when the application navigates to a new location with
- * {@link Browser#setUrl(String)} or when the user activates a
- * hyperlink.
- *
- * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
- *
- * @since 3.0
- */
-public class LocationEvent extends TypedEvent {
- /** current location */
- public String location;
-
- /**
- * A flag indicating whether the location opens in the top frame
- * or not.
- */
- public boolean top;
-
- /**
- * A flag indicating whether the location loading should be allowed.
- * Setting this field to <code>false</code> will cancel the operation.
- */
- public boolean doit;
-
- static final long serialVersionUID = 3906644198244299574L;
-
-/**
- * Constructs a new instance of this class.
- *
- * @param widget the widget that fired the event
- *
- * @since 3.5
- */
-public LocationEvent(Widget widget) {
- super(widget);
-}
-
-/**
- * Returns a string containing a concise, human-readable
- * description of the receiver.
- *
- * @return a string representation of the event
- */
-public String toString() {
- String string = super.toString ();
- return string.substring (0, string.length() - 1) // remove trailing '}'
- + " location=" + location
- + " top=" + top
- + " doit=" + doit
- + "}";
-}
-}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Browser/common/org/eclipse/swt/browser/LocationListener.java b/bundles/org.eclipse.swt/Eclipse SWT Browser/common/org/eclipse/swt/browser/LocationListener.java
deleted file mode 100644
index b34359ba89..0000000000
--- a/bundles/org.eclipse.swt/Eclipse SWT Browser/common/org/eclipse/swt/browser/LocationListener.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.swt.browser;
-
-import org.eclipse.swt.internal.SWTEventListener;
-
-/**
- * This listener interface may be implemented in order to receive
- * a {@link LocationEvent} notification when a {@link Browser}
- * navigates to a different URL.
- *
- * @see Browser#addLocationListener(LocationListener)
- * @see Browser#removeLocationListener(LocationListener)
- *
- * @since 3.0
- */
-public interface LocationListener extends SWTEventListener {
-
-/**
- * This method is called when the current location is about to be changed.
- * <p>
- *
- * <p>The following fields in the <code>LocationEvent</code> apply:
- * <ul>
- * <li>(in) location the location to be loaded
- * <li>(in) widget the <code>Browser</code> whose location is changing
- * <li>(in/out) doit can be set to <code>false</code> to prevent the location
- * from being loaded
- * </ul>
- *
- * @param event the <code>LocationEvent</code> that specifies the location
- * to be loaded by a <code>Browser</code>
- *
- * @since 3.0
- */
-public void changing(LocationEvent event);
-
-/**
- * This method is called when the current location is changed.
- * <p>
- *
- * <p>The following fields in the <code>LocationEvent</code> apply:
- * <ul>
- * <li>(in) location the current location
- * <li>(in) top <code>true</code> if the location opens in the top frame or
- * <code>false</code> otherwise
- * <li>(in) widget the <code>Browser</code> whose location has changed
- * </ul>
- *
- * @param event the <code>LocationEvent</code> that specifies the new
- * location of a <code>Browser</code>
- *
- * @since 3.0
- */
-public void changed(LocationEvent event);
-
-}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Browser/common/org/eclipse/swt/browser/OpenWindowListener.java b/bundles/org.eclipse.swt/Eclipse SWT Browser/common/org/eclipse/swt/browser/OpenWindowListener.java
deleted file mode 100644
index 140f7c3d33..0000000000
--- a/bundles/org.eclipse.swt/Eclipse SWT Browser/common/org/eclipse/swt/browser/OpenWindowListener.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.swt.browser;
-
-import org.eclipse.swt.internal.SWTEventListener;
-
-/**
- * This listener interface may be implemented in order to receive
- * a {@link WindowEvent} notification when a new {@link Browser}
- * needs to be provided by the application.
- *
- * @see Browser#addOpenWindowListener(OpenWindowListener)
- * @see Browser#removeOpenWindowListener(OpenWindowListener)
- * @see CloseWindowListener
- * @see VisibilityWindowListener
- *
- * @since 3.0
- */
-public interface OpenWindowListener extends SWTEventListener {
-
-/**
- * This method is called when a new window needs to be created.
- * <p>
- * A particular <code>Browser</code> can be passed to the event.browser
- * field to host the content of a new window.
- * <p>
- * A standalone system browser is used to host the new window
- * if the event.required field value is false and if the event.browser
- * field is left <code>null</code>. The event.required field
- * is true on platforms that don't support a standalone system browser for
- * new window requests.
- * <p>
- * The navigation is cancelled if the event.required field is set to
- * true and the event.browser field is left <code>null</code>.
- * <p>
- * <p>The following fields in the <code>WindowEvent</code> apply:
- * <ul>
- * <li>(in/out) required true if the platform requires the user to provide a
- * <code>Browser</code> to handle the new window or false otherwise.
- * <li>(out) browser the new <code>Browser</code> that will host the
- * content of the new window.
- * <li>(in) widget the <code>Browser</code> that is requesting to open a
- * new window
- * </ul>
- *
- * @param event the <code>WindowEvent</code> that needs to be passed a new
- * <code>Browser</code> to handle the new window request
- *
- * @since 3.0
- */
-public void open(WindowEvent event);
-}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Browser/common/org/eclipse/swt/browser/ProgressAdapter.java b/bundles/org.eclipse.swt/Eclipse SWT Browser/common/org/eclipse/swt/browser/ProgressAdapter.java
deleted file mode 100644
index 98995dbe14..0000000000
--- a/bundles/org.eclipse.swt/Eclipse SWT Browser/common/org/eclipse/swt/browser/ProgressAdapter.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.swt.browser;
-
-/**
- * This adapter class provides default implementations for the
- * methods described by the {@link ProgressListener} interface.
- * <p>
- * Classes that wish to deal with {@link ProgressEvent}'s can
- * extend this class and override only the methods which they are
- * interested in.
- * </p>
- *
- * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
- *
- * @since 3.0
- */
-public abstract class ProgressAdapter implements ProgressListener {
-
-public void changed(ProgressEvent event) {
-}
-
-public void completed(ProgressEvent event) {
-}
-}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Browser/common/org/eclipse/swt/browser/ProgressEvent.java b/bundles/org.eclipse.swt/Eclipse SWT Browser/common/org/eclipse/swt/browser/ProgressEvent.java
deleted file mode 100644
index 204e2edaa6..0000000000
--- a/bundles/org.eclipse.swt/Eclipse SWT Browser/common/org/eclipse/swt/browser/ProgressEvent.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.swt.browser;
-
-import org.eclipse.swt.widgets.*;
-import org.eclipse.swt.events.*;
-
-/**
- * A <code>ProgressEvent</code> is sent by a {@link Browser} to
- * {@link ProgressListener}'s when a progress is made during the
- * loading of the current URL or when the loading of the current
- * URL has been completed.
- *
- * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
- *
- * @since 3.0
- */
-public class ProgressEvent extends TypedEvent {
- /** current value */
- public int current;
- /** total value */
- public int total;
-
- static final long serialVersionUID = 3977018427045393972L;
-
-/**
- * Constructs a new instance of this class.
- *
- * @param widget the widget that fired the event
- *
- * @since 3.5
- */
-public ProgressEvent(Widget widget) {
- super(widget);
-}
-
-/**
- * Returns a string containing a concise, human-readable
- * description of the receiver.
- *
- * @return a string representation of the event
- */
-public String toString() {
- String string = super.toString ();
- return string.substring (0, string.length() - 1) // remove trailing '}'
- + " current=" + current
- + " total=" + total
- + "}";
-}
-}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Browser/common/org/eclipse/swt/browser/ProgressListener.java b/bundles/org.eclipse.swt/Eclipse SWT Browser/common/org/eclipse/swt/browser/ProgressListener.java
deleted file mode 100644
index 06fbc40f55..0000000000
--- a/bundles/org.eclipse.swt/Eclipse SWT Browser/common/org/eclipse/swt/browser/ProgressListener.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.swt.browser;
-
-import org.eclipse.swt.internal.SWTEventListener;
-
-/**
- * This listener interface may be implemented in order to receive
- * a {@link ProgressEvent} notification when a {@link Browser}
- * makes a progress in loading the current URL or when the
- * current URL has been loaded.
- *
- * @see Browser#addProgressListener(ProgressListener)
- * @see Browser#removeProgressListener(ProgressListener)
- * @see Browser#getUrl()
- *
- * @since 3.0
- */
-public interface ProgressListener extends SWTEventListener {
-
-/**
- * This method is called when a progress is made during the loading of the
- * current location.
- * <p>
- *
- * <p>The following fields in the <code>ProgressEvent</code> apply:
- * <ul>
- * <li>(in) current the progress for the location currently being loaded
- * <li>(in) total the maximum progress for the location currently being loaded
- * <li>(in) widget the <code>Browser</code> whose current URL is being loaded
- * </ul>
- *
- * @param event the <code>ProgressEvent</code> related to the loading of the
- * current location of a <code>Browser</code>
- *
- * @since 3.0
- */
-public void changed(ProgressEvent event);
-
-/**
- * This method is called when the current location has been completely loaded.
- * <p>
- *
- * <p>The following fields in the <code>ProgressEvent</code> apply:
- * <ul>
- * <li>(in) widget the <code>Browser</code> whose current URL has been loaded
- * </ul>
- *
- * @param event the <code>ProgressEvent</code> related to the <code>Browser</code>
- * that has loaded its current URL.
- *
- * @since 3.0
- */
-public void completed(ProgressEvent event);
-}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Browser/common/org/eclipse/swt/browser/StatusTextEvent.java b/bundles/org.eclipse.swt/Eclipse SWT Browser/common/org/eclipse/swt/browser/StatusTextEvent.java
deleted file mode 100644
index 995d76498b..0000000000
--- a/bundles/org.eclipse.swt/Eclipse SWT Browser/common/org/eclipse/swt/browser/StatusTextEvent.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.swt.browser;
-
-import org.eclipse.swt.widgets.*;
-import org.eclipse.swt.events.*;
-
-/**
- * A <code>StatusTextEvent</code> is sent by a {@link Browser} to
- * {@link StatusTextListener}'s when the status text is changed.
- * The status text is typically displayed in the status bar of
- * a browser application.
- *
- * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
- *
- * @since 3.0
- */
-public class StatusTextEvent extends TypedEvent {
- /** status text */
- public String text;
-
- static final long serialVersionUID = 3258407348371600439L;
-
-/**
- * Constructs a new instance of this class.
- *
- * @param widget the widget that fired the event
- *
- * @since 3.5
- */
-public StatusTextEvent(Widget widget) {
- super(widget);
-}
-
-/**
- * Returns a string containing a concise, human-readable
- * description of the receiver.
- *
- * @return a string representation of the event
- */
-public String toString() {
- String string = super.toString ();
- return string.substring (0, string.length() - 1) // remove trailing '}'
- + " text=" + text
- + "}";
-}
-}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Browser/common/org/eclipse/swt/browser/StatusTextListener.java b/bundles/org.eclipse.swt/Eclipse SWT Browser/common/org/eclipse/swt/browser/StatusTextListener.java
deleted file mode 100644
index 68e23fbe3c..0000000000
--- a/bundles/org.eclipse.swt/Eclipse SWT Browser/common/org/eclipse/swt/browser/StatusTextListener.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.swt.browser;
-
-import org.eclipse.swt.internal.SWTEventListener;
-
-/**
- * This listener interface may be implemented in order to receive
- * a {@link StatusTextEvent} notification when the status text for
- * a {@link Browser} is changed.
- *
- * @see Browser#addStatusTextListener(StatusTextListener)
- * @see Browser#removeStatusTextListener(StatusTextListener)
- *
- * @since 3.0
- */
-public interface StatusTextListener extends SWTEventListener {
-
-/**
- * This method is called when the status text is changed. The
- * status text is typically displayed in the status bar of a browser
- * application.
- * <p>
- *
- * <p>The following fields in the <code>StatusTextEvent</code> apply:
- * <ul>
- * <li>(in) text the modified status text
- * <li>(in) widget the <code>Browser</code> whose status text is changed
- * </ul>
- *
- * @param event the <code>StatusTextEvent</code> that contains the updated
- * status description of a <code>Browser</code>
- *
- * @since 3.0
- */
-public void changed(StatusTextEvent event);
-}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Browser/common/org/eclipse/swt/browser/TitleEvent.java b/bundles/org.eclipse.swt/Eclipse SWT Browser/common/org/eclipse/swt/browser/TitleEvent.java
deleted file mode 100644
index d2d9eacb23..0000000000
--- a/bundles/org.eclipse.swt/Eclipse SWT Browser/common/org/eclipse/swt/browser/TitleEvent.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.swt.browser;
-
-import org.eclipse.swt.widgets.*;
-import org.eclipse.swt.events.*;
-
-/**
- * A <code>TitleEvent</code> is sent by a {@link Browser} to
- * {@link TitleListener}'s when the title of the current document
- * is available or when it is modified.
- *
- * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
- *
- * @since 3.0
- */
-public class TitleEvent extends TypedEvent {
- /** the title of the current document */
- public String title;
-
- static final long serialVersionUID = 4121132532906340919L;
-
-/**
- * Constructs a new instance of this class.
- *
- * @param widget the widget that fired the event
- *
- * @since 3.5
- */
-public TitleEvent(Widget widget) {
- super(widget);
-}
-
-/**
- * Returns a string containing a concise, human-readable
- * description of the receiver.
- *
- * @return a string representation of the event
- */
-public String toString() {
- String string = super.toString ();
- return string.substring (0, string.length() - 1) // remove trailing '}'
- + " title=" + title
- + "}";
-}
-}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Browser/common/org/eclipse/swt/browser/TitleListener.java b/bundles/org.eclipse.swt/Eclipse SWT Browser/common/org/eclipse/swt/browser/TitleListener.java
deleted file mode 100644
index a6cbaeb42b..0000000000
--- a/bundles/org.eclipse.swt/Eclipse SWT Browser/common/org/eclipse/swt/browser/TitleListener.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.swt.browser;
-
-import org.eclipse.swt.internal.SWTEventListener;
-
-/**
- * This listener interface may be implemented in order to receive
- * a {@link TitleEvent} notification when the title of the document
- * displayed in a {@link Browser} is known or has been changed.
- *
- * @see Browser#addTitleListener(TitleListener)
- * @see Browser#removeTitleListener(TitleListener)
- *
- * @since 3.0
- */
-public interface TitleListener extends SWTEventListener {
-
-/**
- * This method is called when the title of the current document
- * is available or has changed.
- * <p>
- *
- * <p>The following fields in the <code>TitleEvent</code> apply:
- * <ul>
- * <li>(in) title the title of the current document
- * <li>(in) widget the <code>Browser</code> whose current document's
- * title is known or modified
- * </ul>
- *
- * @param event the <code>TitleEvent</code> that contains the title
- * of the document currently displayed in a <code>Browser</code>
- *
- * @since 3.0
- */
-public void changed(TitleEvent event);
-}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Browser/common/org/eclipse/swt/browser/VisibilityWindowAdapter.java b/bundles/org.eclipse.swt/Eclipse SWT Browser/common/org/eclipse/swt/browser/VisibilityWindowAdapter.java
deleted file mode 100644
index 62808fa1c0..0000000000
--- a/bundles/org.eclipse.swt/Eclipse SWT Browser/common/org/eclipse/swt/browser/VisibilityWindowAdapter.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2008 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.swt.browser;
-
-/**
- * This adapter class provides default implementations for the
- * methods described by the {@link VisibilityWindowListener} interface.
- * <p>
- * Classes that wish to deal with {@link WindowEvent}'s can
- * extend this class and override only the methods which they are
- * interested in.
- * </p>
- *
- * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
- *
- * @since 3.0
- */
-public abstract class VisibilityWindowAdapter implements VisibilityWindowListener {
-
-public void hide(WindowEvent event) {
-}
-
-public void show(WindowEvent event) {
-}
-}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Browser/common/org/eclipse/swt/browser/VisibilityWindowListener.java b/bundles/org.eclipse.swt/Eclipse SWT Browser/common/org/eclipse/swt/browser/VisibilityWindowListener.java
deleted file mode 100644
index 78833d93ea..0000000000
--- a/bundles/org.eclipse.swt/Eclipse SWT Browser/common/org/eclipse/swt/browser/VisibilityWindowListener.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2007 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.swt.browser;
-
-import org.eclipse.swt.internal.SWTEventListener;
-
-/**
- * This listener interface may be implemented in order to receive
- * a {@link WindowEvent} notification when a window hosting a
- * {@link Browser} needs to be displayed or hidden.
- *
- * @see Browser#addVisibilityWindowListener(VisibilityWindowListener)
- * @see Browser#removeVisibilityWindowListener(VisibilityWindowListener)
- * @see OpenWindowListener
- * @see CloseWindowListener
- *
- * @since 3.0
- */
-public interface VisibilityWindowListener extends SWTEventListener {
-
-/**
- * This method is called when the window hosting a <code>Browser</code>
- * is requested to be hidden. Application would typically hide the
- * {@link org.eclipse.swt.widgets.Shell} that hosts the <code>Browser</code>.
- * <p>
- *
- * <p>The following fields in the <code>WindowEvent</code> apply:
- * <ul>
- * <li>(in) widget the <code>Browser</code> that needs to be hidden
- * </ul>
- *
- * @param event the <code>WindowEvent</code> that specifies the
- * <code>Browser</code> that needs to be hidden
- *
- * @see org.eclipse.swt.widgets.Shell#setVisible(boolean)
- *
- * @since 3.0
- */
-public void hide(WindowEvent event);
-
-/**
- * This method is called when the window hosting a <code>Browser</code>
- * is requested to be displayed. Application would typically set the
- * location and the size of the {@link org.eclipse.swt.widgets.Shell}
- * that hosts the <code>Browser</code>, if a particular location and size
- * are specified. The application would then open that <code>Shell</code>.
- * <p>
- *
- * <p>The following fields in the <code>WindowEvent</code> apply:
- * <ul>
- * <li>(in) widget the <code>Browser</code> to display
- * <li>(in) location the requested location for the <code>Shell</code>
- * hosting the browser. It is <code>null</code> if no location is set.
- * <li>(in) size the requested size for the <code>Browser</code>.
- * The client area of the <code>Shell</code> hosting the
- * <code>Browser</code> should be large enough to accommodate that size.
- * It is <code>null</code> if no size is set.
- * <li>(in) addressBar <code>true</code> if the <code>Shell</code>
- * hosting the <code>Browser</code> should display an address bar or
- * <code>false</code> otherwise
- * <li>(in) menuBar <code>true</code> if the <code>Shell</code>
- * hosting the <code>Browser</code> should display a menu bar or
- * <code>false</code> otherwise
- * <li>(in) statusBar <code>true</code> if the <code>Shell</code>
- * hosting the <code>Browser</code> should display a status bar or
- * <code>false</code> otherwise
- * <li>(in) toolBar <code>true</code> if the <code>Shell</code>
- * hosting the <code>Browser</code> should display a tool bar or
- * <code>false</code> otherwise
- * </ul>
- *
- * @param event the <code>WindowEvent</code> that specifies the
- * <code>Browser</code> that needs to be displayed
- *
- * @see org.eclipse.swt.widgets.Control#setLocation(org.eclipse.swt.graphics.Point)
- * @see org.eclipse.swt.widgets.Control#setSize(org.eclipse.swt.graphics.Point)
- * @see org.eclipse.swt.widgets.Shell#open()
- *
- * @since 3.0
- */
-public void show(WindowEvent event);
-
-}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Browser/common/org/eclipse/swt/browser/WebBrowser.java b/bundles/org.eclipse.swt/Eclipse SWT Browser/common/org/eclipse/swt/browser/WebBrowser.java
deleted file mode 100644
index ea8ef4b38a..0000000000
--- a/bundles/org.eclipse.swt/Eclipse SWT Browser/common/org/eclipse/swt/browser/WebBrowser.java
+++ /dev/null
@@ -1,598 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.swt.browser;
-
-import java.util.*;
-
-import org.eclipse.swt.*;
-import org.eclipse.swt.widgets.*;
-
-abstract class WebBrowser {
- Browser browser;
- Hashtable functions = new Hashtable ();
- AuthenticationListener[] authenticationListeners = new AuthenticationListener[0];
- CloseWindowListener[] closeWindowListeners = new CloseWindowListener[0];
- LocationListener[] locationListeners = new LocationListener[0];
- OpenWindowListener[] openWindowListeners = new OpenWindowListener[0];
- ProgressListener[] progressListeners = new ProgressListener[0];
- StatusTextListener[] statusTextListeners = new StatusTextListener[0];
- TitleListener[] titleListeners = new TitleListener[0];
- VisibilityWindowListener[] visibilityWindowListeners = new VisibilityWindowListener[0];
- boolean jsEnabled = true;
- boolean jsEnabledChanged;
- int nextFunctionIndex = 1;
- Object evaluateResult;
-
- static final String ERROR_ID = "org.eclipse.swt.browser.error"; // $NON-NLS-1$
- static final String EXECUTE_ID = "SWTExecuteTemporaryFunction"; // $NON-NLS-1$
- static String CookieName, CookieValue, CookieUrl;
- static boolean CookieResult;
- static Runnable MozillaClearSessions, NativeClearSessions;
- static Runnable MozillaGetCookie, NativeGetCookie;
- static Runnable MozillaSetCookie, NativeSetCookie;
-
- /* Key Mappings */
- static final int [][] KeyTable = {
- /* Keyboard and Mouse Masks */
- {18, SWT.ALT},
- {16, SWT.SHIFT},
- {17, SWT.CONTROL},
- {224, SWT.COMMAND},
-
- /* Literal Keys */
- {65, 'a'},
- {66, 'b'},
- {67, 'c'},
- {68, 'd'},
- {69, 'e'},
- {70, 'f'},
- {71, 'g'},
- {72, 'h'},
- {73, 'i'},
- {74, 'j'},
- {75, 'k'},
- {76, 'l'},
- {77, 'm'},
- {78, 'n'},
- {79, 'o'},
- {80, 'p'},
- {81, 'q'},
- {82, 'r'},
- {83, 's'},
- {84, 't'},
- {85, 'u'},
- {86, 'v'},
- {87, 'w'},
- {88, 'x'},
- {89, 'y'},
- {90, 'z'},
- {48, '0'},
- {49, '1'},
- {50, '2'},
- {51, '3'},
- {52, '4'},
- {53, '5'},
- {54, '6'},
- {55, '7'},
- {56, '8'},
- {57, '9'},
- {32, ' '},
- {59, ';'},
- {61, '='},
- {188, ','},
- {190, '.'},
- {191, '/'},
- {219, '['},
- {221, ']'},
- {222, '\''},
- {192, '`'},
- {220, '\\'},
- {108, '|'},
-
- /* Non-Numeric Keypad Keys */
- {37, SWT.ARROW_LEFT},
- {39, SWT.ARROW_RIGHT},
- {38, SWT.ARROW_UP},
- {40, SWT.ARROW_DOWN},
- {45, SWT.INSERT},
- {36, SWT.HOME},
- {35, SWT.END},
- {46, SWT.DEL},
- {33, SWT.PAGE_UP},
- {34, SWT.PAGE_DOWN},
-
- /* Virtual and Ascii Keys */
- {8, SWT.BS},
- {13, SWT.CR},
- {9, SWT.TAB},
- {27, SWT.ESC},
- {12, SWT.DEL},
-
- /* Functions Keys */
- {112, SWT.F1},
- {113, SWT.F2},
- {114, SWT.F3},
- {115, SWT.F4},
- {116, SWT.F5},
- {117, SWT.F6},
- {118, SWT.F7},
- {119, SWT.F8},
- {120, SWT.F9},
- {121, SWT.F10},
- {122, SWT.F11},
- {123, SWT.F12},
- {124, SWT.F13},
- {125, SWT.F14},
- {126, SWT.F15},
- {127, 0},
- {128, 0},
- {129, 0},
- {130, 0},
- {131, 0},
- {132, 0},
- {133, 0},
- {134, 0},
- {135, 0},
-
- /* Numeric Keypad Keys */
- {96, SWT.KEYPAD_0},
- {97, SWT.KEYPAD_1},
- {98, SWT.KEYPAD_2},
- {99, SWT.KEYPAD_3},
- {100, SWT.KEYPAD_4},
- {101, SWT.KEYPAD_5},
- {102, SWT.KEYPAD_6},
- {103, SWT.KEYPAD_7},
- {104, SWT.KEYPAD_8},
- {105, SWT.KEYPAD_9},
- {14, SWT.KEYPAD_CR},
- {107, SWT.KEYPAD_ADD},
- {109, SWT.KEYPAD_SUBTRACT},
- {106, SWT.KEYPAD_MULTIPLY},
- {111, SWT.KEYPAD_DIVIDE},
- {110, SWT.KEYPAD_DECIMAL},
-
- /* Other keys */
- {20, SWT.CAPS_LOCK},
- {144, SWT.NUM_LOCK},
- {145, SWT.SCROLL_LOCK},
- {44, SWT.PRINT_SCREEN},
- {6, SWT.HELP},
- {19, SWT.PAUSE},
- {3, SWT.BREAK},
-
- /* Safari-specific */
- {186, ';'},
- {187, '='},
- {189, '-'},
- };
-
-public class EvaluateFunction extends BrowserFunction {
- public EvaluateFunction (Browser browser, String name) {
- super (browser, name, false);
- }
- public Object function (Object[] arguments) {
- if (arguments[0] instanceof String) {
- String string = (String)arguments[0];
- if (string.startsWith (ERROR_ID)) {
- String errorString = ExtractError (string);
- if (errorString.length () > 0) {
- evaluateResult = new SWTException (SWT.ERROR_FAILED_EVALUATE, errorString);
- } else {
- evaluateResult = new SWTException (SWT.ERROR_FAILED_EVALUATE);
- }
- return null;
- }
- }
- evaluateResult = arguments[0];
- return null;
- }
-}
-
-public void addAuthenticationListener (AuthenticationListener listener) {
- AuthenticationListener[] newAuthenticationListeners = new AuthenticationListener[authenticationListeners.length + 1];
- System.arraycopy(authenticationListeners, 0, newAuthenticationListeners, 0, authenticationListeners.length);
- authenticationListeners = newAuthenticationListeners;
- authenticationListeners[authenticationListeners.length - 1] = listener;
-}
-
-public void addCloseWindowListener (CloseWindowListener listener) {
- CloseWindowListener[] newCloseWindowListeners = new CloseWindowListener[closeWindowListeners.length + 1];
- System.arraycopy(closeWindowListeners, 0, newCloseWindowListeners, 0, closeWindowListeners.length);
- closeWindowListeners = newCloseWindowListeners;
- closeWindowListeners[closeWindowListeners.length - 1] = listener;
-}
-
-public void addLocationListener (LocationListener listener) {
- LocationListener[] newLocationListeners = new LocationListener[locationListeners.length + 1];
- System.arraycopy(locationListeners, 0, newLocationListeners, 0, locationListeners.length);
- locationListeners = newLocationListeners;
- locationListeners[locationListeners.length - 1] = listener;
-}
-
-public void addOpenWindowListener (OpenWindowListener listener) {
- OpenWindowListener[] newOpenWindowListeners = new OpenWindowListener[openWindowListeners.length + 1];
- System.arraycopy(openWindowListeners, 0, newOpenWindowListeners, 0, openWindowListeners.length);
- openWindowListeners = newOpenWindowListeners;
- openWindowListeners[openWindowListeners.length - 1] = listener;
-}
-
-public void addProgressListener (ProgressListener listener) {
- ProgressListener[] newProgressListeners = new ProgressListener[progressListeners.length + 1];
- System.arraycopy(progressListeners, 0, newProgressListeners, 0, progressListeners.length);
- progressListeners = newProgressListeners;
- progressListeners[progressListeners.length - 1] = listener;
-}
-
-public void addStatusTextListener (StatusTextListener listener) {
- StatusTextListener[] newStatusTextListeners = new StatusTextListener[statusTextListeners.length + 1];
- System.arraycopy(statusTextListeners, 0, newStatusTextListeners, 0, statusTextListeners.length);
- statusTextListeners = newStatusTextListeners;
- statusTextListeners[statusTextListeners.length - 1] = listener;
-}
-
-public void addTitleListener (TitleListener listener) {
- TitleListener[] newTitleListeners = new TitleListener[titleListeners.length + 1];
- System.arraycopy(titleListeners, 0, newTitleListeners, 0, titleListeners.length);
- titleListeners = newTitleListeners;
- titleListeners[titleListeners.length - 1] = listener;
-}
-
-public void addVisibilityWindowListener (VisibilityWindowListener listener) {
- VisibilityWindowListener[] newVisibilityWindowListeners = new VisibilityWindowListener[visibilityWindowListeners.length + 1];
- System.arraycopy(visibilityWindowListeners, 0, newVisibilityWindowListeners, 0, visibilityWindowListeners.length);
- visibilityWindowListeners = newVisibilityWindowListeners;
- visibilityWindowListeners[visibilityWindowListeners.length - 1] = listener;
-}
-
-public abstract boolean back ();
-
-public static void clearSessions () {
- if (NativeClearSessions != null) NativeClearSessions.run ();
- if (MozillaClearSessions != null) MozillaClearSessions.run ();
-}
-
-public static String GetCookie (String name, String url) {
- CookieName = name; CookieUrl = url;
- if (NativeGetCookie != null) NativeGetCookie.run ();
- if (MozillaGetCookie != null) MozillaGetCookie.run ();
- String result = CookieValue;
- CookieName = CookieValue = CookieUrl = null;
- return result;
-}
-
-public static boolean SetCookie (String value, String url) {
- CookieValue = value; CookieUrl = url;
- CookieResult = false;
- if (NativeSetCookie != null) NativeSetCookie.run ();
- if (MozillaSetCookie != null) MozillaSetCookie.run ();
- CookieValue = CookieUrl = null;
- return CookieResult;
-}
-
-public abstract void create (Composite parent, int style);
-
-static String CreateErrorString (String error) {
- return ERROR_ID + error;
-}
-
-static String ExtractError (String error) {
- return error.substring (ERROR_ID.length ());
-}
-
-public void createFunction (BrowserFunction function) {
- /*
- * If an existing function with the same name is found then
- * remove it so that it is not recreated on subsequent pages
- * (the new function overwrites the old one).
- */
- Enumeration keys = functions.keys ();
- while (keys.hasMoreElements ()) {
- Object key = keys.nextElement ();
- BrowserFunction current = (BrowserFunction)functions.get (key);
- if (current.name.equals (function.name)) {
- functions.remove (key);
- break;
- }
- }
-
- function.index = getNextFunctionIndex ();
- registerFunction (function);
-
- StringBuffer buffer = new StringBuffer ("window."); //$NON-NLS-1$
- buffer.append (function.name);
- buffer.append (" = function "); //$NON-NLS-1$
- buffer.append (function.name);
- buffer.append ("() {var result = window.external.callJava("); //$NON-NLS-1$
- buffer.append (function.index);
- buffer.append (",Array.prototype.slice.call(arguments)); if (typeof result == 'string' && result.indexOf('"); //$NON-NLS-1$
- buffer.append (ERROR_ID);
- buffer.append ("') == 0) {var error = new Error(result.substring("); //$NON-NLS-1$
- buffer.append (ERROR_ID.length ());
- buffer.append (")); throw error;} return result;};"); //$NON-NLS-1$
- buffer.append ("for (var i = 0; i < frames.length; i++) {try { frames[i]."); //$NON-NLS-1$
- buffer.append (function.name);
- buffer.append (" = window."); //$NON-NLS-1$
- buffer.append (function.name);
- buffer.append (";} catch (e) {} };"); //$NON-NLS-1$
- function.functionString = buffer.toString ();
- execute (function.functionString);
-}
-
-void deregisterFunction (BrowserFunction function) {
- functions.remove (new Integer (function.index));
-}
-
-public void destroyFunction (BrowserFunction function) {
- String deleteString = getDeleteFunctionString (function.name);
- StringBuffer buffer = new StringBuffer ("for (var i = 0; i < frames.length; i++) {try {frames[i].eval(\""); //$NON-NLS-1$
- buffer.append (deleteString);
- buffer.append ("\");} catch (e) {}}"); //$NON-NLS-1$
- execute (buffer.toString ());
- execute (deleteString);
- deregisterFunction (function);
-}
-
-public abstract boolean execute (String script);
-
-public Object evaluate (String script) throws SWTException {
- BrowserFunction function = new EvaluateFunction (browser, ""); // $NON-NLS-1$
- int index = getNextFunctionIndex ();
- function.index = index;
- function.isEvaluate = true;
- registerFunction (function);
- String functionName = EXECUTE_ID + index;
-
- StringBuffer buffer = new StringBuffer ("window."); // $NON-NLS-1$
- buffer.append (functionName);
- buffer.append (" = function "); // $NON-NLS-1$
- buffer.append (functionName);
- buffer.append ("() {\n"); // $NON-NLS-1$
- buffer.append (script);
- buffer.append ("\n};"); // $NON-NLS-1$
- execute (buffer.toString ());
-
- buffer = new StringBuffer ("if (window."); // $NON-NLS-1$
- buffer.append (functionName);
- buffer.append (" == undefined) {window.external.callJava("); // $NON-NLS-1$
- buffer.append (index);
- buffer.append (", ['"); // $NON-NLS-1$
- buffer.append (ERROR_ID);
- buffer.append ("']);} else {try {var result = "); // $NON-NLS-1$
- buffer.append (functionName);
- buffer.append ("(); window.external.callJava("); // $NON-NLS-1$
- buffer.append (index);
- buffer.append (", [result]);} catch (e) {window.external.callJava("); // $NON-NLS-1$
- buffer.append (index);
- buffer.append (", ['"); // $NON-NLS-1$
- buffer.append (ERROR_ID);
- buffer.append ("' + e.message]);}}"); // $NON-NLS-1$
- execute (buffer.toString ());
- execute (getDeleteFunctionString (functionName));
- deregisterFunction (function);
-
- Object result = evaluateResult;
- evaluateResult = null;
- if (result instanceof SWTException) throw (SWTException)result;
- return result;
-}
-
-public abstract boolean forward ();
-
-public abstract String getBrowserType ();
-
-String getDeleteFunctionString (String functionName) {
- return "delete window." + functionName; //$NON-NLS-1$
-}
-
-int getNextFunctionIndex () {
- return nextFunctionIndex++;
-}
-
-public abstract String getText ();
-
-public abstract String getUrl ();
-
-public Object getWebBrowser () {
- return null;
-}
-
-public abstract boolean isBackEnabled ();
-
-public boolean isFocusControl () {
- return false;
-}
-
-public abstract boolean isForwardEnabled ();
-
-public abstract void refresh ();
-
-void registerFunction (BrowserFunction function) {
- functions.put (new Integer (function.index), function);
-}
-
-public void removeAuthenticationListener (AuthenticationListener listener) {
- if (authenticationListeners.length == 0) return;
- int index = -1;
- for (int i = 0; i < authenticationListeners.length; i++) {
- if (listener == authenticationListeners[i]) {
- index = i;
- break;
- }
- }
- if (index == -1) return;
- if (authenticationListeners.length == 1) {
- authenticationListeners = new AuthenticationListener[0];
- return;
- }
- AuthenticationListener[] newAuthenticationListeners = new AuthenticationListener[authenticationListeners.length - 1];
- System.arraycopy (authenticationListeners, 0, newAuthenticationListeners, 0, index);
- System.arraycopy (authenticationListeners, index + 1, newAuthenticationListeners, index, authenticationListeners.length - index - 1);
- authenticationListeners = newAuthenticationListeners;
-}
-
-public void removeCloseWindowListener (CloseWindowListener listener) {
- if (closeWindowListeners.length == 0) return;
- int index = -1;
- for (int i = 0; i < closeWindowListeners.length; i++) {
- if (listener == closeWindowListeners[i]){
- index = i;
- break;
- }
- }
- if (index == -1) return;
- if (closeWindowListeners.length == 1) {
- closeWindowListeners = new CloseWindowListener[0];
- return;
- }
- CloseWindowListener[] newCloseWindowListeners = new CloseWindowListener[closeWindowListeners.length - 1];
- System.arraycopy (closeWindowListeners, 0, newCloseWindowListeners, 0, index);
- System.arraycopy (closeWindowListeners, index + 1, newCloseWindowListeners, index, closeWindowListeners.length - index - 1);
- closeWindowListeners = newCloseWindowListeners;
-}
-
-public void removeLocationListener (LocationListener listener) {
- if (locationListeners.length == 0) return;
- int index = -1;
- for (int i = 0; i < locationListeners.length; i++) {
- if (listener == locationListeners[i]){
- index = i;
- break;
- }
- }
- if (index == -1) return;
- if (locationListeners.length == 1) {
- locationListeners = new LocationListener[0];
- return;
- }
- LocationListener[] newLocationListeners = new LocationListener[locationListeners.length - 1];
- System.arraycopy (locationListeners, 0, newLocationListeners, 0, index);
- System.arraycopy (locationListeners, index + 1, newLocationListeners, index, locationListeners.length - index - 1);
- locationListeners = newLocationListeners;
-}
-
-public void removeOpenWindowListener (OpenWindowListener listener) {
- if (openWindowListeners.length == 0) return;
- int index = -1;
- for (int i = 0; i < openWindowListeners.length; i++) {
- if (listener == openWindowListeners[i]){
- index = i;
- break;
- }
- }
- if (index == -1) return;
- if (openWindowListeners.length == 1) {
- openWindowListeners = new OpenWindowListener[0];
- return;
- }
- OpenWindowListener[] newOpenWindowListeners = new OpenWindowListener[openWindowListeners.length - 1];
- System.arraycopy (openWindowListeners, 0, newOpenWindowListeners, 0, index);
- System.arraycopy (openWindowListeners, index + 1, newOpenWindowListeners, index, openWindowListeners.length - index - 1);
- openWindowListeners = newOpenWindowListeners;
-}
-
-public void removeProgressListener (ProgressListener listener) {
- if (progressListeners.length == 0) return;
- int index = -1;
- for (int i = 0; i < progressListeners.length; i++) {
- if (listener == progressListeners[i]){
- index = i;
- break;
- }
- }
- if (index == -1) return;
- if (progressListeners.length == 1) {
- progressListeners = new ProgressListener[0];
- return;
- }
- ProgressListener[] newProgressListeners = new ProgressListener[progressListeners.length - 1];
- System.arraycopy (progressListeners, 0, newProgressListeners, 0, index);
- System.arraycopy (progressListeners, index + 1, newProgressListeners, index, progressListeners.length - index - 1);
- progressListeners = newProgressListeners;
-}
-
-public void removeStatusTextListener (StatusTextListener listener) {
- if (statusTextListeners.length == 0) return;
- int index = -1;
- for (int i = 0; i < statusTextListeners.length; i++) {
- if (listener == statusTextListeners[i]){
- index = i;
- break;
- }
- }
- if (index == -1) return;
- if (statusTextListeners.length == 1) {
- statusTextListeners = new StatusTextListener[0];
- return;
- }
- StatusTextListener[] newStatusTextListeners = new StatusTextListener[statusTextListeners.length - 1];
- System.arraycopy (statusTextListeners, 0, newStatusTextListeners, 0, index);
- System.arraycopy (statusTextListeners, index + 1, newStatusTextListeners, index, statusTextListeners.length - index - 1);
- statusTextListeners = newStatusTextListeners;
-}
-
-public void removeTitleListener (TitleListener listener) {
- if (titleListeners.length == 0) return;
- int index = -1;
- for (int i = 0; i < titleListeners.length; i++) {
- if (listener == titleListeners[i]){
- index = i;
- break;
- }
- }
- if (index == -1) return;
- if (titleListeners.length == 1) {
- titleListeners = new TitleListener[0];
- return;
- }
- TitleListener[] newTitleListeners = new TitleListener[titleListeners.length - 1];
- System.arraycopy (titleListeners, 0, newTitleListeners, 0, index);
- System.arraycopy (titleListeners, index + 1, newTitleListeners, index, titleListeners.length - index - 1);
- titleListeners = newTitleListeners;
-}
-
-public void removeVisibilityWindowListener (VisibilityWindowListener listener) {
- if (visibilityWindowListeners.length == 0) return;
- int index = -1;
- for (int i = 0; i < visibilityWindowListeners.length; i++) {
- if (listener == visibilityWindowListeners[i]){
- index = i;
- break;
- }
- }
- if (index == -1) return;
- if (visibilityWindowListeners.length == 1) {
- visibilityWindowListeners = new VisibilityWindowListener[0];
- return;
- }
- VisibilityWindowListener[] newVisibilityWindowListeners = new VisibilityWindowListener[visibilityWindowListeners.length - 1];
- System.arraycopy (visibilityWindowListeners, 0, newVisibilityWindowListeners, 0, index);
- System.arraycopy (visibilityWindowListeners, index + 1, newVisibilityWindowListeners, index, visibilityWindowListeners.length - index - 1);
- visibilityWindowListeners = newVisibilityWindowListeners;
-}
-
-public void setBrowser (Browser browser) {
- this.browser = browser;
-}
-
-public abstract boolean setText (String html);
-
-public abstract boolean setUrl (String url);
-
-public abstract void stop ();
-
-int translateKey (int key) {
- for (int i = 0; i < KeyTable.length; i++) {
- if (KeyTable[i][0] == key) return KeyTable[i][1];
- }
- return 0;
-}
-}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Browser/common/org/eclipse/swt/browser/WindowEvent.java b/bundles/org.eclipse.swt/Eclipse SWT Browser/common/org/eclipse/swt/browser/WindowEvent.java
deleted file mode 100644
index ae7551533a..0000000000
--- a/bundles/org.eclipse.swt/Eclipse SWT Browser/common/org/eclipse/swt/browser/WindowEvent.java
+++ /dev/null
@@ -1,218 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2009 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are 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:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.swt.browser;
-
-import org.eclipse.swt.widgets.*;
-import org.eclipse.swt.events.*;
-import org.eclipse.swt.graphics.*;
-
-/**
- * A <code>WindowEvent</code> is sent by a {@link Browser} when
- * a new window needs to be created or when an existing window needs to be
- * closed. This notification occurs when a javascript command such as
- * <code>window.open</code> or <code>window.close</code> gets executed by
- * a <code>Browser</code>.
- *
- * <p>
- * The following example shows how <code>WindowEvent</code>'s are typically
- * handled.
- *
- * <code><pre>
- * public static void main(String[] args) {
- * Display display = new Display();
- * Shell shell = new Shell(display);
- * shell.setText("Main Window");
- * shell.setLayout(new FillLayout());
- * Browser browser = new Browser(shell, SWT.NONE);
- * initialize(display, browser);
- * shell.open();
- * browser.setUrl("http://www.eclipse.org");
- * while (!shell.isDisposed()) {
- * if (!display.readAndDispatch())
- * display.sleep();
- * }
- * display.dispose();
- * }
- *
- * static void initialize(final Display display, Browser browser) {
- * browser.addOpenWindowListener(new OpenWindowListener() {
- * public void open(WindowEvent event) {
- * // Certain platforms can provide a default full browser.
- * // simply return in that case if the application prefers
- * // the default full browser to the embedded one set below.
- * if (!event.required) return;
- *
- * // Embed the new window
- * Shell shell = new Shell(display);
- * shell.setText("New Window");
- * shell.setLayout(new FillLayout());
- * Browser browser = new Browser(shell, SWT.NONE);
- * initialize(display, browser);
- * event.browser = browser;
- * }
- * });
- * browser.addVisibilityWindowListener(new VisibilityWindowListener() {
- * public void hide(WindowEvent event) {
- * Browser browser = (Browser)event.widget;
- * Shell shell = browser.getShell();
- * shell.setVisible(false);
- * }
- * public void show(WindowEvent event) {
- * Browser browser = (Browser)event.widget;
- * Shell shell = browser.getShell();
- * if (event.location != null) shell.setLocation(event.location);
- * if (event.size != null) {
- * Point size = event.size;
- * shell.setSize(shell.computeSize(size.x, size.y));
- * }
- * if (event.addressBar || event.menuBar || event.statusBar || event.toolBar) {
- * // Create widgets for the address bar, menu bar, status bar and/or tool bar
- * // leave enough space in the Shell to accommodate a Browser of the size
- * // given by event.size
- * }
- * shell.open();
- * }
- * });
- * browser.addCloseWindowListener(new CloseWindowListener() {
- * public void close(WindowEvent event) {
- * Browser browser = (Browser)event.widget;
- * Shell shell = browser.getShell();
- * shell.close();
- * }
- * });
- * }
- * </pre></code>
- *
- * The following notifications are emitted when the user selects a hyperlink that targets a new window
- * or as the result of a javascript that executes window.open.
- *
- * <p>Main Browser
- * <ul>
- * <li>User selects a link that opens in a new window or javascript requests a new window</li>
- * <li>OpenWindowListener.open() notified</li>
- * <ul>
- * <li>Application creates a new Shell and a second Browser inside that Shell</li>
- * <li>Application registers WindowListener's on that second Browser, such as VisibilityWindowListener</li>
- * <li>Application returns the second Browser as the host for the new window content</li>
- * </ul>
- * </ul>
- *
- * <p>Second Browser
- * <ul>
- * <li>VisibilityWindowListener.show() notified</li>
- * <ul>
- * <li>Application sets navigation tool bar, status bar, menu bar and Shell size
- * <li>Application makes the Shell hosting the second Browser visible
- * <li>User now sees the new window
- * </ul>
- * </ul>
- *
- * @see CloseWindowListener
- * @see OpenWindowListener
- * @see VisibilityWindowListener
- * @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>
- *
- * @since 3.0
- */
-public class WindowEvent extends TypedEvent {
-
- /**
- * Specifies whether the platform requires the user to provide a
- * <code>Browser</code> to handle the new window.
- *
- * @since 3.1
- */
- public boolean required;
-
-
- /**
- * <code>Browser</code> provided by the application.
- */
- public Browser browser;
-
- /**
- * Requested location for the <code>Shell</code> hosting the <code>Browser</code>.
- * It is <code>null</code> if no location has been requested.
- */
- public Point location;
-
- /**
- * Requested <code>Browser</code> size. The client area of the <code>Shell</code>
- * hosting the <code>Browser</code> should be large enough to accommodate that size.
- * It is <code>null</code> if no size has been requested.
- */
- public Point size;
-
- /**
- * Specifies whether the <code>Shell</code> hosting the <code>Browser</code> should
- * display an address bar.
- *
- * @since 3.1
- */
- public boolean addressBar;
-
- /**
- * Specifies whether the <code>Shell</code> hosting the <code>Browser</code> should
- * display a menu bar. Note that this is always <code>true</code> on OS X.
- *
- * @since 3.1
- */
- public boolean menuBar;
-
- /**
- * Specifies whether the <code>Shell</code> hosting the <code>Browser</code> should
- * display a status bar.
- *
- * @since 3.1
- */
- public boolean statusBar;
-
- /**
- * Specifies whether the <code>Shell</code> hosting the <code>Browser</code> should
- * display a tool bar.
- *
- * @since 3.1
- */
- public boolean toolBar;
-
- static final long serialVersionUID = 3617851997387174969L;
-
-/**
- * Constructs a new instance of this class.
- *
- * @param widget the widget that fired the event
- *
- * @since 3.5
- */
-public WindowEvent(Widget widget) {
- super(widget);
-}
-
-/**
- * Returns a string containing a concise, human-readable
- * description of the receiver.
- *
- * @return a string representation of the event
- */
-public String toString() {
- String string = super.toString ();
- return string.substring (0, string.length() - 1) // remove trailing '}'
- + " required=" + required
- + " browser=" + browser
- + " location=" + location
- + " size=" + size
- + " addressBar=" + addressBar
- + " menuBar=" + menuBar
- + " statusBar=" + statusBar
- + " toolBar=" + toolBar
- + "}";
-}
-}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Browser/common/org/eclipse/swt/browser/package.html b/bundles/org.eclipse.swt/Eclipse SWT Browser/common/org/eclipse/swt/browser/package.html
deleted file mode 100644
index f64b6c4847..0000000000
--- a/bundles/org.eclipse.swt/Eclipse SWT Browser/common/org/eclipse/swt/browser/package.html
+++ /dev/null
@@ -1,15 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
-<html>
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
- <meta name="Author" content="IBM">
- <title>Package-level Javadoc</title>
-</head>
-<body>
-SWT Browser widget.
-<h2>
-Package Specification</h2>
-This package provides the classes to implement the browser user interface
-metaphor.
-</body>
-</html>