a2b08f1f54736fbd5ccd9ef4533abf0817870115
[phpeclipse.git] / net.sourceforge.phpeclipse.ui / 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 net.sourceforge.phpdt.ui.text.java.hover.IJavaEditorTextHover;
14
15 import org.eclipse.jface.text.IRegion;
16 import org.eclipse.jface.text.ITextViewer;
17 import org.eclipse.ui.IEditorPart;
18
19 public class JavaTypeHover implements IJavaEditorTextHover {
20
21         private IJavaEditorTextHover fAnnotationHover;
22
23         // private IJavaEditorTextHover fJavadocHover;
24
25         public JavaTypeHover() {
26                 fAnnotationHover = new AnnotationHover();
27                 // fJavadocHover= new JavadocHover();
28         }
29
30         /**
31          * @see IJavaEditorTextHover#setEditor(IEditorPart)
32          */
33         public void setEditor(IEditorPart editor) {
34                 fAnnotationHover.setEditor(editor);
35                 // fJavadocHover.setEditor(editor);
36         }
37
38         /*
39          * @see ITextHover#getHoverRegion(ITextViewer, int)
40          */
41         public IRegion getHoverRegion(ITextViewer textViewer, int offset) {
42                 // return fJavadocHover.getHoverRegion(textViewer, offset);
43                 return null;
44         }
45
46         /*
47          * @see ITextHover#getHoverInfo(ITextViewer, IRegion)
48          */
49         public String getHoverInfo(ITextViewer textViewer, IRegion hoverRegion) {
50                 String hoverInfo = fAnnotationHover.getHoverInfo(textViewer,
51                                 hoverRegion);
52                 if (hoverInfo != null)
53                         return hoverInfo;
54
55                 // return fJavadocHover.getHoverInfo(textViewer, hoverRegion);
56                 return null;
57         }
58 }