Examples of IHyperlinkDetector


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


  @Override
  public IHyperlinkDetector[] getHyperlinkDetectors(ISourceViewer sourceViewer) {
    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) {
View Full Code Here

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

    final IRegion region = new Region(textSelection.getOffset(), textSelection.getLength());
    IHyperlink hyperlink = null;

    synchronized (fHyperlinkDetectors) {
      for (int i = 0, length = fHyperlinkDetectors.length; i < length && hyperlink == null; i++) {
        final IHyperlinkDetector detector = fHyperlinkDetectors[i];
        if (detector == null)
          continue;

        /* The array is final, but its contents aren't */
        final IHyperlink[][] hyperlinks = new IHyperlink[1][];

        /*
         * Detect from within a SafeRunnable since the list of
         * detectors is extensible
         */
        SafeRunnable detectorRunnable = new SafeRunnable() {
          public void run() throws Exception {
            hyperlinks[0] = detector.detectHyperlinks(fTextViewer, region, false);
          }
        };
        SafeRunner.run(detectorRunnable);

        if (hyperlinks[0] == null)
View Full Code Here

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

    List<IHyperlinkDetector> detectors = new LinkedList<IHyperlinkDetector>();
    IHyperlinkDetector[] inheritedDetectors = super
        .getHyperlinkDetectors(sourceViewer);
    if (inheritedDetectors != null) {
      for (final IHyperlinkDetector detector : inheritedDetectors) {
        detectors.add(new IHyperlinkDetector() {
          public IHyperlink[] detectHyperlinks(
              ITextViewer textViewer, IRegion region,
              boolean canShowMultipleHyperlinks) {
            try {
              return detector.detectHyperlinks(textViewer,
View Full Code Here

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

    List<IHyperlinkDetector> result = new ArrayList<IHyperlinkDetector>(0);
    result.add(new ClickXMLHyperlinkDetector());
   
    IHyperlinkDetector[] superDetectors = super.getHyperlinkDetectors(sourceViewer);
    for (int m = 0; m < superDetectors.length; m++) {
      IHyperlinkDetector detector = superDetectors[m];
      if (!result.contains(detector)) {
        result.add(detector);
      }
    }
   
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.