Package org.eclipse.wst.xml.core.internal.contentmodel.util

Examples of org.eclipse.wst.xml.core.internal.contentmodel.util.CMDocumentCache


              baseLocation = modelsBaseLocation;
            }
          }
          idResolver = new XMLCatalogIdResolver(baseLocation, null);
        }
        CMDocumentCache documentCache = new CMDocumentCache();
        ModelQuery modelQuery = new HTMLModelQueryImpl(documentCache, idResolver);
        modelQuery.setEditMode(ModelQuery.EDIT_MODE_UNCONSTRAINED);
        modelQueryAdapter = new ModelQueryAdapterImpl(documentCache, modelQuery, idResolver);
      }
    }
View Full Code Here


          idResolver = new XMLCatalogIdResolver(baseLocation, null);
        }

        ModelQuery modelQuery = createModelQuery(model, idResolver);
        modelQuery.setEditMode(ModelQuery.EDIT_MODE_UNCONSTRAINED);
        modelQueryAdapterImpl = new JSPModelQueryAdapterImpl(new CMDocumentCache(), modelQuery, idResolver);
      }
    }
    return modelQueryAdapterImpl;
  }
View Full Code Here

            }
          }
          idResolver = new XMLCatalogIdResolver(baseLocation, null);
        }

        CMDocumentCache cmDocumentCache = new CMDocumentCache();
        ModelQuery modelQuery = new XMLModelQueryImpl(cmDocumentCache, idResolver);

        // cs todo...
        // for now we create a CMDocumentCache on a 'per editor' basis
        // in the future we need to support a CMDocumentCache that is
View Full Code Here

    Thread.sleep(StsTestUtil.WAIT_TIME);
    cEditor.setActivePage(page.getId());
    assertNotNull("Could not load overview page.", page.getMasterPart());

    IDOMDocument document = cEditor.getDomDocument();
    CMDocumentCache cache = ModelQueryUtil.getCMDocumentCache(document);
    final String siUri = ConfigCoreUtils.getSelectedSchemaLocation(document, IntegrationSchemaConstants.URI);
    final String siJmsUri = ConfigCoreUtils.getSelectedSchemaLocation(document, IntJmsSchemaConstants.URI);
    final String siStreamUri = ConfigCoreUtils.getSelectedSchemaLocation(document, IntStreamSchemaConstants.URI);
    final CountDownLatch latch = new CountDownLatch(3);
    if (cache.getStatus(siUri) == CMDocumentCache.STATUS_LOADED) {
      latch.countDown();
    }
    if (cache.getStatus(siJmsUri) == CMDocumentCache.STATUS_LOADED) {
      latch.countDown();
    }
    if (cache.getStatus(siStreamUri) == CMDocumentCache.STATUS_LOADED) {
      latch.countDown();
    }

    cache.addListener(new CMDocumentCacheListener() {

      public void cacheUpdated(CMDocumentCache cache, String uri, int oldStatus, int newStatus,
          CMDocument cmDocument) {
        if (newStatus == CMDocumentCache.STATUS_LOADED && oldStatus != CMDocumentCache.STATUS_LOADED) {
          if (uri.equals(siUri) || uri.equals(siJmsUri) || uri.equals(siStreamUri)) {
View Full Code Here

    Thread.sleep(StsTestUtil.WAIT_TIME);
    cEditor.setActivePage(page.getId());
    assertNotNull("Could not load overview page.", page.getMasterPart());

    IDOMDocument document = cEditor.getDomDocument();
    CMDocumentCache cache = ModelQueryUtil.getCMDocumentCache(document);

    final String batchUri = ConfigCoreUtils.getSelectedSchemaLocation(document, BatchSchemaConstants.URI);
    IFile file = cEditor.getResourceFile();

    ProjectClasspathExtensibleUriResolver resolver = new ProjectClasspathExtensibleUriResolver();
    final String resolvedBatchUri = resolver.resolve(file, null, batchUri, batchUri);

    final CountDownLatch latch = new CountDownLatch(1);
    if (cache.getStatus(resolvedBatchUri) == CMDocumentCache.STATUS_LOADED) {
      latch.countDown();
    }
    cache.addListener(new CMDocumentCacheListener() {
      public void cacheUpdated(CMDocumentCache cache, String uri, int oldStatus, int newStatus,
          CMDocument cmDocument) {
        if (newStatus == CMDocumentCache.STATUS_LOADED && oldStatus != CMDocumentCache.STATUS_LOADED) {
          if (uri.equals(resolvedBatchUri)) {
            latch.countDown();
View Full Code Here

TOP

Related Classes of org.eclipse.wst.xml.core.internal.contentmodel.util.CMDocumentCache

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.