]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.eclipse.swt.win32.win32.x86_64/src/org/eclipse/swt/events/ShellListener.java
Remove invalid SHA-256-Digests
[simantics/platform.git] / bundles / org.eclipse.swt.win32.win32.x86_64 / src / org / eclipse / swt / events / ShellListener.java
1 /*******************************************************************************
2  * Copyright (c) 2000, 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.events;
15
16
17 import java.util.function.*;
18
19 import org.eclipse.swt.internal.*;
20
21 /**
22  * Classes which implement this interface provide methods
23  * that deal with changes in state of <code>Shell</code>s.
24  * <p>
25  * After creating an instance of a class that implements
26  * this interface it can be added to a shell using the
27  * <code>addShellListener</code> method and removed using
28  * the <code>removeShellListener</code> method. When the
29  * state of the shell changes, the appropriate method will
30  * be invoked.
31  * </p>
32  *
33  * @see ShellAdapter
34  * @see ShellEvent
35  */
36 public interface ShellListener extends SWTEventListener {
37
38 /**
39  * Sent when a shell becomes the active window.
40  *
41  * @param e an event containing information about the activation
42  */
43 void shellActivated(ShellEvent e);
44
45 /**
46  * Sent when a shell is closed.
47  *
48  * @param e an event containing information about the close
49  */
50 void shellClosed(ShellEvent e);
51
52 /**
53  * Sent when a shell stops being the active window.
54  *
55  * @param e an event containing information about the deactivation
56  */
57 void shellDeactivated(ShellEvent e);
58
59 /**
60  * Sent when a shell is un-minimized.
61  *
62  * @param e an event containing information about the un-minimization
63  */
64 void shellDeiconified(ShellEvent e);
65
66 /**
67  * Sent when a shell is minimized.
68  *
69  * @param e an event containing information about the minimization
70  */
71 void shellIconified(ShellEvent e);
72
73 /**
74  * Static helper method to create a <code>ShellListener</code> for the
75  * {@link #shellActivated(ShellEvent e)}) method, given a lambda expression or a method reference.
76  *
77  * @param c the consumer of the event
78  * @return ShellListener
79  * @since 3.107
80  */
81 static ShellListener shellActivatedAdapter(Consumer<ShellEvent> c) {
82         return new ShellAdapter() {
83                 @Override
84                 public void shellActivated(ShellEvent e) {
85                         c.accept(e);
86                 }
87         };
88 }
89
90 /**
91  * Static helper method to create a <code>ShellListener</code> for the
92  * {@link #shellClosed(ShellEvent e)}) method, given a lambda expression or a method reference.
93  *
94  * @param c the consumer of the event
95  * @return ShellListener
96  * @since 3.107
97  */
98 static ShellListener shellClosedAdapter(Consumer<ShellEvent> c) {
99         return new ShellAdapter() {
100                 @Override
101                 public void shellClosed(ShellEvent e) {
102                         c.accept(e);
103                 }
104         };
105 }
106
107 /**
108  * Static helper method to create a <code>ShellListener</code> for the
109  * {@link #shellDeactivated(ShellEvent e)}) method, given a lambda expression or a method reference.
110  *
111  * @param c the consumer of the event
112  * @return ShellListener
113  * @since 3.107
114  */
115 static ShellListener shellDeactivatedAdapter(Consumer<ShellEvent> c) {
116         return new ShellAdapter() {
117                 @Override
118                 public void shellDeactivated(ShellEvent e) {
119                         c.accept(e);
120                 }
121         };
122 }
123
124 /**
125  * Static helper method to create a <code>ShellListener</code> for the
126  * {@link #shellDeiconified(ShellEvent e)}) method, given a lambda expression or a method reference.
127  *
128  * @param c the consumer of the event
129  * @return ShellListener
130  * @since 3.107
131  */
132 static ShellListener shellDeiconifiedAdapter(Consumer<ShellEvent> c) {
133         return new ShellAdapter() {
134                 @Override
135                 public void shellDeiconified(ShellEvent e) {
136                         c.accept(e);
137                 }
138         };
139 }
140
141 /**
142  * Static helper method to create a <code>ShellListener</code> for the
143  * {@link #shellIconified(ShellEvent e)}) method, given a lambda expression or a method reference.
144  *
145  * @param c the consumer of the event
146  * @return ShellListener
147  * @since 3.107
148  */
149 static ShellListener shellIconifiedAdapter(Consumer<ShellEvent> c) {
150         return new ShellAdapter() {
151                 @Override
152                 public void shellIconified(ShellEvent e) {
153                         c.accept(e);
154                 }
155         };
156 }
157 }