diff options
author | Christophe Cornu <ccornu> | 2003-12-05 17:24:19 +0000 |
---|---|---|
committer | Christophe Cornu <ccornu> | 2003-12-05 17:24:19 +0000 |
commit | 4c34839a26365eaadaaf6fb5819b82fe74ef0f2a (patch) | |
tree | 95b05c8967e02ae892b9236acbdef1a7dfddf761 /bundles | |
parent | c20df65da31901357ff40e6d1c45035edeef54af (diff) | |
download | eclipse.platform.swt-4c34839a26365eaadaaf6fb5819b82fe74ef0f2a.tar.gz eclipse.platform.swt-4c34839a26365eaadaaf6fb5819b82fe74ef0f2a.tar.xz eclipse.platform.swt-4c34839a26365eaadaaf6fb5819b82fe74ef0f2a.zip |
48168 - event renaming
Diffstat (limited to 'bundles')
10 files changed, 42 insertions, 133 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Browser/common/org/eclipse/swt/browser/CloseWindowEvent.java b/bundles/org.eclipse.swt/Eclipse SWT Browser/common/org/eclipse/swt/browser/CloseWindowEvent.java deleted file mode 100644 index a78acd983c..0000000000 --- a/bundles/org.eclipse.swt/Eclipse SWT Browser/common/org/eclipse/swt/browser/CloseWindowEvent.java +++ /dev/null @@ -1,42 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.swt.browser; - -import org.eclipse.swt.widgets.*; -import org.eclipse.swt.events.*; - -/** - * This event is sent to CloseWindowListeners when a script - * requesting to close a window is executed. For example, - * the javascript command <code>window.close()</code> will - * trigger a CloseWindow event when it is run. - * </p> - * - * <p> - * An application typically handles this notification by closing - * the Shell associated to the Browser. - * </p> - * - * <p> - * NOTE: The API in the browser package is NOT finalized. - * Use at your own risk, because it will most certainly change. - * The only reason this API is being released at this time is so that - * other teams can try it out. - * </p> - * - * @since 3.0 - */ -public class CloseWindowEvent extends TypedEvent { - -CloseWindowEvent(Widget w) { - super(w); -} -} 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 index f545a72520..1b6bd1a4d5 100644 --- 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 @@ -14,7 +14,7 @@ import org.eclipse.swt.internal.SWTEventListener; /** * This listener interface may be implemented in order to receive - * CloseWindowEvents. + * WindowEvents. * * <p> * NOTE: The API in the browser package is NOT finalized. @@ -23,7 +23,7 @@ import org.eclipse.swt.internal.SWTEventListener; * other teams can try it out. * </p> * - * @see CloseWindowEvent + * @see WindowEvent * * @since 3.0 */ @@ -37,9 +37,9 @@ public interface CloseWindowListener extends SWTEventListener { * * @param event.widget the browser that is going to be disposed * - * @see CloseWindowEvent + * @see WindowEvent * * @since 3.0 */ -public void close(CloseWindowEvent event); +public void close(WindowEvent event); } diff --git a/bundles/org.eclipse.swt/Eclipse SWT Browser/common/org/eclipse/swt/browser/OpenWindowEvent.java b/bundles/org.eclipse.swt/Eclipse SWT Browser/common/org/eclipse/swt/browser/OpenWindowEvent.java deleted file mode 100644 index cf591fc4b3..0000000000 --- a/bundles/org.eclipse.swt/Eclipse SWT Browser/common/org/eclipse/swt/browser/OpenWindowEvent.java +++ /dev/null @@ -1,54 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2003 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.swt.browser; - -import org.eclipse.swt.widgets.*; -import org.eclipse.swt.events.*; - -/** - * This event is sent to OpenWindowListeners when a new Browser is - * requested. - * - * <p> - * This event is typically sent when a script requesting a new - * instance is executed. For example, the javascript command - * <code>window.open("document.html", "Document")</code> will - * trigger an OpenWindow event when it is run. - * </p> - * - * <p> - * The default behaviour is to ignore new window requests and cancel - * the navigation request. To handle new window requests, - * the application needs to create an instance of Browser and set it - * into the OpenWindowEvent.browser field. - * </p> - * - * <p> - * NOTE: The API in the browser package is NOT finalized. - * Use at your own risk, because it will most certainly change. - * The only reason this API is being released at this time is so that - * other teams can try it out. - * </p> - * - * @since 3.0 - */ -public class OpenWindowEvent extends TypedEvent { - - /** - * Browser provided by the application. Default is null and null - * will cancel the associated navigation request. - */ - public Browser browser; - -OpenWindowEvent(Widget w) { - super(w); -} -} 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 index 6aa7fbb05d..6a8f9791ac 100644 --- 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 @@ -14,7 +14,7 @@ import org.eclipse.swt.internal.SWTEventListener; /** * This listener interface may be implemented in order to receive - * OpenWindowEvents. + * WindowEvents. * * <p> * NOTE: The API in the browser package is NOT finalized. @@ -23,7 +23,7 @@ import org.eclipse.swt.internal.SWTEventListener; * other teams can try it out. * </p> * - * @see OpenWindowEvent + * @see WindowEvent * * @since 3.0 */ @@ -35,9 +35,9 @@ public interface OpenWindowListener extends SWTEventListener { * * @param event.browser the browser that will be used to display the navigation request * - * @see OpenWindowEvent + * @see WindowEvent * * @since 3.0 */ -public void open(OpenWindowEvent event); +public void open(WindowEvent 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 index f17a7f34bb..b7bfeeb495 100644 --- 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 @@ -14,7 +14,7 @@ package org.eclipse.swt.browser; * This adapter class provides default implementations for the * methods described by the <code>VisibilityWindowListener</code> interface. * <p> - * Classes that wish to deal with <code>VisibilityWindowEvent</code>s can + * Classes that wish to deal with <code>WindowEvent</code>s can * extend this class and override only the methods which they are * interested in. * </p><p> @@ -25,7 +25,7 @@ package org.eclipse.swt.browser; * </p> * * @see VisibilityWindowListener - * @see VisibilityWindowEvent + * @see WindowEvent */ public abstract class VisibilityWindowAdapter implements VisibilityWindowListener { @@ -35,11 +35,11 @@ public abstract class VisibilityWindowAdapter implements VisibilityWindowListene * * @param event.widget the browser to hide * - * @see VisibilityWindowEvent + * @see WindowEvent * * @since 3.0 */ -public void hide(VisibilityWindowEvent event) { +public void hide(WindowEvent event) { } /** @@ -50,10 +50,10 @@ public void hide(VisibilityWindowEvent event) { * @param event.location if not null, the requested location for the Shell hosting the browser * @param event.size if not null, the requested size for the Shell hosting the browser * - * @see VisibilityWindowEvent + * @see WindowEvent * * @since 3.0 */ -public void show(VisibilityWindowEvent event) { +public void show(WindowEvent event) { } }
\ No newline at end of file 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 index b74af78bd6..8108ed64b4 100644 --- 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 @@ -14,7 +14,7 @@ import org.eclipse.swt.internal.SWTEventListener; /** * This listener interface may be implemented in order to receive - * VisibilityWindowEvents. + * WindowEvents. * * <p> * NOTE: The API in the browser package is NOT finalized. @@ -23,7 +23,7 @@ import org.eclipse.swt.internal.SWTEventListener; * other teams can try it out. * </p> * - * @see VisibilityWindowEvent + * @see WindowEvent * * @since 3.0 */ @@ -35,11 +35,11 @@ public interface VisibilityWindowListener extends SWTEventListener { * * @param event.widget the browser to hide * - * @see VisibilityWindowEvent + * @see WindowEvent * * @since 3.0 */ -public void hide(VisibilityWindowEvent event); +public void hide(WindowEvent event); /** * This method is called when the Browser is requested to be displayed. @@ -49,10 +49,10 @@ public void hide(VisibilityWindowEvent event); * @param event.location if not null, the requested location for the Shell hosting the browser * @param event.size if not null, the requested size for the Shell hosting the browser * - * @see VisibilityWindowEvent + * @see WindowEvent * * @since 3.0 */ -public void show(VisibilityWindowEvent event); +public void show(WindowEvent event); } diff --git a/bundles/org.eclipse.swt/Eclipse SWT Browser/common/org/eclipse/swt/browser/VisibilityWindowEvent.java b/bundles/org.eclipse.swt/Eclipse SWT Browser/common/org/eclipse/swt/browser/WindowEvent.java index a6564a4ae6..3da5597f87 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Browser/common/org/eclipse/swt/browser/VisibilityWindowEvent.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Browser/common/org/eclipse/swt/browser/WindowEvent.java @@ -15,9 +15,8 @@ import org.eclipse.swt.events.*; import org.eclipse.swt.graphics.*; /** - * This event is sent to VisibilityWindowListeners when the Browser - * should be displayed or hidden. - * + * This event is sent to WindowListeners. + * * <p> * NOTE: The API in the browser package is NOT finalized. * Use at your own risk, because it will most certainly change. @@ -27,7 +26,13 @@ import org.eclipse.swt.graphics.*; * * @since 3.0 */ -public class VisibilityWindowEvent extends TypedEvent { +public class WindowEvent extends TypedEvent { + + /** + * Browser provided by the application. Default is null and null + * will cancel the associated navigation request. + */ + public Browser browser; /** * Requested location for the Shell hosting the Browser. Null if no location @@ -41,7 +46,7 @@ public class VisibilityWindowEvent extends TypedEvent { */ public Point size; -VisibilityWindowEvent(Widget w) { +WindowEvent(Widget w) { super(w); } } diff --git a/bundles/org.eclipse.swt/Eclipse SWT Browser/mozilla/org/eclipse/swt/browser/Browser.java b/bundles/org.eclipse.swt/Eclipse SWT Browser/mozilla/org/eclipse/swt/browser/Browser.java index 7fa315b4e7..9c474b24fc 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Browser/mozilla/org/eclipse/swt/browser/Browser.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Browser/mozilla/org/eclipse/swt/browser/Browser.java @@ -1550,8 +1550,8 @@ int SetChromeFlags(int aChromeFlags) { } int DestroyBrowserWindow() { - CloseWindowEvent newEvent = new CloseWindowEvent(this); - newEvent.data = getDisplay(); + WindowEvent newEvent = new WindowEvent(this); + newEvent.display = getDisplay(); newEvent.widget = this; for (int i = 0; i < closeWindowListeners.length; i++) closeWindowListeners[i].close(newEvent); @@ -1604,7 +1604,7 @@ int GetVisibility(int value) { } int SetVisibility(int value) { - VisibilityWindowEvent event = new VisibilityWindowEvent(this); + WindowEvent event = new WindowEvent(this); event.display = getDisplay(); event.widget = this; if (value == 1) { diff --git a/bundles/org.eclipse.swt/Eclipse SWT Browser/mozilla/org/eclipse/swt/browser/WindowCreator.java b/bundles/org.eclipse.swt/Eclipse SWT Browser/mozilla/org/eclipse/swt/browser/WindowCreator.java index 113e7182f9..33242477c2 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Browser/mozilla/org/eclipse/swt/browser/WindowCreator.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Browser/mozilla/org/eclipse/swt/browser/WindowCreator.java @@ -110,7 +110,7 @@ int CreateChromeWindow(int parent, int chromeFlags, int _retval) { Display display = Display.getCurrent(); Browser src = (Browser)display.findWidget(aParentNativeWindow[0]); - OpenWindowEvent event = new OpenWindowEvent(src); + WindowEvent event = new WindowEvent(src); event.display = display; event.widget = src; for (int i = 0; i < src.openWindowListeners.length; i++) diff --git a/bundles/org.eclipse.swt/Eclipse SWT Browser/win32/org/eclipse/swt/browser/Browser.java b/bundles/org.eclipse.swt/Eclipse SWT Browser/win32/org/eclipse/swt/browser/Browser.java index 6e2bf4e758..4cd0534736 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Browser/win32/org/eclipse/swt/browser/Browser.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Browser/win32/org/eclipse/swt/browser/Browser.java @@ -257,12 +257,12 @@ public Browser(Composite parent, int style) { break; } case NewWindow2 : { - OpenWindowEvent openEvent = new OpenWindowEvent(Browser.this); - openEvent.display = getDisplay(); - openEvent.widget = Browser.this; + WindowEvent newEvent = new WindowEvent(Browser.this); + newEvent.display = getDisplay(); + newEvent.widget = Browser.this; for (int i = 0; i < openWindowListeners.length; i++) - openWindowListeners[i].open(openEvent); - Browser browser = openEvent.browser; + openWindowListeners[i].open(newEvent); + Browser browser = newEvent.browser; boolean doit = browser != null && !browser.isDisposed(); if (doit) { Variant variant = new Variant(browser.auto); @@ -287,7 +287,7 @@ public Browser(Composite parent, int style) { case OnVisible : { Variant arg1 = event.arguments[0]; boolean visible = arg1.getBoolean(); - VisibilityWindowEvent newEvent = new VisibilityWindowEvent(Browser.this); + WindowEvent newEvent = new WindowEvent(Browser.this); newEvent.display = getDisplay(); newEvent.widget = Browser.this; if (visible) { @@ -334,8 +334,8 @@ public Browser(Composite parent, int style) { break; } case WindowClosing : { - CloseWindowEvent newEvent = new CloseWindowEvent(Browser.this); - newEvent.data = getDisplay(); + WindowEvent newEvent = new WindowEvent(Browser.this); + newEvent.display = getDisplay(); newEvent.widget = Browser.this; for (int i = 0; i < closeWindowListeners.length; i++) closeWindowListeners[i].close(newEvent); |