1
/*******************************************************************************
2
* Copyright (c) 2007 Wind River Systems, Inc. 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
9
* Markus Schorn - initial API and implementation
10
*******************************************************************************/
12
package org.eclipse.cdt.internal.ui.typehierarchy;
14
import org.eclipse.jface.text.IRegion;
15
import org.eclipse.jface.text.ITextViewer;
16
import org.eclipse.jface.text.Region;
17
import org.eclipse.jface.text.information.IInformationProvider;
18
import org.eclipse.jface.text.information.IInformationProviderExtension;
19
import org.eclipse.ui.texteditor.ITextEditor;
21
public class THInformationProvider implements IInformationProviderExtension, IInformationProvider {
23
private ITextEditor fEditor;
25
public THInformationProvider(ITextEditor editor) {
29
public Object getInformation2(ITextViewer textViewer, IRegion subject) {
30
return fEditor == null ? null : TypeHierarchyUI.getInput(fEditor, subject);
33
public String getInformation(ITextViewer textViewer, IRegion subject) {
37
public IRegion getSubject(ITextViewer textViewer, int offset) {
38
return new Region(offset, 0);