Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright (c) 2010 Christoph Kulla 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: Christoph Kulla - Initial API and implementation /
package org.eclipse.xtext.ui.editor.hover.html;
import  org.eclipse.core.runtime.Assert;
import  org.eclipse.jface.internal.text.html.BrowserInformationControlInput;
import  org.eclipse.jface.viewers.ILabelProvider;

Browser input for XtextHtmlHover.

Since:
2.3
// Clone from JavadocBrowserInformationControlInput. Following changes have been made:
// - Changed type of fElement from IJavaElement to EObject.
// - Removed fLeadingImageWidth, leading images are not yet supported by the XtextHtmlHover
// - getInputName requires an labelProvider to retrieve the EObjects name. 
public class XtextBrowserInformationControlInput extends BrowserInformationControlInput {
	private final EObject fElement;
	private final String fHtml;
	private final ILabelProvider fLabelProvider;

Creates a new browser information control input.

Parameters:
previous previous input, or null if none available
element the element, or null if none available
html HTML contents, must not be null
labelProvider used to determinate the input name getInputName().
			String html, ILabelProvider labelProvider) {
		super(previous);
		Assert.isNotNull(html);
		 = element;
		 = html;
		 = labelProvider;
	}

Since:
2.3
	public int getLeadingImageWidth() {
		return 16;
	}
	public EObject getElement() {
		return ;
	}
	public String getHtml() {
		return ;
	}
	public Object getInputElement() {
		return ;
	}
	public String getInputName() {
		if ( == null)
			return "no label provider";
		return .getText();
	}
New to GrepCode? Check out our FAQ X