129
|
1 /*******************************************************************************
|
|
2 * Copyright (c) 2000, 2008 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.IHyperlinkPresenter;
|
|
14
|
|
15 import dwt.dwthelper.utils;
|
|
16
|
|
17 import dwtx.jface.text.ITextViewer;
|
|
18
|
|
19
|
|
20 /**
|
|
21 * A hyperlink presenter shows hyperlinks on the installed text viewer
|
|
22 * and allows to pick one on of the hyperlinks.
|
|
23 * <p>
|
|
24 * In order to provide backward compatibility for clients of <code>IHyperlinkDetector</code>, extension
|
|
25 * interfaces are used to provide a means of evolution. The following extension interfaces exist:
|
|
26 * <ul>
|
|
27 * <li>{@link IHyperlinkPresenterExtension} since version 3.4,
|
|
28 * adds the ability to query whether the currently shown hyperlinks
|
|
29 * can be hidden.
|
|
30 * </li>
|
|
31 * </ul></p>
|
|
32 * <p>
|
|
33 * Clients may implement this interface. A default implementation is provided
|
|
34 * through {@link dwtx.jface.text.hyperlink.DefaultHyperlinkPresenter}.
|
|
35 * </p>
|
|
36 *
|
|
37 * @see IHyperlinkPresenterExtension
|
|
38 * @since 3.1
|
|
39 */
|
|
40 public interface IHyperlinkPresenter {
|
|
41
|
|
42 /**
|
|
43 * Tells whether this presenter is able to handle
|
|
44 * more than one hyperlink.
|
|
45 *
|
|
46 * @return <code>true</code> if this presenter can handle more than one hyperlink
|
|
47 */
|
|
48 bool canShowMultipleHyperlinks();
|
|
49
|
|
50 /**
|
|
51 * Tells this hyperlink presenter to show the given
|
|
52 * hyperlinks on the installed text viewer.
|
|
53 *
|
|
54 * @param hyperlinks the hyperlinks to show
|
|
55 * @throws IllegalArgumentException if
|
|
56 * <ul>
|
|
57 * <li><code>hyperlinks</code> is empty</li>
|
|
58 * <li>{@link #canShowMultipleHyperlinks()} returns <code>false</code> and <code>hyperlinks</code> contains more than one element</li>
|
|
59 * </ul>
|
|
60 */
|
|
61 void showHyperlinks(IHyperlink[] hyperlinks) throws IllegalArgumentException;
|
|
62
|
|
63 /**
|
|
64 * Tells this hyperlink presenter to hide the hyperlinks
|
|
65 * requested to be shown by {@link #showHyperlinks(IHyperlink[])}.
|
|
66 */
|
|
67 void hideHyperlinks();
|
|
68
|
|
69 /**
|
|
70 * Installs this hyperlink presenter on the given text viewer.
|
|
71 *
|
|
72 * @param textViewer the text viewer
|
|
73 */
|
|
74 void install(ITextViewer textViewer);
|
|
75
|
|
76 /**
|
|
77 * Uninstalls this hyperlink presenter.
|
|
78 */
|
|
79 void uninstall();
|
|
80 }
|