org.eclipse.m2m.atl.adt.ui.text.atl
Class AtlCompletionDataSource

java.lang.Object
  extended by org.eclipse.m2m.atl.adt.ui.text.atl.AtlCompletionDataSource

public class AtlCompletionDataSource
extends java.lang.Object

The AtlCompletionDataSource, retrieves data from EMF metamodels.


Constructor Summary
AtlCompletionDataSource(AtlEditor editor)
          Creates an ATL completion data source.
 
Method Summary
static java.lang.Object eGet(org.eclipse.emf.ecore.EObject self, java.lang.String featureName)
          Returns the value of a feature on an EObject.
 org.eclipse.emf.ecore.EClassifier getEClassifierFromAtlType(org.eclipse.emf.ecore.EObject atlType)
          Returns the EMF classifier matching with an ATL type.
 java.util.List getHelperTypesProposals(java.lang.String prefix, int offset)
          Computes types completion for helper, i.e. primitive types and all metamodels types
static org.eclipse.swt.graphics.Image getImage(java.lang.String path)
          Looks for an image in the icons folder.
 java.util.List getMetaElementsProposals(java.lang.String prefix, int offset, int filter)
          Metamodel elements proposals for a given filter.
 java.util.List getMetaFeaturesProposals(java.util.List existing, org.eclipse.emf.ecore.EObject atlType, java.lang.String prefix, int offset)
          Features proposals for a given MetaElement.
 java.util.Collection getMetamodelsProposals(java.lang.String prefix, int offset)
          Metamodels names proposals.
 java.util.List getPathProposals(java.lang.String prefix, int offset)
          Computes proposals for EMF paths.
static java.util.List getProposalsFromList(int offset, java.lang.String prefix, java.lang.Object[] proposals)
           
 java.util.List getURIProposals(java.lang.String prefix, int offset)
          Computes proposals for EMF uris.
static java.util.Map getVariables(org.eclipse.emf.ecore.EObject rule)
          Returns the list of variables.
 java.util.List getVariablesProposals(org.eclipse.emf.ecore.EObject rule, java.lang.String prefix, int offset)
          Returns a list of variables proposals.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AtlCompletionDataSource

public AtlCompletionDataSource(AtlEditor editor)
Creates an ATL completion data source.

Parameters:
editor - the current ATL editor.
Method Detail

getURIProposals

public java.util.List getURIProposals(java.lang.String prefix,
                                      int offset)
Computes proposals for EMF uris.

Parameters:
prefix - the current prefix
offset - the current offset
Returns:
the proposals

getPathProposals

public java.util.List getPathProposals(java.lang.String prefix,
                                       int offset)
Computes proposals for EMF paths.

Parameters:
prefix - the current prefix
offset - the current offset
Returns:
the proposals

getMetaElementsProposals

public java.util.List getMetaElementsProposals(java.lang.String prefix,
                                               int offset,
                                               int filter)
Metamodel elements proposals for a given filter.

Parameters:
prefix - completion prefix
offset - completion offset
filter - the given filter
Returns:
the filtered proposals

getMetamodelsProposals

public java.util.Collection getMetamodelsProposals(java.lang.String prefix,
                                                   int offset)
Metamodels names proposals.

Parameters:
prefix - completion prefix
offset - completion offset
Returns:
the filtered proposals

getMetaFeaturesProposals

public java.util.List getMetaFeaturesProposals(java.util.List existing,
                                               org.eclipse.emf.ecore.EObject atlType,
                                               java.lang.String prefix,
                                               int offset)
Features proposals for a given MetaElement.

Parameters:
existing - the list of features that have ever been typed
atlType - the type under its "OclModelElement" form
prefix - completion prefix
offset - completion offset
Returns:
the proposals

getHelperTypesProposals

public java.util.List getHelperTypesProposals(java.lang.String prefix,
                                              int offset)
Computes types completion for helper, i.e. primitive types and all metamodels types

Parameters:
prefix - completion prefix
offset - completion offset
Returns:
the proposals

getImage

public static org.eclipse.swt.graphics.Image getImage(java.lang.String path)
Looks for an image in the icons folder.

Parameters:
path - the image path
Returns:
the searched Image

eGet

public static java.lang.Object eGet(org.eclipse.emf.ecore.EObject self,
                                    java.lang.String featureName)
Returns the value of a feature on an EObject.

Parameters:
self - the EObject
featureName - the feature name
Returns:
the feature value

getEClassifierFromAtlType

public org.eclipse.emf.ecore.EClassifier getEClassifierFromAtlType(org.eclipse.emf.ecore.EObject atlType)
Returns the EMF classifier matching with an ATL type.

Parameters:
atlType - the ATL type
Returns:
the EMF classifier matching with an ATL type

getVariables

public static java.util.Map getVariables(org.eclipse.emf.ecore.EObject rule)
Returns the list of variables.

Parameters:
rule - the current rule
Returns:
the list of variables

getVariablesProposals

public java.util.List getVariablesProposals(org.eclipse.emf.ecore.EObject rule,
                                            java.lang.String prefix,
                                            int offset)
Returns a list of variables proposals.

Parameters:
rule - the current rule
prefix - current prefix
offset - current offset
Returns:
a list of variables proposals

getProposalsFromList

public static java.util.List getProposalsFromList(int offset,
                                                  java.lang.String prefix,
                                                  java.lang.Object[] proposals)

Copyright 2007 IBM Corporation and others.
All Rights Reserved.