Examples of ITLDRecord


Examples of org.eclipse.jst.jsp.core.taglib.ITLDRecord

    if (reference == null)
      return null;
    Object identifier = null;
    switch (reference.getRecordType()) {
      case (ITaglibRecord.TLD) : {
        ITLDRecord record = (ITLDRecord) reference;
        identifier = record.getPath();
      }
        break;
      case (ITaglibRecord.JAR) : {
        IJarRecord record = (IJarRecord) reference;
        identifier = record.getLocation();
      }
        break;
      case (ITaglibRecord.TAGDIR) : {
        ITagDirRecord record = (ITagDirRecord) reference;
        identifier = record.getPath();
      }
        break;
      case (ITaglibRecord.URL) : {
        IURLRecord record = (IURLRecord) reference;
        identifier = record.getURL();
      }
        break;
      default :
        identifier = reference;
        break;
View Full Code Here

Examples of org.eclipse.jst.jsp.core.taglib.ITLDRecord

        if (uri.length() > 0) {
          ITaglibRecord reference = TaglibIndex.resolve(file.getFullPath().toString(), uri, false);
          if (reference != null) {
            switch (reference.getRecordType()) {
              case (ITaglibRecord.TLD) : {
                ITLDRecord record = (ITLDRecord) reference;
                IResource tldfile = ResourcesPlugin.getWorkspace().getRoot().getFile(record.getPath());
                addDependsOn(tldfile);
              }
                break;
              case (ITaglibRecord.JAR) : {
                IJarRecord record = (IJarRecord) reference;
                IFile[] foundFilesForLocation = ResourcesPlugin.getWorkspace().getRoot().findFilesForLocation(record.getLocation());
                for (int i = 0; i < foundFilesForLocation.length; i++) {
                  addDependsOn(foundFilesForLocation[i]);
                }
              }
                break;
              case (ITaglibRecord.TAGDIR) : {
                ITagDirRecord record = (ITagDirRecord) reference;
                IPath path = record.getPath();
                IResource found = ResourcesPlugin.getWorkspace().getRoot().findMember(path, false);

                try {
                  found.accept(new IResourceVisitor() {
                    public boolean visit(IResource resource) throws CoreException {
                      if (resource.getType() == IResource.FILE) {
                        addDependsOn(resource);
                      }
                      return true;
                    }
                  });
                }
                catch (CoreException e) {
                  Logger.logException(e);
                }
              }
                break;
              case (ITaglibRecord.URL) : {
                IURLRecord record = (IURLRecord) reference;
                String baseLocation = record.getBaseLocation();
                if (baseLocation != null && baseLocation.indexOf("://") < 0) {
                  IResource found = ResourcesPlugin.getWorkspace().getRoot().findMember(baseLocation, false);
                  if (found != null) {
                    try {
                      found.accept(new IResourceVisitor() {
View Full Code Here

Examples of org.eclipse.jst.jsp.core.taglib.ITLDRecord

   */
  public CMDocument createCMDocument(ITaglibRecord reference) {
    CMDocumentImpl document = null;
    switch (reference.getRecordType()) {
      case (ITaglibRecord.TLD) : {
        ITLDRecord record = (ITLDRecord) reference;
        IResource file = ResourcesPlugin.getWorkspace().getRoot().getFile(record.getPath());
        if (file.getLocation() != null) {
          document = (CMDocumentImpl) buildCMDocumentFromFile(file.getLocation().toString());
          document.setLocationString(record.getPath().toString());
          if (_debug && document != null && document.getElements().getLength() == 0) {
            System.out.println("failure parsing " + record.getPath()); //$NON-NLS-1$
          }

          if (document.getSmallIcon() != null) {
            String iconPath = URIHelper.normalize(((TLDDocument) document).getSmallIcon(), file.getLocation().toString(), "/"); //$NON-NLS-1$
            document.setProperty(JSP12TLDNames.SMALL_ICON, "file:" + iconPath); //$NON-NLS-1$
          }
          if (document.getLargeIcon() != null) {
            String iconPath = URIHelper.normalize(((TLDDocument) document).getLargeIcon(), file.getLocation().toString(), "/"); //$NON-NLS-1$
            document.setProperty(JSP12TLDNames.LARGE_ICON, "file:" + iconPath); //$NON-NLS-1$
          }
        }
      }
        break;
      case (ITaglibRecord.JAR) : {
        IJarRecord record = (IJarRecord) reference;
        document = (CMDocumentImpl) buildCMDocumentFromJar(record.getLocation().toString());
        document.setLocationString("jar:file:" + record.getLocation().toString() + "!/META-INF/taglib.tld");
        if (document.getSmallIcon() != null) {
          String iconPath = URIHelper.normalize(((TLDDocument) document).getSmallIcon(), record.getLocation().toString() + "!/META-INF/", "/"); //$NON-NLS-1$ //$NON-NLS-2$
          document.setProperty(JSP12TLDNames.SMALL_ICON, "jar:file:" + iconPath); //$NON-NLS-1$
        }
        if (document.getLargeIcon() != null) {
          String iconPath = URIHelper.normalize(((TLDDocument) document).getLargeIcon(), record.getLocation().toString() + "!/META-INF/", "/"); //$NON-NLS-1$ //$NON-NLS-2$
          document.setProperty(JSP12TLDNames.LARGE_ICON, "jar:file:" + iconPath); //$NON-NLS-1$
        }
        if (_debug && document != null && document.getElements().getLength() == 0) {
          System.out.println("failure parsing " + record.getLocation()); //$NON-NLS-1$
        }
      }
        break;
      case (ITaglibRecord.TAGDIR) : {
        ITagDirRecord record = (ITagDirRecord) reference;
        document = buildCMDocumentFromFolder(record.getPath());
      }
        break;
      case (ITaglibRecord.URL) : {
        IURLRecord record = (IURLRecord) reference;
        URL url = record.getURL();
        InputStream urlContents = JarUtilities.getInputStream(url);
        if (urlContents != null) {
          document = (CMDocumentImpl) buildCMDocument(record.getBaseLocation(), urlContents);
          String urlString = url.toString();
          document.setLocationString(urlString);
          if (document.getSmallIcon() != null) {
            String iconPath = URIHelper.normalize(((TLDDocument) document).getSmallIcon(), urlString, "/"); //$NON-NLS-1$
            document.setProperty(JSP12TLDNames.SMALL_ICON, iconPath);
View Full Code Here

Examples of org.eclipse.jst.jsp.core.taglib.ITLDRecord

                    // there's nothing to link to
                    if (reference != null) {
                      // handle taglibs
                      switch (reference.getRecordType()) {
                        case (ITaglibRecord.TLD) : {
                          ITLDRecord record = (ITLDRecord) reference;
                          String uriString = record.getPath().toString();
                          IRegion hyperlinkRegion = getHyperlinkRegion(taglibURINode, region);
                          if (hyperlinkRegion != null) {
                            hyperlink = createHyperlink(uriString, hyperlinkRegion, doc, null);
                          }
                        }
                          break;
                        case (ITaglibRecord.JAR) :
                        case (ITaglibRecord.URL) : {
                          IRegion hyperlinkRegion = getHyperlinkRegion(taglibURINode, region);
                          if (hyperlinkRegion != null) {
                            hyperlink = new TaglibJarUriHyperlink(hyperlinkRegion, reference);
                          }
                        }
                      }
                    }
                  }
                }
                else if (baseLocationForTaglib != null && JSP12Namespace.ElementName.ROOT.equalsIgnoreCase(currentNode.getNodeName())) {
                  /**
                   * The jsp:root element
                   */
                  NamedNodeMap attrs = currentNode.getAttributes();
                  for (int i = 0; i < attrs.getLength(); i++) {
                    Attr attr = (Attr) attrs.item(i);
                    if (attr.getNodeName().startsWith(XMLNS)) {
                      String uri = StringUtils.strip(attr.getNodeValue());
                      if (uri.startsWith(URN_TLD)) {
                        uri = uri.substring(URN_TLD.length());
                      }
                      ITaglibRecord reference = TaglibIndex.resolve(baseLocationForTaglib, uri, false);
                      // when using a tagdir
                      // (ITaglibRecord.TAGDIR),
                      // there's nothing to link to
                      if (reference != null) {
                        // handle taglibs
                        switch (reference.getRecordType()) {
                          case (ITaglibRecord.TLD) : {
                            ITLDRecord record = (ITLDRecord) reference;
                            String uriString = record.getPath().toString();
                            IRegion hyperlinkRegion = getHyperlinkRegion(attr, region);
                            if (hyperlinkRegion != null) {
                              hyperlink = createHyperlink(uriString, hyperlinkRegion, doc, null);
                            }
                          }
View Full Code Here

Examples of org.eclipse.jst.jsp.core.taglib.ITLDRecord

 
  private String getSmallImageURL(ITaglibRecord taglibRecord) {
    String url = null;
    switch (taglibRecord.getRecordType()) {
      case (ITaglibRecord.TLD) : {
        ITLDRecord record = (ITLDRecord) taglibRecord;
        IResource file = ResourcesPlugin.getWorkspace().getRoot().getFile(record.getPath());
        if (file.getLocation() != null && record.getDescriptor().getSmallIcon().length() > 0) {
          url = "platform:/resource/" + //$NON-NLS-1$
          FacetModuleCoreSupport.resolve(file.getFullPath(),
              record.getDescriptor().getSmallIcon());
        }
      }
        break;
      case (ITaglibRecord.JAR) : {
        IJarRecord record = (IJarRecord) taglibRecord;
        if (record.getDescriptor().getSmallIcon().length() > 0) {
          // url = "file:" +
          // URIHelper.normalize(record.getDescriptor().getSmallIcon(),
          // record.getLocation().toString(), "/"); //$NON-NLS-1$
        }
      }
        break;
      case (ITaglibRecord.TAGDIR) : {
      }
        break;
      case (ITaglibRecord.URL) : {
        IURLRecord record = (IURLRecord) taglibRecord;
        if (record.getDescriptor().getSmallIcon().length() > 0) {
          url = URIHelper.normalize(record.getDescriptor().getSmallIcon(), record.getURL().toString(), "/"); //$NON-NLS-1$
        }
      }
        break;
    }
    return url;
View Full Code Here

Examples of org.eclipse.jst.jsp.core.taglib.ITLDRecord

 
  private String getSmallImageURL(ITaglibRecord taglibRecord) {
    String url = null;
    switch (taglibRecord.getRecordType()) {
      case (ITaglibRecord.TLD) : {
        ITLDRecord record = (ITLDRecord) taglibRecord;
        IResource file = ResourcesPlugin.getWorkspace().getRoot().getFile(record.getPath());
        if (file.getLocation() != null && record.getDescriptor().getSmallIcon().length() > 0) {
          url = "platform:/resource/" + //$NON-NLS-1$
          FacetModuleCoreSupport.resolve(file.getFullPath(),
              record.getDescriptor().getSmallIcon());
        }
      }
        break;
      case (ITaglibRecord.JAR) : {
        IJarRecord record = (IJarRecord) taglibRecord;
        if (record.getDescriptor().getSmallIcon().length() > 0) {
          // url = "file:" +
          // URIHelper.normalize(record.getDescriptor().getSmallIcon(),
          // record.getLocation().toString(), "/"); //$NON-NLS-1$
        }
      }
        break;
      case (ITaglibRecord.TAGDIR) : {
      }
        break;
      case (ITaglibRecord.URL) : {
        IURLRecord record = (IURLRecord) taglibRecord;
        if (record.getDescriptor().getSmallIcon().length() > 0) {
          url = URIHelper.normalize(record.getDescriptor().getSmallIcon(), record.getURL().toString(), "/"); //$NON-NLS-1$
        }
      }
        break;
    }
    return url;
View Full Code Here

Examples of org.eclipse.jst.jsp.core.taglib.ITLDRecord

   */
  public CMDocument createCMDocument(ITaglibRecord reference) {
    CMDocumentImpl document = null;
    switch (reference.getRecordType()) {
      case (ITaglibRecord.TLD) : {
        ITLDRecord record = (ITLDRecord) reference;
        IResource file = ResourcesPlugin.getWorkspace().getRoot().getFile(record.getPath());
        if (file.getLocation() != null) {
          document = (CMDocumentImpl) buildCMDocumentFromFile(file.getLocation().toString());
          document.setLocationString(record.getPath().toString());
          if (_debug && document != null && document.getElements().getLength() == 0) {
            System.out.println("failure parsing " + record.getPath()); //$NON-NLS-1$
          }

          if (document.getSmallIcon() != null) {
            String iconPath = URIHelper.normalize(((TLDDocument) document).getSmallIcon(), file.getLocation().toString(), "/"); //$NON-NLS-1$
            document.setProperty(JSP12TLDNames.SMALL_ICON, "file:" + iconPath); //$NON-NLS-1$
          }
          if (document.getLargeIcon() != null) {
            String iconPath = URIHelper.normalize(((TLDDocument) document).getLargeIcon(), file.getLocation().toString(), "/"); //$NON-NLS-1$
            document.setProperty(JSP12TLDNames.LARGE_ICON, "file:" + iconPath); //$NON-NLS-1$
          }
        }
      }
        break;
      case (ITaglibRecord.JAR) : {
        IJarRecord record = (IJarRecord) reference;
        document = (CMDocumentImpl) buildCMDocumentFromJar(record.getLocation().toString());
        document.setLocationString("jar:file:" + record.getLocation().toString() + "!/META-INF/taglib.tld");
        if (document.getSmallIcon() != null) {
          String iconPath = URIHelper.normalize(((TLDDocument) document).getSmallIcon(), record.getLocation().toString() + "!/META-INF/", "/"); //$NON-NLS-1$ //$NON-NLS-2$
          document.setProperty(JSP12TLDNames.SMALL_ICON, "jar:file:" + iconPath); //$NON-NLS-1$
        }
        if (document.getLargeIcon() != null) {
          String iconPath = URIHelper.normalize(((TLDDocument) document).getLargeIcon(), record.getLocation().toString() + "!/META-INF/", "/"); //$NON-NLS-1$ //$NON-NLS-2$
          document.setProperty(JSP12TLDNames.LARGE_ICON, "jar:file:" + iconPath); //$NON-NLS-1$
        }
        if (_debug && document != null && document.getElements().getLength() == 0) {
          System.out.println("failure parsing " + record.getLocation()); //$NON-NLS-1$
        }
      }
        break;
      case (ITaglibRecord.TAGDIR) : {
        ITagDirRecord record = (ITagDirRecord) reference;
        document = buildCMDocumentFromFolder(record.getPath());
      }
        break;
      case (ITaglibRecord.URL) : {
        IURLRecord record = (IURLRecord) reference;
        URL url = record.getURL();
        InputStream urlContents = JarUtilities.getInputStream(url);
        if (urlContents != null) {
          document = (CMDocumentImpl) buildCMDocument(record.getBaseLocation(), urlContents);
          String urlString = url.toString();
          document.setLocationString(urlString);
          if (document.getSmallIcon() != null) {
            String iconPath = URIHelper.normalize(((TLDDocument) document).getSmallIcon(), urlString, "/"); //$NON-NLS-1$
            document.setProperty(JSP12TLDNames.SMALL_ICON, iconPath);
View Full Code Here

Examples of org.eclipse.jst.jsp.core.taglib.ITLDRecord

    if (reference == null)
      return null;
    Object identifier = null;
    switch (reference.getRecordType()) {
      case (ITaglibRecord.TLD) : {
        ITLDRecord record = (ITLDRecord) reference;
        identifier = record.getPath();
      }
        break;
      case (ITaglibRecord.JAR) : {
        IJarRecord record = (IJarRecord) reference;
        identifier = record.getLocation();
      }
        break;
      case (ITaglibRecord.TAGDIR) : {
        ITagDirRecord record = (ITagDirRecord) reference;
        identifier = record.getPath();
      }
        break;
      case (ITaglibRecord.URL) : {
        IURLRecord record = (IURLRecord) reference;
        identifier = record.getURL();
      }
        break;
      default :
        identifier = reference;
        break;
View Full Code Here

Examples of org.eclipse.jst.jsp.core.taglib.ITLDRecord

        if (uri.length() > 0) {
          ITaglibRecord reference = TaglibIndex.resolve(file.getFullPath().toString(), uri, false);
          if (reference != null) {
            switch (reference.getRecordType()) {
              case (ITaglibRecord.TLD) : {
                ITLDRecord record = (ITLDRecord) reference;
                IResource tldfile = ResourcesPlugin.getWorkspace().getRoot().getFile(record.getPath());
                addDependsOn(tldfile);
              }
                break;
              case (ITaglibRecord.JAR) : {
                IJarRecord record = (IJarRecord) reference;
                IFile[] foundFilesForLocation = ResourcesPlugin.getWorkspace().getRoot().findFilesForLocation(record.getLocation());
                for (int i = 0; i < foundFilesForLocation.length; i++) {
                  addDependsOn(foundFilesForLocation[i]);
                }
              }
                break;
              case (ITaglibRecord.TAGDIR) : {
                ITagDirRecord record = (ITagDirRecord) reference;
                IPath path = record.getPath();
                IResource found = ResourcesPlugin.getWorkspace().getRoot().findMember(path, false);

                try {
                  found.accept(new IResourceVisitor() {
                    public boolean visit(IResource resource) throws CoreException {
                      if (resource.getType() == IResource.FILE) {
                        addDependsOn(resource);
                      }
                      return true;
                    }
                  });
                }
                catch (CoreException e) {
                  Logger.logException(e);
                }
              }
                break;
              case (ITaglibRecord.URL) : {
                IURLRecord record = (IURLRecord) reference;
                String baseLocation = record.getBaseLocation();
                if (baseLocation != null && baseLocation.indexOf("://") < 0) {
                  IResource found = ResourcesPlugin.getWorkspace().getRoot().findMember(baseLocation, false);
                  if (found != null) {
                    try {
                      found.accept(new IResourceVisitor() {
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.