use of org.eclipse.jface.text.information.IInformationPresenter 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.information.IInformationPresenter 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.information.IInformationPresenter in project dbeaver by serge-rider.
the class SQLEditorSourceViewerConfiguration method getInformationPresenter.
@Override
public IInformationPresenter getInformationPresenter(ISourceViewer sourceViewer) {
InformationPresenter presenter = new InformationPresenter(getInformationControlCreator(sourceViewer));
presenter.setDocumentPartitioning(getConfiguredDocumentPartitioning(sourceViewer));
// Register information provider
IInformationProvider provider = new SQLInformationProvider(getSQLEditor());
String[] contentTypes = getConfiguredContentTypes(sourceViewer);
for (String contentType : contentTypes) {
presenter.setInformationProvider(provider, contentType);
}
presenter.setSizeConstraints(60, 10, true, true);
return presenter;
}
use of org.eclipse.jface.text.information.IInformationPresenter in project KaiZen-OpenAPI-Editor by RepreZen.
the class JsonEditor method doCreateSourceViewer.
protected ISourceViewer doCreateSourceViewer(Composite parent, IVerticalRuler ruler, int styles) {
ProjectionViewer viewer = new ProjectionViewer(parent, ruler, getOverviewRuler(), isOverviewRulerVisible(), styles) {
private IInformationPresenter outlinePresenter;
@Override
public void doOperation(int operation) {
if (operation == OpenQuickOutlineHandler.QUICK_OUTLINE && outlinePresenter != null) {
outlinePresenter.showInformation();
return;
}
super.doOperation(operation);
}
@Override
public boolean canDoOperation(int operation) {
if (operation == OpenQuickOutlineHandler.QUICK_OUTLINE && outlinePresenter != null) {
return true;
}
return super.canDoOperation(operation);
}
@Override
public void configure(SourceViewerConfiguration configuration) {
super.configure(configuration);
if (configuration instanceof JsonSourceViewerConfiguration) {
JsonSourceViewerConfiguration c = (JsonSourceViewerConfiguration) configuration;
outlinePresenter = c.getOutlinePresenter(this);
if (outlinePresenter != null) {
outlinePresenter.install(this);
}
}
}
};
IFocusService focusService = (IFocusService) PlatformUI.getWorkbench().getService(IFocusService.class);
if (focusService != null) {
focusService.addFocusTracker(viewer.getTextWidget(), "com.reprezen.swagedit.editor.sourceViewer");
}
viewer.getTextWidget().addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
// detectOutlineLocationChanged();
}
});
viewer.getTextWidget().setData(ISourceViewer.class.getName(), viewer);
getSourceViewerDecorationSupport(viewer);
return viewer;
}
Aggregations