Java 类org.eclipse.emf.edit.provider.ComposedAdapterFactory.Descriptor.Registry 实例源码

项目:OpenSPIFe    文件:TransactionUtils.java   
private ComposedAdapterFactoryImpl(Registry adapterFactoryDescriptorRegistry) {
    super(adapterFactoryDescriptorRegistry);
    changeNotifier = new ChangeNotifier() {

        @Override
        public void fireNotifyChanged(Notification notification) {
            int size = size();
            INotifyChangedListener[] listeners = new INotifyChangedListener[size];
            toArray(listeners);
            int expectedModCount = modCount;
            for (int i = 0; i < size; ++i) {
                INotifyChangedListener notifyChangedListener = listeners[i];
                if (notifyChangedListener == null) {
                    continue;
                }
                if (expectedModCount == modCount || this.contains(notifyChangedListener)) {
                    notifyChangedListener.notifyChanged(notification);
                }
            }
        }

    };
}
项目:OpenSPIFe    文件:TransactionUtils.java   
public static TransactionalEditingDomain createTransactionEditingDomain(boolean addListener, Map<?, ?> txOptions) {
    ComposedAdapterFactory composedAdapterFactory = new ComposedAdapterFactoryImpl(ComposedAdapterFactory.Descriptor.Registry.INSTANCE);
    FixedTransactionEditingDomain domain = EDITING_DOMAIN_FACTORY.createEditingDomain(composedAdapterFactory);
    domain.setDefaultTransactionOptions(txOptions);
    if (addListener) {
        ExtensionPointResourceSetListener.addListener(domain);
    }
    ResourceSet resourceSet = domain.getResourceSet();
    resourceSet.getAdapterFactories().add(composedAdapterFactory);
    return domain;
}
项目:OpenSPIFe    文件:TransactionUtils.java   
/**
 * This constructor will create a consistency only resource set.
 * 
 * @param ePackage
 * @param defaultResourceFactory
 * @return ResourceSet
 */
public static ResourceSet createTransactionResourceSet(EPackage ePackage, Resource.Factory defaultResourceFactory) {
    ComposedAdapterFactory composedAdapterFactory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE);
    TransactionalEditingDomain domain = EDITING_DOMAIN_FACTORY.createEditingDomain(composedAdapterFactory);
    ExtensionPointResourceSetListener.addListener(domain, true);
    ResourceSet resourceSet = domain.getResourceSet();
    resourceSet.getAdapterFactories().add(composedAdapterFactory);
    resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put(Resource.Factory.Registry.DEFAULT_EXTENSION, defaultResourceFactory);
    resourceSet.getPackageRegistry().put(ePackage.getNsURI(), ePackage);
    return resourceSet;
}
项目:bts    文件:InjectableAdapterFactory.java   
@Inject
public InjectableAdapterFactory(Registry adapterFactoryDescriptorRegistry) {
    super(adapterFactoryDescriptorRegistry);
}
项目:OpenSPIFe    文件:EnsembleEditingDomain.java   
public EnsembleEditingDomain() {
    super(new ComposedAdapterFactory(Registry.INSTANCE), new BasicCommandStack(), new EnsembleEditingDomainResourceSet());
    resourceToReadOnlyMap = new HashMap<Resource, Boolean>();
    ((EnsembleEditingDomainResourceSet)getResourceSet()).setEditingDomain(this);
    initializePackageRegistry();
}