Package org.eclipse.wst.sse.core.internal.model

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


  /**
   */
  public FactoryRegistry getFactoryRegistry() {
    IDOMModel model = getModel();
    if (model != null) {
      FactoryRegistry reg = model.getFactoryRegistry();
      if (reg != null)
        return reg;
    }
    return null;
  }
View Full Code Here


    // Must update/add to propagating adapters here too
    addPropagatingAdapters(structuredModel);
  }

  protected void addContentBasedFactories(IStructuredModel structuredModel) {
    FactoryRegistry factoryRegistry = structuredModel.getFactoryRegistry();
    Assert.isNotNull(factoryRegistry, "Program Error: client caller must ensure model has factory registry"); //$NON-NLS-1$
    INodeAdapterFactory factory = null;
    factory = factoryRegistry.getFactoryFor(IJFaceNodeAdapter.class);
    if (factory == null) {
      factory = new JFaceNodeAdapterFactoryForHTML(IJFaceNodeAdapter.class, true);
      factoryRegistry.addFactory(factory);
    }

    ModelHandlerForJSP.ensureTranslationAdapterFactory(structuredModel);
  }
View Full Code Here

    }
    else {
      adapterFactoryProviders = adapterRegistry.getAdapterFactories();
    }

    FactoryRegistry factoryRegistry = structuredModel.getFactoryRegistry();
    Assert.isNotNull(factoryRegistry, SSEUIMessages.EditorModelUtil_0); //$NON-NLS-1$
    // Add all those appropriate for this particular type of content
    while (adapterFactoryProviders.hasNext()) {
      try {
        final AdapterFactoryProvider provider = (AdapterFactoryProvider) adapterFactoryProviders.next();
View Full Code Here

    }
    else {
      adapterFactoryProviders = adapterRegistry.getAdapterFactories();
    }

    FactoryRegistry factoryRegistry = structuredModel.getFactoryRegistry();
    Assert.isNotNull(factoryRegistry, SSEUIMessages.EditorModelUtil_0); //$NON-NLS-1$
    // Add all those appropriate for this particular type of content
    while (adapterFactoryProviders.hasNext()) {
      try {
        final AdapterFactoryProvider provider = (AdapterFactoryProvider) adapterFactoryProviders.next();
View Full Code Here

    // add the normal content based factories to model's registry
    addContentBasedFactories(structuredModel);
  }

  protected void addContentBasedFactories(IStructuredModel structuredModel) {
    FactoryRegistry factoryRegistry = structuredModel.getFactoryRegistry();
    Assert.isNotNull(factoryRegistry, "Program Error: client caller must ensure model has factory registry"); //$NON-NLS-1$
    INodeAdapterFactory factory = null;

    factory = factoryRegistry.getFactoryFor(IJFaceNodeAdapter.class);
    if (factory == null) {
      factory = new JFaceNodeAdapterFactory();
      factoryRegistry.addFactory(factory);
    }

    // cs... added for inferred grammar support
    //
    if (structuredModel != null) {
View Full Code Here

    // Must update/add to propagating adapters here too
    addPropagatingAdapters(structuredModel);
  }

  protected void addContentBasedFactories(IStructuredModel structuredModel) {
    FactoryRegistry factoryRegistry = structuredModel.getFactoryRegistry();
    Assert
        .isNotNull(factoryRegistry,
            "Program Error: client caller must ensure model has factory registry"); //$NON-NLS-1$
    INodeAdapterFactory factory = null;
    factory = factoryRegistry.getFactoryFor(IJFaceNodeAdapter.class);
    if (factory == null) {
      factory = new JFaceNodeAdapterFactoryForHTML(
          IJFaceNodeAdapter.class, true);
      factoryRegistry.addFactory(factory);
    }
  }
View Full Code Here

      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

            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

@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

@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

TOP

Related Classes of org.eclipse.wst.sse.core.internal.model.FactoryRegistry

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.