Package com.google.dart.engine.element.angular

Examples of com.google.dart.engine.element.angular.AngularHasTemplateElement


    // resolve AngularComponentElement template URIs
    // TODO(scheglov) resolve to HtmlElement to allow F3 ?
    Set<Source> angularElementsSources = Sets.newHashSet();
    for (AngularElement angularElement : angularElements) {
      if (angularElement instanceof AngularHasTemplateElement) {
        AngularHasTemplateElement hasTemplate = (AngularHasTemplateElement) angularElement;
        angularElementsSources.add(angularElement.getSource());
        String templateUri = hasTemplate.getTemplateUri();
        if (templateUri == null) {
          continue;
        }
        try {
          Source templateSource = context.getSourceFactory().forUri(
              source.resolveRelativeUri(new URI(templateUri)));
          if (!context.exists(templateSource)) {
            templateSource = context.getSourceFactory().resolveUri(source, "package:" + templateUri);
            if (!context.exists(templateSource)) {
              errorListener.onError(new AnalysisError(
                  angularElement.getSource(),
                  hasTemplate.getTemplateUriOffset(),
                  templateUri.length(),
                  AngularCode.URI_DOES_NOT_EXIST,
                  templateUri));
              continue;
            }
          }
          if (!AnalysisEngine.isHtmlFileName(templateUri)) {
            continue;
          }
          if (hasTemplate instanceof AngularComponentElementImpl) {
            ((AngularComponentElementImpl) hasTemplate).setTemplateSource(templateSource);
          }
          if (hasTemplate instanceof AngularViewElementImpl) {
            ((AngularViewElementImpl) hasTemplate).setTemplateSource(templateSource);
          }
        } catch (URISyntaxException exception) {
          errorListener.onError(new AnalysisError(
              angularElement.getSource(),
              hasTemplate.getTemplateUriOffset(),
              templateUri.length(),
              AngularCode.INVALID_URI,
              templateUri));
        }
      }
View Full Code Here


    entryCopy.setState(HtmlEntry.ANGULAR_ENTRY, CacheState.INVALID);
    // reset HTML sources
    AngularElement[] oldAngularElements = application.getElements();
    for (AngularElement angularElement : oldAngularElements) {
      if (angularElement instanceof AngularHasTemplateElement) {
        AngularHasTemplateElement hasTemplate = (AngularHasTemplateElement) angularElement;
        Source templateSource = hasTemplate.getTemplateSource();
        if (templateSource != null) {
          HtmlEntry htmlEntry = getReadableHtmlEntry(templateSource);
          HtmlEntryImpl htmlCopy = htmlEntry.getWritableCopy();
          htmlCopy.setValue(HtmlEntry.ANGULAR_APPLICATION, null);
          htmlCopy.setValue(HtmlEntry.ANGULAR_COMPONENT, null);
View Full Code Here

      entry.setValue(HtmlEntry.ANGULAR_ERRORS, task.getEntryErrors());
      // schedule HTML templates analysis
      AngularElement[] newAngularElements = application.getElements();
      for (AngularElement angularElement : newAngularElements) {
        if (angularElement instanceof AngularHasTemplateElement) {
          AngularHasTemplateElement hasTemplate = (AngularHasTemplateElement) angularElement;
          Source templateSource = hasTemplate.getTemplateSource();
          if (templateSource != null) {
            HtmlEntry htmlEntry = getReadableHtmlEntry(templateSource);
            HtmlEntryImpl htmlCopy = htmlEntry.getWritableCopy();
            htmlCopy.setValue(HtmlEntry.ANGULAR_APPLICATION, application);
            if (hasTemplate instanceof AngularComponentElement) {
View Full Code Here

TOP

Related Classes of com.google.dart.engine.element.angular.AngularHasTemplateElement

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.