Examples of EFactory


Examples of org.eclipse.emf.ecore.EFactory

    // we will just let ecore do it
    element.eSet(reference, value);   
  }

  private EObject createElement(EClass eClass) {
    EFactory ep = resource.getResourceSet().getPackageRegistry().getEFactory(eClass.getEPackage().getNsURI());
    return ep.create(eClass);
  }
View Full Code Here

Examples of org.eclipse.emf.ecore.EFactory

          // resolve it
          EClass found = GmfGenTestCase.resolveSimpleEClass(nodeName);
          assertNotNull("Could not find EClass for '" + nodeName + "'", found);
         
          // then instantiate it
          EFactory factory = ContainmentTestCase.getAllClasses().get(found);
          EObject obj = factory.create(found);
          assertNotNull("Factory returned a null object for '" + nodeName + "'", obj);
         
          // save it
          edgeTypes.put(nodeName, obj);
        }
View Full Code Here

Examples of org.eclipse.emf.ecore.EFactory

    for (EClass typ2 : EdgeTypes.getEdgeTypes()) {
      // make concrete
      EClass typ = findConcreteTypeFor(typ2);
     
      // find the factory for it
      EFactory factory = ContainmentTestCase.getAllClasses().get(typ);
      assertNotNull("Could not find factory for '" + typ.getName() + "'", factory);
     
      // instantiate the object
      EObject obj = factory.create(typ);
     
      // the 'from' and to' should be null, so we need to remove this phantom edge
      assertTrue("We should remove type " + typ.getName() + ": " + obj,
          RemovePhantomEdgesAction.shouldRemove(obj));
    }
View Full Code Here

Examples of org.eclipse.emf.ecore.EFactory

          isEdge = true;
      }
      if (isEdge) continue;
     
      // find the factory for it
      EFactory factory = ContainmentTestCase.getAllClasses().get(typ);
      assertNotNull("Could not find factory for '" + typ.getName() + "'", factory);
     
      // instantiate the object
      EObject obj = factory.create(typ);
     
      // we should not remove this non-edge object
      assertFalse("Asking to remove non-edge object '" + typ.getName() + "' was unexpectedly successful", RemovePhantomEdgesAction.shouldRemove(obj));
    }
   
View Full Code Here

Examples of org.eclipse.emf.ecore.EFactory

      // instantiate all non-abstract classes in this package
      if (c instanceof EClass && !((EClass) c).isAbstract()) {
        EClass target = (EClass) c;
       
        // we should know of the factory to create the model element
        EFactory factory = getFactoryMap().get( target.getEPackage() );
        assertNotNull("Couldn't find a factory for package: " + target.getEPackage(), factory);
        EObject obj;
        try {
          obj = factory.create( target );
        } catch (IllegalArgumentException e) {
          throw new RuntimeException("Could not create '" + target + "' in EPackage '" + target.getEPackage() + "' from factory: " + factory, e);
        }
       
        if (obj instanceof GeneratedElement) {
View Full Code Here

Examples of org.eclipse.emf.ecore.EFactory

   
    @Override
    protected void registerBindings(Map bindings) {
        super.registerBindings(bindings);
       
        final EFactory wcsFactory = Wcs111Factory.eINSTANCE;
        register(bindings, wcsFactory, WCS._GetCapabilities);
        register(bindings, wcsFactory, WCS.RequestBaseType);
        register(bindings, wcsFactory, WCS._DescribeCoverage);
        register(bindings, wcsFactory, WCS._GetCoverage);
        register(bindings, wcsFactory, WCS.DomainSubsetType);
View Full Code Here

Examples of org.eclipse.emf.ecore.EFactory

                return null;
            }

            protected void handleUnknownFeature(String prefix, String name, boolean isElement, EObject peekObject, String value) {
                if (objects.size() == 1) {
                    EFactory eFactory;
                    EClassifier type;
                    String typeQName = getXSIType();
                    if (typeQName == null) {
                        type = defaultRootType(prefix, name, isElement, peekObject, value);
                        if (type == null)
View Full Code Here

Examples of org.eclipse.emf.ecore.EFactory

     */
   
   

    // get company factory
    EFactory graphFactory = graphPackage.getEFactoryInstance();
    //EFactory graphFactory2 = graphPackage2.getEFactoryInstance();
   
    // using the factory create instance of company class and
    // set company name
    //EObject company2 = graphFactory2.create(oNodeClass);
    //company2.eSet(oNodeName, "MyNode2");
    EObject company = graphFactory.create(oNodeClass);
    company.eSet(oNodeName, "MyNode");

    // create an instance of employee class
    EObject employee = graphFactory.create(oArcClass);
    //using reflective API initialize name of employee
    employee.eSet(oArcName, "MyArc");

    // create an instance of department class
   
View Full Code Here

Examples of org.eclipse.emf.ecore.EFactory

    {}

   

    // get company factory
    EFactory graphFactory = graphPackage.getEFactoryInstance();
    //EFactory graphFactory2 = graphPackage2.getEFactoryInstance();
   
    // using the factory create instance of company class and
    // set company name
    //EObject company2 = graphFactory2.create(oNodeClass);
    //company2.eSet(oNodeName, "MyNode2");
    EObject company = graphFactory.create(oNodeClass);
    company.eSet(oNodeName, "MyNode");

    // create an instance of employee class
    EObject employee = graphFactory.create(oArcClass);
    //using reflective API initialize name of employee
    employee.eSet(oArcName, "MyArc");

    // create an instance of department class
   
View Full Code Here

Examples of org.eclipse.emf.ecore.EFactory

    companyPackage.getEClassifiers().add(oNodeClass);
    companyPackage.getEClassifiers().add(oArcClass);
    companyPackage.getEClassifiers().add(oTCGClass);

    // get company factory
    EFactory companyFactory = companyPackage.getEFactoryInstance();
    //companyFactory.
   
    // using the factory create instance of company class and
    // set company name
    EObject company = companyFactory.create(oNodeClass);
    company.eSet(oNodeName, "MyCompany");

    // create an instance of employee class
    EObject employee = companyFactory.create(oArcClass);
    //using reflective API initialize name of employee
    employee.eSet(oArcName, "John");

    // create an instance of department class
   
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.