]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.eclipse.swt.win32.win32.x86_64/src/org/eclipse/swt/browser/ProgressListener.java
Remove invalid SHA-256-Digests
[simantics/platform.git] / bundles / org.eclipse.swt.win32.win32.x86_64 / src / org / eclipse / swt / browser / ProgressListener.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 ProgressEvent} notification when a {@link Browser}
23  * makes a progress in loading the current URL or when the
24  * current URL has been loaded.
25  *
26  * @see Browser#addProgressListener(ProgressListener)
27  * @see Browser#removeProgressListener(ProgressListener)
28  * @see Browser#getUrl()
29  *
30  * @since 3.0
31  */
32 public interface ProgressListener extends SWTEventListener {
33
34 /**
35  * This method is called when a progress is made during the loading of the
36  * current location.
37  *
38  *
39  * <p>The following fields in the <code>ProgressEvent</code> apply:</p>
40  * <ul>
41  * <li>(in) current the progress for the location currently being loaded
42  * <li>(in) total the maximum progress for the location currently being loaded
43  * <li>(in) widget the <code>Browser</code> whose current URL is being loaded
44  * </ul>
45  *
46  * @param event the <code>ProgressEvent</code> related to the loading of the
47  * current location of a <code>Browser</code>
48  *
49  * @since 3.0
50  */
51 public void changed(ProgressEvent event);
52
53 /**
54  * This method is called when the current location has been completely loaded.
55  *
56  *
57  * <p>The following fields in the <code>ProgressEvent</code> apply:</p>
58  * <ul>
59  * <li>(in) widget the <code>Browser</code> whose current URL has been loaded
60  * </ul>
61  *
62  * @param event the <code>ProgressEvent</code> related to the <code>Browser</code>
63  * that has loaded its current URL.
64  *
65  * @since 3.0
66  */
67 public void completed(ProgressEvent event);
68
69 /**
70  * Static helper method to create a <code>ProgressListener</code> for the
71  * {@link #changed(ProgressEvent e)}) method, given a lambda expression or a method reference.
72  *
73  * @param c the consumer of the event
74  * @return LocationListener
75  * @since 3.107
76  */
77 public static ProgressListener changedAdapter(Consumer<ProgressEvent> c) {
78         return new ProgressAdapter() {
79                 @Override
80                 public void changed(ProgressEvent e) {
81                         c.accept(e);
82                 }
83         };
84 }
85
86 /**
87  * Static helper method to create a <code>ProgressListener</code> for the
88  * {@link #completed(ProgressEvent e)}) method, given a lambda expression or a method reference.
89  *
90  * @param c the consumer of the event
91  * @return LocationListener
92  * @since 3.107
93  */
94 public static ProgressListener completedAdapter(Consumer<ProgressEvent> c) {
95         return new ProgressAdapter() {
96                 @Override
97                 public void completed(ProgressEvent e) {
98                         c.accept(e);
99                 }
100         };
101 }
102 }