129
|
1 /*******************************************************************************
|
|
2 * Copyright (c) 2000, 2007 IBM Corporation and others.
|
|
3 * All rights reserved. This program and the accompanying materials
|
|
4 * are made available under the terms of the Eclipse Public License v1.0
|
|
5 * which accompanies this distribution, and is available at
|
|
6 * http://www.eclipse.org/legal/epl-v10.html
|
|
7 *
|
|
8 * Contributors:
|
|
9 * IBM Corporation - initial API and implementation
|
|
10 * Port to the D programming language:
|
|
11 * Frank Benoit <benoit@tionex.de>
|
|
12 *******************************************************************************/
|
|
13 module dwtx.jface.text.hyperlink.IHyperlinkDetector;
|
|
14
|
131
|
15 import dwtx.jface.text.hyperlink.IHyperlinkPresenterExtension; // packageimport
|
|
16 import dwtx.jface.text.hyperlink.MultipleHyperlinkPresenter; // packageimport
|
|
17 import dwtx.jface.text.hyperlink.HyperlinkManager; // packageimport
|
|
18 import dwtx.jface.text.hyperlink.URLHyperlink; // packageimport
|
|
19 import dwtx.jface.text.hyperlink.IHyperlinkDetectorExtension2; // packageimport
|
|
20 import dwtx.jface.text.hyperlink.IHyperlinkPresenter; // packageimport
|
|
21 import dwtx.jface.text.hyperlink.URLHyperlinkDetector; // packageimport
|
|
22 import dwtx.jface.text.hyperlink.DefaultHyperlinkPresenter; // packageimport
|
|
23 import dwtx.jface.text.hyperlink.AbstractHyperlinkDetector; // packageimport
|
|
24 import dwtx.jface.text.hyperlink.IHyperlinkDetectorExtension; // packageimport
|
|
25 import dwtx.jface.text.hyperlink.HyperlinkMessages; // packageimport
|
|
26 import dwtx.jface.text.hyperlink.IHyperlink; // packageimport
|
|
27
|
|
28
|
129
|
29 import dwt.dwthelper.utils;
|
|
30
|
|
31 import dwtx.jface.text.IRegion;
|
|
32 import dwtx.jface.text.ITextViewer;
|
|
33 import dwtx.jface.text.source.SourceViewerConfiguration;
|
|
34
|
|
35
|
|
36 /**
|
|
37 * A hyperlink detector tries to find a hyperlink at
|
|
38 * a given location in a given text viewer.
|
|
39 * <p>
|
|
40 * In order to provide backward compatibility for clients of <code>IHyperlinkDetector</code>, extension
|
|
41 * interfaces are used to provide a means of evolution. The following extension interfaces exist:
|
|
42 * <ul>
|
|
43 * <li>{@link IHyperlinkDetectorExtension} since version 3.3,
|
|
44 * adds the ability to dispose a hyperlink detector
|
|
45 * </li>
|
|
46 * <li>{@link IHyperlinkDetectorExtension2} since version 3.3,
|
|
47 * adds the ability to specify the state mask of the modifier
|
|
48 * keys that need to be pressed for this hyperlink detector
|
|
49 * </li>
|
|
50 * </ul></p>
|
|
51 * <p>
|
|
52 * Clients may implement this interface.
|
|
53 * </p>
|
|
54 *
|
|
55 * @see SourceViewerConfiguration#getHyperlinkDetectors(dwtx.jface.text.source.ISourceViewer)
|
|
56 * @since 3.1
|
|
57 */
|
|
58 public interface IHyperlinkDetector {
|
|
59
|
|
60 /**
|
|
61 * Tries to detect hyperlinks for the given region in
|
|
62 * the given text viewer and returns them.
|
|
63 * <p>
|
|
64 * In most of the cases only one hyperlink should be returned.
|
|
65 * </p>
|
|
66 * @param textViewer the text viewer on which the hover popup should be shown
|
|
67 * @param region the text range in the text viewer which is used to detect the hyperlinks
|
|
68 * @param canShowMultipleHyperlinks tells whether the caller is able to show multiple links
|
|
69 * to the user.
|
|
70 * If <code>true</code> {@link IHyperlink#open()} should directly open
|
|
71 * the link and not show any additional UI to select from a list.
|
|
72 * If <code>false</code> this method should only return one hyperlink
|
|
73 * which upon {@link IHyperlink#open()} may allow to select from a list.
|
|
74 * @return the hyperlinks or <code>null</code> if no hyperlink was detected
|
|
75 */
|
|
76 IHyperlink[] detectHyperlinks(ITextViewer textViewer, IRegion region, bool canShowMultipleHyperlinks);
|
|
77
|
|
78 }
|