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;
11:
12: /**
13: * A part service tracks the creation and activation of parts within a
14: * workbench page.
15: * <p>
16: * This interface is not intended to be implemented by clients.
17: * </p>
18: *
19: * @see IWorkbenchPage
20: */
21: public interface IPartService {
22:
23: /**
24: * Adds the given listener for part lifecycle events.
25: * Has no effect if an identical listener is already registered.
26: *
27: * @param listener a part listener
28: */
29: public void addPartListener(IPartListener listener);
30:
31: /**
32: * Adds the given listener for part lifecycle events.
33: * Has no effect if an identical listener is already registered.
34: *
35: * @param listener a part listener
36: */
37: public void addPartListener(IPartListener2 listener);
38:
39: /**
40: * Returns the active part.
41: *
42: * @return the active part, or <code>null</code> if no part is currently active
43: */
44: public IWorkbenchPart getActivePart();
45:
46: /**
47: * Returns the active part reference.
48: *
49: * @return the active part reference, or <code>null</code> if no part
50: * is currently active
51: */
52: public IWorkbenchPartReference getActivePartReference();
53:
54: /**
55: * Removes the given part listener.
56: * Has no affect if an identical listener is not registered.
57: *
58: * @param listener a part listener
59: */
60: public void removePartListener(IPartListener listener);
61:
62: /**
63: * Removes the given part listener.
64: * Has no affect if an identical listener is not registered.
65: *
66: * @param listener a part listener
67: */
68: public void removePartListener(IPartListener2 listener);
69: }
|