Runtime

## org.eclipse.gmf.runtime.diagram.ui.resources.editor.document
Class DocumentProviderRegistry

    java.lang.Object
      org.eclipse.gmf.runtime.diagram.ui.resources.editor.document.DocumentProviderRegistry

public class DocumentProviderRegistry
extends java.lang.Object

This registry manages shared document providers. Document providers are specified in `plugin.xml` either per name extension or per editor input type. A name extension rule always overrules an editor input type rule. Editor input type rules follow the same rules `IAdapterManager` used to find object adapters.

See Also:
  `IAdapterManager`

Nested Class Summary
`static interface` `DocumentProviderRegistry.IDocumentProviderSelector`

Field Summary
`java.util.Map` `fExtensionMapping` The mapping between name extensions and configuration elements.
`java.util.Map` `fInputTypeMapping` The mapping between editor input type names and configuration elements.

Method Summary
`protected java.util.Set` `findInputTypeMapping(java.lang.Class type)` Returns the appropriate configuration element for the given type.
`static DocumentProviderRegistry` `getDefault()` Returns the standard document provider registry.
`IDocumentProvider` `getDocumentProvider(IEditorInput editorInput, DocumentProviderRegistry.IDocumentProviderSelector selector)` Returns the shared document for the type of the given editor input.
`IDocumentProvider` `getDocumentProvider(java.lang.String extension, DocumentProviderRegistry.IDocumentProviderSelector selector)` Returns a shared document provider for the given name extension.

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

Field Detail

### fExtensionMapping

    public java.util.Map fExtensionMapping

  The mapping between name extensions and configuration elements.

### fInputTypeMapping

    public java.util.Map fInputTypeMapping

  The mapping between editor input type names and configuration elements.

Method Detail

### getDefault

    public static DocumentProviderRegistry getDefault()

  Returns the standard document provider registry.

  Returns:
    the default document provider registry

### getDocumentProvider

    public IDocumentProvider getDocumentProvider(java.lang.String extension,
                                                 DocumentProviderRegistry.IDocumentProviderSelector selector)

  Returns a shared document provider for the given name extension.

  Parameters:
    `extension` - the name extension to be used for lookup
  Returns:
    the shared document provider or `null`

### findInputTypeMapping

    protected java.util.Set findInputTypeMapping(java.lang.Class type)

  Returns the appropriate configuration element for the given type. If there is no configuration element for the type's name, first the list of super classes is searched, and if not successful the list of all interfaces.

  Parameters:
    `type` - a `Class` object
  Returns:
    an input type mapping or `null`

### getDocumentProvider

    public IDocumentProvider getDocumentProvider(IEditorInput editorInput,
                                                 DocumentProviderRegistry.IDocumentProviderSelector selector)

  Returns the shared document for the type of the given editor input.

  Parameters:
    `editorInput` - the input for whose type the provider is looked up
  Returns:
    the shared document provider

Runtime

Guidelines for using Eclipse APIs.

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