Mercurial > projects > dwt-addons
comparison dwtx/jface/text/hyperlink/IHyperlinkDetector.d @ 129:eb30df5ca28b
Added JFace Text sources
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Sat, 23 Aug 2008 19:10:48 +0200 |
parents | |
children | c4fb132a086c |
comparison
equal
deleted
inserted
replaced
128:8df1d4193877 | 129:eb30df5ca28b |
---|---|
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 | |
15 import dwt.dwthelper.utils; | |
16 | |
17 import dwtx.jface.text.IRegion; | |
18 import dwtx.jface.text.ITextViewer; | |
19 import dwtx.jface.text.source.SourceViewerConfiguration; | |
20 | |
21 | |
22 /** | |
23 * A hyperlink detector tries to find a hyperlink at | |
24 * a given location in a given text viewer. | |
25 * <p> | |
26 * In order to provide backward compatibility for clients of <code>IHyperlinkDetector</code>, extension | |
27 * interfaces are used to provide a means of evolution. The following extension interfaces exist: | |
28 * <ul> | |
29 * <li>{@link IHyperlinkDetectorExtension} since version 3.3, | |
30 * adds the ability to dispose a hyperlink detector | |
31 * </li> | |
32 * <li>{@link IHyperlinkDetectorExtension2} since version 3.3, | |
33 * adds the ability to specify the state mask of the modifier | |
34 * keys that need to be pressed for this hyperlink detector | |
35 * </li> | |
36 * </ul></p> | |
37 * <p> | |
38 * Clients may implement this interface. | |
39 * </p> | |
40 * | |
41 * @see SourceViewerConfiguration#getHyperlinkDetectors(dwtx.jface.text.source.ISourceViewer) | |
42 * @since 3.1 | |
43 */ | |
44 public interface IHyperlinkDetector { | |
45 | |
46 /** | |
47 * Tries to detect hyperlinks for the given region in | |
48 * the given text viewer and returns them. | |
49 * <p> | |
50 * In most of the cases only one hyperlink should be returned. | |
51 * </p> | |
52 * @param textViewer the text viewer on which the hover popup should be shown | |
53 * @param region the text range in the text viewer which is used to detect the hyperlinks | |
54 * @param canShowMultipleHyperlinks tells whether the caller is able to show multiple links | |
55 * to the user. | |
56 * If <code>true</code> {@link IHyperlink#open()} should directly open | |
57 * the link and not show any additional UI to select from a list. | |
58 * If <code>false</code> this method should only return one hyperlink | |
59 * which upon {@link IHyperlink#open()} may allow to select from a list. | |
60 * @return the hyperlinks or <code>null</code> if no hyperlink was detected | |
61 */ | |
62 IHyperlink[] detectHyperlinks(ITextViewer textViewer, IRegion region, bool canShowMultipleHyperlinks); | |
63 | |
64 } |