01: /*******************************************************************************
02: * Copyright (c) 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.navigator;
11:
12: import org.eclipse.jface.action.MenuManager;
13: import org.eclipse.jface.viewers.ISelectionProvider;
14: import org.eclipse.ui.IActionBars;
15: import org.eclipse.ui.IWorkbenchPage;
16: import org.eclipse.ui.IWorkbenchPart;
17: import org.eclipse.ui.IWorkbenchPartSite;
18: import org.eclipse.ui.IWorkbenchWindow;
19:
20: /**
21: *
22: * Provides a page, set of action bars, menu registration callback, and active
23: * window.
24: *
25: * <p>
26: * This interface is not intended to be implemented by clients.
27: * </p>
28: *
29: * @since 3.2
30: *
31: */
32: public interface ICommonViewerWorkbenchSite extends ICommonViewerSite {
33:
34: /**
35: * Returns the page corresponding to this viewer site.
36: *
37: * @return the page corresponding to this viewer site
38: */
39: public IWorkbenchPage getPage();
40:
41: /**
42: * Registers a pop-up menu with a particular id for extension.
43: * <p>
44: * Within the workbench one plug-in may extend the pop-up menus for a view
45: * or editor within another plug-in. In order to be eligible for extension,
46: * the menu must be registered by calling <code>registerContextMenu</code>.
47: * Once this has been done the workbench will automatically insert any
48: * action extensions which exist.
49: * </p>
50: * <p>
51: * A unique menu id must be provided for each registered menu. This id
52: * should be published in the Javadoc for the page.
53: * </p>
54: * <p>
55: * Any pop-up menu which is registered with the workbench should also define
56: * a <code>GroupMarker</code> in the registered menu with id
57: * <code>IWorkbenchActionConstants.MB_ADDITIONS</code>. Other plug-ins
58: * will use this group as a reference point for insertion. The marker should
59: * be defined at an appropriate location within the menu for insertion.
60: * </p>
61: *
62: * @param menuId
63: * the menu id
64: * @param menuManager
65: * the menu manager
66: * @param selectionProvider
67: * the selection provider
68: */
69: void registerContextMenu(String menuId, MenuManager menuManager,
70: ISelectionProvider selectionProvider);
71:
72: /**
73: * Returns the action bars for this page site. Pages have exclusive use of
74: * their site's action bars.
75: *
76: * @return the action bars
77: */
78: IActionBars getActionBars();
79:
80: /**
81: *
82: * @return A workbench window corresponding to the container of the
83: * {@link CommonViewer}
84: */
85: IWorkbenchWindow getWorkbenchWindow();
86:
87: /**
88: * @return the IWorkbenchPart that this site is embedded within.
89: */
90: IWorkbenchPart getPart();
91:
92: /**
93: * @return the IWorkbenchPartSite that this site is embedded within.
94: */
95: IWorkbenchPartSite getSite();
96: }
|