KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jface > text > hyperlink > IHyperlinkPresenter


1 /*******************************************************************************
2  * Copyright (c) 2000, 2005 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  *******************************************************************************/

11 package org.eclipse.jface.text.hyperlink;
12
13 import org.eclipse.jface.text.ITextViewer;
14
15
16 /**
17  * A hyperlink presenter shows hyperlinks on the installed text viewer
18  * and allows to pick one on of the hyperlinks.
19  * <p>
20  * Clients may implement this interface. A default implementation is provided
21  * through {@link org.eclipse.jface.text.hyperlink.DefaultHyperlinkPresenter}.
22  * </p>
23  *
24  * @since 3.1
25  */

26 public interface IHyperlinkPresenter {
27
28     /**
29      * Tells whether this presenter is able to handle
30      * more than one hyperlink.
31      *
32      * @return <code>true</code> if this presenter can handle more than one hyperlink
33      */

34     boolean canShowMultipleHyperlinks();
35
36     /**
37      * Tells this hyperlink presenter to show the given
38      * hyperlinks on the installed text viewer.
39      *
40      * @param hyperlinks the hyperlinks to show
41      * @throws IllegalArgumentException if
42      * <ul>
43      * <li><code>hyperlinks</code> is empty</li>
44      * <li>{@link #canShowMultipleHyperlinks()} returns <code>false</code> and <code>hyperlinks</code> contains more than one element</li>
45      * </ul>
46      */

47     void showHyperlinks(IHyperlink[] hyperlinks) throws IllegalArgumentException JavaDoc;
48
49     /**
50      * Tells this hyperlink presenter to hide the hyperlinks
51      * requested to be shown by {@link #showHyperlinks(IHyperlink[])}.
52      */

53     void hideHyperlinks();
54
55     /**
56      * Installs this hyperlink presenter on the given text viewer.
57      *
58      * @param textViewer the text viewer
59      */

60     void install(ITextViewer textViewer);
61
62     /**
63      * Uninstalls this hyperlink presenter.
64      */

65     void uninstall();
66 }
67
Popular Tags