Examples of IHyperlink


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

      // hyperlinks should be detected in tml_start_tags only - so retrieve current partition first
      ITypedRegion partition = textViewer.getDocument().getPartition(region.getOffset());
      if (partition.getType().equals(TMLPartitionScanner.TML_TAG_START)) {
        // get partition info
        TMLRegion tmlInfo = TMLRegion.parse(partition, textViewer.getDocument());
        IHyperlink link = null;
        if (tmlInfo.getTagName().equals("include") || tmlInfo.getTagName().equals("portlet")) {
          // check if design db attribute is missing
          // we can only lookup references in local sources
          if (!tmlInfo.hasAttribute("designdb") && !tmlInfo.isDynamicAttributeValue("medium") && !tmlInfo.isDynamicAttributeValue("ref")) {
            link = createTMLReferenceLink(textViewer, region, partition, "ref", tmlInfo);
View Full Code Here

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

    public IHyperlink hyperlink(final String type, int startOffset, int endOffset) {
      final IRegion region= new Region(
          offset + matcher.start() + startOffset,
          matcher.end() - matcher.start() - startOffset + endOffset);
      return new IHyperlink() {

        @Override
        public IRegion getHyperlinkRegion() {
          return region;
        }
View Full Code Here

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

    IHyperlinkDetector[] parent = super.getHyperlinkDetectors(sourceViewer);
    IHyperlinkDetector mine = new IHyperlinkDetector() {

      @Override
      public IHyperlink[] detectHyperlinks(ITextViewer textViewer, IRegion region, boolean canShowMultipleHyperlinks) {
        IHyperlink link = editor.detectHyperlink(textViewer, region);
        if(link == null) {
          return null;
//          return new IHyperlink[0];
        }
        return new IHyperlink[] {link};
View Full Code Here

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

    } catch (final Exception e) {
      return null;
    }

    final IHyperlink wicketHyperlink = new WicketHyperlink(widRegion, wicketId, wcPropertiesRegion == null ? "html" : "properties");
   
    return new IHyperlink[] { wicketHyperlink };
  }
View Full Code Here

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

    assertNull(detector.detectHyperlinks(textViewer, new Region(433, 1), false));

    for (int i = 0; i < 418; i++) {
      assertNull(detector.detectHyperlinks(textViewer, new Region(i, 1), false));
    }
    IHyperlink hyperlink = null;
    for (int i = 419; i < 431; i++) {
      IRegion region = new Region(i, 1);
      IHyperlink[] hyperlinks = detector.detectHyperlinks(textViewer, region, false);
      assertEquals(hyperlinks.length, 1);
      hyperlink = hyperlinks[0];
      assertEquals("WicketHyperlink for wicket:id \"issue54Label\" to html file", hyperlink.toString());
      assertEquals("Open html file and jump to wicket:id \"issue54Label\"", hyperlink.getHyperlinkText());
    }
    for (int i = 431; i < 440; i++) {
      assertNull(detector.detectHyperlinks(textViewer, new Region(i, 1), false));
    }

    try {
      activePage.closeAllEditors(false);
      IDE.openEditor(activePage, file);
    } catch (PartInitException e) {
    }
    hyperlink.open();
    final IEditorPart activeEditor = activePage.getActiveEditor();
    assertTrue(activeEditor.getEditorInput() instanceof FileEditorInput);
    FileEditorInput input = (FileEditorInput) activeEditor.getEditorInput();
    assertEquals("/testproject/src/main/java/org/qwickie/test/project/issue54/Issue54Page.html", input.getFile().getFullPath().toPortableString());
    activePage.closeAllEditors(false);
View Full Code Here

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

    assertNull(detector.detectHyperlinks(textViewer, new Region(255, 1), false));

    IRegion region = new Region(477, 1);
    IHyperlink[] hyperlinks = detector.detectHyperlinks(textViewer, region, false);
    assertEquals(hyperlinks.length, 1);
    final IHyperlink hyperlink = hyperlinks[0];
    assertEquals("WicketHyperlink for wicket:id \"test\" to html file", hyperlink.toString());
    assertEquals("Open html file and jump to wicket:id \"test\"", hyperlink.getHyperlinkText());

    try {
      activePage.closeAllEditors(false);
      IDE.openEditor(activePage, file);
    } catch (PartInitException e) {
    }
    hyperlink.open();
    final IEditorPart activeEditor = activePage.getActiveEditor();
    assertTrue(activeEditor.getEditorInput() instanceof FileEditorInput);
    FileEditorInput input = (FileEditorInput) activeEditor.getEditorInput();
    assertEquals("/testproject/src/main/resources/org/qwickie/test/project/issue45/mobile/RegistrationPage.html", input.getFile().getFullPath()
        .toPortableString());
View Full Code Here

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

    assertNull(detector.detectHyperlinks(textViewer, new Region(255, 1), false));

    IRegion region = new Region(1052, 1);
    IHyperlink[] hyperlinks = detector.detectHyperlinks(textViewer, region, false);
    assertEquals(hyperlinks.length, 2);
    final IHyperlink wicketHyperlink = hyperlinks[0];
    final IHyperlink componentHyperlink = hyperlinks[1];
    assertEquals("WicketHyperlink for wicket:id \"content\" to html file", wicketHyperlink.toString());
    assertEquals("Open html file and jump to wicket:id \"content\"", wicketHyperlink.getHyperlinkText());
    assertEquals(
        "WicketComponentHyperlink for wicket Component ModalPanel2 to L/testproject/src/main/java/org/qwickie/test/project/refactor/ModalPanel2.html",
        componentHyperlink.toString());
    assertEquals("Open \"ModalPanel2.html\"", componentHyperlink.getHyperlinkText());

    try {
      activePage.closeAllEditors(false);
      IDE.openEditor(activePage, file);
    } catch (PartInitException e) {
    }
    wicketHyperlink.open();
    IEditorPart activeEditor = activePage.getActiveEditor();
    assertTrue(activeEditor.getEditorInput() instanceof FileEditorInput);
    FileEditorInput input = (FileEditorInput) activeEditor.getEditorInput();
    assertEquals("/testproject/src/main/java/org/qwickie/test/project/refactor/RefPage.html", input.getFile().getFullPath().toPortableString());
    activePage.closeAllEditors(false);

    componentHyperlink.open();
    activeEditor = activePage.getActiveEditor();
    assertTrue(activeEditor.getEditorInput() instanceof FileEditorInput);
    input = (FileEditorInput) activeEditor.getEditorInput();
    assertEquals("/testproject/src/main/java/org/qwickie/test/project/refactor/ModalPanel2.html", input.getFile().getFullPath().toPortableString());
    activePage.closeAllEditors(false);
View Full Code Here

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

    } catch (final Exception e) {
      return null;
    }

    final IHyperlink wicketHyperlink = new WicketHyperlink(widRegion, wicketId, wcPropertiesRegion == null ? "html" : "properties");
    final IHyperlink wcHyperlink = new WicketComponentHyperlink(wcRegion, wcName);

    if (wcHyperlink.getHyperlinkText() != null) {
      return new IHyperlink[] { wicketHyperlink, wcHyperlink };
    } else {
      return new IHyperlink[] { wicketHyperlink };
    }
  }
View Full Code Here

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

    assertNull(hls);

    IRegion region = new Region(255, 1);
    final IHyperlink[] hyperlinks = detector.detectHyperlinks(textViewer, region, false);
    assertEquals(hyperlinks.length, 1);
    final IHyperlink hyperlink = hyperlinks[0];
    assertEquals(hyperlink.getHyperlinkText(), "Open java file and jump to wicket:id \"test\"");

    final IWorkbenchPage activePage = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
    try {
      activePage.closeAllEditors(false);
      IDE.openEditor(activePage, file);
    } catch (PartInitException e) {
    }
    hyperlink.open();
    final IEditorPart activeEditor = activePage.getActiveEditor();
    assertTrue(activeEditor.getEditorInput() instanceof FileEditorInput);
    FileEditorInput input = (FileEditorInput) activeEditor.getEditorInput();
    assertEquals(input.getFile().getFullPath().toPortableString(), "/testproject/src/main/java/org/qwickie/test/project/issue45/mobile/RegistrationPage.java");
    activePage.closeAllEditors(false);
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.