Runtime

## org.eclipse.gmf.runtime.common.ui.services.editor
Class EditorService

    java.lang.Object
      org.eclipse.gmf.runtime.common.core.service.AbstractProvider
          org.eclipse.gmf.runtime.common.core.service.Service
              org.eclipse.gmf.runtime.common.ui.services.editor.EditorService

All Implemented Interfaces:
  java.util.EventListener, IProvider, IProviderChangeListener, IEditorProvider

    public class EditorService

extends Service
implements IEditorProvider

A service for manipulating editors

Nested Class Summary

Nested classes/interfaces inherited from class org.eclipse.gmf.runtime.common.core.service.Service
`Service.ProviderDescriptor`

Field Summary

Fields inherited from class org.eclipse.gmf.runtime.common.core.service.Service
`INVALID_ELEMENT_MESSAGE_PATTERN`

Constructor Summary
`protected` `EditorService()` Constructs a new editor service.

Method Summary
`protected java.util.Map` `getEditorsMap()` Returns the editorsMap.
`static EditorService` `getInstance()` Retrieves the singleton instance of the editor service.
`java.util.List` `getRegisteredEditorParts()` Return a list of all editor parts
`java.util.List` `getRegisteredEditors(java.lang.String editorId)` Returns all registered editors with given id
`IEditorPart` `openEditor(IEditorInput editorInput)` Opens an editor with the given editor input
`void` `registerEditor(IEditorPart editor)` Method registerEditor registers the editor with the editor service should be called by the editor upon initialization
`void` `unregisterEditor(IEditorPart editor)` Method unregisterEditor unregisters the editor from the editor service should be called by the editor upon getting disposed

Methods inherited from class org.eclipse.gmf.runtime.common.core.service.Service
`addProvider, clearCache, configureProviders, configureProviders, createPriorityCache, execute, executeUnique, getAllProviders, getCachingKey, getPriority, getProviders, isOptimistic, isOptimized, newProviderDescriptor, providerChanged, provides, provides, removeProvider`

Methods inherited from class org.eclipse.gmf.runtime.common.core.service.AbstractProvider
`addProviderChangeListener, fireProviderChange, removeProviderChangeListener`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Methods inherited from interface org.eclipse.gmf.runtime.common.core.service.IProvider
`addProviderChangeListener, provides, removeProviderChangeListener`

Constructor Detail

### EditorService

    protected EditorService()

  Constructs a new editor service.

Method Detail

### getInstance

    public static EditorService getInstance()

  Retrieves the singleton instance of the editor service.

  Returns:
    The editor service singleton.

### openEditor

    public IEditorPart openEditor(IEditorInput editorInput)

  Opens an editor with the given editor input

  Specified by:
    `openEditor` in interface `IEditorProvider`
  Parameters:
    `editorInput` - the editor input object
  Returns:
    the opened IEditorPart
  See Also:
    `IEditorProvider.openEditor(IEditorInput)`

### getEditorsMap

    protected java.util.Map getEditorsMap()

  Returns the editorsMap.

  Returns:
    Map of editors

### registerEditor

    public void registerEditor(IEditorPart editor)

  Method registerEditor registers the editor with the editor service should be called by the editor upon initialization

  Parameters:
    `editor` - to be registered in the editor service

### unregisterEditor

    public void unregisterEditor(IEditorPart editor)

  Method unregisterEditor unregisters the editor from the editor service should be called by the editor upon getting disposed

  Parameters:
    `editor` - to unregister from the editor service

### getRegisteredEditors

    public java.util.List getRegisteredEditors(java.lang.String editorId)

  Returns all registered editors with given id

  Parameters:
    `editorId` - returned editors must have this String id
  Returns:
    List editors matching the String editorId

### getRegisteredEditorParts

    public java.util.List getRegisteredEditorParts()

  Return a list of all editor parts

  Returns:
    List of IEditorPart editors.

Runtime

Guidelines for using Eclipse APIs.

Copyright (c) IBM Corp., Borland Software Corp., and others 2005,2006. All rights reserved.