KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*******************************************************************************
2  * Copyright (c) 2000, 2005 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 import org.eclipse.jface.action.MenuManager;
14 import org.eclipse.jface.viewers.ISelectionProvider;
15
16 /**
17  * The primary interface between an editor part and the workbench.
18  * <p>
19  * The workbench exposes its implemention of editor part sites via this
20  * interface, which is not intended to be implemented or extended by clients.
21  * </p>
22  */

23 public interface IEditorSite extends IWorkbenchPartSite {
24
25     /**
26      * Returns the action bar contributor for this editor.
27      * <p>
28      * An action contributor is responsable for the creation of actions.
29      * By design, this contributor is used for one or more editors of the same type.
30      * Thus, the contributor returned by this method is not owned completely
31      * by the editor - it is shared.
32      * </p>
33      *
34      * @return the editor action bar contributor, or <code>null</code> if none exists
35      */

36     public IEditorActionBarContributor getActionBarContributor();
37
38     /**
39      * Returns the action bars for this part site. Editors of the same type (and
40      * in the same window) share the same action bars. Contributions to the
41      * action bars are done by the <code>IEditorActionBarContributor</code>.
42      *
43      * @return the action bars
44      * @since 2.1
45      */

46     public IActionBars getActionBars();
47
48     /**
49      * <p>
50      * Registers a pop-up menu with the default id for extension. The default id
51      * is defined as the part id.
52      * </p>
53      * <p>
54      * By default, context menus include object contributions based on the
55      * editor input for the current editor. It is possible to override this
56      * behaviour by calling this method with <code>includeEditorInput</code>
57      * as <code>false</code>. This might be desirable for editors that
58      * present a localized view of an editor input (e.g., a node in a model
59      * editor).
60      * </p>
61      * <p>
62      * For a detailed description of context menu registration see
63      * {@link IWorkbenchPartSite#registerContextMenu(MenuManager, ISelectionProvider)}
64      * </p>
65      *
66      * @param menuManager
67      * the menu manager; must not be <code>null</code>.
68      * @param selectionProvider
69      * the selection provider; must not be <code>null</code>.
70      * @param includeEditorInput
71      * Whether the editor input should be included when adding object
72      * contributions to this context menu.
73      * @see IWorkbenchPartSite#registerContextMenu(MenuManager,
74      * ISelectionProvider)
75      * @since 3.1
76      */

77     public void registerContextMenu(MenuManager menuManager,
78             ISelectionProvider selectionProvider, boolean includeEditorInput);
79
80     /**
81      * <p>
82      * Registers a pop-up menu with a particular id for extension. This method
83      * should only be called if the target part has more than one context menu
84      * to register.
85      * </p>
86      * <p>
87      * By default, context menus include object contributions based on the
88      * editor input for the current editor. It is possible to override this
89      * behaviour by calling this method with <code>includeEditorInput</code>
90      * as <code>false</code>. This might be desirable for editors that
91      * present a localized view of an editor input (e.g., a node in a model
92      * editor).
93      * </p>
94      * <p>
95      * For a detailed description of context menu registration see
96      * {@link IWorkbenchPartSite#registerContextMenu(MenuManager, ISelectionProvider)}
97      * </p>
98      *
99      * @param menuId
100      * the menu id; must not be <code>null</code>.
101      * @param menuManager
102      * the menu manager; must not be <code>null</code>.
103      * @param selectionProvider
104      * the selection provider; must not be <code>null</code>.
105      * @param includeEditorInput
106      * Whether the editor input should be included when adding object
107      * contributions to this context menu.
108      * @see IWorkbenchPartSite#registerContextMenu(MenuManager,
109      * ISelectionProvider)
110      * @since 3.1
111      */

112     public void registerContextMenu(String JavaDoc menuId, MenuManager menuManager,
113             ISelectionProvider selectionProvider, boolean includeEditorInput);
114 }
115
Popular Tags