01: /*******************************************************************************
02: * Copyright (c) 2000, 2006 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: *******************************************************************************/package org.eclipse.ui.internal.misc;
11:
12: import org.eclipse.ui.IPartListener;
13: import org.eclipse.ui.IWorkbenchPart;
14:
15: /**
16: * Prints out part listener events
17: */
18: public class TestPartListener implements IPartListener {
19: /**
20: * TestPartListener constructor comment.
21: * @issue seems like garbage - no one using it
22: */
23: public TestPartListener() {
24: super ();
25: }
26:
27: /**
28: * Notifies this listener that the given part has been activated.
29: *
30: * @param part the part that was activated
31: * @see IPerspective#activate
32: */
33: public void partActivated(IWorkbenchPart part) {
34: System.out.println("partActivated(" + part + ")");//$NON-NLS-2$//$NON-NLS-1$
35: }
36:
37: /**
38: * Notifies this listener that the given part has been brought to the top.
39: * <p>
40: * These events occur when an editor is brought to the top in the editor area,
41: * or when a view is brought to the top in a page book with multiple views.
42: * They are normally only sent when a part is brought to the top
43: * programmatically (via <code>IPerspective.bringToTop</code>). When a part is
44: * activated by the user clicking on it, only <code>partActivated</code> is sent.
45: * </p>
46: *
47: * @param part the part that was surfaced
48: * @see IPerspective#bringToTop
49: */
50: public void partBroughtToTop(IWorkbenchPart part) {
51: System.out.println("partBroughtToTop(" + part + ")");//$NON-NLS-2$//$NON-NLS-1$
52: }
53:
54: /**
55: * Notifies this listener that the given part has been closed.
56: *
57: * @param part the part that was closed
58: * @see IPerspective#close
59: */
60: public void partClosed(IWorkbenchPart part) {
61: System.out.println("partClosed(" + part + ")");//$NON-NLS-2$//$NON-NLS-1$
62: }
63:
64: /**
65: * Notifies this listener that the given part has been deactivated.
66: *
67: * @param part the part that was deactivated
68: * @see IPerspective#activate
69: */
70: public void partDeactivated(IWorkbenchPart part) {
71: System.out.println("partDeactivated(" + part + ")");//$NON-NLS-2$//$NON-NLS-1$
72: }
73:
74: /**
75: * Notifies this listener that the given part has been opened.
76: *
77: * @param part the part that was opened
78: */
79: public void partOpened(IWorkbenchPart part) {
80: System.out.println("partOpened(" + part + ")");//$NON-NLS-2$//$NON-NLS-1$
81: }
82: }
|