Runtime

## org.eclipse.gmf.runtime.diagram.core.providers
Class AbstractViewProvider

    java.lang.Object
      org.eclipse.gmf.runtime.common.core.service.AbstractProvider
          org.eclipse.gmf.runtime.diagram.core.providers.AbstractViewProvider

All Implemented Interfaces:
  IProvider, IViewProvider

    public class AbstractViewProvider

extends AbstractProvider
implements IViewProvider

Implements of the `IViewProvider` interface. This implementations invokes the approrpiate factory method by inspecting the supplied operation and provides the actual view creation functionality.

Nested Class Summary
`protected static class` `AbstractViewProvider.ClassToCreationMethodMap`

Field Summary
`static AbstractViewProvider.ClassToCreationMethodMap` `classToCreateMethod`

Constructor Summary
`AbstractViewProvider()`

Method Summary
`Diagram` `createDiagram(IAdaptable contextElement, java.lang.String diagramKind, PreferencesHint preferencesHint)` create an `Diagram` element.
`Edge` `createEdge(IAdaptable semanticAdapter, View containerView, java.lang.String semanticHint, int index, boolean persisted, PreferencesHint preferencesHint)` create an `Edge` element.
`Node` `createNode(IAdaptable semanticAdapter, View containerView, java.lang.String semanticHint, int index, boolean persisted, PreferencesHint preferencesHint)` create a `Node`.
`protected java.lang.Class` `getDiagramViewClass(IAdaptable semanticAdapter, java.lang.String diagramKind)` Returns the diagram view class to instantiate based on the passed params
`protected java.lang.Class` `getEdgeViewClass(IAdaptable semanticAdapter, View containerView, java.lang.String semanticHint)` Returns the edge view class to instantiate based on the passed params
`protected java.lang.Class` `getNodeViewClass(IAdaptable semanticAdapter, View containerView, java.lang.String semanticHint)` Returns the node view class to instantiate based on the passed params
`protected org.eclipse.emf.ecore.EClass` `getSemanticEClass(IAdaptable semanticAdapter)` Returns the EClass associated with the semantic adapter
`protected org.eclipse.emf.ecore.EObject` `getSemanticElement(IAdaptable semanticAdapter)` Returns the semantic element associated with the semantic adapter
`protected org.eclipse.emf.ecore.EObject` `getSemanticElement(IAdaptable semanticAdapter, org.eclipse.emf.transaction.TransactionalEditingDomain domain)` Returns the semantic element associated with the semantic adapter
`protected boolean` `provides(CreateDiagramViewOperation operation)` Determines whether this provider can provide for the specified diagram view operation
`protected boolean` `provides(CreateEdgeViewOperation operation)` Determines whether this provider can provide for the specified edge view operation
`protected boolean` `provides(CreateNodeViewOperation operation)` Determines whether this provider can provide for the specified node view operation
`protected boolean` `provides(CreateViewForKindOperation op)` Determines whether this provider can provide for the specified view creation operation
`boolean` `provides(IOperation operation)` Determines whether this view provider can provide for the required operation It inspects the type of view operation and calls the corresponding `provides` method.

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, removeProviderChangeListener`

Field Detail

### classToCreateMethod

    public static AbstractViewProvider.ClassToCreationMethodMap classToCreateMethod

Constructor Detail

### AbstractViewProvider

    public AbstractViewProvider()

Method Detail

### provides

    public final boolean provides(IOperation operation)

  Determines whether this view provider can provide for the required operation It inspects the type of view operation and calls the corresponding `provides` method.

  Specified by:
    `provides` in interface `IProvider`
  Parameters:
    `operation` - The operation in question.
  Returns:
    `true` if this provider provides the operation; `false` otherwise.
  See Also:
    `IProvider.provides(IOperation)`

### createDiagram

    public final Diagram createDiagram(IAdaptable contextElement,
                                       java.lang.String diagramKind,
                                       PreferencesHint preferencesHint)

  Description copied from interface: `IViewProvider`
  create an `Diagram` element.

  Specified by:
    `createDiagram` in interface `IViewProvider`
    `diagramKind` - indicates the diagram type
    `preferencesHint` - The preference hint that is to be used to find the appropriate preference store from which to retrieve diagram preference values. The preference hint is mapped to a preference store in the preference registry <@link DiagramPreferencesRegistry>.
  Returns:
    the created `Diagram`

### createEdge

    public final Edge createEdge(IAdaptable semanticAdapter,
                                 View containerView,
                                 java.lang.String semanticHint,
                                 int index,
                                 boolean persisted,
                                 PreferencesHint preferencesHint)

  Description copied from interface: `IViewProvider`
  create an `Edge` element.

  Specified by:
    `createEdge` in interface `IViewProvider`
    `containerView` - the container view that will contain the created view.
    `index` - position in the container view's list of children views.
    `persisted` - indicates if the created edge will be persisted or not
    `preferencesHint` - The preference hint that is to be used to find the appropriate preference store from which to retrieve diagram preference values. The preference hint is mapped to a preference store in the preference registry <@link DiagramPreferencesRegistry>.
  Returns:
    the created `Edge`

### createNode

    public final Node createNode(IAdaptable semanticAdapter,
                                 View containerView,
                                 java.lang.String semanticHint,
                                 int index,
                                 boolean persisted,
                                 PreferencesHint preferencesHint)

  Description copied from interface: `IViewProvider`
  create a `Node`.

  Specified by:
    `createNode` in interface `IViewProvider`
    `containerView` - the container view that will contain the created view.
    `index` - position in the container view's list of children views.
    `persisted` - indicates if the created view will be persisted or not
    `preferencesHint` - The preference hint that is to be used to find the appropriate preference store from which to retrieve diagram preference values. The preference hint is mapped to a preference store in the preference registry <@link DiagramPreferencesRegistry>.
  Returns:
    the created `Node`

### provides

    protected boolean provides(CreateViewForKindOperation op)

  Determines whether this provider can provide for the specified view creation operation

  Parameters:
    `operation` - Contains a semantic kind and a containerView
  Returns:
    boolean

### provides

    protected boolean provides(CreateDiagramViewOperation operation)

  Determines whether this provider can provide for the specified diagram view operation

  Parameters:
    `operation` -
  Returns:
    boolean

### provides

    protected boolean provides(CreateEdgeViewOperation operation)

  Determines whether this provider can provide for the specified edge view operation

  Parameters:
    `operation` -
  Returns:
    boolean

### provides

    protected boolean provides(CreateNodeViewOperation operation)

  Determines whether this provider can provide for the specified node view operation

  Parameters:
    `operation` -
  Returns:
    boolean

### getDiagramViewClass

    protected java.lang.Class getDiagramViewClass(IAdaptable semanticAdapter,
                                                  java.lang.String diagramKind)

  Returns the diagram view class to instantiate based on the passed params

  Parameters:
    `semanticAdapter` - TODO
    `semanticAdapter` -
  Returns:
    Class

### getEdgeViewClass

    protected java.lang.Class getEdgeViewClass(IAdaptable semanticAdapter,
                                               View containerView,
                                               java.lang.String semanticHint)

  Returns the edge view class to instantiate based on the passed params

  Parameters:
    `semanticAdapter` -
    `containerView` -
    `semanticHint` -
  Returns:
    Class

### getNodeViewClass

    protected java.lang.Class getNodeViewClass(IAdaptable semanticAdapter,
                                               View containerView,
                                               java.lang.String semanticHint)

  Returns the node view class to instantiate based on the passed params

  Parameters:
    `semanticAdapter` -
    `containerView` -
    `semanticHint` -
  Returns:
    Class

### getSemanticEClass

    protected org.eclipse.emf.ecore.EClass getSemanticEClass(IAdaptable semanticAdapter)

  Returns the EClass associated with the semantic adapter

  Parameters:
    `semanticAdapter` -
  Returns:
    EClass

### getSemanticElement

    protected org.eclipse.emf.ecore.EObject getSemanticElement(IAdaptable semanticAdapter)

  Returns the semantic element associated with the semantic adapter

  Parameters:
    `semanticAdapter` -
  Returns:
    EClass

### getSemanticElement

    protected org.eclipse.emf.ecore.EObject getSemanticElement(IAdaptable semanticAdapter,
                                                               org.eclipse.emf.transaction.TransactionalEditingDomain domain)

  Returns the semantic element associated with the semantic adapter

  Parameters:
    `semanticAdapter` -
  Returns:
    EClass

Runtime

Guidelines for using Eclipse APIs.

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