KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ui > navigator > ICommonViewerWorkbenchSite


1 /*******************************************************************************
2  * Copyright (c) 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
12 package org.eclipse.ui.navigator;
13
14 import org.eclipse.jface.action.MenuManager;
15 import org.eclipse.jface.viewers.ISelectionProvider;
16 import org.eclipse.ui.IActionBars;
17 import org.eclipse.ui.IWorkbenchPage;
18 import org.eclipse.ui.IWorkbenchPart;
19 import org.eclipse.ui.IWorkbenchPartSite;
20 import org.eclipse.ui.IWorkbenchWindow;
21
22 /**
23  *
24  * Provides a page, set of action bars, menu registration callback, and active
25  * window.
26  *
27  * <p>
28  * This interface is not intended to be implemented by clients.
29  * </p>
30  *
31  * @since 3.2
32  *
33  */

34 public interface ICommonViewerWorkbenchSite extends ICommonViewerSite {
35
36     /**
37      * Returns the page corresponding to this viewer site.
38      *
39      * @return the page corresponding to this viewer site
40      */

41     public IWorkbenchPage getPage();
42
43     /**
44      * Registers a pop-up menu with a particular id for extension.
45      * <p>
46      * Within the workbench one plug-in may extend the pop-up menus for a view
47      * or editor within another plug-in. In order to be eligible for extension,
48      * the menu must be registered by calling <code>registerContextMenu</code>.
49      * Once this has been done the workbench will automatically insert any
50      * action extensions which exist.
51      * </p>
52      * <p>
53      * A unique menu id must be provided for each registered menu. This id
54      * should be published in the Javadoc for the page.
55      * </p>
56      * <p>
57      * Any pop-up menu which is registered with the workbench should also define
58      * a <code>GroupMarker</code> in the registered menu with id
59      * <code>IWorkbenchActionConstants.MB_ADDITIONS</code>. Other plug-ins
60      * will use this group as a reference point for insertion. The marker should
61      * be defined at an appropriate location within the menu for insertion.
62      * </p>
63      *
64      * @param menuId
65      * the menu id
66      * @param menuManager
67      * the menu manager
68      * @param selectionProvider
69      * the selection provider
70      */

71     void registerContextMenu(String JavaDoc menuId, MenuManager menuManager,
72             ISelectionProvider selectionProvider);
73
74     /**
75      * Returns the action bars for this page site. Pages have exclusive use of
76      * their site's action bars.
77      *
78      * @return the action bars
79      */

80     IActionBars getActionBars();
81
82     /**
83      *
84      * @return A workbench window corresponding to the container of the
85      * {@link CommonViewer}
86      */

87     IWorkbenchWindow getWorkbenchWindow();
88
89     /**
90      * @return the IWorkbenchPart that this site is embedded within.
91      */

92     IWorkbenchPart getPart();
93
94     /**
95      * @return the IWorkbenchPartSite that this site is embedded within.
96      */

97     IWorkbenchPartSite getSite();
98 }
99
Popular Tags