Examples of FactoryRegistry


Examples of org.eclipse.wst.sse.core.internal.model.FactoryRegistry

      IStructuredModel sModel = null;
      try {
        sModel = StructuredModelManager.getModelManager()
            .getExistingModelForRead(fDocument);
        if (sModel != null && (sModel instanceof IDOMModel)) {
          final FactoryRegistry factoryRegistry = sModel
              .getFactoryRegistry();

          // getting the projectionmodelnodeadapter for the first
          // time
          // so do some initializing
          if (!factoryRegistry
              .contains(ProjectionModelNodeAdapterHTML.class)
              && createIfNeeded) {
            final ProjectionModelNodeAdapterFactoryHTML newFactory = new ProjectionModelNodeAdapterFactoryHTML();

            // add factory to factory registry
            factoryRegistry.addFactory(newFactory);

            // add factory to propogating adapter
            final IDOMModel domModel = (IDOMModel) sModel;
            final IDOMDocument document = domModel.getDocument();
            final PropagatingAdapter propagatingAdapter = (PropagatingAdapter) ((INodeNotifier) document)
                .getAdapterFor(PropagatingAdapter.class);
            if (propagatingAdapter != null) {
              propagatingAdapter
                  .addAdaptOnCreateFactory(newFactory);
            }
          }

          // try and get the factory
          factory = (ProjectionModelNodeAdapterFactoryHTML) factoryRegistry
              .getFactoryFor(ProjectionModelNodeAdapterHTML.class);
        }
      } finally {
        if (sModel != null) {
          sModel.releaseFromRead();
View Full Code Here

Examples of org.eclipse.wst.sse.core.internal.model.FactoryRegistry

            IStructuredModel sModel = null;
            try {
                sModel = StructuredModelManager.getModelManager()
                        .getExistingModelForRead(fDocument);
                if (sModel != null && (sModel instanceof IDOMModel)) {
                    final FactoryRegistry factoryRegistry = sModel
                            .getFactoryRegistry();

                    // getting the projectionmodelnodeadapter for the first
                    // time
                    // so do some initializing
                    if (!factoryRegistry
                            .contains(ProjectionModelNodeAdapterHTML.class)
                            && createIfNeeded) {
                        final ProjectionModelNodeAdapterFactoryHTML newFactory = new ProjectionModelNodeAdapterFactoryHTML();

                        // add factory to factory registry
                        factoryRegistry.addFactory(newFactory);

                        // add factory to propogating adapter
                        final IDOMModel domModel = (IDOMModel) sModel;
                        final IDOMDocument document = domModel.getDocument();
                        final PropagatingAdapter propagatingAdapter = (PropagatingAdapter) ((INodeNotifier) document)
                                .getAdapterFor(PropagatingAdapter.class);
                        if (propagatingAdapter != null) {
                            propagatingAdapter
                                    .addAdaptOnCreateFactory(newFactory);
                        }
                    }

                    // try and get the factory
                    factory = (ProjectionModelNodeAdapterFactoryHTML) factoryRegistry
                            .getFactoryFor(ProjectionModelNodeAdapterHTML.class);
                }
            } finally {
                if (sModel != null) {
                    sModel.releaseFromRead();
View Full Code Here

Examples of org.eclipse.wst.sse.core.internal.model.FactoryRegistry

@SuppressWarnings("restriction")
public class BeansAdapterFactoryProvider extends AdapterFactoryProviderForXML {

  @Override
  protected void addContentBasedFactories(IStructuredModel structuredModel) {
    FactoryRegistry factoryRegistry = structuredModel.getFactoryRegistry();
    Assert.notNull(factoryRegistry, "No factory registered");
    INodeAdapterFactory factory = factoryRegistry
        .getFactoryFor(IJFaceNodeAdapter.class);
    if (factory == null) {
      factory = new BeansJFaceNodeAdapterFactory();
      factoryRegistry.addFactory(factory);
    }

    // Stuff from super method (inferred grammar support)
    if (structuredModel != null) {
      ModelQuery modelQuery = ModelQueryUtil
View Full Code Here

Examples of org.eclipse.wst.sse.core.internal.model.FactoryRegistry

@SuppressWarnings("restriction")
public class WebflowAdapterFactoryProvider extends AdapterFactoryProviderForXML {

  @Override
  protected void addContentBasedFactories(IStructuredModel structuredModel) {
    FactoryRegistry factoryRegistry = structuredModel.getFactoryRegistry();
    Assert.notNull(factoryRegistry, "No factory registered");
    INodeAdapterFactory factory = factoryRegistry.getFactoryFor(IJFaceNodeAdapter.class);
    if (factory == null) {
      factory = new BeansJFaceNodeAdapterFactory();
      factoryRegistry.addFactory(factory);
    }

    // Stuff from super method (inferred grammar support)
    if (structuredModel != null) {
      ModelQuery modelQuery = ModelQueryUtil.getModelQuery(structuredModel);
View Full Code Here

Examples of org.geotools.factory.FactoryRegistry

     * @param version: requested version compatibility    
     * @param w
     * @return
     */
    public static DXFWriter getWriter(String version, Writer writer) {
        FactoryRegistry writerRegistry = getServiceRegistry();
        Iterator<DXFWriter> it = writerRegistry.getServiceProviders(DXFWriter.class, null, null);
        DXFWriter candidate;
        while (it.hasNext()) {
            candidate = it.next();
            LOGGER.log(Level.FINE,"Evaluating candidate: "+candidate.getDescription());
            if (candidate.supportsVersion(version)) {
View Full Code Here

Examples of org.geotools.factory.FactoryRegistry

     * @return An iterator over all discovered datastores which have registered
     *         factories, and whose available method returns true.
     */
    public static synchronized Iterator<DataStoreFactorySpi> getAvailableDataStores() {
        Set<DataStoreFactorySpi> availableDS;
        FactoryRegistry serviceRegistry = getServiceRegistry();
        availableDS = DataAccessFinder.getAvailableDataStores(serviceRegistry, DataStoreFactorySpi.class);
        return availableDS.iterator();
    }
View Full Code Here

Examples of org.geotools.factory.FactoryRegistry

 
  /**
       * Resets the factory finder and prepares for a new full scan of the SPI subsystems
       */
      public static void reset() {
          FactoryRegistry copy = registry;
          registry = null;
          if(copy != null) {
              copy.deregisterAll();
          }
      }
View Full Code Here

Examples of org.geotools.factory.FactoryRegistry

     * @return An iterator over all discovered datastores which have registered
     *         factories, and whose available method returns true.
     */
    public static synchronized Iterator<DataAccessFactory> getAvailableDataStores() {

        FactoryRegistry serviceRegistry = getServiceRegistry();
        Set<DataAccessFactory> availableDS = getAvailableDataStores(serviceRegistry,
                DataAccessFactory.class);

        Iterator<DataStoreFactorySpi> availableDataStores = DataStoreFinder
                .getAvailableDataStores();
View Full Code Here

Examples of org.geotools.factory.FactoryRegistry

   
    /**
     * Resets the factory finder and prepares for a new full scan of the SPI subsystems
     */
    public static void reset() {
        FactoryRegistry copy = registry;
        registry = null;
        if(copy != null) {
            copy.deregisterAll();
        }
    }
View Full Code Here

Examples of org.geotools.factory.FactoryRegistry

        assertNotNull(source);
        assertTrue(source instanceof SolrDataStore);
    }

    private FactoryRegistry getServiceRegistry() {
        FactoryRegistry registry = new FactoryCreator(
                Arrays.asList(new Class<?>[] { DataStoreFactorySpi.class }));
        return registry;
    }
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.