1 /*******************************************************************************
2 * Copyright (c) 2003, 2016 IBM Corporation and others.
4 * This program and the accompanying materials
5 * are made available under the terms of the Eclipse Public License 2.0
6 * which accompanies this distribution, and is available at
7 * https://www.eclipse.org/legal/epl-2.0/
9 * SPDX-License-Identifier: EPL-2.0
12 * IBM Corporation - initial API and implementation
13 *******************************************************************************/
14 package org.eclipse.swt.browser;
16 import org.eclipse.swt.internal.*;
19 * This listener interface may be implemented in order to receive
20 * a {@link WindowEvent} notification when a new {@link Browser}
21 * needs to be provided by the application.
23 * @see Browser#addOpenWindowListener(OpenWindowListener)
24 * @see Browser#removeOpenWindowListener(OpenWindowListener)
25 * @see CloseWindowListener
26 * @see VisibilityWindowListener
31 public interface OpenWindowListener extends SWTEventListener {
34 * This method is called when a new window needs to be created.
36 * A particular <code>Browser</code> can be passed to the event.browser
37 * field to host the content of a new window.
39 * A standalone system browser is used to host the new window
40 * if the event.required field value is <code>false</code> and if the event.browser
41 * field is left <code>null</code>. The event.required field
42 * is <code>true</code> on platforms that don't support a standalone system browser for
43 * new window requests.
45 * The navigation is cancelled if the event.required field is set to
46 * <code>true</code> and the event.browser field is left <code>null</code>.</p>
47 * <p>The following fields in the <code>WindowEvent</code> apply:</p>
49 * <li>(in/out) {@link WindowEvent#required}: true if the platform requires the user to provide a
50 * <code>Browser</code> to handle the new window or false otherwise.
51 * <li>(out) {@link WindowEvent#browser}: the new (unique) <code>Browser</code> that will host the
52 * content of the new window.
53 * <li>(in) widget the <code>Browser</code> that is requesting to open a
57 * @param event the <code>WindowEvent</code> that needs to be passed a new
58 * <code>Browser</code> to handle the new window request
62 public void open(WindowEvent event);