Examples of ITaglibRecord


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

  protected Object getCacheKey(String uri) {
    IPath currentParserPath = getCurrentParserPath();
    if (currentParserPath == null)
      return null;
   
    ITaglibRecord record = TaglibIndex.resolve(currentParserPath.toString(), uri, false);
    if (record != null) {
      return getUniqueIdentifier(record);
    }
    String location = URIResolverPlugin.createResolver().resolve(getCurrentBaseLocation().toString(), null, uri);
    return location;
View Full Code Here

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

    IPath currentParserPath = getCurrentParserPath();
    if (currentParserPath == null) {
      return IResource.NULL_STAMP;
    }
   
    ITaglibRecord record = TaglibIndex.resolve(currentParserPath.toString(), reference, false);
    long modificationStamp = IResource.NULL_STAMP;
    if (record != null) {
      switch (record.getRecordType()) {
        case (ITaglibRecord.TLD) : {
          IFile tldfile = ResourcesPlugin.getWorkspace().getRoot().getFile(((ITLDRecord) record).getPath());
          if (tldfile.isAccessible()) {
            modificationStamp = tldfile.getModificationStamp();
          }
View Full Code Here

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

   */
  protected CMDocument loadTaglib(String uri) {
    CMDocument document = null;
    IPath currentPath = getCurrentParserPath();
    if (currentPath != null) {
      ITaglibRecord record = TaglibIndex.resolve(currentPath.toString(), uri, false);
      if (record != null) {
        document = getCMDocumentBuilder().createCMDocument(record);
      }
      else {
        /* Not a very-often used code path (we hope) */
 
View Full Code Here

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

      String uri = documentRegion.getText(uriValueRegion);

      if (file != null) {
        uri = StringUtils.stripQuotes(uri);
        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);
              }
View Full Code Here

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

      doc = HTMLCMDocumentFactory.getCMDocument(CMDocType.TAPESTRY5_DOC_TYPE);
    }
    else if (_project != null ){//TLD
      CMDocumentFactoryTLD factory = new CMDocumentFactoryTLD();
      ITaglibRecord[] tldRecs = TaglibIndex.getAvailableTaglibRecords(_project.getFullPath());
      ITaglibRecord tldRec = findTLD(tldRecs, uri);
      if (tldRec != null)
        doc = factory.createCMDocument(tldRec);
    }
   
    if (doc != null){
View Full Code Here

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

    return ret;
  }

  private ITaglibRecord findTLD(ITaglibRecord[] tldRecs, String uri) {
    for (int i=0;i<tldRecs.length;i++){
      ITaglibRecord tldRec = tldRecs[i];
      String tldRecURI = CMUtil.getURIFromTaglibRecord(tldRec, _project);
      if (uri.equals(tldRecURI))
        return tldRec;
    }
   
View Full Code Here

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

                   * The taglib directive itself
                   */
                  // get the uri attribute
                  Attr taglibURINode = ((Element) currentNode).getAttributeNode(JSP11Namespace.ATTR_NAME_URI);
                  if (taglibURINode != null) {
                    ITaglibRecord reference = TaglibIndex.resolve(baseLocationForTaglib, taglibURINode.getValue(), 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(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) {
View Full Code Here

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

             * a simple enough way to remove duplicates (resolution at
             * runtime would be nondeterministic anyway)
             */
            Map uriToRecords = new HashMap();
            for (int taglibRecordNumber = 0; taglibRecordNumber < availableTaglibRecords.length; taglibRecordNumber++) {
              ITaglibRecord taglibRecord = availableTaglibRecords[taglibRecordNumber];
              ITaglibDescriptor descriptor = taglibRecord.getDescriptor();
              String uri = null;
              switch (taglibRecord.getRecordType()) {
                case ITaglibRecord.URL :
                  uri = descriptor.getURI();
                  uriToRecords.put(uri, taglibRecord);
                  break;
                case ITaglibRecord.JAR : {
                  IPath location = ((IJarRecord) taglibRecord).getLocation();
                  IFile[] files = ResourcesPlugin.getWorkspace().getRoot().findFilesForLocation(location);
                  IPath localContextRoot = FacetModuleCoreSupport.computeWebContentRootPath(basePath);
                  for (int fileNumber = 0; fileNumber < files.length; fileNumber++) {
                    if (localContextRoot.isPrefixOf(files[fileNumber].getFullPath())) {
                      uri = IPath.SEPARATOR +
                          files[fileNumber].getFullPath().removeFirstSegments(localContextRoot.segmentCount()).toString();
                      uriToRecords.put(uri, taglibRecord);
                    }
                    else {
                      uri = FacetModuleCoreSupport.getRuntimePath(files[fileNumber].getFullPath()).toString();
                      uriToRecords.put(uri, taglibRecord);
                    }
                  }
                  break;
                }
                case ITaglibRecord.TLD : {
                  uri = descriptor.getURI();
                  if (uri == null || uri.trim().length() == 0) {
                    IPath path = ((ITLDRecord) taglibRecord).getPath();
                    IPath localContextRoot = FacetModuleCoreSupport.computeWebContentRootPath(basePath);
                    if (localContextRoot.isPrefixOf(path)) {
                      uri = IPath.SEPARATOR + path.removeFirstSegments(localContextRoot.segmentCount()).toString();
                    }
                    else {
                      uri = FacetModuleCoreSupport.getRuntimePath(path).toString();
                    }
                  }
                  uriToRecords.put(uri, taglibRecord);
                  break;
                }
              }
            }
            /*
             * use the records and their descriptors to construct
             * proposals
             */
            Object[] uris = uriToRecords.keySet().toArray();
            for (int uriNumber = 0; uriNumber < uris.length; uriNumber++) {
              String uri = uris[uriNumber].toString();
              ITaglibRecord taglibRecord = (ITaglibRecord) uriToRecords.get(uri);
              ITaglibDescriptor descriptor = (taglibRecord).getDescriptor();
              if (uri != null && uri.length() > 0 && (matchString.length() == 0 ||
                  uri.toLowerCase(Locale.US).startsWith(lowerCaseMatch))) {
               
                String url = getSmallImageURL(taglibRecord);
                ImageDescriptor imageDescriptor = JSPUIPlugin.getInstance().getImageRegistry().getDescriptor(url);
                if (imageDescriptor == null && url != null) {
                  URL imageURL;
                  try {
                    imageURL = new URL(url);
                    imageDescriptor = ImageDescriptor.createFromURL(imageURL);
                    JSPUIPlugin.getInstance().getImageRegistry().put(url, imageDescriptor);
                  }
                  catch (MalformedURLException e) {
                    Logger.logException(e);
                  }
                }
                String additionalInfo = descriptor.getDisplayName() + "<br/>" + //$NON-NLS-1$
                    descriptor.getDescription() + "<br/>" + descriptor.getTlibVersion(); //$NON-NLS-1$
                Image image = null;
                try {
                  image = JSPUIPlugin.getInstance().getImageRegistry().get(url);
                }
                catch (Exception e) {
                  Logger.logException(e);
                }
                if (image == null) {
                  image = XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_ATTRIBUTE);
                }
                CustomCompletionProposal proposal = new CustomCompletionProposal(
                    "\"" + uri + "\"", start, length, uri.length() + 2, //$NON-NLS-1$ //$NON-NLS-2$
                    image, uri, null, additionalInfo, IRelevanceConstants.R_NONE);
                contentAssistRequest.addProposal(proposal);
              }
            }
          }
          else if (attributeName.equals(JSP20Namespace.ATTR_NAME_TAGDIR)) {
            ITaglibRecord[] availableTaglibRecords = TaglibIndex.getAvailableTaglibRecords(basePath);
            /*
             * a simple enough way to remove duplicates (resolution at
             * runtime would be nondeterministic anyway)
             */
            Map uriToRecords = new HashMap();
            IPath localContextRoot = FacetModuleCoreSupport.computeWebContentRootPath(basePath);
            for (int taglibRecordNumber = 0; taglibRecordNumber < availableTaglibRecords.length; taglibRecordNumber++) {
              ITaglibRecord taglibRecord = availableTaglibRecords[taglibRecordNumber];
              String uri = null;
              if (taglibRecord.getRecordType() == ITaglibRecord.TAGDIR) {
                IPath path = ((ITagDirRecord) taglibRecord).getPath();
                if (localContextRoot.isPrefixOf(path)) {
                  uri = IPath.SEPARATOR + path.removeFirstSegments(localContextRoot.segmentCount()).toString();
                  uriToRecords.put(uri, taglibRecord);
                }
              }
            }
            /*
             * use the records and their descriptors to construct
             * proposals
             */
            Object[] uris = uriToRecords.keySet().toArray();
            for (int uriNumber = 0; uriNumber < uris.length; uriNumber++) {
              String uri = uris[uriNumber].toString();
              ITaglibRecord taglibRecord = (ITaglibRecord) uriToRecords.get(uri);
              ITaglibDescriptor descriptor = (taglibRecord).getDescriptor();
              if (uri != null && uri.length() > 0 && (matchString.length() == 0 ||
                  uri.toLowerCase(Locale.US).startsWith(lowerCaseMatch))) {
               
                String url = getSmallImageURL(taglibRecord);
                ImageDescriptor imageDescriptor = null;
                if (url != null) {
                  imageDescriptor = JSPUIPlugin.getInstance().getImageRegistry().getDescriptor(url);
                }
                if (imageDescriptor == null && url != null) {
                  URL imageURL;
                  try {
                    imageURL = new URL(url);
                    imageDescriptor = ImageDescriptor.createFromURL(imageURL);
                    JSPUIPlugin.getInstance().getImageRegistry().put(url, imageDescriptor);
                  }
                  catch (MalformedURLException e) {
                    Logger.logException(e);
                  }
                }
                String additionalInfo = descriptor.getDescription() + "<br/>" + descriptor.getTlibVersion(); //$NON-NLS-1$
                Image image = null;
                try {
                  image = JSPUIPlugin.getInstance().getImageRegistry().get(url);
                }
                catch (Exception e) {
                  Logger.logException(e);
                }
                if (image == null) {
                  image = XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_ATTRIBUTE);
                }
                CustomCompletionProposal proposal = new CustomCompletionProposal(
                    "\"" + uri + "\"", start, length, uri.length() + 2, image, uri, //$NON-NLS-1$ //$NON-NLS-2$
                    null, additionalInfo, IRelevanceConstants.R_NONE);
                contentAssistRequest.addProposal(proposal);
              }
            }
          }
          else if (attributeName.equals(JSP11Namespace.ATTR_NAME_PREFIX)) {
            Node uriAttr = node.getAttributes().getNamedItem(JSP11Namespace.ATTR_NAME_URI);
            String uri = null;
            if (uriAttr != null) {
              uri = uriAttr.getNodeValue();
              ITaglibRecord[] availableTaglibRecords = TaglibIndex.getAvailableTaglibRecords(basePath);
              Map prefixMap = new HashMap();
              for (int taglibrecordNumber = 0; taglibrecordNumber < availableTaglibRecords.length; taglibrecordNumber++) {
                ITaglibDescriptor descriptor = availableTaglibRecords[taglibrecordNumber].getDescriptor();
                if (descriptor != null && descriptor.getURI() != null &&
                    descriptor.getURI().toLowerCase(Locale.US).equals(uri.toLowerCase(Locale.US))) {
                  String shortName = descriptor.getShortName().trim();
                  if (shortName.length() > 0) {
                    boolean valid = true;
                    for (int character = 0; character < shortName.length(); character++) {
                      valid = valid && !Character.isWhitespace(shortName.charAt(character));
                    }
                    if (valid) {
                      prefixMap.put(shortName, descriptor);
                    }
                  }
                }
              }
              Object prefixes[] = prefixMap.keySet().toArray();
              for (int j = 0; j < prefixes.length; j++) {
                String prefix = (String) prefixes[j];
                ITaglibDescriptor descriptor = (ITaglibDescriptor) prefixMap.get(prefix);
                Image image = XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_ATTRIBUTE);
                CustomCompletionProposal proposal = new CustomCompletionProposal(
                    "\"" + prefix + "\"", start, length, prefix.length() + 2, image, //$NON-NLS-1$ //$NON-NLS-2$
                    prefix, null, descriptor.getDescription(), IRelevanceConstants.R_NONE);
                contentAssistRequest.addProposal(proposal);
              }
            }
            else {
              Node dirAttr = node.getAttributes().getNamedItem(JSP20Namespace.ATTR_NAME_TAGDIR);
              if (dirAttr != null) {
                String dir = dirAttr.getNodeValue();
                if (dir != null) {
                  ITaglibRecord record = TaglibIndex.resolve(basePath.toString(), dir, false);
                  if (record != null) {
                    ITaglibDescriptor descriptor = record.getDescriptor();
                    if (descriptor != null) {
                      String shortName = descriptor.getShortName();
   
                      Image image = XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_ATTRIBUTE);
                      CustomCompletionProposal proposal = new CustomCompletionProposal(
View Full Code Here

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

             * a simple enough way to remove duplicates (resolution at
             * runtime would be nondeterministic anyway)
             */
            Map uriToRecords = new HashMap();
            for (int taglibRecordNumber = 0; taglibRecordNumber < availableTaglibRecords.length; taglibRecordNumber++) {
              ITaglibRecord taglibRecord = availableTaglibRecords[taglibRecordNumber];
              ITaglibDescriptor descriptor = taglibRecord.getDescriptor();
              String uri = null;
              switch (taglibRecord.getRecordType()) {
                case ITaglibRecord.URL :
                  uri = descriptor.getURI();
                  uriToRecords.put(uri, taglibRecord);
                  break;
                case ITaglibRecord.JAR : {
                  IPath location = ((IJarRecord) taglibRecord).getLocation();
                  IFile[] files = ResourcesPlugin.getWorkspace().getRoot().findFilesForLocation(location);
                  IPath localContextRoot = FacetModuleCoreSupport.computeWebContentRootPath(basePath);
                  for (int fileNumber = 0; fileNumber < files.length; fileNumber++) {
                    if (localContextRoot.isPrefixOf(files[fileNumber].getFullPath())) {
                      uri = IPath.SEPARATOR +
                          files[fileNumber].getFullPath().removeFirstSegments(localContextRoot.segmentCount()).toString();
                      uriToRecords.put(uri, taglibRecord);
                    }
                    else {
                      uri = FacetModuleCoreSupport.getRuntimePath(files[fileNumber].getFullPath()).toString();
                      uriToRecords.put(uri, taglibRecord);
                    }
                  }
                  break;
                }
                case ITaglibRecord.TLD : {
                  uri = descriptor.getURI();
                  if (uri == null || uri.trim().length() == 0) {
                    IPath path = ((ITLDRecord) taglibRecord).getPath();
                    IPath localContextRoot = FacetModuleCoreSupport.computeWebContentRootPath(basePath);
                    if (localContextRoot.isPrefixOf(path)) {
                      uri = IPath.SEPARATOR + path.removeFirstSegments(localContextRoot.segmentCount()).toString();
                    }
                    else {
                      uri = FacetModuleCoreSupport.getRuntimePath(path).toString();
                    }
                  }
                  uriToRecords.put(uri, taglibRecord);
                  break;
                }
              }
            }
            /*
             * use the records and their descriptors to construct
             * proposals
             */
            Object[] uris = uriToRecords.keySet().toArray();
            for (int uriNumber = 0; uriNumber < uris.length; uriNumber++) {
              String uri = uris[uriNumber].toString();
              ITaglibRecord taglibRecord = (ITaglibRecord) uriToRecords.get(uri);
              ITaglibDescriptor descriptor = (taglibRecord).getDescriptor();
              if (uri != null && uri.length() > 0 && (matchString.length() == 0 ||
                  uri.toLowerCase(Locale.US).startsWith(lowerCaseMatch))) {
               
                String url = getSmallImageURL(taglibRecord);
                ImageDescriptor imageDescriptor = JSPUIPlugin.getInstance().getImageRegistry().getDescriptor(url);
                if (imageDescriptor == null && url != null) {
                  URL imageURL;
                  try {
                    imageURL = new URL(url);
                    imageDescriptor = ImageDescriptor.createFromURL(imageURL);
                    JSPUIPlugin.getInstance().getImageRegistry().put(url, imageDescriptor);
                  }
                  catch (MalformedURLException e) {
                    Logger.logException(e);
                  }
                }
                String additionalInfo = descriptor.getDisplayName() + "<br/>" + //$NON-NLS-1$
                    descriptor.getDescription() + "<br/>" + descriptor.getTlibVersion(); //$NON-NLS-1$
                Image image = null;
                try {
                  image = JSPUIPlugin.getInstance().getImageRegistry().get(url);
                }
                catch (Exception e) {
                  Logger.logException(e);
                }
                if (image == null) {
                  image = XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_ATTRIBUTE);
                }
                CustomCompletionProposal proposal = new CustomCompletionProposal(
                    "\"" + uri + "\"", start, length, uri.length() + 2, //$NON-NLS-1$ //$NON-NLS-2$
                    image, uri, null, additionalInfo, IRelevanceConstants.R_NONE);
                contentAssistRequest.addProposal(proposal);
              }
            }
          }
          else if (attributeName.equals(JSP20Namespace.ATTR_NAME_TAGDIR)) {
            ITaglibRecord[] availableTaglibRecords = TaglibIndex.getAvailableTaglibRecords(basePath);
            /*
             * a simple enough way to remove duplicates (resolution at
             * runtime would be nondeterministic anyway)
             */
            Map uriToRecords = new HashMap();
            for (int taglibRecordNumber = 0; taglibRecordNumber < availableTaglibRecords.length; taglibRecordNumber++) {
              ITaglibRecord taglibRecord = availableTaglibRecords[taglibRecordNumber];
              String uri = null;
              if (taglibRecord.getRecordType() == ITaglibRecord.TAGDIR) {
                IPath path = ((ITagDirRecord) taglibRecord).getPath();
                IPath localContextRoot = TaglibIndex.getContextRoot(basePath);
                if (localContextRoot.isPrefixOf(path)) {
                  uri = IPath.SEPARATOR + path.removeFirstSegments(localContextRoot.segmentCount()).toString();
                  uriToRecords.put(uri, taglibRecord);
                }
              }
            }
            /*
             * use the records and their descriptors to construct
             * proposals
             */
            Object[] uris = uriToRecords.keySet().toArray();
            for (int uriNumber = 0; uriNumber < uris.length; uriNumber++) {
              String uri = uris[uriNumber].toString();
              ITaglibRecord taglibRecord = (ITaglibRecord) uriToRecords.get(uri);
              ITaglibDescriptor descriptor = (taglibRecord).getDescriptor();
              if (uri != null && uri.length() > 0 && (matchString.length() == 0 ||
                  uri.toLowerCase(Locale.US).startsWith(lowerCaseMatch))) {
               
                String url = getSmallImageURL(taglibRecord);
                ImageDescriptor imageDescriptor = null;
                if (url != null) {
                  imageDescriptor = JSPUIPlugin.getInstance().getImageRegistry().getDescriptor(url);
                }
                if (imageDescriptor == null && url != null) {
                  URL imageURL;
                  try {
                    imageURL = new URL(url);
                    imageDescriptor = ImageDescriptor.createFromURL(imageURL);
                    JSPUIPlugin.getInstance().getImageRegistry().put(url, imageDescriptor);
                  }
                  catch (MalformedURLException e) {
                    Logger.logException(e);
                  }
                }
                String additionalInfo = descriptor.getDescription() + "<br/>" + descriptor.getTlibVersion(); //$NON-NLS-1$
                Image image = null;
                try {
                  image = JSPUIPlugin.getInstance().getImageRegistry().get(url);
                }
                catch (Exception e) {
                  Logger.logException(e);
                }
                if (image == null) {
                  image = XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_ATTRIBUTE);
                }
                CustomCompletionProposal proposal = new CustomCompletionProposal(
                    "\"" + uri + "\"", start, length, uri.length() + 2, image, uri, //$NON-NLS-1$ //$NON-NLS-2$
                    null, additionalInfo, IRelevanceConstants.R_NONE);
                contentAssistRequest.addProposal(proposal);
              }
            }
          }
          else if (attributeName.equals(JSP11Namespace.ATTR_NAME_PREFIX)) {
            Node uriAttr = node.getAttributes().getNamedItem(JSP11Namespace.ATTR_NAME_URI);
            String uri = null;
            if (uriAttr != null) {
              uri = uriAttr.getNodeValue();
              ITaglibRecord[] availableTaglibRecords = TaglibIndex.getAvailableTaglibRecords(basePath);
              Map prefixMap = new HashMap();
              for (int taglibrecordNumber = 0; taglibrecordNumber < availableTaglibRecords.length; taglibrecordNumber++) {
                ITaglibDescriptor descriptor = availableTaglibRecords[taglibrecordNumber].getDescriptor();
                if (descriptor != null && descriptor.getURI() != null &&
                    descriptor.getURI().toLowerCase(Locale.US).equals(uri.toLowerCase(Locale.US))) {
                  String shortName = descriptor.getShortName().trim();
                  if (shortName.length() > 0) {
                    boolean valid = true;
                    for (int character = 0; character < shortName.length(); character++) {
                      valid = valid && !Character.isWhitespace(shortName.charAt(character));
                    }
                    if (valid) {
                      prefixMap.put(shortName, descriptor);
                    }
                  }
                }
              }
              Object prefixes[] = prefixMap.keySet().toArray();
              for (int j = 0; j < prefixes.length; j++) {
                String prefix = (String) prefixes[j];
                ITaglibDescriptor descriptor = (ITaglibDescriptor) prefixMap.get(prefix);
                Image image = XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_ATTRIBUTE);
                CustomCompletionProposal proposal = new CustomCompletionProposal(
                    "\"" + prefix + "\"", start, length, prefix.length() + 2, image, //$NON-NLS-1$ //$NON-NLS-2$
                    prefix, null, descriptor.getDescription(), IRelevanceConstants.R_NONE);
                contentAssistRequest.addProposal(proposal);
              }
            }
            else {
              Node dirAttr = node.getAttributes().getNamedItem(JSP20Namespace.ATTR_NAME_TAGDIR);
              if (dirAttr != null) {
                String dir = dirAttr.getNodeValue();
                if (dir != null) {
                  ITaglibRecord record = TaglibIndex.resolve(basePath.toString(), dir, false);
                  if (record != null) {
                    ITaglibDescriptor descriptor = record.getDescriptor();
                    if (descriptor != null) {
                      String shortName = descriptor.getShortName();
   
                      Image image = XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_ATTRIBUTE);
                      CustomCompletionProposal proposal = new CustomCompletionProposal(
View Full Code Here

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

  protected Object getCacheKey(String uri) {
    IPath currentParserPath = getCurrentParserPath();
    if (currentParserPath == null)
      return null;
   
    ITaglibRecord record = TaglibIndex.resolve(currentParserPath.toString(), uri, false);
    if (record != null) {
      return getUniqueIdentifier(record);
    }
    String location = URIResolverPlugin.createResolver().resolve(getCurrentBaseLocation().toString(), null, uri);
    return location;
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.