Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright (c) 2000, 2005 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html Contributors: IBM Corporation - initial API and implementation /
 
package org.eclipse.ant.internal.ui.editor.templates;
public class AntTemplateVariableTextHover implements ITextHover {
	}
	/* (non-Javadoc)
	 * @see org.eclipse.jface.text.ITextHover#getHoverInfo(org.eclipse.jface.text.ITextViewer, org.eclipse.jface.text.IRegion)
	 */
	public String getHoverInfo(ITextViewer textViewerIRegion subject) {
		try {
			IDocument doctextViewer.getDocument();
			int offsetsubject.getOffset();
			if (offset >= 2 && "${".equals(doc.get(offset-2, 2))) { //$NON-NLS-1$
				String varNamedoc.get(offsetsubject.getLength());
				if (contextType != null) {
					Iterator itercontextType.resolvers();
					while (iter.hasNext()) {
						if (varName.equals(var.getType())) {
							return var.getDescription();
						}
					}
				}
			}				
catch (BadLocationException e) {
		}
		return null;
	}
	/* (non-Javadoc)
	 * @see org.eclipse.jface.text.ITextHover#getHoverRegion(org.eclipse.jface.text.ITextViewer, int)
	 */
	public IRegion getHoverRegion(ITextViewer textViewerint offset) {
		if (textViewer != null) {
			return XMLTextHover.getRegion(textVieweroffset);
		}
		return null;	
	}

New to GrepCode? Check out our FAQ X