use of org.eclipse.jface.text.IInformationControlCreator in project tdi-studio-se by Talend.
the class SQLSourceViewerConfiguration method getInformationPresenter.
/*
* (non-Javadoc)
*
* @see org.eclipse.jface.text.source.SourceViewerConfiguration#getInformationPresenter(org.eclipse.jface.text.source.ISourceViewer)
*/
public IInformationPresenter getInformationPresenter(ISourceViewer sourceViewer) {
if (iPresenter == null) {
IInformationControlCreator informationControlCreator = new IInformationControlCreator() {
public IInformationControl createInformationControl(Shell parent) {
// SWT.H_SCROLL);
return new DefaultInformationControl(parent);
// SWT.RESIZE,,
// style,
// new
// HTMLTextPresenter(cutDown));
}
};
iPresenter = new InformationPresenter(informationControlCreator);
iPresenter.setSizeConstraints(60, 10, true, true);
}
return iPresenter;
}
use of org.eclipse.jface.text.IInformationControlCreator in project tdi-studio-se by Talend.
the class ReconcilerViewer method initializeModel.
protected void initializeModel() {
ProjectionSupport projectionSupport = new ProjectionSupport(this, annotationAccess, sharedColors);
//$NON-NLS-1$
projectionSupport.addSummarizableAnnotationType("org.eclipse.ui.workbench.texteditor.error");
//$NON-NLS-1$
projectionSupport.addSummarizableAnnotationType("org.eclipse.ui.workbench.texteditor.warning");
projectionSupport.setHoverControlCreator(new IInformationControlCreator() {
@Override
public IInformationControl createInformationControl(Shell shell) {
return new SourceViewerInformationControl(shell, false, SWT.LEFT_TO_RIGHT, EditorsUI.getTooltipAffordanceString());
}
});
projectionSupport.setInformationPresenterControlCreator(new IInformationControlCreator() {
@Override
public IInformationControl createInformationControl(Shell shell) {
int shellStyle = SWT.RESIZE | SWT.TOOL | SWT.LEFT_TO_RIGHT;
int style = SWT.V_SCROLL | SWT.H_SCROLL;
return new SourceViewerInformationControl(shell, true, SWT.LEFT_TO_RIGHT, null);
}
});
projectionSupport.install();
}
use of org.eclipse.jface.text.IInformationControlCreator in project KaiZen-OpenAPI-Editor by RepreZen.
the class JsonSourceViewerConfiguration method getOutlinePresenter.
public IInformationPresenter getOutlinePresenter(ISourceViewer sourceViewer) {
if (informationPresenter == null) {
IInformationControlCreator controlCreator = getOutlineInformationControlCreator();
informationPresenter = new InformationPresenter(controlCreator);
informationPresenter.setDocumentPartitioning(getConfiguredDocumentPartitioning(sourceViewer));
// Register information provider
IInformationProvider provider = new InformationProvider(controlCreator);
String[] contentTypes = getConfiguredContentTypes(sourceViewer);
for (String contentType : contentTypes) {
informationPresenter.setInformationProvider(provider, contentType);
}
informationPresenter.setSizeConstraints(60, 20, true, true);
}
return informationPresenter;
}
use of org.eclipse.jface.text.IInformationControlCreator in project erlide_eclipse by erlang.
the class AbstractErlangEditor method createPartControl.
@Override
public void createPartControl(final Composite parent) {
super.createPartControl(parent);
final IInformationControlCreator informationControlCreator = getSourceViewerConfiguration().getInformationControlCreator(getSourceViewer());
fInformationPresenter = new InformationPresenter(informationControlCreator);
// sizes: see org.eclipse.jface.text.TextViewer.TEXT_HOVER_*_CHARS
fInformationPresenter.setSizeConstraints(100, 12, true, true);
fInformationPresenter.install(getSourceViewer());
fInformationPresenter.setDocumentPartitioning(getSourceViewerConfiguration().getConfiguredDocumentPartitioning(getSourceViewer()));
}
use of org.eclipse.jface.text.IInformationControlCreator in project mylyn.docs by eclipse.
the class MarkupSourceViewerConfiguration method getOutlineInformationPresenter.
/**
* provide access to an information presenter that can be used to pop-up a quick outline. Source viewers should
* configure as follows:
*
* <pre>
* public void configure(SourceViewerConfiguration configuration) {
* super.configure(configuration);
* if (configuration instanceof MarkupSourceViewerConfiguration) {
* outlinePresenter = ((MarkupSourceViewerConfiguration) configuration)
* .getOutlineInformationPresenter(this);
* outlinePresenter.install(this);
* }
* }
* </pre>
*
* @param sourceViewer
* the source viewer for which the presenter should be created
* @return the presenter
*/
public IInformationPresenter getOutlineInformationPresenter(ISourceViewer sourceViewer) {
if (informationPresenter == null) {
IInformationControlCreator controlCreator = getOutlineInformationControlCreator();
informationPresenter = new InformationPresenter(controlCreator);
informationPresenter.setDocumentPartitioning(getConfiguredDocumentPartitioning(sourceViewer));
// Register information provider
IInformationProvider provider = new InformationProvider(controlCreator);
String[] contentTypes = getConfiguredContentTypes(sourceViewer);
for (String contentType : contentTypes) {
informationPresenter.setInformationProvider(provider, contentType);
}
informationPresenter.setSizeConstraints(60, 20, true, true);
}
return informationPresenter;
}
Aggregations