org.eclipse.xtext.ui.editor.hover.html.IXtextBrowserInformationControl Java Examples

The following examples show how to use org.eclipse.xtext.ui.editor.hover.html.IXtextBrowserInformationControl. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: XbaseHoverProvider.java    From xtext-eclipse with Eclipse Public License 2.0 6 votes vote down vote up
@Override
public IInformationControl doCreateInformationControl(Shell parent) {
	String tooltipAffordanceString = EditorsUI.getTooltipAffordanceString();
	if (BrowserInformationControl.isAvailable(parent)) {
		String font = "org.eclipse.jdt.ui.javadocfont";
		IXtextBrowserInformationControl iControl = new XbaseInformationControl(parent, font,
				tooltipAffordanceString, xbaseHoverConfiguration) {
			@Override
			public IInformationControlCreator getInformationPresenterControlCreator() {
				return fInformationPresenterControlCreator;
			}
		};
		addLinkListener(iControl);
		return iControl;
	} else {
		return new DefaultInformationControl(parent, tooltipAffordanceString);
	}
}
 
Example #2
Source File: GamlHoverProvider.java    From gama with GNU General Public License v3.0 6 votes vote down vote up
@Override
public IInformationControl doCreateInformationControl(final Shell parent) {

	final String tooltipAffordanceString = EditorsUI.getTooltipAffordanceString();
	if (BrowserInformationControl.isAvailable(parent)) {
		final String font = "org.eclipse.jdt.ui.javadocfont"; // FIXME:
																// PreferenceConstants.APPEARANCE_JAVADOC_FONT;
		final IXtextBrowserInformationControl iControl =
				new GamlInformationControl(parent, font, tooltipAffordanceString) {

				};
		addLinkListener(iControl);
		return iControl;
	} else {
		return new DefaultInformationControl(parent, tooltipAffordanceString);
	}
}
 
Example #3
Source File: CustomCSSHelpHoverProvider.java    From solidity-ide with Eclipse Public License 1.0 5 votes vote down vote up
protected void configureControl(
		IXtextBrowserInformationControl control, ToolBarManager tbm,
		String font) {
	OpenInHelpAction openHelpAction = new OpenInHelpAction();
	openHelpAction.setEnabled(true);
	tbm.add(openHelpAction);
	tbm.update(true);
}
 
Example #4
Source File: XbaseHoverProvider.java    From xtext-eclipse with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public IInformationControl doCreateInformationControl(Shell parent) {
	if (XbaseInformationControl.isAvailable(parent)) {
		ToolBarManager tbm = new ToolBarManager(SWT.FLAT);
		String font = "org.eclipse.jdt.ui.javadocfont";
		IXtextBrowserInformationControl control = new XbaseInformationControl(parent, font, tbm,
				xbaseHoverConfiguration);
		configureControl(control, tbm, font);
		return control;
	} else {
		return new DefaultInformationControl(parent, true);
	}
}
 
Example #5
Source File: XbaseHoverProvider.java    From xtext-eclipse with Eclipse Public License 2.0 5 votes vote down vote up
@Override
protected void configureControl(final IXtextBrowserInformationControl control, ToolBarManager tbm, String font) {
	final BackAction backAction = new BackAction(control);
	backAction.setEnabled(false);
	tbm.add(backAction);
	final ForwardAction forwardAction = new ForwardAction(control);
	tbm.add(forwardAction);
	forwardAction.setEnabled(false);
	final ShowInJavadocViewAction showInJavadocViewAction = new ShowInJavadocViewAction(control);
	tbm.add(showInJavadocViewAction);
	showInJavadocViewAction.setEnabled(false);
	final OpenDeclarationAction openDeclarationAction = new OpenDeclarationAction(control);
	tbm.add(openDeclarationAction);
	IInputChangedListener inputChangeListener = new IInputChangedListener() {
		@Override
		public void inputChanged(Object newInput) {
			backAction.update();
			forwardAction.update();
			if (newInput != null && newInput instanceof XbaseInformationControlInput) {
				openDeclarationAction.setEnabled(true);
				if (((XtextBrowserInformationControlInput) newInput).getInputElement() != null) {
					showInJavadocViewAction.setEnabled(true);
				}
			}
		}
	};
	control.addInputChangeListener(inputChangeListener);
	tbm.update(true);
	addLinkListener(control);
}
 
Example #6
Source File: XbaseHoverProvider.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
public ShowInJavadocViewAction(IXtextBrowserInformationControl infoControl) {
	fInfoControl = infoControl;
	setText(XtextUIMessages.XtextBrowserInformationControlInput_ShowInJavaDocView);
	setImageDescriptor(JavaPluginImages.DESC_OBJS_JAVADOCTAG);
}
 
Example #7
Source File: XbaseHoverProvider.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
public OpenDeclarationAction(IXtextBrowserInformationControl infoControl) {
	fInfoControl = infoControl;
	setText(XtextUIMessages.XtextBrowserInformationControlInput_OpenDeclaration);
	JavaPluginImages.setLocalImageDescriptors(this, "goto_input.gif"); //$NON-NLS-1$ 
}
 
Example #8
Source File: HelpHoverProvider.java    From statecharts with Eclipse Public License 1.0 4 votes vote down vote up
protected void configureControl(IXtextBrowserInformationControl control, ToolBarManager tbm, String font) {
	openExternalDocumentationAction.setEnabled(true);
	tbm.add(openExternalDocumentationAction);
	tbm.update(true);
}