use of org.eclipse.jdt.internal.ui.text.JavaElementProvider in project xtext-eclipse by eclipse.
the class QuickTypeHierarchyHandler method openPresentation.
@Override
protected void openPresentation(final XtextEditor editor, final IJavaElement javaElement, final EObject selectedElement) {
final ISourceViewer sourceViewer = editor.getInternalSourceViewer();
ITextRegion significantTextRegion = locationInFileProvider.getSignificantTextRegion(selectedElement);
InformationPresenter presenter = new HierarchyInformationPresenter(sourceViewer, javaElement, new Region(significantTextRegion.getOffset(), significantTextRegion.getLength()));
presenter.setDocumentPartitioning(IDocumentExtension3.DEFAULT_PARTITIONING);
presenter.setAnchor(AbstractInformationControlManager.ANCHOR_GLOBAL);
IInformationProvider provider = new JavaElementProvider(editor, false);
presenter.setInformationProvider(provider, IDocument.DEFAULT_CONTENT_TYPE);
presenter.setInformationProvider(provider, IJavaPartitions.JAVA_DOC);
presenter.setInformationProvider(provider, IJavaPartitions.JAVA_MULTI_LINE_COMMENT);
presenter.setInformationProvider(provider, IJavaPartitions.JAVA_SINGLE_LINE_COMMENT);
presenter.setInformationProvider(provider, IJavaPartitions.JAVA_STRING);
presenter.setInformationProvider(provider, IJavaPartitions.JAVA_CHARACTER);
presenter.setSizeConstraints(50, 20, true, false);
presenter.install(sourceViewer);
presenter.showInformation();
}
use of org.eclipse.jdt.internal.ui.text.JavaElementProvider in project xtext-eclipse by eclipse.
the class JvmImplementationOpener method openQuickHierarchy.
protected void openQuickHierarchy(ITextViewer textViewer, IJavaElement element, IRegion region) {
HierarchyInformationPresenter presenter = new HierarchyInformationPresenter((ISourceViewer) textViewer, element, region);
presenter.setDocumentPartitioning(IDocumentExtension3.DEFAULT_PARTITIONING);
presenter.setAnchor(AbstractInformationControlManager.ANCHOR_GLOBAL);
IInformationProvider provider = new JavaElementProvider(null, false);
presenter.setInformationProvider(provider, IDocument.DEFAULT_CONTENT_TYPE);
presenter.setInformationProvider(provider, IJavaPartitions.JAVA_DOC);
presenter.setInformationProvider(provider, IJavaPartitions.JAVA_MULTI_LINE_COMMENT);
presenter.setInformationProvider(provider, IJavaPartitions.JAVA_SINGLE_LINE_COMMENT);
presenter.setInformationProvider(provider, IJavaPartitions.JAVA_STRING);
presenter.setInformationProvider(provider, IJavaPartitions.JAVA_CHARACTER);
presenter.setSizeConstraints(50, 20, true, false);
presenter.install(textViewer);
presenter.showInformation();
}
Aggregations