Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: fc23b5d8272c29a5478c6a979e7ae44f1fd70434 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
/*******************************************************************************
 * Copyright (c) 2000, 2015 IBM Corporation and others.
 *
 * This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License 2.0
 * which accompanies this distribution, and is available at
 * https://www.eclipse.org/legal/epl-2.0/
 *
 * SPDX-License-Identifier: EPL-2.0
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
package org.eclipse.ui;

/**
 * Interface for listening to part lifecycle events.
 * <p>
 * This interface may be implemented by clients.
 * </p>
 *
 * @see IPartService#addPartListener(IPartListener)
 */
public interface IPartListener {

    /**
     * Notifies this listener that the given part has been activated.
     *
     * @param part the part that was activated
     * @see IWorkbenchPage#activate
     */
    void partActivated(IWorkbenchPart part);

    /**
     * Notifies this listener that the given part has been brought to the top.
     * <p>
     * These events occur when an editor is brought to the top in the editor area,
     * or when a view is brought to the top in a page book with multiple views.
     * They are normally only sent when a part is brought to the top
     * programmatically (via <code>IPerspective.bringToTop</code>). When a part is
     * activated by the user clicking on it, only <code>partActivated</code> is sent.
     * </p>
     *
     * @param part the part that was surfaced
     * @see IWorkbenchPage#bringToTop
     */
    void partBroughtToTop(IWorkbenchPart part);

    /**
     * Notifies this listener that the given part has been closed.
     *
     * @param part the part that was closed
     * @see IWorkbenchPage#hideView(IViewPart)
     */
    void partClosed(IWorkbenchPart part);

    /**
     * Notifies this listener that the given part has been deactivated.
     *
     * @param part the part that was deactivated
     * @see IWorkbenchPage#activate(IWorkbenchPart)
     */
    void partDeactivated(IWorkbenchPart part);

    /**
     * Notifies this listener that the given part has been opened.
     *
     * @param part the part that was opened
     * @see IWorkbenchPage#showView(String)
     */
    void partOpened(IWorkbenchPart part);
}

Back to the top