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.


Field Summary
static int ALL_METAMODELS
          Metamodel filter types : 0 : input + output metamodels 1 : input metamodels 2 : output metamodels
static int INPUT_METAMODELS
           
static int OUTPUT_METAMODELS
           
static java.lang.String PATH_TAG
          PATH tag value.
static java.lang.String URI_TAG
          URI tag value.
 
Constructor Summary
AtlCompletionDataSource(AtlEditor editor)
          Constructor.
 
Method Summary
static java.lang.Object eGet(org.eclipse.emf.ecore.EObject self, java.lang.String featureName)
           
 org.eclipse.emf.ecore.EClassifier getEClassifierFromAtlType(org.eclipse.emf.ecore.EObject atlType)
           
 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.
static java.util.List getTaggedInformations(java.io.BufferedReader reader, java.lang.String tag)
           
 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)
          Computes the type of a given variable in a given rule.
 java.util.List getVariablesProposals(org.eclipse.emf.ecore.EObject rule, java.lang.String prefix, int offset)
           
 boolean initialized()
          Status method.
static org.eclipse.emf.ecore.resource.Resource load(org.eclipse.emf.common.util.URI modelURI, org.eclipse.emf.ecore.resource.ResourceSet resourceSet)
          Loads a model from an URI in a given ResourceSet.
 void updateDataSource()
          Update method : parsing and metamodel detection
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

URI_TAG

public static final java.lang.String URI_TAG
URI tag value.

See Also:
Constant Field Values

PATH_TAG

public static final java.lang.String PATH_TAG
PATH tag value.

See Also:
Constant Field Values

ALL_METAMODELS

public static final int ALL_METAMODELS
Metamodel filter types : 0 : input + output metamodels 1 : input metamodels 2 : output metamodels

See Also:
Constant Field Values

INPUT_METAMODELS

public static final int INPUT_METAMODELS
See Also:
Constant Field Values

OUTPUT_METAMODELS

public static final int OUTPUT_METAMODELS
See Also:
Constant Field Values
Constructor Detail

AtlCompletionDataSource

public AtlCompletionDataSource(AtlEditor editor)
Constructor.

Parameters:
editor -
Method Detail

initialized

public boolean initialized()
Status method.

Returns:
True if the some metamodels have ever been detected , False if not.

updateDataSource

public void updateDataSource()
Update method : parsing and metamodel detection


getURIProposals

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

Parameters:
prefix -
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

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 -
Returns:
the searched Image

getTaggedInformations

public static java.util.List getTaggedInformations(java.io.BufferedReader reader,
                                                   java.lang.String tag)
                                            throws java.io.IOException
Throws:
java.io.IOException

load

public static org.eclipse.emf.ecore.resource.Resource load(org.eclipse.emf.common.util.URI modelURI,
                                                           org.eclipse.emf.ecore.resource.ResourceSet resourceSet)
                                                    throws java.io.IOException
Loads a model from an URI in a given ResourceSet.

Parameters:
modelURI - URI where the model is stored.
resourceSet - The ResourceSet to load the model in.
Returns:
The packages of the model loaded from the URI.
Throws:
java.io.IOException - If the given file does not exist.

eGet

public static java.lang.Object eGet(org.eclipse.emf.ecore.EObject self,
                                    java.lang.String featureName)

getEClassifierFromAtlType

public org.eclipse.emf.ecore.EClassifier getEClassifierFromAtlType(org.eclipse.emf.ecore.EObject atlType)

getVariables

public static java.util.Map getVariables(org.eclipse.emf.ecore.EObject rule)
Computes the type of a given variable in a given rule. Uses the outline model for that.

Parameters:
ruleName -
variableName -
Returns:
the type of the variable

getVariablesProposals

public java.util.List getVariablesProposals(org.eclipse.emf.ecore.EObject rule,
                                            java.lang.String prefix,
                                            int offset)

Copyright 2007 IBM Corporation and others.
All Rights Reserved.