Added: PreferencePage; External Browser startup; extended syntax highlighting
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpeclipse / phpeditor / PHPAnnotationHover.java
1 package net.sourceforge.phpeclipse.phpeditor;
2
3 /**********************************************************************
4 Copyright (c) 2000, 2002 IBM Corp. and others.
5 All rights reserved. This program and the accompanying materials
6 are made available under the terms of the Common Public License v1.0
7 which accompanies this distribution, and is available at
8 http://www.eclipse.org/legal/cpl-v10.html
9
10 Contributors:
11     IBM Corporation - Initial implementation
12     Klaus Hartlage - www.eclipseproject.de
13 **********************************************************************/
14
15 import org.eclipse.jface.text.BadLocationException;
16 import org.eclipse.jface.text.IDocument;
17 import org.eclipse.jface.text.IRegion;
18 import org.eclipse.jface.text.source.IAnnotationHover;
19 import org.eclipse.jface.text.source.ISourceViewer;
20
21 /** 
22  * The JavaAnnotationHover provides the hover support for java editors.
23  */
24  
25 public class PHPAnnotationHover implements IAnnotationHover {
26
27         /* (non-Javadoc)
28          * Method declared on IAnnotationHover
29          */
30         public String getHoverInfo(ISourceViewer sourceViewer, int lineNumber) {
31                 IDocument document= sourceViewer.getDocument();
32
33                 try {
34                         IRegion info= document.getLineInformation(lineNumber);
35                         return document.get(info.getOffset(), info.getLength());
36                 } catch (BadLocationException x) {
37                 }
38
39                 return null;
40         }
41 }