KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jface > text > source > IAnnotationHoverExtension


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.source;
12
13 import org.eclipse.jface.text.IInformationControlCreator;
14
15 /**
16  * Extension interface for {@link org.eclipse.jface.text.source.IAnnotationHover} for
17  * <ul>
18  * <li>providing its own information control creator</li>
19  * <li>providing the range of lines for which the hover for a given line is valid</li>
20  * <li>providing whether the information control can interact with the mouse cursor</li>
21  * </ul>
22  *
23  * @see org.eclipse.jface.text.IInformationControlCreator
24  * @see org.eclipse.jface.text.source.IAnnotationHover
25  * @since 3.0
26  */

27 public interface IAnnotationHoverExtension {
28
29     /**
30      * Returns the hover control creator of this annotation hover.
31      *
32      * @return the hover control creator
33      */

34     IInformationControlCreator getHoverControlCreator();
35
36     /**
37      * Returns whether the provided information control can interact with the mouse cursor. I.e. the
38      * hover must implement custom information control management.
39      *
40      * @return <code>true</code> if the mouse cursor can be handled
41      */

42     boolean canHandleMouseCursor();
43
44     /**
45      * Returns the object which should be presented in the a
46      * hover popup window. The information is requested based on
47      * the specified line range.
48      *
49      * @param sourceViewer the source viewer this hover is registered with
50      * @param lineRange the line range for which information is requested
51      * @param visibleNumberOfLines the number of visible lines
52      * @return the requested information or <code>null</code> if no such information exists
53      */

54     Object JavaDoc getHoverInfo(ISourceViewer sourceViewer, ILineRange lineRange, int visibleNumberOfLines);
55
56     /**
57      * Returns the range of lines that include the given line number for which
58      * the same hover information is valid.
59      *
60      * @param viewer the viewer which the hover is queried for
61      * @param lineNumber the line number of the line for which a hover is displayed for
62      * @return the computed line range or <code>null</code> for no range
63      */

64     ILineRange getHoverLineRange(ISourceViewer viewer, int lineNumber);
65 }
66
Popular Tags