Java Code Examples for org.eclipse.ui.editors.text.EditorsUI#getTooltipAffordanceString()

The following examples show how to use org.eclipse.ui.editors.text.EditorsUI#getTooltipAffordanceString() . 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: AbstractPyEditorTextHover.java    From Pydev with Eclipse Public License 1.0 6 votes vote down vote up
@Override
public IInformationControlCreator getHoverControlCreator() {
    return new IInformationControlCreator() {

        @Override
        public IInformationControl createInformationControl(Shell parent) {
            String tooltipAffordanceString = null;
            try {
                tooltipAffordanceString = EditorsUI.getTooltipAffordanceString();
            } catch (Throwable e) {
                //Not available on Eclipse 3.2
            }
            informationControl = new PyInformationControl(parent, tooltipAffordanceString,
                    informationPresenter);
            return informationControl;
        }
    };
}
 
Example 2
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 3
Source File: AbstractDocumentationHover.java    From APICloud-Studio with GNU General Public License v3.0 6 votes vote down vote up
public IInformationControl doCreateInformationControl(Shell parent)
{
	if (CustomBrowserInformationControl.isAvailable(parent))
	{
		CustomBrowserInformationControl iControl = new CustomBrowserInformationControl(parent, null,
				EditorsUI.getTooltipAffordanceString())
		{
			public IInformationControlCreator getInformationPresenterControlCreator()
			{
				return informationPresenterControlCreator;
			}
		};
		iControl.setBackgroundColor(getBackgroundColor());
		iControl.setForegroundColor(getForegroundColor());
		return iControl;
	}
	else
	{
		// return new ThemedInformationControl(parent, null, EditorsUI.getTooltipAffordanceString());
		return new DefaultInformationControl(parent, true);
	}
}
 
Example 4
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 5
Source File: CustomCSSHelpHoverProvider.java    From solidity-ide with Eclipse Public License 1.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";
		BrowserInformationControl iControl = new BrowserInformationControl(
				parent, font, false) {
			@Override
			public IInformationControlCreator getInformationPresenterControlCreator() {
				return fInformationPresenterControlCreator;
			}
		};
		addLinkListener(iControl);
		return iControl;
	} else {
		return new DefaultInformationControl(parent,
				tooltipAffordanceString);
	}
}
 
Example 6
Source File: HelpHoverProvider.java    From statecharts with Eclipse Public License 1.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";

		boolean areHoverDocsScrollable = true;

		// resizable flag of BrowserInformationControl causes the scrollbar to be always
		// enabled.
		BrowserInformationControl iControl = new BrowserInformationControl(parent, font,
				areHoverDocsScrollable) {
			@Override
			public IInformationControlCreator getInformationPresenterControlCreator() {
				return fInformationPresenterControlCreator;
			}
		};
		addLinkListener(iControl);
		return iControl;
	} else {
		return new DefaultInformationControl(parent, tooltipAffordanceString);
	}
}
 
Example 7
Source File: AbstractAnnotationHover.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
@Override
public IInformationControl doCreateInformationControl(Shell parent) {
	return new AnnotationInformationControl(parent, EditorsUI.getTooltipAffordanceString()) {
		/*
		 * @see org.eclipse.jface.text.IInformationControlExtension5#getInformationPresenterControlCreator()
		 */
		@Override
		public IInformationControlCreator getInformationPresenterControlCreator() {
			return fPresenterControlCreator;
		}
	};
}
 
Example 8
Source File: AbstractAnnotationHover.java    From goclipse with Eclipse Public License 1.0 5 votes vote down vote up
@Override
public IInformationControl doCreateInformationControl(Shell parent) {
	return new AnnotationInformationControl(parent, EditorsUI.getTooltipAffordanceString()) {
		/*
		 * @see org.eclipse.jface.text.IInformationControlExtension5#getInformationPresenterControlCreator()
		 */
		@Override
		public IInformationControlCreator getInformationPresenterControlCreator() {
			return fPresenterControlCreator;
		}
	};
}
 
Example 9
Source File: ScriptDebugHover.java    From birt with Eclipse Public License 1.0 5 votes vote down vote up
public IInformationControlCreator getHoverControlCreator( )
{
	return new IInformationControlCreator( ) {

		public IInformationControl createInformationControl( Shell parent )
		{
			return new DefaultInformationControl( parent,
					EditorsUI.getTooltipAffordanceString( ) );
		}
	};
}
 
Example 10
Source File: AbstractJavaEditorTextHover.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
public IInformationControlCreator getHoverControlCreator() {
	return new IInformationControlCreator() {
		public IInformationControl createInformationControl(Shell parent) {
			return new DefaultInformationControl(parent, EditorsUI.getTooltipAffordanceString());
		}
	};
}
 
Example 11
Source File: NLSStringHover.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
@Override
public IInformationControl doCreateInformationControl(Shell parent) {
	return new NLSHoverControl(parent, EditorsUI.getTooltipAffordanceString()) {
		/*
		 * @see org.eclipse.jface.text.IInformationControlExtension5#getInformationPresenterControlCreator()
		 */
		@Override
		public IInformationControlCreator getInformationPresenterControlCreator() {
			return fPresenterControlCreator;
		}
	};
}
 
Example 12
Source File: JavaChangeHover.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
@Override
public IInformationControlCreator getHoverControlCreator() {
	return new IInformationControlCreator() {
		public IInformationControl createInformationControl(Shell parent) {
			fInformationControl= new ChangeHoverInformationControl(parent, false, fOrientation, fPartition, EditorsUI.getTooltipAffordanceString());
			fInformationControl.setHorizontalScrollPixel(fLastScrollIndex);
			return fInformationControl;
		}
	};
}
 
Example 13
Source File: AbstractAnnotationHover.java    From typescript.java with MIT License 5 votes vote down vote up
@Override
public IInformationControl doCreateInformationControl(Shell parent) {
	return new AnnotationInformationControl(parent, EditorsUI.getTooltipAffordanceString()) {
		/*
		 * @see org.eclipse.jface.text.IInformationControlExtension5#
		 * getInformationPresenterControlCreator()
		 */
		@Override
		public IInformationControlCreator getInformationPresenterControlCreator() {
			return fPresenterControlCreator;
		}
	};
}
 
Example 14
Source File: DotColorProposalProvider.java    From gef with Eclipse Public License 2.0 5 votes vote down vote up
/**
 * This customization is needed to render the additional proposal
 * information in html form properly.
 */
@Override
protected ConfigurableCompletionProposal doCreateProposal(String proposal,
		StyledString displayString, Image image, int replacementOffset,
		int replacementLength) {
	return new ConfigurableCompletionProposal(proposal, replacementOffset,
			replacementLength, proposal.length(), image, displayString,
			null, null) {
		@Override
		public IInformationControlCreator getInformationControlCreator() {
			return new IInformationControlCreator() {

				@Override
				public IInformationControl createInformationControl(
						Shell parent) {
					/**
					 * These information has been taken from the
					 * org.eclipse.xtext.ui.editor.hover.html.DefaultEObjectHoverProvider.HoverControlCreator
					 * class
					 */
					String font = "org.eclipse.jdt.ui.javadocfont"; //$NON-NLS-1$
					String tooltipAffordanceString = EditorsUI
							.getTooltipAffordanceString();
					return new XtextBrowserInformationControl(parent, font,
							tooltipAffordanceString);
				}
			};
		}
	};
}
 
Example 15
Source File: ModulaEditorTextHover.java    From xds-ide with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * {@inheritDoc}
 */
@Override
public IInformationControlCreator getHoverControlCreator() {
	if (lastReturnedHover instanceof ITextHoverExtension) {
		return ((ITextHoverExtension) lastReturnedHover).getHoverControlCreator();
	} else {
		return new IInformationControlCreator() {
			public IInformationControl createInformationControl(Shell parent) {
				return new HoverInformationControl(parent, EditorsUI.getTooltipAffordanceString());
			}
		};
	}
}
 
Example 16
Source File: ModulaInformationProvider.java    From xds-ide with Eclipse Public License 1.0 5 votes vote down vote up
public IInformationControlCreator getInformationPresenterControlCreator() {
    return new IInformationControlCreator() {
        public IInformationControl createInformationControl(Shell parent) {
            HoverInformationControl mic = new HoverInformationControl(parent, EditorsUI.getTooltipAffordanceString());
            IInformationControlCreator creatorWithFocus = mic.getInformationPresenterControlCreator();
            return creatorWithFocus.createInformationControl(parent);
        }
    };
}
 
Example 17
Source File: ModulaSpellingHover.java    From xds-ide with Eclipse Public License 1.0 5 votes vote down vote up
@Override
public IInformationControlCreator getHoverControlCreator() {
	return new IInformationControlCreator() {
		public IInformationControl createInformationControl(Shell parent) {
			return new HoverInformationControl(parent, EditorsUI.getTooltipAffordanceString());
		}
	};
}
 
Example 18
Source File: AbstractJavaEditorTextHover.java    From goclipse with Eclipse Public License 1.0 5 votes vote down vote up
@Override
public IInformationControlCreator getHoverControlCreator() {
	return new IInformationControlCreator() {
		@Override
		public IInformationControl createInformationControl(Shell parent) {
			return new DefaultInformationControl(parent, EditorsUI.getTooltipAffordanceString());
		}
	};
}
 
Example 19
Source File: AbstractHover.java    From xtext-eclipse with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public IInformationControlCreator getHoverControlCreator() {
	return new IInformationControlCreator() {
		@Override
		public IInformationControl createInformationControl(Shell parent) {
			return new DefaultInformationControl(parent, EditorsUI.getTooltipAffordanceString());
		}
	};
}
 
Example 20
Source File: AnnotationWithQuickFixesHover.java    From xtext-eclipse with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public IInformationControl doCreateInformationControl(Shell parent) {
	return new AnnotationInformationControl(parent, EditorsUI.getTooltipAffordanceString()) {

		@Override
		public IInformationControlCreator getInformationPresenterControlCreator() {
			return fPresenterControlCreator;
		}
	};
}