Package org.eclipse.emf.common.util

Examples of org.eclipse.emf.common.util.EList


   * <!-- end-user-doc -->
   * @generated NOT
   */
  public List getChangedDataObjects()
  {
    EList result = new UniqueEList.FastCompare(getCachedDeletedObjects());
    result.addAll(getCachedCreatedObjects());
    for (Iterator i = getObjectChanges().iterator(); i.hasNext(); )
    {
      Map.Entry entry = (Map.Entry)i.next();
      result.add(entry.getKey());
    }
    return result;
  }
View Full Code Here


   * <!-- end-user-doc -->
   * @generated NOT
   */
  public List getProperties()
  {
    final EList allFeatures = getEAllStructuralFeatures();
    if (allFeatures != allFeaturesCache)
    {
      allFeaturesCache = allFeatures;
      allProperties = allExtendedProperties = null;
    }
View Full Code Here

    return allProperties;
  }

  public List getAllExtendedProperties()
  {
    final EList allFeatures = getEAllStructuralFeatures();
    if (allFeatures != allFeaturesCache)
    {
      allFeaturesCache = allFeatures;
      allProperties = allExtendedProperties = null;
    }
View Full Code Here

   * <!-- end-user-doc -->
   * @generated NOT
   */
  public List getChangedDataObjects()
  {
    EList result = new UniqueEList.FastCompare(getCachedDeletedObjects());
    result.addAll(getCachedCreatedObjects());
    for (Iterator i = getObjectChanges().iterator(); i.hasNext(); )
    {
      Map.Entry entry = (Map.Entry)i.next();
      result.add(entry.getKey());
    }
    return result;
  }
View Full Code Here

    /*
     * @see IStructuredContentProvider#getElements(Object)
     */
    @SuppressWarnings("unchecked")
    public Object[] getElements(Object element) {
      EList elist = new BasicEList();

      if (element == null) {
        System.err.println("getElements : element null");
      } else if (!(element instanceof Model)) {
        System.err.println("getElements : element pas de type Model");
      } else if (!element.equals(input)) {
        System.err.println("getElements : element != input");
      } else {
        OperationalTransformation opt = null;
        try {
          List listRoot = ((Model) element).getRoots();
          for (Iterator iterator = listRoot.iterator(); iterator
              .hasNext()
              && opt == null;) {
            EObject myObject = (EObject) iterator.next();
            if (myObject instanceof OperationalTransformation)
              opt = (OperationalTransformation) myObject;
          }
        } catch (Exception e) {
          UiPlugin.getDefault().getLogger()
              .log(java.util.logging.Level.WARNING,
                  "Unknown error", e);
        }
        if (opt != null)
          elist.add(opt);
      }
      Object[] res = elist.toArray();
      return res;
    }
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

    return extensionSetList;
  }

  public Adapter getExtensionAdapter(EObject extendedObject, String namespace) {
   
    EList adapterList = extendedObject.eAdapters();
    for (Iterator iter = adapterList.iterator(); iter.hasNext();) {
      Adapter element = (Adapter) iter.next();
      if(element instanceof ExtendedObjectUserAdapter && ((ExtendedObjectUserAdapter)element).getNamespace().equals(namespace)){
        return element;       
      }
    }
View Full Code Here

           
            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);
View Full Code Here

    if(extendedObject!=null){
   
      // First check if the is an adapted associated with this object.
      // If there is, the adapter points to the Extension object.  Return this
      // object.
      EList adapterList = extendedObject.eAdapters();
         
      for (Iterator iter = adapterList.iterator(); iter.hasNext();) {
        Adapter element = (Adapter) iter.next();
        if(element instanceof ExtendedObjectAdapter && ((ExtendedObjectAdapter)element).getNamespace().equals(getNamespace())){
          extension = ((ExtendedObjectAdapter)element).getExtension();
          break;
        }
      }
         
      // Was the extension found though the adapter?  Not if it's null.
      // There is no adapter associated with this bject so we must search the
      // Extension list.  Once the Extension is found, associate an adapter with this
      // object to improve performance in future queries.
      if(extension == null){
         
        EList extensionList = getExtensions();
           
        for (Iterator iter = extensionList.iterator(); iter.hasNext();) {
          Extension ext = (Extension) iter.next();
         
          if (ext.getExtendedObject() != null && ext.getExtendedObject().equals(extendedObject)){
            extension = ext;
           
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

TOP

Related Classes of org.eclipse.emf.common.util.EList

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.