Package org.eclipse.emf.ecore

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


        modificationTrackingAdapter = createModificationTrackingAdapter();

        for (TreeIterator<EObject> i = getAllProperContents(getContents()); i.hasNext(); )
        {
          EObject eObject = i.next();
          eObject.eAdapters().add(modificationTrackingAdapter);
        }
      }
      else
      {
        Adapter oldModificationTrackingAdapter = modificationTrackingAdapter;
View Full Code Here


        modificationTrackingAdapter = null;

        for (TreeIterator<EObject> i = getAllProperContents(getContents()); i.hasNext(); )
        {
          EObject eObject = i.next();
          eObject.eAdapters().remove(oldModificationTrackingAdapter);
        }
      }
    }

    if (eNotificationRequired())
View Full Code Here

        modificationTrackingAdapter = createModificationTrackingAdapter();

        for (TreeIterator<EObject> i = getAllProperContents(getContents()); i.hasNext(); )
        {
          EObject eObject = i.next();
          eObject.eAdapters().add(modificationTrackingAdapter);
        }
      }
      else
      {
        Adapter oldModificationTrackingAdapter = modificationTrackingAdapter;
View Full Code Here

        modificationTrackingAdapter = null;

        for (TreeIterator<EObject> i = getAllProperContents(getContents()); i.hasNext(); )
        {
          EObject eObject = i.next();
          eObject.eAdapters().remove(oldModificationTrackingAdapter);
        }
      }
    }

    if (eNotificationRequired())
View Full Code Here

    Class instanceClass = String.class;
    EList<Adapter> adapters = createMock(EList.class);
    String name = "rule";

    expect(object.eClass()).andReturn(eClass);
    expect(object.eAdapters()).andReturn(adapters);

    expect(eClass.getEStructuralFeature("name")).andReturn(nameFeature);

    expect(nameFeature.isMany()).andReturn(false);
    expect(nameFeature.getEType()).andReturn(eType);
View Full Code Here

    Class instanceClass = String.class;
    EList<Adapter> adapters = createMock(EList.class);
    String name = "rule";

    expect(object.eClass()).andReturn(eClass).times(2);
    expect(object.eAdapters()).andReturn(adapters);

    expect(eClass.getEStructuralFeature("name")).andReturn(null);
    expect(eClass.getEStructuralFeature("id")).andReturn(idFeature);

    expect(idFeature.isMany()).andReturn(false);
View Full Code Here

   * @see org.eclipse.core.runtime.IAdapterFactory#getAdapter(java.lang.Object, java.lang.Class)
   */
  public Object getAdapter(Object adaptableObject, Class adapterType) {
    if (adapterType.equals(IPropertySource.class) && adaptableObject instanceof EObject) {
      EObject eObj = (EObject) adaptableObject;
      List adapters = eObj.eAdapters();
      for (Iterator itr = adapters.iterator(); itr.hasNext();) {
        Object adapter = itr.next();
        if (adapter instanceof IItemPropertySource) {
          //TODO handle the case with multiple IItemPropertySource adapters for this EObject
          return new PropertySource(adaptableObject, (IItemPropertySource) adapter);
View Full Code Here

    EcoreUtil.resolveAll(eObject);
    List<Pair<EObject, ICompositeNode>> result = Lists.newArrayList();
    Iterator<Object> iterator = EcoreUtil.getAllContents(eObject.eResource(), false);
    while(iterator.hasNext()) {
      EObject object = (EObject) iterator.next();
      Iterator<Adapter> adapters = object.eAdapters().iterator();
      while(adapters.hasNext()) {
        Adapter adapter = adapters.next();
        if(adapter instanceof ICompositeNode) {
          adapters.remove();
          result.add(Tuples.create(object, (ICompositeNode) adapter));
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.