Class CustomEmbeddedEditorBuilder
- java.lang.Object
-
- org.eclipse.xtext.ui.editor.embedded.EmbeddedEditorFactory.Builder
-
- com._1c.g5.ides.ui.texteditor.xtext.embedded.CustomEmbeddedEditorBuilder
-
public class CustomEmbeddedEditorBuilder extends org.eclipse.xtext.ui.editor.embedded.EmbeddedEditorFactory.Builder
Custom implementationEmbeddedEditorFactory.Builder
. Have folding support and underlying working copy support.
-
-
Field Summary
-
Fields inherited from class org.eclipse.xtext.ui.editor.embedded.EmbeddedEditorFactory.Builder
actionFactory, annotationTypes, characterPairMatcher, documentPartitionerProvider, documentProvider, editorBuild, highlightingHelper, issueProcessor, issueResolutionProvider, lineNumbers, lineNumbersBackgroundColor, lineNumbersForegroundColor, preferenceStoreAccess, readonly, resourceProvider, resourceValidator, sourceViewerConfigurationProvider, sourceViewerFactory, style, VERTICAL_RULER_WIDTH, xtextDocumentUtil
-
-
Constructor Summary
Constructors Constructor Description CustomEmbeddedEditorBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
afterCreatePartialEditor(org.eclipse.xtext.ui.editor.XtextSourceViewer viewer, org.eclipse.xtext.ui.editor.model.XtextDocument document, org.eclipse.jface.text.source.CompositeRuler verticalRuler, org.eclipse.xtext.ui.editor.embedded.EmbeddedEditorActions actions)
protected org.eclipse.jface.text.source.CompositeRuler
createAnnotationRuler()
Create annotation ruler.protected org.eclipse.xtext.ui.editor.model.XtextDocument
createDocument()
Create Xtext document.protected org.eclipse.xtext.ui.editor.embedded.EmbeddedEditor
createEmbeddedEditor(org.eclipse.jface.text.source.CompositeRuler annotationRuler, org.eclipse.xtext.ui.editor.XtextSourceViewer viewer, org.eclipse.xtext.ui.editor.XtextSourceViewerConfiguration viewerConfiguration, org.eclipse.xtext.ui.editor.model.XtextDocument document, org.eclipse.xtext.ui.editor.embedded.EmbeddedEditorActions actions)
Create Xtext embedded editor.protected org.eclipse.xtext.ui.editor.XtextSourceViewer
createSourceViewer(org.eclipse.swt.widgets.Composite parent, org.eclipse.jface.text.source.IVerticalRuler ruler, org.eclipse.xtext.ui.editor.XtextSourceViewerConfiguration viewerConfiguration)
Create and configure Xtext source viewer.protected org.eclipse.xtext.ui.editor.XtextSourceViewerConfiguration
createSourceViewerConfiguration()
Create Xtext source viewer configuration.protected org.eclipse.handly.model.impl.support.SourceFile
createWorkingCopy(org.eclipse.xtext.ui.editor.model.XtextDocument document, org.eclipse.core.resources.IFile underlyingFile)
Create working copy for given editor and non-existing input.CustomEmbeddedEditorBuilder
enableFolding()
Enable folding for embedded editor.protected org.eclipse.jface.text.source.IAnnotationAccess
getAnnotationAccess()
Get default annotation access.protected void
installFoldingSupport(org.eclipse.xtext.ui.editor.XtextSourceViewer viewer, org.eclipse.xtext.ui.editor.model.XtextDocument document)
Install folding support for given embedded editor.protected org.eclipse.jface.text.source.projection.ProjectionSupport
installProjectionSupport(org.eclipse.xtext.ui.editor.XtextSourceViewer viewer)
Install projection support to given xtext source viewer.protected org.eclipse.ui.texteditor.SourceViewerDecorationSupport
installSourceViewerDecorationSupport(org.eclipse.swt.widgets.Composite parent, org.eclipse.xtext.ui.editor.XtextSourceViewer viewer)
Install source viewer decoration support for given embedded editor.protected void
installValidationSupport(org.eclipse.xtext.ui.editor.model.XtextDocument document, org.eclipse.xtext.ui.editor.XtextSourceViewer viewer)
Install validation support for given embedded editor.protected org.eclipse.handly.model.impl.support.SourceFile
installWorkingCopySupport(org.eclipse.xtext.ui.editor.XtextSourceViewer viewer, org.eclipse.xtext.ui.editor.model.XtextDocument document)
Install working copy and discard it by editor disposing.CustomEmbeddedEditorBuilder
setUderlyingFile(org.eclipse.core.resources.IFile underlyingFile)
Set underlying file for constructing embedded editor.org.eclipse.xtext.ui.editor.embedded.EmbeddedEditor
withParent(org.eclipse.swt.widgets.Composite parent)
-
Methods inherited from class org.eclipse.xtext.ui.editor.embedded.EmbeddedEditorFactory.Builder
getSharedColors, initializeActions, installUndoRedoSupport, processIssuesBy, readOnly, setResourceProvider, showAnnotations, showErrorAndWarningAnnotations, showLineNumbers, showLineNumbers, uninstallUndoRedoSupport, updateUndoAction, withResourceValidator, withStyle
-
-
-
-
Method Detail
-
setUderlyingFile
public CustomEmbeddedEditorBuilder setUderlyingFile(org.eclipse.core.resources.IFile underlyingFile)
Set underlying file for constructing embedded editor. Used to create handle model.- Parameters:
underlyingFile
- underlying file (notnull
)- Returns:
- builder (never
null
) - See Also:
IHandle
,ISourceFile
-
enableFolding
public CustomEmbeddedEditorBuilder enableFolding()
Enable folding for embedded editor.- Returns:
- builder (never
null
)
-
withParent
public org.eclipse.xtext.ui.editor.embedded.EmbeddedEditor withParent(org.eclipse.swt.widgets.Composite parent)
- Overrides:
withParent
in classorg.eclipse.xtext.ui.editor.embedded.EmbeddedEditorFactory.Builder
-
afterCreatePartialEditor
protected void afterCreatePartialEditor(org.eclipse.xtext.ui.editor.XtextSourceViewer viewer, org.eclipse.xtext.ui.editor.model.XtextDocument document, org.eclipse.jface.text.source.CompositeRuler verticalRuler, org.eclipse.xtext.ui.editor.embedded.EmbeddedEditorActions actions)
- Overrides:
afterCreatePartialEditor
in classorg.eclipse.xtext.ui.editor.embedded.EmbeddedEditorFactory.Builder
-
installSourceViewerDecorationSupport
protected org.eclipse.ui.texteditor.SourceViewerDecorationSupport installSourceViewerDecorationSupport(org.eclipse.swt.widgets.Composite parent, org.eclipse.xtext.ui.editor.XtextSourceViewer viewer)
Install source viewer decoration support for given embedded editor.- Parameters:
parent
- parent composite (notnull
)viewer
- Xtext source viewer (notnull
)- Returns:
- source viewer decoration support (never
null
)
-
installValidationSupport
protected void installValidationSupport(org.eclipse.xtext.ui.editor.model.XtextDocument document, org.eclipse.xtext.ui.editor.XtextSourceViewer viewer)
Install validation support for given embedded editor.- Parameters:
document
- Xtext document (notnull
)viewer
- Xtext source viewer (notnull
)
-
installFoldingSupport
protected void installFoldingSupport(org.eclipse.xtext.ui.editor.XtextSourceViewer viewer, org.eclipse.xtext.ui.editor.model.XtextDocument document)
Install folding support for given embedded editor.- Parameters:
viewer
- target xtext source viewer (notnull
)document
- target xtext document (notnull
)
-
installProjectionSupport
protected org.eclipse.jface.text.source.projection.ProjectionSupport installProjectionSupport(org.eclipse.xtext.ui.editor.XtextSourceViewer viewer)
Install projection support to given xtext source viewer.- Parameters:
viewer
- target xtext source viewer (notnull
)- Returns:
- projection support (never
null
)
-
installWorkingCopySupport
protected org.eclipse.handly.model.impl.support.SourceFile installWorkingCopySupport(org.eclipse.xtext.ui.editor.XtextSourceViewer viewer, org.eclipse.xtext.ui.editor.model.XtextDocument document)
Install working copy and discard it by editor disposing.- Parameters:
viewer
- target xtext source viewer (notnull
)document
- target xtext document (notnull
)- Returns:
- source file by IFile corresponding to
editor
ornull
if none
-
createSourceViewer
protected org.eclipse.xtext.ui.editor.XtextSourceViewer createSourceViewer(org.eclipse.swt.widgets.Composite parent, org.eclipse.jface.text.source.IVerticalRuler ruler, org.eclipse.xtext.ui.editor.XtextSourceViewerConfiguration viewerConfiguration)
Create and configure Xtext source viewer.- Parameters:
parent
- parent composite (notnull
)ruler
- annotation ruler (notnull
)viewerConfiguration
- viewer configuration (notnull
)- Returns:
- created Xtext source viewer (never
null
)
-
createDocument
protected org.eclipse.xtext.ui.editor.model.XtextDocument createDocument()
Create Xtext document.- Returns:
- created Xtext document (never
null
)
-
createSourceViewerConfiguration
protected org.eclipse.xtext.ui.editor.XtextSourceViewerConfiguration createSourceViewerConfiguration()
Create Xtext source viewer configuration.- Returns:
- created source viewer configuration (never
null
)
-
createEmbeddedEditor
protected org.eclipse.xtext.ui.editor.embedded.EmbeddedEditor createEmbeddedEditor(org.eclipse.jface.text.source.CompositeRuler annotationRuler, org.eclipse.xtext.ui.editor.XtextSourceViewer viewer, org.eclipse.xtext.ui.editor.XtextSourceViewerConfiguration viewerConfiguration, org.eclipse.xtext.ui.editor.model.XtextDocument document, org.eclipse.xtext.ui.editor.embedded.EmbeddedEditorActions actions)
Create Xtext embedded editor.- Parameters:
annotationRuler
- annotation ruler (notnull
)viewer
- source viewer (notnull
)viewerConfiguration
- source viewer configuration (notnull
)document
- xtext document (notnull
)actions
- embedded editor actions (notnull
)- Returns:
- created embedded editor (not
null
)
-
createAnnotationRuler
protected org.eclipse.jface.text.source.CompositeRuler createAnnotationRuler()
Create annotation ruler.- Returns:
- created composite ruler (can return
null
)
-
getAnnotationAccess
protected org.eclipse.jface.text.source.IAnnotationAccess getAnnotationAccess()
Get default annotation access.- Returns:
- annotation access (never
null
)
-
createWorkingCopy
protected org.eclipse.handly.model.impl.support.SourceFile createWorkingCopy(org.eclipse.xtext.ui.editor.model.XtextDocument document, org.eclipse.core.resources.IFile underlyingFile)
Create working copy for given editor and non-existing input.- Parameters:
document
- target xtext document (notnull
)file
- underlying file (notnull
)- Returns:
- sourceFile created source file by given IFile or
null
if none - Throws:
IllegalStateException
- if cannot create source file
-
-