Package org.eclipse.emf.ecore

Examples of org.eclipse.emf.ecore.EObject.eResource()


            Resource r = resources.get(i);
            for( Iterator<EObject> j = r.getAllContents(); j.hasNext(); ) {
                for( Object object : j.next().eCrossReferences() ) {
                    if (object instanceof EObject) {
                        EObject eObject = (EObject) object;
                        Resource otherResource = eObject.eResource();
                        if (otherResource != null && !resources.contains(otherResource)) {
                            resources.add(otherResource);
                        }
                    }
                }
View Full Code Here


          new EmfInferenceHandler(
            part.getEditingDomain(),
            new ArrayList<Object>(), /* affected files */
            new SubProgressMonitor(monitor, 100),
            null /* IAdapter == null */,
            container.eResource()  /* eResource */
          )
      ), monitor, part.getEditingDomain() /* editing domain */, part /* editing part */);
       
      return Status.OK_STATUS;
 
View Full Code Here

          return new EmfInferenceHandler(
            part.getEditingDomain(),
            new ArrayList<Object>(), /* affected files */
            new SubProgressMonitor(monitor, 100),
            null /* IAdapter == null */,
            target.eResource()  /* eResource */);
        }
       
      };
           
      refreshMappings(target, factory, monitor);
View Full Code Here

    String fileExtension = getFileExtension(target);
    if (fileExtension == null) {
      return errorStatus("Cannot move the given object '" + target.eClass().getName() + "' into a separate file." );
    }

    String location = target.eResource().getURI().toPlatformString(true);
    IStructuredSelection selection = new StructuredSelection(ResourcesPlugin.getWorkspace().getRoot().findMember( location ));

    // get a wizard to select the new model element file
    final NewDomainFileWizard wizard = new NewDomainFileWizard(selection,
        suggestedName,
View Full Code Here

          EObject adapterTarget = (EObject) e2DAdapter.getTarget();
          /*
           * Now check if it's the right one (Multiple resources could
           * be attached)
           */
          if (adapterTarget.eResource() == myTarget || adapterTarget.eResource() == null) {
            return e2DAdapter;
          }
        }
      }
    }
View Full Code Here

          EObject adapterTarget = (EObject) e2DAdapter.getTarget();
          /*
           * Now check if it's the right one (Multiple resources could
           * be attached)
           */
          if (adapterTarget.eResource() == myTarget || adapterTarget.eResource() == null) {
            return e2DAdapter;
          }
        }
      }
    }
View Full Code Here

          EObject myTarget = (EObject) getTarget();
          /*
           * Now check if it's the right one (Multiple resources could
           * be attached)
           */
          if (adapterTarget != null && ((EObject)adapterTarget).eResource() == myTarget.eResource()) {
            return e2DAdapter;
          }
        }
       
        if (adapterTarget instanceof EObject) {
View Full Code Here

          EObject myTarget = (EObject) getTarget();
          /*
           * Now check if it's the right one (Multiple resources could
           * be attached)
           */
          if (adapterTarget != null && ((EObject)adapterTarget).eResource() == myTarget.eResource()) {
            return e2DAdapter;
          }
        }
       
        if (adapterTarget instanceof EObject) {
View Full Code Here

    return getGEFWrapper(new DestroyReferenceCommand(req) {
      protected CommandResult doExecuteWithResult(
          IProgressMonitor progressMonitor, IAdaptable info)
          throws ExecutionException {
        EObject referencedObject = getReferencedObject();
        Resource resource = referencedObject.eResource();
        CommandResult result = super.doExecuteWithResult(
            progressMonitor, info);
        if (resource != null) {
          resource.getContents().add(referencedObject);
        }
View Full Code Here

          EObject obj = ModelLoader.load(model);
          migrateSuccessful = true;
         
          try {
            // ask EMF to re-save it
            obj.eResource().save( ModelLoader.getSaveOptions() );
          } catch (IOException e) {
            // IO exception during save
            status.add(AbstractIAMLJob.errorStatus("Could not save loaded model " + model + ": " + e.getMessage(), e));
          }
        } catch (ModelLoadException e) {
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.