Package org.eclipse.emf.common.util

Examples of org.eclipse.emf.common.util.BasicEList$EListIterator


    }
    return oclLib.new OrderedSet(packages);
  }

  public OrderedSet getOutsidePackagesByUri(java.lang.String self, Trace trace) {
    List packages = new BasicEList();
    try {

      String nsURI = self;
      Model model = (Model) loadedModelsMap.get(nsURI);
      if (model == null) {
        model = ModulesmanagerPlugin.getDefault().getEMOFRegistry()
            .getEmofByNsURI(nsURI);
        loadedModelsMap.put(nsURI, model);
      }
      Iterator iter = model.getRoots().iterator();
      while (iter.hasNext()) {
        EObject element = (EObject) iter.next();
        if (element instanceof Package) {
          packages.add(element);
        }
      }
    } catch (Exception e) {
      logger.log(Level.SEVERE, "faild to find a package from a nsURI", e);
    }
View Full Code Here


        .hasNext();) {
      Object objet = iter.next();
      if ((objet != null) && (objet instanceof OperationalTransformation)) {
        transfo = (OperationalTransformation) objet;

        List var = new BasicEList();
        var.addAll(getObjectsOf(transfo));

        for (Iterator iter2 = transfo.getModuleImport().iterator(); iter2
            .hasNext();) {
          ModuleImport mod = (ModuleImport) iter2.next();
          var.addAll(getObjectsOf(mod.getImportedModule()));
        }

        for (Iterator iter2 = var.iterator(); iter2.hasNext();) {
          Object obj = iter2.next();
          if (obj instanceof ImperativeOperation) {
            ImperativeOperation imp = (ImperativeOperation) obj;
            if ((imp.getContext() != null)
                && (imp.getContext().getType() != null)
View Full Code Here

    this.properties = properties;
    qvtLib = ModulesmanagerPlugin.getDefault().getQvtLib();
  }

  private OrderedSet getOutsidePackages(java.lang.String self, Trace trace) {
    List packages = new BasicEList();
    try {
      String nsURI = (String) properties.get(self + ".nsURI");
      Model model = ModulesmanagerPlugin.getDefault().getEMOFRegistry()
          .getEmofByNsURI(nsURI);
      Iterator iter = model.getRoots().iterator();
      while (iter.hasNext()) {
        EObject element = (EObject) iter.next();
        if (element instanceof Package) {
          packages.add(element);
        }
      }
    } catch (Exception e) {
      logger.log(Level.SEVERE,"Unkonwn error",e);
    }
View Full Code Here

 
  /**
   * @see org.eclipse.bpel.common.extension.model.ExtensionmodelFactory#findExtensionSets(java.lang.String, org.eclipse.emf.common.util.EList)
   */
  public EList findExtensionMaps(String namespace, EList contents) {
    EList extensionSetList = new BasicEList();
     
    for (Iterator iter = contents.iterator(); iter.hasNext();) {
      EObject element = (EObject) iter.next();
     
      if(element instanceof ExtensionMap && ((ExtensionMap)element).getNamespace().equals(namespace)){
        extensionSetList.add(element);
        ExtensionmodelAdapterFactory adapterFactory = new ExtensionmodelAdapterFactory();
        adapterFactory.adapt(element,ExtensionMapAdapterImpl.class);
      }
     
    }
View Full Code Here

         
          List extensionList = null;
          if(notification.getEventType() == Notification.REMOVE_MANY)
            extensionList = (List) notification.getOldValue();
          else{
            extensionList = new BasicEList();
            extensionList.add(notification.getOldValue());
          }
           
          for (Iterator iter = extensionList.iterator(); iter.hasNext();) {
            Extension extension = (Extension) iter.next();
           
            EObject extendedObject = extension.getExtendedObject();
           
            // if the exended EObject had an adapter, remove it.
            if(extendedObject != null){
              EList adapters = extendedObject.eAdapters();
              EList removeAdapterList = new BasicEList();             
              for (Iterator iter2 = adapters.iterator();iter2.hasNext();) {
                Adapter adapter = (Adapter) iter2.next();
               
                if((adapter instanceof ExtendedObjectUserAdapter && ((ExtendedObjectUserAdapter)adapter).getNamespace().equals(((ExtensionMap)getTarget()).getNamespace()))||
                    adapter instanceof ExtendedObjectAdapter && ((ExtendedObjectAdapter)adapter).getNamespace().equals(((ExtensionMap)getTarget()).getNamespace())){
                  removeAdapterList.add(adapter)
                }
              } 
                
                 for (Iterator iter2 = removeAdapterList.iterator(); iter2.hasNext();) {
                   Adapter adapter = (Adapter) iter2.next();
                   try{
                     ((ExtendedObjectAdapter)adapter).setExtension(null);
                   }catch(ClassCastException e){}
                   extendedObject.eAdapters().remove(adapter);
              }
            }
           
            // Set the Extension attributes to null.
            if (!(notification.getNotifier() instanceof Extension)){
              if(extension.getExtendedObject() != null)
                extension.setExtendedObject(null);
           
              if(extension.getExtensionObject() != null
                extension.setExtensionObject(null);
            }
             
          }
          break;
 
        case Notification.REMOVING_ADAPTER :
       
          ExtensionMap map = (ExtensionMap) notification.getNotifier();   
          Set extendedObjects = map.keySet();
         
          for (Iterator iter = extendedObjects.iterator(); iter.hasNext();) {
            EObject element = (EObject) iter.next();
           
            List remove = new BasicEList();
            for (Iterator iterator = element.eAdapters().iterator(); iterator.hasNext();) {
              Adapter adapter = (Adapter) iterator.next();
              if(adapter instanceof ExtendedObjectUserAdapter ||
                  adapter instanceof ExtendedObjectAdapter)
                remove.add(adapter);
            }
            element.eAdapters().removeAll(remove);
          }
         
          break;
View Full Code Here

    * @customized
    */
   private void removeAdapters(EObject target) {
   
    if(target != null){
      EList removeAdapterList = new BasicEList();
      for (Iterator adapters = target.eAdapters().iterator(); adapters.hasNext(); ){
        Adapter currAdapter = (Adapter)adapters.next();
        if ((currAdapter instanceof ExtendedObjectUserAdapter && ((ExtendedObjectUserAdapter)currAdapter).getNamespace().equals(getNamespace()))||
          (currAdapter instanceof ExtendedObjectAdapter && ((ExtendedObjectAdapter)currAdapter).getNamespace().equals(getNamespace())))
          removeAdapterList.add(currAdapter)
      }
        
         for (Iterator iter = removeAdapterList.iterator(); iter.hasNext();) {
        target.eAdapters().remove(iter.next());
      }
    }
   }
View Full Code Here

    }
   
    static Collection createEmptyCollection(EStructuralFeature feature) {
        Class clazz = feature.getEType().getInstanceClass();
        if (EList.class.isAssignableFrom(clazz)) {
            return new BasicEList();
        }
        if (List.class.isAssignableFrom(clazz)) {
            return new ArrayList();
        }
        if (Set.class.isAssignableFrom(clazz)) {
View Full Code Here

  @SuppressWarnings({ "rawtypes", "unchecked" })
  public String formatComment(Element element, String prefix,
      String propertyFileName) {
    String comment = "";
    EList comments = new BasicEList();

    createAnnotationSourceKey(propertyFileName);
    for (Iterator<String> iter = annotationSourceKeyMap.keySet().iterator(); iter
        .hasNext();) {
      String source = iter.next();
      String key = annotationSourceKeyMap.get(source);
      comment = findDocumentationAnnotation(element, source, key);
      if (comment != null) {
        break;
      }
    }

    if (comment != null) {
      comments.add(comment);
    } else {
      comments = element.getOwnedComments();
    }

    return getFormatedComment(comments, prefix, null);
View Full Code Here

   */
  @SuppressWarnings({ "rawtypes", "unchecked" })
  public String formatParameterComment(Parameter parameter, String prefix,
      String annotation, String propertyFileName) {
    String comment = "";
    EList comments = new BasicEList();
    createAnnotationSourceKey(propertyFileName);
    for (Iterator iter = annotationSourceKeyMap.keySet().iterator(); iter
        .hasNext();) {
      String source = (String) iter.next();
      String key = annotationSourceKeyMap.get(source);
      comment = findDocumentationAnnotation(parameter, source, key);
      if (comment != null) {
        break;
      }
    }

    if (comment != null) {
      comments.add(comment);
    } else {
      comments = parameter.getOwnedComments();
    }

    if (comments.isEmpty()) {
      comment = prefix
          + "@"
          + annotation
          + " "
          + ((parameter.getDirection()
View Full Code Here

   
    // For all types
    for(EDataType type : typesAndValues.keySet()){
     
      // Test 1-1 = true
      EList args = new BasicEList();     
      args.add(createEqOperation(type, true, false));
      args.add(createNeqOperation(type, true, true));     
      assertTrue(tested.or(args));
     
      // Test 1-0 = true
      args = new BasicEList();     
      args.add(createEqOperation(type, true, false));
      args.add(createNeqOperation(type, false, true));     
      assertTrue(tested.or(args));
     
      // Test 0-1 = true
      args = new BasicEList();     
      args.add(createEqOperation(type, false, false));
      args.add(createNeqOperation(type, true, true));     
      assertTrue(tested.or(args));
     
      // Test 0-0 = false
      args = new BasicEList();     
      args.add(createEqOperation(type, false, false));
      args.add(createNeqOperation(type, false, true));     
      assertFalse(tested.or(args));     
    }
  }
View Full Code Here

TOP

Related Classes of org.eclipse.emf.common.util.BasicEList$EListIterator

Copyright © 2018 www.massapicom. 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.