use of org.jkiss.dbeaver.ui.editors.sql.util.SQLSymbolInserter in project dbeaver by serge-rider.
the class SQLEditorBase method createPartControl.
@Override
public void createPartControl(Composite parent) {
setRangeIndicator(new DefaultRangeIndicator());
editorControl = new SQLEditorControl(parent, this);
super.createPartControl(editorControl);
if (occurrencesHighlighter.isEnabled()) {
occurrencesHighlighter.installOccurrencesFinder();
}
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 = new SQLSymbolInserter(this);
loadActivePreferenceSettings();
ISourceViewer sourceViewer = getSourceViewer();
if (sourceViewer instanceof ITextViewerExtension) {
((ITextViewerExtension) sourceViewer).prependVerifyKeyListener(sqlSymbolInserter);
}
}
{
// Context listener
EditorUtils.trackControlContext(getSite(), getViewer().getTextWidget(), SQLEditorContributions.SQL_EDITOR_CONTROL_CONTEXT);
}
}
use of org.jkiss.dbeaver.ui.editors.sql.util.SQLSymbolInserter in project dbeaver by dbeaver.
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);
}
}
}
Aggregations