Eclipse 3M7
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpdt / internal / ui / text / java / hover / JavaTypeHover.java
1 /*******************************************************************************
2  * Copyright (c) 2000, 2003 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials 
4  * are made available under the terms of the Common Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/cpl-v10.html
7  * 
8  * Contributors:
9  *     IBM Corporation - initial API and implementation
10  *******************************************************************************/
11 package net.sourceforge.phpdt.internal.ui.text.java.hover;
12
13 import org.eclipse.jface.text.IRegion;
14 import org.eclipse.jface.text.ITextViewer;
15
16 import org.eclipse.ui.IEditorPart;
17
18 import net.sourceforge.phpdt.ui.text.java.hover.IJavaEditorTextHover;
19
20
21 public class JavaTypeHover implements IJavaEditorTextHover {
22         
23         private IJavaEditorTextHover fAnnotationHover;
24         //private IJavaEditorTextHover fJavadocHover;
25         
26         public JavaTypeHover() {
27                 fAnnotationHover= new AnnotationHover();
28         //      fJavadocHover= new JavadocHover();
29         }
30
31         /**
32          * @see IJavaEditorTextHover#setEditor(IEditorPart)
33          */
34         public void setEditor(IEditorPart editor) {
35                 fAnnotationHover.setEditor(editor);
36         //      fJavadocHover.setEditor(editor);
37         }
38         
39         /*
40          * @see ITextHover#getHoverRegion(ITextViewer, int)
41          */
42         public IRegion getHoverRegion(ITextViewer textViewer, int offset) {
43                 //return fJavadocHover.getHoverRegion(textViewer, offset);
44                 return null;
45         }
46         
47         /*
48          * @see ITextHover#getHoverInfo(ITextViewer, IRegion)
49          */
50         public String getHoverInfo(ITextViewer textViewer, IRegion hoverRegion) {
51                 String hoverInfo= fAnnotationHover.getHoverInfo(textViewer, hoverRegion);
52                 if (hoverInfo != null)
53                         return hoverInfo;
54
55                 //return fJavadocHover.getHoverInfo(textViewer, hoverRegion);
56             return null;
57         }
58 }