]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.eclipse.swt.win32.win32.x86_64/src/org/eclipse/swt/browser/VisibilityWindowListener.java
Remove invalid SHA-256-Digests
[simantics/platform.git] / bundles / org.eclipse.swt.win32.win32.x86_64 / src / org / eclipse / swt / browser / VisibilityWindowListener.java
1 /*******************************************************************************
2  * Copyright (c) 2003, 2017 IBM Corporation and others.
3  *
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/
8  *
9  * SPDX-License-Identifier: EPL-2.0
10  *
11  * Contributors:
12  *     IBM Corporation - initial API and implementation
13  *******************************************************************************/
14 package org.eclipse.swt.browser;
15
16 import java.util.function.*;
17
18 import org.eclipse.swt.internal.*;
19
20 /**
21  * This listener interface may be implemented in order to receive
22  * a {@link WindowEvent} notification when a window hosting a
23  * {@link Browser} needs to be displayed or hidden.
24  *
25  * @see Browser#addVisibilityWindowListener(VisibilityWindowListener)
26  * @see Browser#removeVisibilityWindowListener(VisibilityWindowListener)
27  * @see OpenWindowListener
28  * @see CloseWindowListener
29  *
30  * @since 3.0
31  */
32 public interface VisibilityWindowListener extends SWTEventListener {
33
34 /**
35  * This method is called when the window hosting a <code>Browser</code>
36  * is requested to be hidden. Application would typically hide the
37  * {@link org.eclipse.swt.widgets.Shell} that hosts the <code>Browser</code>.
38  *
39  * <p>The following fields in the <code>WindowEvent</code> apply:</p>
40  * <ul>
41  * <li>(in) widget the <code>Browser</code> that needs to be hidden
42  * </ul>
43  *
44  * @param event the <code>WindowEvent</code> that specifies the
45  * <code>Browser</code> that needs to be hidden
46  *
47  * @see org.eclipse.swt.widgets.Shell#setVisible(boolean)
48  *
49  * @since 3.0
50  */
51 public void hide(WindowEvent event);
52
53 /**
54  * This method is called when the window hosting a <code>Browser</code>
55  * is requested to be displayed. Application would typically set the
56  * location and the size of the {@link org.eclipse.swt.widgets.Shell}
57  * that hosts the <code>Browser</code>, if a particular location and size
58  * are specified. The application would then open that <code>Shell</code>.
59  *
60  * <p>The following fields in the <code>WindowEvent</code> apply:</p>
61  * <ul>
62  * <li>(in) widget the <code>Browser</code> to display
63  * <li>(in) location the requested location for the <code>Shell</code>
64  * hosting the browser. It is <code>null</code> if no location is set.
65  * <li>(in) size the requested size for the <code>Browser</code>.
66  * The client area of the <code>Shell</code> hosting the
67  * <code>Browser</code> should be large enough to accommodate that size.
68  * It is <code>null</code> if no size is set.
69  * <li>(in) addressBar <code>true</code> if the <code>Shell</code>
70  * hosting the <code>Browser</code> should display an address bar or
71  * <code>false</code> otherwise
72  * <li>(in) menuBar <code>true</code> if the <code>Shell</code>
73  * hosting the <code>Browser</code> should display a menu bar or
74  * <code>false</code> otherwise
75  * <li>(in) statusBar <code>true</code> if the <code>Shell</code>
76  * hosting the <code>Browser</code> should display a status bar or
77  * <code>false</code> otherwise
78  * <li>(in) toolBar <code>true</code> if the <code>Shell</code>
79  * hosting the <code>Browser</code> should display a tool bar or
80  * <code>false</code> otherwise
81  * </ul>
82  *
83  * @param event the <code>WindowEvent</code> that specifies the
84  * <code>Browser</code> that needs to be displayed
85  *
86  * @see org.eclipse.swt.widgets.Control#setLocation(org.eclipse.swt.graphics.Point)
87  * @see org.eclipse.swt.widgets.Control#setSize(org.eclipse.swt.graphics.Point)
88  * @see org.eclipse.swt.widgets.Shell#open()
89  *
90  * @since 3.0
91  */
92 public void show(WindowEvent event);
93
94 /**
95  * Static helper method to create a <code>VisibilityWindowListener</code> for thehide
96  * {@link #hide(WindowEvent e)}) method, given a lambda expression or a method reference.
97  *
98  * @param c the consumer of the event
99  * @return LocationListener
100  * @since 3.107
101  */
102 public static VisibilityWindowListener hideAdapter(Consumer<WindowEvent> c) {
103         return new VisibilityWindowAdapter() {
104                 @Override
105                 public void hide(WindowEvent e) {
106                         c.accept(e);
107                 }
108         };
109 }
110
111 /**
112  * Static helper method to create a <code>VisibilityWindowListener</code> for the
113  * {@link #show(WindowEvent e)}) method, given a lambda expression or a method reference.
114  *
115  * @param c the consumer of the event
116  * @return LocationListener
117  * @since 3.107
118  */
119 public static VisibilityWindowListener showAdapter(Consumer<WindowEvent> c) {
120         return new VisibilityWindowAdapter() {
121                 @Override
122                 public void show(WindowEvent e) {
123                         c.accept(e);
124                 }
125         };
126 }
127
128 }