KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ui > internal > misc > TestPartListener


1 /*******************************************************************************
2  * Copyright (c) 2000, 2006 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.ui.internal.misc;
12
13 import org.eclipse.ui.IPartListener;
14 import org.eclipse.ui.IWorkbenchPart;
15
16 /**
17  * Prints out part listener events
18  */

19 public class TestPartListener implements IPartListener {
20     /**
21      * TestPartListener constructor comment.
22      * @issue seems like garbage - no one using it
23      */

24     public TestPartListener() {
25         super();
26     }
27
28     /**
29      * Notifies this listener that the given part has been activated.
30      *
31      * @param part the part that was activated
32      * @see IPerspective#activate
33      */

34     public void partActivated(IWorkbenchPart part) {
35         System.out.println("partActivated(" + part + ")");//$NON-NLS-2$//$NON-NLS-1$
36
}
37
38     /**
39      * Notifies this listener that the given part has been brought to the top.
40      * <p>
41      * These events occur when an editor is brought to the top in the editor area,
42      * or when a view is brought to the top in a page book with multiple views.
43      * They are normally only sent when a part is brought to the top
44      * programmatically (via <code>IPerspective.bringToTop</code>). When a part is
45      * activated by the user clicking on it, only <code>partActivated</code> is sent.
46      * </p>
47      *
48      * @param part the part that was surfaced
49      * @see IPerspective#bringToTop
50      */

51     public void partBroughtToTop(IWorkbenchPart part) {
52         System.out.println("partBroughtToTop(" + part + ")");//$NON-NLS-2$//$NON-NLS-1$
53
}
54
55     /**
56      * Notifies this listener that the given part has been closed.
57      *
58      * @param part the part that was closed
59      * @see IPerspective#close
60      */

61     public void partClosed(IWorkbenchPart part) {
62         System.out.println("partClosed(" + part + ")");//$NON-NLS-2$//$NON-NLS-1$
63
}
64
65     /**
66      * Notifies this listener that the given part has been deactivated.
67      *
68      * @param part the part that was deactivated
69      * @see IPerspective#activate
70      */

71     public void partDeactivated(IWorkbenchPart part) {
72         System.out.println("partDeactivated(" + part + ")");//$NON-NLS-2$//$NON-NLS-1$
73
}
74
75     /**
76      * Notifies this listener that the given part has been opened.
77      *
78      * @param part the part that was opened
79      */

80     public void partOpened(IWorkbenchPart part) {
81         System.out.println("partOpened(" + part + ")");//$NON-NLS-2$//$NON-NLS-1$
82
}
83 }
84
Popular Tags