Eclipse Platform
2.0

org.eclipse.ui.part
Class MultiPageEditorSite

java.lang.Object
  |
  +--org.eclipse.ui.part.MultiPageEditorSite
All Implemented Interfaces:
IEditorSite, IWorkbenchPartSite, IWorkbenchSite

public class MultiPageEditorSite
extends Object
implements IEditorSite

Site for a nested editor within a multi-page editor. Selection is handled by forwarding the event to the multi-page editor's selection listeners; most other methods are forwarded to the multi-page editor's site.

The base implementation of MultiPageEditor.createSite creates an instance of this class. This class may be instantiated or subclassed.


Constructor Summary
MultiPageEditorSite(MultiPageEditorPart multiPageEditor, IEditorPart editor)
          Creates a site for the given editor nested within the given multi-page editor.
 
Method Summary
 IEditorActionBarContributor getActionBarContributor()
          The MultiPageEditorSite implementation of this IEditorSite method returns null, since nested editors do not have their own action bar contributor.
 ILabelDecorator getDecoratorManager()
          Deprecated. use IWorkbench.getDecoratorManager()
 IEditorPart getEditor()
          Returns the nested editor.
 String getId()
          The MultiPageEditorSite implementation of this IWorkbenchPartSite method returns an empty string since the nested editor is not created from the registry.
 IKeyBindingService getKeyBindingService()
          Returns the key binding service in use.
 MultiPageEditorPart getMultiPageEditor()
          Returns the multi-page editor.
 IWorkbenchPage getPage()
          The MultiPageEditorSite implementation of this IWorkbenchPartSite method forwards to the multi-page editor to return the workbench page.
 String getPluginId()
          The MultiPageEditorSite implementation of this IWorkbenchPartSite method returns an empty string since the nested editor is not created from the registry.
 String getRegisteredName()
          The MultiPageEditorSite implementation of this IWorkbenchPartSite method returns an empty string since the nested editor is not created from the registry.
 ISelectionProvider getSelectionProvider()
          The MultiPageEditorSite implementation of this IWorkbenchPartSite method returns the selection provider set by setSelectionProvider.
 Shell getShell()
          The MultiPageEditorSite implementation of this IWorkbenchPartSite method forwards to the multi-page editor to return the shell.
 IWorkbenchWindow getWorkbenchWindow()
          The MultiPageEditorSite implementation of this IWorkbenchPartSite method forwards to the multi-page editor to return the workbench window.
protected  void handleSelectionChanged(SelectionChangedEvent event)
          Handles a selection changed event from the nested editor.
 void registerContextMenu(MenuManager menuManager, ISelectionProvider selectionProvider)
          The MultiPageEditorSite implementation of this IWorkbenchPartSite method forwards to the multi-page editor for registration.
 void registerContextMenu(String menuID, MenuManager menuMgr, ISelectionProvider selProvider)
          The MultiPageEditorSite implementation of this IWorkbenchPartSite method forwards to the multi-page editor for registration.
 void setSelectionProvider(ISelectionProvider provider)
          The MultiPageEditorSite implementation of this IWorkbenchPartSite method remembers the selection provider, and also hooks a listener on it, which calls handleSelectionChanged when a selection changed event occurs.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MultiPageEditorSite

public MultiPageEditorSite(MultiPageEditorPart multiPageEditor,
                           IEditorPart editor)
Creates a site for the given editor nested within the given multi-page editor.

Parameters:
multiPageEditor - the multi-page editor
editor - the nested editor
Method Detail

getActionBarContributor

public IEditorActionBarContributor getActionBarContributor()
The MultiPageEditorSite implementation of this IEditorSite method returns null, since nested editors do not have their own action bar contributor.

Specified by:
getActionBarContributor in interface IEditorSite
Returns:
the editor action bar contributor, or null if none exists

getDecoratorManager

public ILabelDecorator getDecoratorManager()
Deprecated. use IWorkbench.getDecoratorManager()

The MultiPageEditorSite implementation of this IWorkbenchPartSite method forwards to the multi-page editor to return the decorator manager.


getEditor

public IEditorPart getEditor()
Returns the nested editor.

Returns:
the nested editor

getId

public String getId()
The MultiPageEditorSite implementation of this IWorkbenchPartSite method returns an empty string since the nested editor is not created from the registry.

Specified by:
getId in interface IWorkbenchPartSite
Returns:
the registry extension id
See Also:
#getConfigurationElement

getKeyBindingService

public IKeyBindingService getKeyBindingService()
Description copied from interface: IEditorSite
Returns the key binding service in use.

The editor part will access this service to register all of its actions, to set the active scope, and to forward key events.

Specified by:
getKeyBindingService in interface IEditorSite
Returns:
the key binding service in use

getMultiPageEditor

public MultiPageEditorPart getMultiPageEditor()
Returns the multi-page editor.

Returns:
the multi-page editor

getPage

public IWorkbenchPage getPage()
The MultiPageEditorSite implementation of this IWorkbenchPartSite method forwards to the multi-page editor to return the workbench page.

Specified by:
getPage in interface IWorkbenchSite
Returns:
the page containing this workbench site

getPluginId

public String getPluginId()
The MultiPageEditorSite implementation of this IWorkbenchPartSite method returns an empty string since the nested editor is not created from the registry.

Specified by:
getPluginId in interface IWorkbenchPartSite
Returns:
the unique identifier of the declaring plug-in
See Also:
IPluginDescriptor.getUniqueIdentifier()

getRegisteredName

public String getRegisteredName()
The MultiPageEditorSite implementation of this IWorkbenchPartSite method returns an empty string since the nested editor is not created from the registry.

Specified by:
getRegisteredName in interface IWorkbenchPartSite
Returns:
the part name

getSelectionProvider

public ISelectionProvider getSelectionProvider()
The MultiPageEditorSite implementation of this IWorkbenchPartSite method returns the selection provider set by setSelectionProvider.

Specified by:
getSelectionProvider in interface IWorkbenchSite
Returns:
the selection provider, or null if none

getShell

public Shell getShell()
The MultiPageEditorSite implementation of this IWorkbenchPartSite method forwards to the multi-page editor to return the shell.

Specified by:
getShell in interface IWorkbenchSite
Returns:
the shell for this workbench site

getWorkbenchWindow

public IWorkbenchWindow getWorkbenchWindow()
The MultiPageEditorSite implementation of this IWorkbenchPartSite method forwards to the multi-page editor to return the workbench window.

Specified by:
getWorkbenchWindow in interface IWorkbenchSite
Returns:
the workbench window containing this workbench site

handleSelectionChanged

protected void handleSelectionChanged(SelectionChangedEvent event)
Handles a selection changed event from the nested editor. The default implementation gets the selection provider from the multi-page editor's site, and calls fireSelectionChanged on it (only if it is an instance of MultiPageSelectionProvider), passing a new event object.

Subclasses may extend or reimplement this method.

Parameters:
event - the event

registerContextMenu

public void registerContextMenu(String menuID,
                                MenuManager menuMgr,
                                ISelectionProvider selProvider)
The MultiPageEditorSite implementation of this IWorkbenchPartSite method forwards to the multi-page editor for registration.

Specified by:
registerContextMenu in interface IWorkbenchPartSite
Parameters:
menuID - the menu id
menuMgr - the menu manager
selProvider - the selection provider

registerContextMenu

public void registerContextMenu(MenuManager menuManager,
                                ISelectionProvider selectionProvider)
The MultiPageEditorSite implementation of this IWorkbenchPartSite method forwards to the multi-page editor for registration.

Specified by:
registerContextMenu in interface IWorkbenchPartSite
Parameters:
menuManager - the menu manager
selectionProvider - the selection provider

setSelectionProvider

public void setSelectionProvider(ISelectionProvider provider)
The MultiPageEditorSite implementation of this IWorkbenchPartSite method remembers the selection provider, and also hooks a listener on it, which calls handleSelectionChanged when a selection changed event occurs.

Specified by:
setSelectionProvider in interface IWorkbenchSite
Parameters:
provider - the selection provider, or null to clear it
See Also:
handleSelectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent)

Eclipse Platform
2.0

Copyright (c) IBM Corp. and others 2000, 2002. All Rights Reserved.