1
|
/*******************************************************************************
|
2
|
* Copyright (c) 2006, 2009 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
|
* @since 3.2
|
28
|
* @noextend This interface is not intended to be extended by clients.
|
29
|
* @noimplement This interface is not intended to be implemented by clients.
|
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
|
}
|