Search in sources :

Example 81 with EObject

use of org.eclipse.emf.ecore.EObject in project applause by applause.

the class InternalApplauseDslParser method entryRulePlatform.

// $ANTLR end "ruleAttribute"
// $ANTLR start "entryRulePlatform"
// ../org.applause.lang/src-gen/org/applause/lang/parser/antlr/internal/InternalApplauseDsl.g:501:1: entryRulePlatform returns [EObject current=null] : iv_rulePlatform= rulePlatform EOF ;
public final EObject entryRulePlatform() throws RecognitionException {
    EObject current = null;
    EObject iv_rulePlatform = null;
    try {
        // ../org.applause.lang/src-gen/org/applause/lang/parser/antlr/internal/InternalApplauseDsl.g:502:2: (iv_rulePlatform= rulePlatform EOF )
        // ../org.applause.lang/src-gen/org/applause/lang/parser/antlr/internal/InternalApplauseDsl.g:503:2: iv_rulePlatform= rulePlatform EOF
        {
            newCompositeNode(grammarAccess.getPlatformRule());
            pushFollow(FOLLOW_rulePlatform_in_entryRulePlatform1170);
            iv_rulePlatform = rulePlatform();
            state._fsp--;
            current = iv_rulePlatform;
            match(input, EOF, FOLLOW_EOF_in_entryRulePlatform1180);
        }
    } catch (RecognitionException re) {
        recover(input, re);
        appendSkippedTokens();
    } finally {
    }
    return current;
}
Also used : EObject(org.eclipse.emf.ecore.EObject)

Example 82 with EObject

use of org.eclipse.emf.ecore.EObject in project applause by applause.

the class InternalApplauseDslParser method ruleUrlFragment.

// $ANTLR end "entryRuleUrlFragment"
// $ANTLR start "ruleUrlFragment"
// ../org.applause.lang/src-gen/org/applause/lang/parser/antlr/internal/InternalApplauseDsl.g:1278:1: ruleUrlFragment returns [EObject current=null] : (this_UrlPathFragment_0= ruleUrlPathFragment | this_Variable_1= ruleVariable ) ;
public final EObject ruleUrlFragment() throws RecognitionException {
    EObject current = null;
    EObject this_UrlPathFragment_0 = null;
    EObject this_Variable_1 = null;
    enterRule();
    try {
        // ../org.applause.lang/src-gen/org/applause/lang/parser/antlr/internal/InternalApplauseDsl.g:1281:28: ( (this_UrlPathFragment_0= ruleUrlPathFragment | this_Variable_1= ruleVariable ) )
        // ../org.applause.lang/src-gen/org/applause/lang/parser/antlr/internal/InternalApplauseDsl.g:1282:1: (this_UrlPathFragment_0= ruleUrlPathFragment | this_Variable_1= ruleVariable )
        {
            // ../org.applause.lang/src-gen/org/applause/lang/parser/antlr/internal/InternalApplauseDsl.g:1282:1: (this_UrlPathFragment_0= ruleUrlPathFragment | this_Variable_1= ruleVariable )
            int alt19 = 2;
            int LA19_0 = input.LA(1);
            if ((LA19_0 == RULE_ID)) {
                alt19 = 1;
            } else if ((LA19_0 == 26)) {
                alt19 = 2;
            } else {
                NoViableAltException nvae = new NoViableAltException("", 19, 0, input);
                throw nvae;
            }
            switch(alt19) {
                case 1:
                    // ../org.applause.lang/src-gen/org/applause/lang/parser/antlr/internal/InternalApplauseDsl.g:1283:5: this_UrlPathFragment_0= ruleUrlPathFragment
                    {
                        newCompositeNode(grammarAccess.getUrlFragmentAccess().getUrlPathFragmentParserRuleCall_0());
                        pushFollow(FOLLOW_ruleUrlPathFragment_in_ruleUrlFragment2890);
                        this_UrlPathFragment_0 = ruleUrlPathFragment();
                        state._fsp--;
                        current = this_UrlPathFragment_0;
                        afterParserOrEnumRuleCall();
                    }
                    break;
                case 2:
                    // ../org.applause.lang/src-gen/org/applause/lang/parser/antlr/internal/InternalApplauseDsl.g:1293:5: this_Variable_1= ruleVariable
                    {
                        newCompositeNode(grammarAccess.getUrlFragmentAccess().getVariableParserRuleCall_1());
                        pushFollow(FOLLOW_ruleVariable_in_ruleUrlFragment2917);
                        this_Variable_1 = ruleVariable();
                        state._fsp--;
                        current = this_Variable_1;
                        afterParserOrEnumRuleCall();
                    }
                    break;
            }
        }
        leaveRule();
    } catch (RecognitionException re) {
        recover(input, re);
        appendSkippedTokens();
    } finally {
    }
    return current;
}
Also used : EObject(org.eclipse.emf.ecore.EObject)

Example 83 with EObject

use of org.eclipse.emf.ecore.EObject in project benchmarx by eMoflon.

the class EMoflonFamiliesToPersons method saveModels.

public void saveModels(String name) {
    ResourceSet set = new ResourceSetImpl();
    set.getResourceFactoryRegistry().getExtensionToFactoryMap().put(Resource.Factory.Registry.DEFAULT_EXTENSION, new XMIResourceFactoryImpl());
    URI srcURI = URI.createFileURI(RESULTPATH + "/" + name + "Family.xmi");
    URI trgURI = URI.createFileURI(RESULTPATH + "/" + name + "Person.xmi");
    Resource resSource = set.createResource(srcURI);
    Resource resTarget = set.createResource(trgURI);
    EObject colSource = EcoreUtil.copy(getSourceModel());
    EObject colTarget = EcoreUtil.copy(getTargetModel());
    resSource.getContents().add(colSource);
    resTarget.getContents().add(colTarget);
    try {
        resSource.save(null);
        resTarget.save(null);
    } catch (IOException e) {
        e.printStackTrace();
    }
}
Also used : ResourceSetImpl(org.eclipse.emf.ecore.resource.impl.ResourceSetImpl) EObject(org.eclipse.emf.ecore.EObject) XMIResourceFactoryImpl(org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl) Resource(org.eclipse.emf.ecore.resource.Resource) ResourceSet(org.eclipse.emf.ecore.resource.ResourceSet) IOException(java.io.IOException) URI(org.eclipse.emf.common.util.URI)

Example 84 with EObject

use of org.eclipse.emf.ecore.EObject in project benchmarx by eMoflon.

the class MediniQVTFamiliesToPersons method saveModels.

/**
	 * Allows to save the current state of the source and target models
	 * 
	 * @param name : Filename 
	 */
public void saveModels(String name) {
    ResourceSet set = new ResourceSetImpl();
    set.getResourceFactoryRegistry().getExtensionToFactoryMap().put(Resource.Factory.Registry.DEFAULT_EXTENSION, new XMIResourceFactoryImpl());
    URI srcURI = URI.createFileURI(RESULTPATH + "/" + name + "Family.xmi");
    URI trgURI = URI.createFileURI(RESULTPATH + "/" + name + "Person.xmi");
    Resource resSource = set.createResource(srcURI);
    Resource resTarget = set.createResource(trgURI);
    EObject colSource = EcoreUtil.copy(getSourceModel());
    EObject colTarget = EcoreUtil.copy(getTargetModel());
    resSource.getContents().add(colSource);
    resTarget.getContents().add(colTarget);
    try {
        resSource.save(null);
        resTarget.save(null);
    } catch (IOException e) {
        e.printStackTrace();
    }
}
Also used : ResourceSetImpl(org.eclipse.emf.ecore.resource.impl.ResourceSetImpl) EObject(org.eclipse.emf.ecore.EObject) XMIResourceFactoryImpl(org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl) Resource(org.eclipse.emf.ecore.resource.Resource) ResourceSet(org.eclipse.emf.ecore.resource.ResourceSet) IOException(java.io.IOException) URI(org.eclipse.emf.common.util.URI)

Example 85 with EObject

use of org.eclipse.emf.ecore.EObject in project benchmarx by eMoflon.

the class UbtXtendFamiliesToPersons method saveModels.

/**
	 * Allows to save the current state of the source and target models
	 * 
	 * @param name : Filename 
	 */
@Override
public void saveModels(String name) {
    ResourceSet set = new ResourceSetImpl();
    set.getResourceFactoryRegistry().getExtensionToFactoryMap().put(Resource.Factory.Registry.DEFAULT_EXTENSION, new XMIResourceFactoryImpl());
    URI srcURI = URI.createFileURI(RESULTPATH + "/" + name + "Family.xmi");
    URI trgURI = URI.createFileURI(RESULTPATH + "/" + name + "Person.xmi");
    Resource resSource = set.createResource(srcURI);
    Resource resTarget = set.createResource(trgURI);
    EObject colSource = EcoreUtil.copy(getSourceModel());
    EObject colTarget = EcoreUtil.copy(getTargetModel());
    resSource.getContents().add(colSource);
    resTarget.getContents().add(colTarget);
    try {
        resSource.save(null);
        resTarget.save(null);
    } catch (IOException e) {
        e.printStackTrace();
    }
}
Also used : ResourceSetImpl(org.eclipse.emf.ecore.resource.impl.ResourceSetImpl) EObject(org.eclipse.emf.ecore.EObject) XMIResourceFactoryImpl(org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl) Resource(org.eclipse.emf.ecore.resource.Resource) ResourceSet(org.eclipse.emf.ecore.resource.ResourceSet) IOException(java.io.IOException) URI(org.eclipse.emf.common.util.URI)

Aggregations

EObject (org.eclipse.emf.ecore.EObject)7112 AntlrDatatypeRuleToken (org.eclipse.xtext.parser.antlr.AntlrDatatypeRuleToken)1950 Resource (org.eclipse.emf.ecore.resource.Resource)304 Test (org.junit.Test)301 IPropertiesEditionEvent (org.eclipse.emf.eef.runtime.api.notify.IPropertiesEditionEvent)262 PropertiesEditionEvent (org.eclipse.emf.eef.runtime.impl.notify.PropertiesEditionEvent)262 ArrayList (java.util.ArrayList)207 GridData (org.eclipse.swt.layout.GridData)198 SelectionEvent (org.eclipse.swt.events.SelectionEvent)190 URI (org.eclipse.emf.common.util.URI)189 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)187 InternalEObject (org.eclipse.emf.ecore.InternalEObject)181 ReferencesTable (org.eclipse.emf.eef.runtime.ui.widgets.ReferencesTable)162 ReferencesTableListener (org.eclipse.emf.eef.runtime.ui.widgets.ReferencesTable.ReferencesTableListener)162 ViewerFilter (org.eclipse.jface.viewers.ViewerFilter)138 ResourceSet (org.eclipse.emf.ecore.resource.ResourceSet)128 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)127 List (java.util.List)125 XtextResource (org.eclipse.xtext.resource.XtextResource)124 EReference (org.eclipse.emf.ecore.EReference)96