KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ant > internal > ui > editor > text > AntInformationProvider


1 /*******************************************************************************
2  * Copyright (c) 2004, 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  
12 package org.eclipse.ant.internal.ui.editor.text;
13
14 import org.eclipse.jface.text.IRegion;
15 import org.eclipse.jface.text.ITextViewer;
16 import org.eclipse.jface.text.information.IInformationProvider;
17
18 public class AntInformationProvider implements IInformationProvider {
19
20     XMLTextHover fTextHover;
21     
22     public AntInformationProvider(XMLTextHover hover) {
23         fTextHover= hover;
24     }
25     /* (non-Javadoc)
26      * @see org.eclipse.jface.text.information.IInformationProvider#getSubject(org.eclipse.jface.text.ITextViewer, int)
27      */

28     public IRegion getSubject(ITextViewer textViewer, int offset) {
29         return fTextHover.getHoverRegion(textViewer, offset);
30     }
31
32     /* (non-Javadoc)
33      * @see org.eclipse.jface.text.information.IInformationProvider#getInformation(org.eclipse.jface.text.ITextViewer, org.eclipse.jface.text.IRegion)
34      */

35     public String JavaDoc getInformation(ITextViewer textViewer, IRegion subject) {
36         return fTextHover.getHoverInfo(textViewer, subject);
37     }
38 }
39
Popular Tags