org.eclipse.ui.IWorkbenchPartSite Maven / Gradle / Ivy
Show all versions of workbench Show documentation
/*******************************************************************************
* Copyright (c) 2000, 2006 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package org.eclipse.ui;
import org.eclipse.jface.action.MenuManager;
import org.eclipse.jface.viewers.ISelectionProvider;
import org.eclipse.ui.contexts.IContextService;
import org.eclipse.ui.handlers.IHandlerService;
import org.eclipse.ui.services.IServiceLocator;
/**
* The primary interface between a workbench part and the workbench.
*
* This interface is not intended to be implemented or extended by clients.
*
*/
public interface IWorkbenchPartSite extends IWorkbenchSite {
/**
* Returns the part registry extension id for this workbench site's part.
*
* The name comes from the id
attribute in the configuration
* element.
*
*
* @return the registry extension id
*/
public String getId();
/**
* Returns the unique identifier of the plug-in that defines this workbench
* site's part.
*
* @return the unique identifier of the declaring plug-in
*/
public String getPluginId();
/**
* Returns the registered name for this workbench site's part.
*
* The name comes from the name
attribute in the configuration
* element.
*
*
* @return the part name
*/
public String getRegisteredName();
/**
* Registers a pop-up menu with a particular id for extension.
* This method should only be called if the target part has more
* than one context menu to register.
*
* For a detailed description of context menu registration see
* registerContextMenu(MenuManager, ISelectionProvider);
*
*
* @param menuId the menu id
* @param menuManager the menu manager
* @param selectionProvider the selection provider
*/
public void registerContextMenu(String menuId, MenuManager menuManager,
ISelectionProvider selectionProvider);
/**
* Registers a pop-up menu with the default id for extension.
* The default id is defined as the part id.
*
* Within the workbench one plug-in may extend the pop-up menus for a view
* or editor within another plug-in. In order to be eligible for extension,
* the target part must publish each menu by calling registerContextMenu
.
* Once this has been done the workbench will automatically insert any action
* extensions which exist.
*
*
* A menu id must be provided for each registered menu. For consistency across
* parts the following strategy should be adopted by all part implementors.
*
*
* - If the target part has only one context menu it should be registered
* with
id == part id
. This can be done easily by calling
* registerContextMenu(MenuManager, ISelectionProvider).
* - If the target part has more than one context menu a unique id should be
* defined for each. Prefix each menu id with the part id and publish these
* ids within the javadoc for the target part. Register each menu at
* runtime by calling
registerContextMenu(String, MenuManager,
* ISelectionProvider)
.
*
*
* Any pop-up menu which is registered with the workbench should also define a
* GroupMarker
in the registered menu with id
* IWorkbenchActionConstants.MB_ADDITIONS
. Other plug-ins will use this
* group as a reference point for insertion. The marker should be defined at an
* appropriate location within the menu for insertion.
*
*
* @param menuManager the menu manager
* @param selectionProvider the selection provider
*/
public void registerContextMenu(MenuManager menuManager,
ISelectionProvider selectionProvider);
/**
* Returns the key binding service in use.
*
* The part will access this service to register all of its actions, to set
* the active scope.
*
*
* @return the key binding service in use
* @since 2.1
* @deprecated Use {@link IServiceLocator#getService(Class)} instead.
* @see IContextService
* @see IHandlerService
*/
public IKeyBindingService getKeyBindingService();
/**
* Returns the part associated with this site
*
* @since 3.1
*
* @return the part associated with this site
*/
public IWorkbenchPart getPart();
}