use of org.eclipse.jface.text.source.projection.ProjectionSupport in project dbeaver by serge-rider.
the class SQLEditorBase method createPartControl.
@Override
public void createPartControl(Composite parent) {
setRangeIndicator(new DefaultRangeIndicator());
super.createPartControl(new SQLEditorControl(parent, this));
ProjectionViewer viewer = (ProjectionViewer) getSourceViewer();
projectionSupport = new ProjectionSupport(viewer, getAnnotationAccess(), getSharedColors());
//$NON-NLS-1$
projectionSupport.addSummarizableAnnotationType("org.eclipse.ui.workbench.texteditor.error");
//$NON-NLS-1$
projectionSupport.addSummarizableAnnotationType("org.eclipse.ui.workbench.texteditor.warning");
projectionSupport.install();
viewer.doOperation(ProjectionViewer.TOGGLE);
annotationModel = viewer.getProjectionAnnotationModel();
// Symbol inserter
{
SQLSymbolInserter symbolInserter = new SQLSymbolInserter(this);
DBPPreferenceStore preferenceStore = getActivePreferenceStore();
boolean closeSingleQuotes = preferenceStore.getBoolean(SQLPreferenceConstants.SQLEDITOR_CLOSE_SINGLE_QUOTES);
boolean closeDoubleQuotes = preferenceStore.getBoolean(SQLPreferenceConstants.SQLEDITOR_CLOSE_DOUBLE_QUOTES);
boolean closeBrackets = preferenceStore.getBoolean(SQLPreferenceConstants.SQLEDITOR_CLOSE_BRACKETS);
symbolInserter.setCloseSingleQuotesEnabled(closeSingleQuotes);
symbolInserter.setCloseDoubleQuotesEnabled(closeDoubleQuotes);
symbolInserter.setCloseBracketsEnabled(closeBrackets);
ISourceViewer sourceViewer = getSourceViewer();
if (sourceViewer instanceof ITextViewerExtension) {
((ITextViewerExtension) sourceViewer).prependVerifyKeyListener(symbolInserter);
}
}
}
use of org.eclipse.jface.text.source.projection.ProjectionSupport in project KaiZen-OpenAPI-Editor by RepreZen.
the class JsonEditor method createPartControl.
@Override
public void createPartControl(Composite parent) {
super.createPartControl(parent);
ProjectionViewer viewer = getProjectionViewer();
projectionSupport = new ProjectionSupport(viewer, getAnnotationAccess(), getSharedColors());
projectionSupport.install();
// turn projection mode on
viewer.doOperation(ProjectionViewer.TOGGLE);
annotationModel = viewer.getProjectionAnnotationModel();
preferenceStore.addPropertyChangeListener(preferenceChangeListener);
}
use of org.eclipse.jface.text.source.projection.ProjectionSupport 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();
}
Aggregations