Package org.eclipse.emf.common.notify

Examples of org.eclipse.emf.common.notify.AdapterFactory


    if (result == null)
    {
      ResourceSet resourceSet = resource.getResourceSet();
      if (resourceSet != null)
      {
        AdapterFactory factory = getAdapterFactory(resourceSet.getAdapterFactories(), type);
        if (factory != null)
        {
          result = factory.adaptNew(resource, type);
        }
      }
    }
    return result;
  }
View Full Code Here


   */
  public static AdapterFactory getAdapterFactory(List<AdapterFactory> adapterFactories, Object type)
  {
    for (int i = 0, size = adapterFactories.size(); i < size; ++i)
    {
      AdapterFactory factory = adapterFactories.get(i);
      if (factory.isFactoryForType(type))
      {
        return factory;
      }
    }
    return null;
View Full Code Here

   */
  public IPropertySource getPropertySource(Object object) {
    if (object instanceof IPropertySource) {
      return (IPropertySource) object;
    }
    AdapterFactory af = getAdapterFactory(object);
    if (af != null) {
      IItemPropertySource ips = (IItemPropertySource) af.adapt(object,
          IItemPropertySource.class);
      if (ips != null) {
        return new PropertySource(object, ips);
      }
    }
View Full Code Here

   */
  public IPropertySource getPropertySource(Object object) {
    if (object instanceof IPropertySource) {
      return (IPropertySource) object;
    }
    AdapterFactory af = getAdapterFactory(object);
    if (af != null) {
      IItemPropertySource ips = (IItemPropertySource) af.adapt(object,
          IItemPropertySource.class);
      if (ips != null) {
        return new PropertySource(object, ips);
      }
    }
View Full Code Here

   */
  public IPropertySource getPropertySource(Object object) {
    if (object instanceof IPropertySource) {
      return (IPropertySource) object;
    }
    AdapterFactory af = getAdapterFactory(object);
    if (af != null) {
      IItemPropertySource ips = (IItemPropertySource) af.adapt(object,
          IItemPropertySource.class);
      if (ips != null) {
        return new PropertySource(object, ips);
      }
    }
View Full Code Here

   */
  public IPropertySource getPropertySource(Object object) {
    if (object instanceof IPropertySource) {
      return (IPropertySource) object;
    }
    AdapterFactory af = getAdapterFactory(object);
    if (af != null) {
      IItemPropertySource ips = (IItemPropertySource) af.adapt(object,
          IItemPropertySource.class);
      if (ips != null) {
        return new PropertySource(object, ips);
      }
    }
View Full Code Here

   */
  public IPropertySource getPropertySource(Object object) {
    if (object instanceof IPropertySource) {
      return (IPropertySource) object;
    }
    AdapterFactory af = getAdapterFactory(object);
    if (af != null) {
      IItemPropertySource ips = (IItemPropertySource) af.adapt(object,
          IItemPropertySource.class);
      if (ips != null) {
        return new PropertySource(object, ips);
      }
    }
View Full Code Here

        List<URIHandler> uriHandlers) throws IOException {
        ResourceSet resourceSet = new ResourceSetImpl();
       
        //add the specialized schema location resolvers
        if ((resolvers != null) && !resolvers.isEmpty()) {
           AdapterFactory adapterFactory = new SchemaLocationResolverAdapterFactory(resolvers);
           resourceSet.getAdapterFactories().add(adapterFactory);
        }
       
        //add the specialized schema locators as adapters
        if ((locators != null) && !locators.isEmpty()) {
            AdapterFactory adapterFactory = new SchemaLocatorAdapterFactory(locators);
            resourceSet.getAdapterFactories().add(adapterFactory);
        }

        //add the specifialized uri handlers
        if (uriHandlers != null && !uriHandlers.isEmpty()) {
View Full Code Here

                }
               
                return null;
            }
        });
        AdapterFactory adapterFactory = new SchemaLocatorAdapterFactory(locators);
        resource.getResourceSet().getAdapterFactories().add( adapterFactory );
        return imprt;
    }
View Full Code Here

        adapter = (Adapter) invocation.getArguments()[0];
        return null;
      }

    });
    AdapterFactory adapterFactory = mock(AdapterFactory.class);
    IStructuredItemContentProvider contentProvider = mock(IStructuredItemContentProvider.class);
    when(adapterFactory.adapt(any(), any())).thenReturn(contentProvider);
    AdapterFactoryObservableList observableList = new AdapterFactoryObservableList(
        adapterFactory, notifier);
    observableList.elements = elements;

    // make sure that notification are forwarded
View Full Code Here

TOP

Related Classes of org.eclipse.emf.common.notify.AdapterFactory

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.