Runtime

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

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

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

    public class ModelingAssistantService

extends Service
implements IModelingAssistantProvider

This service is used to assist the user with modeling gestures.

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

Field Summary

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

Constructor Summary
`ModelingAssistantService()`

Method Summary
`static ModelingAssistantService` `getInstance()` Retrieves the singleton instance of the modeling assistant service.
`java.util.List` `getRelTypesForSREOnSource(IAdaptable source)` Executes the `GetRelTypesForSREOnSourceOperation` using the `FORWARD` execution strategy.
`java.util.List` `getRelTypesForSREOnTarget(IAdaptable target)` Executes the `GetRelTypesForSREOnTargetOperation` using the `FORWARD` execution strategy.
`java.util.List` `getRelTypesOnSource(IAdaptable source)` Executes the `GetRelTypesOnSourceOperation` using the `FORWARD` execution strategy.
`java.util.List` `getRelTypesOnSourceAndTarget(IAdaptable source, IAdaptable target)` Executes the `GetRelTypesOnSourceAndTargetOperation` using the `FORWARD` execution strategy.
`java.util.List` `getRelTypesOnTarget(IAdaptable target)` Executes the `GetRelTypesOnTargetOperation` using the `FORWARD` execution strategy.
`java.util.List` `getTypes(java.lang.String hint, IAdaptable data)` Executes the `GetTypesOperation` using the `FORWARD` execution strategy.
`java.util.List` `getTypesForActionBar(IAdaptable host)` Deprecated. Renamed to `getTypesForPopupBar(IAdaptable)`
`java.util.List` `getTypesForPopupBar(IAdaptable host)` Executes the `GetTypesForPopupBarOperation` using the `FORWARD` execution strategy.
`java.util.List` `getTypesForSource(IAdaptable target, IElementType relationshipType)` Executes the `GetTypesForSourceOperation` using the `FORWARD` execution strategy.
`java.util.List` `getTypesForTarget(IAdaptable source, IElementType relationshipType)` Executes the `GetTypesForTargetOperation` using the `FORWARD` execution strategy.
`protected Service.ProviderDescriptor` `newProviderDescriptor(IConfigurationElement element)` Creates a new provider descriptor for the specified configuration `element`.
`org.eclipse.emf.ecore.EObject` `selectExistingElementForSource(IAdaptable target, IElementType relationshipType)` Executes the `SelectExistingElementForSourceOperation` using the `FIRST` execution strategy.
`org.eclipse.emf.ecore.EObject` `selectExistingElementForTarget(IAdaptable source, IElementType relationshipType)` Executes the `SelectExistingElementForTargetOperation` using the `FIRST` execution strategy.

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

### ModelingAssistantService

    public ModelingAssistantService()

Method Detail

### 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.

### getInstance

    public static ModelingAssistantService getInstance()

  Retrieves the singleton instance of the modeling assistant service.

  Returns:
    The modeling assistant service singleton.

### getTypes

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

  Executes the `GetTypesOperation` using the `FORWARD` execution strategy.

  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`)

### getRelTypesOnSource

    public java.util.List getRelTypesOnSource(IAdaptable source)

  Executes the `GetRelTypesOnSourceOperation` using the `FORWARD` execution strategy.

  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)

  Executes the `GetRelTypesOnTargetOperation` using the `FORWARD` execution strategy.

  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)

  Executes the `GetRelTypesOnSourceAndTargetOperation` using the `FORWARD` execution strategy.

  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`)

### getRelTypesForSREOnSource

    public java.util.List getRelTypesForSREOnSource(IAdaptable source)

  Executes the `GetRelTypesForSREOnSourceOperation` using the `FORWARD` execution strategy.

  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)

  Executes the `GetRelTypesForSREOnTargetOperation` using the `FORWARD` execution strategy.

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

### getTypesForSource

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

  Executes the `GetTypesForSourceOperation` using the `FORWARD` execution strategy.

  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)

  Executes the `GetTypesForTargetOperation` using the `FORWARD` execution strategy.

  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)

  Executes the `SelectExistingElementForSourceOperation` using the `FIRST` execution strategy.

  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)

  Executes the `SelectExistingElementForTargetOperation` using the `FIRST` execution strategy.

  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)

  Executes the `GetTypesForPopupBarOperation` using the `FORWARD` execution strategy.

  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`)

### getTypesForActionBar

    public java.util.List getTypesForActionBar(IAdaptable host)

  Deprecated. Renamed to `getTypesForPopupBar(IAdaptable)`

  Executes the `GetTypesForPopupBarOperation` using the `FORWARD` execution strategy.

  See Also:
    `org.eclipse.gmf.runtime.emf.ui.services.modelingassistant.IModelingAssistantProvider#getTypesForActionBar(IAdaptable)`

Runtime

Guidelines for using Eclipse APIs.

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