]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.eclipse.swt.win32.win32.x86_64/src/org/eclipse/swt/custom/CTabFolder2Listener.java
Remove invalid SHA-256-Digests
[simantics/platform.git] / bundles / org.eclipse.swt.win32.win32.x86_64 / src / org / eclipse / swt / custom / CTabFolder2Listener.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.custom;
15
16 import java.util.function.*;
17
18 import org.eclipse.swt.internal.*;
19
20 /**
21  * Classes which implement this interface provide methods
22  * that deal with the events that are generated by the CTabFolder
23  * control.
24  * <p>
25  * After creating an instance of a class that implements
26  * this interface it can be added to a CTabFolder using the
27  * <code>addCTabFolder2Listener</code> method and removed using
28  * the <code>removeCTabFolder2Listener</code> method. When
29  * events occurs in a CTabFolder the appropriate method
30  * will be invoked.
31  * </p>
32  *
33  * @see CTabFolder2Adapter
34  * @see CTabFolderEvent
35  *
36  * @since 3.0
37  */
38 public interface CTabFolder2Listener extends SWTEventListener {
39
40 /**
41  * Sent when the user clicks on the close button of an item in the CTabFolder.
42  * The item being closed is specified in the event.item field.
43  * Setting the event.doit field to false will stop the CTabItem from closing.
44  * When the CTabItem is closed, it is disposed.  The contents of the
45  * CTabItem (see CTabItem.setControl) will be made not visible when
46  * the CTabItem is closed.
47  *
48  * @param event an event indicating the item being closed
49  */
50 public void close(CTabFolderEvent event);
51
52 /**
53  * Sent when the user clicks on the minimize button of a CTabFolder.
54  * The state of the CTabFolder does not change automatically - it
55  * is up to the application to change the state of the CTabFolder
56  * in response to this event using CTabFolder.setMinimized(true).
57  *
58  * @param event an event containing information about the minimize
59  *
60  * @see CTabFolder#getMinimized()
61  * @see CTabFolder#setMinimized(boolean)
62  * @see CTabFolder#setMinimizeVisible(boolean)
63  */
64 public void minimize(CTabFolderEvent event);
65
66 /**
67  * Sent when the user clicks on the maximize button of a CTabFolder.
68  * The state of the CTabFolder does not change automatically - it
69  * is up to the application to change the state of the CTabFolder
70  * in response to this event using CTabFolder.setMaximized(true).
71  *
72  * @param event an event containing information about the maximize
73  *
74  * @see CTabFolder#getMaximized()
75  * @see CTabFolder#setMaximized(boolean)
76  * @see CTabFolder#setMaximizeVisible(boolean)
77  */
78 public void maximize(CTabFolderEvent event);
79
80 /**
81  * Sent when the user clicks on the restore button of a CTabFolder.
82  * This event is sent either to restore the CTabFolder from the
83  * minimized state or from the maximized state.  To determine
84  * which restore is requested, use CTabFolder.getMinimized() or
85  * CTabFolder.getMaximized() to determine the current state.
86  * The state of the CTabFolder does not change automatically - it
87  * is up to the application to change the state of the CTabFolder
88  * in response to this event using CTabFolder.setMaximized(false)
89  * or CTabFolder.setMinimized(false).
90  *
91  * @param event an event containing information about the restore
92  *
93  * @see CTabFolder#getMinimized()
94  * @see CTabFolder#getMaximized()
95  * @see CTabFolder#setMinimized(boolean)
96  * @see CTabFolder#setMinimizeVisible(boolean)
97  * @see CTabFolder#setMaximized(boolean)
98  * @see CTabFolder#setMaximizeVisible(boolean)
99  */
100 public void restore(CTabFolderEvent event);
101
102 /**
103  * Sent when the user clicks on the chevron button of the CTabFolder.
104  * A chevron appears in the CTabFolder when there are more tabs
105  * than can be displayed at the current widget size.  To select a
106  * tab that is not currently visible, the user clicks on the
107  * chevron and selects a tab item from a list.  By default, the
108  * CTabFolder provides a list of all the items that are not currently
109  * visible, however, the application can provide its own list by setting
110  * the event.doit field to <code>false</code> and displaying a selection list.
111  *
112  * @param event an event containing information about the show list
113  *
114  * @see CTabFolder#setSelection(CTabItem)
115  */
116 public void showList(CTabFolderEvent event);
117
118 /**
119  * Static helper method to create a <code>CTabFolder2Listener</code> for the
120  * {@link #close(CTabFolderEvent e)}) method, given a lambda expression or a method reference.
121  *
122  * @param c the consumer of the event
123  * @return CTabFolder2Listener
124  * @since 3.107
125  */
126 public static CTabFolder2Listener closeAdapter(Consumer<CTabFolderEvent> c) {
127         return new CTabFolder2Adapter() {
128                 @Override
129                 public void close(CTabFolderEvent e) {
130                         c.accept(e);
131                 }
132         };
133 }
134
135 /**
136  * Static helper method to create a <code>CTabFolder2Listener</code> for the
137  * {@link #minimize(CTabFolderEvent e)}) method, given a lambda expression or a method reference.
138  *
139  * @param c the consumer of the event
140  * @return CTabFolder2Listener
141  * @since 3.107
142  */
143 public static CTabFolder2Listener minimizeAdapter(Consumer<CTabFolderEvent> c) {
144         return new CTabFolder2Adapter() {
145                 @Override
146                 public void minimize(CTabFolderEvent e) {
147                         c.accept(e);
148                 }
149         };
150 }
151
152 /**
153  * Static helper method to create a <code>CTabFolder2Listener</code> for the
154  * {@link #maximize(CTabFolderEvent e)}) method, given a lambda expression or a method reference.
155  *
156  * @param c the consumer of the event
157  * @return CTabFolder2Listener
158  * @since 3.107
159  */
160 public static CTabFolder2Listener maximizeAdapter(Consumer<CTabFolderEvent> c) {
161         return new CTabFolder2Adapter() {
162                 @Override
163                 public void maximize(CTabFolderEvent e) {
164                         c.accept(e);
165                 }
166         };
167 }
168
169 /**
170  * Static helper method to create a <code>CTabFolder2Listener</code> for the
171  * {@link #restore(CTabFolderEvent e)}) method, given a lambda expression or a method reference.
172  *
173  * @param c the consumer of the event
174  * @return CTabFolder2Listener
175  * @since 3.107
176  */
177 public static CTabFolder2Listener restoreAdapter(Consumer<CTabFolderEvent> c) {
178         return new CTabFolder2Adapter() {
179                 @Override
180                 public void restore(CTabFolderEvent e) {
181                         c.accept(e);
182                 }
183         };
184 }
185
186 /**
187  * Static helper method to create a <code>CTabFolder2Listener</code> for the
188  * {@link #showList(CTabFolderEvent e)}) method, given a lambda expression or a method reference.
189  *
190  * @param c the consumer of the event
191  * @return CTabFolder2Listener
192  * @since 3.107
193  */
194 public static CTabFolder2Listener showListAdapter(Consumer<CTabFolderEvent> c) {
195         return new CTabFolder2Adapter() {
196                 @Override
197                 public void showList(CTabFolderEvent e) {
198                         c.accept(e);
199                 }
200         };
201 }
202 }