KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ui > IPartService


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;
12
13 /**
14  * A part service tracks the creation and activation of parts within a
15  * workbench page.
16  * <p>
17  * This interface is not intended to be implemented by clients.
18  * </p>
19  *
20  * @see IWorkbenchPage
21  */

22 public interface IPartService {
23
24     /**
25      * Adds the given listener for part lifecycle events.
26      * Has no effect if an identical listener is already registered.
27      *
28      * @param listener a part listener
29      */

30     public void addPartListener(IPartListener listener);
31
32     /**
33      * Adds the given listener for part lifecycle events.
34      * Has no effect if an identical listener is already registered.
35      *
36      * @param listener a part listener
37      */

38     public void addPartListener(IPartListener2 listener);
39
40     /**
41      * Returns the active part.
42      *
43      * @return the active part, or <code>null</code> if no part is currently active
44      */

45     public IWorkbenchPart getActivePart();
46
47     /**
48      * Returns the active part reference.
49      *
50      * @return the active part reference, or <code>null</code> if no part
51      * is currently active
52      */

53     public IWorkbenchPartReference getActivePartReference();
54
55     /**
56      * Removes the given part listener.
57      * Has no affect if an identical listener is not registered.
58      *
59      * @param listener a part listener
60      */

61     public void removePartListener(IPartListener listener);
62
63     /**
64      * Removes the given part listener.
65      * Has no affect if an identical listener is not registered.
66      *
67      * @param listener a part listener
68      */

69     public void removePartListener(IPartListener2 listener);
70 }
71
Popular Tags