Runtime

## org.eclipse.gmf.runtime.emf.ui.services.modelingassistant
Class ModelingAssistantProvider

    java.lang.Object
      org.eclipse.gmf.runtime.common.core.service.AbstractProvider
          org.eclipse.gmf.runtime.emf.ui.services.modelingassistant.ModelingAssistantProvider

All Implemented Interfaces:
  IProvider, IModelingAssistantProvider

    public abstract class ModelingAssistantProvider

extends AbstractProvider
implements IModelingAssistantProvider

Abstract class for the Modeling Assistant Provider so that subclasses don't have to override methods they do not provide for. Provides some default behavior.

Constructor Summary
`ModelingAssistantProvider()`

Method Summary
`java.util.List` `getRelTypesForSREOnSource(IAdaptable source)` Returns the same list of relationship types as `getRelTypesOnSource`.
`java.util.List` `getRelTypesForSREOnTarget(IAdaptable target)` Returns the same list of relationship types as `getRelTypesOnTarget`.
`java.util.List` `getRelTypesOnSource(IAdaptable source)` Returns an empty list.
`java.util.List` `getRelTypesOnSourceAndTarget(IAdaptable source, IAdaptable target)` Returns an empty list.
`java.util.List` `getRelTypesOnTarget(IAdaptable target)` Returns an empty list.
`java.util.List` `getTypes(java.lang.String hint, IAdaptable data)` Returns an empty list.
`java.util.List` `getTypesForPopupBar(IAdaptable host)` Returns an empty list.
`java.util.List` `getTypesForSource(IAdaptable target, IElementType relationshipType)` Returns an empty list.
`java.util.List` `getTypesForTarget(IAdaptable source, IElementType relationshipType)` Returns an empty list.
`boolean` `provides(IOperation operation)` For the `Get*TypesFor*` operations, this will return true if the corresponding `get*TypesFor*` call does not return an empty list.
`org.eclipse.emf.ecore.EObject` `selectExistingElementForSource(IAdaptable target, IElementType relationshipType)` Pops up a dialog that allows the user to select an existing element that is to be used as the source in a new relationship being created.
`org.eclipse.emf.ecore.EObject` `selectExistingElementForTarget(IAdaptable source, IElementType relationshipType)` Returns null.

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`

Constructor Detail

### ModelingAssistantProvider

    public ModelingAssistantProvider()

Method Detail

### provides

    public boolean provides(IOperation operation)

  For the `Get*TypesFor*` operations, this will return true if the corresponding `get*TypesFor*` call does not return an empty list.

  For the `SelectElementFor*` operations, this will return true if the corresponding `getTypesFor*` call does not return an empty list.

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

### getTypes

    public java.util.List getTypes(java.lang.String hint,
                                   IAdaptable data)

  Returns an empty list.

  Specified by:
    `getTypes` in interface `IModelingAssistantProvider`
  Parameters:
    `hint` - identifies the hint or gesture
    `data` -
    - provides additional data that is required
    - may be null depending on the hint
  Returns:
    a list of element types (`IElementType`)

### getRelTypesForSREOnSource

    public java.util.List getRelTypesForSREOnSource(IAdaptable source)

  Returns the same list of relationship types as `getRelTypesOnSource`.

  Specified by:
    `getRelTypesForSREOnSource` in interface `IModelingAssistantProvider`
  Parameters:
    `source` - the source: adapts to editpart, view, element, etc.
  Returns:
    a list of relationship types (`IElementType`)

### getRelTypesForSREOnTarget

    public java.util.List getRelTypesForSREOnTarget(IAdaptable target)

  Returns the same list of relationship types as `getRelTypesOnTarget`.

  Specified by:
    `getRelTypesForSREOnTarget` in interface `IModelingAssistantProvider`
  Parameters:
    `target` - the target: adapts to editpart, view, element, etc.
  Returns:
    a list of relationship types (`IElementType` objects)

### getRelTypesOnSource

    public java.util.List getRelTypesOnSource(IAdaptable source)

  Returns an empty list.

  Specified by:
    `getRelTypesOnSource` in interface `IModelingAssistantProvider`
  Parameters:
    `source` - the source: adapts to editpart, view, element, etc.
  Returns:
    a list of relationship types (`IElementType`)

### getRelTypesOnTarget

    public java.util.List getRelTypesOnTarget(IAdaptable target)

  Returns an empty list.

  Specified by:
    `getRelTypesOnTarget` in interface `IModelingAssistantProvider`
  Parameters:
    `target` - the target: adapts to editpart, view, element, etc.
  Returns:
    a list of relationship types (`IElementType`)

### getRelTypesOnSourceAndTarget

    public java.util.List getRelTypesOnSourceAndTarget(IAdaptable source,
                                                       IAdaptable target)

  Returns an empty list.

  Specified by:
    `getRelTypesOnSourceAndTarget` in interface `IModelingAssistantProvider`
  Parameters:
    `source` - the source: adapts to editpart, view, element, etc.
    `target` - the target: adapts to editpart, view, element, etc.
  Returns:
    a list of relationship types (`IElementType`)

### getTypesForSource

    public java.util.List getTypesForSource(IAdaptable target,
                                            IElementType relationshipType)

  Returns an empty list.

  Specified by:
    `getTypesForSource` in interface `IModelingAssistantProvider`
  Parameters:
    `target` - the target: adapts to editpart, view, element, etc.
    `relationshipType` - the relationship type to be created
  Returns:
    a list of types for the new source (`IElementType` objects)

### getTypesForTarget

    public java.util.List getTypesForTarget(IAdaptable source,
                                            IElementType relationshipType)

  Returns an empty list.

  Specified by:
    `getTypesForTarget` in interface `IModelingAssistantProvider`
  Parameters:
    `source` - the source: adapts to editpart, view, element, etc.
    `relationshipType` - the relationship type to be created
  Returns:
    a list of types for the new target (`IElementType` objects)

### selectExistingElementForSource

    public org.eclipse.emf.ecore.EObject selectExistingElementForSource(IAdaptable target,
                                                                        IElementType relationshipType)

  Description copied from interface: `IModelingAssistantProvider`
  Pops up a dialog that allows the user to select an existing element that is to be used as the source in a new relationship being created.

  Specified by:
    `selectExistingElementForSource` in interface `IModelingAssistantProvider`
  Parameters:
    `target` - the target: adapts to editpart, view, element, etc.
    `relationshipType` - the relationship type to be created
  Returns:
    Returns the `EObject` the user selected, or null if an error occurred or the gesture was cancelled.

### selectExistingElementForTarget

    public org.eclipse.emf.ecore.EObject selectExistingElementForTarget(IAdaptable source,
                                                                        IElementType relationshipType)

  Returns null.

  Specified by:
    `selectExistingElementForTarget` in interface `IModelingAssistantProvider`
  Parameters:
    `source` - the source: adapts to editpart, view, element, etc.
    `relationshipType` - the relationship type to be created
  Returns:
    Returns the `IElement` the user selected, or null if an error occurred or the gesture was cancelled.

### getTypesForPopupBar

    public java.util.List getTypesForPopupBar(IAdaptable host)

  Returns an empty list.

  Specified by:
    `getTypesForPopupBar` in interface `IModelingAssistantProvider`
  Parameters:
    `host` - the host on which the popup bar will be displayed: adapts to editpart, view, element, etc.
  Returns:
    a list of element types (`IElementType`)

Runtime

Guidelines for using Eclipse APIs.

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