Runtime

## org.eclipse.gmf.runtime.diagram.ui.services.editpart
Class EditPartService

    java.lang.Object
      org.eclipse.gmf.runtime.common.core.service.AbstractProvider
          org.eclipse.gmf.runtime.common.core.service.Service
              org.eclipse.gmf.runtime.diagram.ui.services.editpart.EditPartService

All Implemented Interfaces:
  EditPartFactory, java.util.EventListener, org.eclipse.gmf.runtime.diagram.ui.internal.services.editpart.IEditPartProvider, IProvider, IProviderChangeListener

public final class EditPartService
extends Service
implements org.eclipse.gmf.runtime.diagram.ui.internal.services.editpart.IEditPartProvider, EditPartFactory

A service that supports the creation of editpart elements. Default editparts will be created if no sub-implementation creates one.

See Also:
  `EditPartService.createGraphicEditPart(View)`

Nested Class Summary
`protected static class` `EditPartService.ProviderDescriptor` A descriptor for `ISemanticProvider` defined by a configuration element.

Field Summary

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

Method Summary
`EditPart` `createEditPart(EditPart context, java.lang.Object model)`
`IGraphicalEditPart` `createGraphicEditPart(View view)` Creates an `IGraphicalEditPart` instance by forwarding a `CreateGraphicEditPartOperation` to the registered providers.
`protected java.util.Map` `createPriorityCache()` Creates a map for caching service providers keyed by the values returned in `EditPartService.getCachingKey(IOperation)`.
`RootEditPart` `createRootEditPart(Diagram diagram)` Creates a `RootEditPart`.
`protected java.lang.Object` `getCachingKey(IOperation operation)` Gets the key used to cache service providers that provide for `operation` in the map created by `EditPartService.createPriorityCache()`.
`static EditPartService` `getInstance()` Signleton constructor.
`protected Service.ProviderDescriptor` `newProviderDescriptor(IConfigurationElement element)` Creates a new provider descriptor for the specified configuration `element`.

Methods inherited from class org.eclipse.gmf.runtime.common.core.service.Service
`addProvider, clearCache, configureProviders, configureProviders, execute, executeUnique, getAllProviders, getPriority, getProviders, isOptimistic, isOptimized, 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`

Method Detail

### getInstance

    public static EditPartService getInstance()

  Signleton constructor.

  Returns:
    the Signleton instance

### newProviderDescriptor

    protected Service.ProviderDescriptor newProviderDescriptor(IConfigurationElement element)

  Description copied from class: `Service`
  Creates a new provider descriptor for the specified configuration `element`.

  Overrides:
    `newProviderDescriptor` in class `Service`
  Parameters:
    `element` - The configuration element from which to create the descriptor.
  Returns:
    A new provider descriptor.
  See Also:
    `Service.newProviderDescriptor(org.eclipse.core.runtime.IConfigurationElement)`

### createPriorityCache

    protected java.util.Map createPriorityCache()

  Description copied from class: `Service`
  Creates a map for caching service providers keyed by the values returned in `Service.getCachingKey(IOperation)`.

  Overrides:
    `createPriorityCache` in class `Service`
  Returns:
    the new map
  See Also:
    `Service.createPriorityCache()`

### getCachingKey

    protected java.lang.Object getCachingKey(IOperation operation)

  Description copied from class: `Service`
  Gets the key used to cache service providers that provide for `operation` in the map created by `Service.createPriorityCache()`.

  Overrides:
    `getCachingKey` in class `Service`
  Parameters:
    `operation` - `IOperation` for which the key will be retrieved
  Returns:
    the key into the service providers cache

### createGraphicEditPart

    public IGraphicalEditPart createGraphicEditPart(View view)

  Creates an `IGraphicalEditPart` instance by forwarding a `CreateGraphicEditPartOperation` to the registered providers. The supplied parameter is the editpart's constructor parameter.

  The following default editparts are created if none is created by a provider.

  - `IDiagramView` ... `DiagramEditPart`
  - `ILabelView</code< ... <code>LabelEditPart`
  - `ITextCompartmentView` ... `TextCompartmentEditPart`

  Specified by:
    `createGraphicEditPart` in interface `org.eclipse.gmf.runtime.diagram.ui.internal.services.editpart.IEditPartProvider`
  Parameters:
    `view` - the view element controlled by the created editpart
  Returns:
    an instance.

### createEditPart

    public EditPart createEditPart(EditPart context,
                                   java.lang.Object model)

  Specified by:
    `createEditPart` in interface `EditPartFactory`

### createRootEditPart

    public RootEditPart createRootEditPart(Diagram diagram)

  Description copied from interface: `org.eclipse.gmf.runtime.diagram.ui.internal.services.editpart.IEditPartProvider`
  Creates a `RootEditPart`.

  Specified by:
    `createRootEditPart` in interface `org.eclipse.gmf.runtime.diagram.ui.internal.services.editpart.IEditPartProvider`
  Parameters:
    `diagram` - `Diagram` notation object that is the context for the operation.
  Returns:
    the `RootEditPart`

Runtime

Guidelines for using Eclipse APIs.

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