Examples of IHyperlink


Examples of org.eclipse.jface.text.hyperlink.IHyperlink

              String xmlFilePath = tsString.replaceAll("\\.", "/");
              xmlFilePath = xmlFilePath.substring(0, xmlFilePath.length()) + ".xml";
              Set<String> types = getTypes(folder, xmlFilePath);
              if (types.contains(nodeText)) {
                IFile iFile = getFile(folder, xmlFilePath);
                IHyperlink link = new ExternalTypeHyperlink(nodeText, wordRegion, iFile, tsString,
                        fTextEditor);
                result.add(link);
              }
            }
            if (!result.isEmpty()) {
View Full Code Here

Examples of org.eclipse.jface.text.hyperlink.IHyperlink

        List<IHyperlink> links = new ArrayList<IHyperlink>();

        Matcher matcher = ISSUE_PATTERN.matcher(text);
        while (matcher.find()) {
            if (index == -1 || (index >= matcher.start() && index <= matcher.end())) {
                IHyperlink link = extractTaskHyperlink(repository, textOffset, matcher);
                links.add(link);
            }
        }

        matcher = REVISION_PATTERN.matcher(text);
        while (matcher.find()) {
            if (index == -1 || (index >= matcher.start() && index <= matcher.end())) {
                IHyperlink link = extractRevisionHyperlink(repository, textOffset, matcher);
                links.add(link);
            }
        }

        return links.toArray(new IHyperlink[links.size()]);
View Full Code Here

Examples of org.eclipse.jface.text.hyperlink.IHyperlink

    }

    // filter hyperlinks that do not match original region
    if (region.getLength() == 0) {
      for (Iterator<IHyperlink> it = hyperlinks.iterator(); it.hasNext();) {
        IHyperlink hyperlink = it.next();
        IRegion hyperlinkRegion = hyperlink.getHyperlinkRegion();
        if (!isInRegion(region, hyperlinkRegion)) {
          it.remove();
        }
      }
    }
View Full Code Here

Examples of org.eclipse.jface.text.hyperlink.IHyperlink

        elements = PHPModelUtils.getTypeInString((ISourceModule) input,
            wordRegion);

      }
      if (elements != null && elements.length > 0) {
        final IHyperlink link;
        if (elements.length == 1) {
          link = new ModelElementHyperlink(wordRegion, elements[0],
              new OpenAction(editor));
        } else {
          link = new ModelElementHyperlink(wordRegion,
View Full Code Here

Examples of org.eclipse.jface.text.hyperlink.IHyperlink

        if (currentAttr != null
            && region.getOffset() >= attr
                .getValueRegionStartOffset()) {
          if (isLinkableAttr(currentAttr)) {
            IRegion hyperlinkRegion = getHyperlinkRegion(currentAttr);
            IHyperlink hyperLink = createHyperlink(currentAttr
                .getName(), currentAttr.getNodeValue(),
                currentNode, currentNode.getParentNode(),
                document, textViewer, hyperlinkRegion, region);
            if (hyperLink != null) {
              return new IHyperlink[] { hyperLink };
            }
          }
        }
        break;

      case Node.TEXT_NODE:
        IRegion hyperlinkRegion = getHyperlinkRegion(currentNode);
        Node parentNode = currentNode.getParentNode();
        if (parentNode != null) {
          IHyperlink hyperLink = createHyperlink(parentNode
              .getNodeName(), currentNode.getNodeValue(),
              currentNode, parentNode, document, textViewer,
              hyperlinkRegion, region);
          if (hyperLink != null) {
            return new IHyperlink[] { hyperLink };
View Full Code Here

Examples of org.eclipse.jface.text.hyperlink.IHyperlink

      } else if (nodeType == Node.ELEMENT_NODE) {
        // element nodes
        Attr currentAttr = getCurrentAttrNode(currentNode, region.getOffset());
        if (currentAttr != null){
          IRegion hyperlinkRegion = getHyperlinkRegion(currentAttr);
          IHyperlink hyperLink = createHyperlinkForClass(
              currentAttr.getName(), currentAttr.getNodeValue(), hyperlinkRegion, document);
          if (hyperLink != null) {
            return new IHyperlink[] { hyperLink };
          }
        }
View Full Code Here

Examples of org.eclipse.jface.text.hyperlink.IHyperlink

   * Create the appropriate hyperlink.
   */
  private IHyperlink createHyperlinkForClass(String name, String target,
      IRegion hyperlinkRegion, IDocument document) {
   
    IHyperlink link = null;

    if (name != null) {
      if (ClickPlugin.ATTR_CLASSNAME.equals(name)) {
        try {
          IFile file = ClickUtils.getResource(document);
View Full Code Here

Examples of org.eclipse.jface.text.hyperlink.IHyperlink

      if (path.contains("::")) {

        String[] parts = path.split("::");
       
        if (parts.length == 2) {         
          IHyperlink link = getTemplateLink(viewPath, wordRegion);         
          if (link != null) {           
            return new IHyperlink[] { link };
          }
        }

      // "AcmeDemoBundle:Demo:index.html.twig" 3 part viewpath
      // link the controller and the template separately
      } else if (path.contains(":")) {

        String[] parts = path.split(":");

        if (parts.length == 3) {
         
          int controllerLength = parts[0].length() + parts[1].length() + 1;   
          int deltaOffset = offset - wordRegion.getOffset();

          if (deltaOffset < controllerLength) {
           
            Region controllerRegion =  new Region(wordRegion.getOffset(), controllerLength);           
            IHyperlink link = getControllerlink(viewPath, controllerRegion);
           
            if (link != null) {
              return new IHyperlink[] { link };
            }
           
          } else {
           
            Region templateRegion = new Region(wordRegion.getOffset() + controllerLength + 1, parts[2].length());
            IHyperlink link = getTemplateLink(viewPath, templateRegion);
           
            if (link != null) {             
              return new IHyperlink[] { link };
            }
          }
View Full Code Here

Examples of org.eclipse.jface.text.hyperlink.IHyperlink

      IType type = SymfonyModelAccess.getDefault().findEntity(alias, input.getScriptProject());
     
      if (type == null)
        return null;
     
      IHyperlink link = new ModelElementHyperlink(wordRegion, type, new OpenAction(editor));
     
      return new IHyperlink[] { link };
     
    } catch (Exception e) {   
      Logger.logException(e);     
View Full Code Here

Examples of org.eclipse.jface.text.hyperlink.IHyperlink

    this.name = attrName;
  }

  protected IHyperlink createHyperlink(String value, IRegion region) {
    IHyperlinkCalculator calc = createHyperlinkCalculator();
    IHyperlink hyperlink = calc.createHyperlink(name, value, input, input.getParentNode(), input
        .getStructuredDocument(), textViewer, region, region);

    IFile file = BeansEditorUtils.getFile(input.getStructuredDocument());
    if (hyperlink instanceof NodeElementHyperlink) {
      Node bean = BeansEditorUtils.getFirstReferenceableNodeById(input.getOwnerDocument(), value, file);
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.