Class XtextSourceViewerEx
- java.lang.Object
-
- org.eclipse.jface.viewers.Viewer
-
- org.eclipse.jface.text.TextViewer
-
- org.eclipse.jface.text.source.SourceViewer
-
- org.eclipse.jface.text.source.projection.ProjectionViewer
-
- org.eclipse.xtext.ui.editor.XtextSourceViewer
-
- org.yakindu.base.xtext.utils.jface.viewers.XtextSourceViewerEx
-
- All Implemented Interfaces:
IAdaptable
,IEditingSupportRegistry
,ITextOperationTarget
,ITextOperationTargetExtension
,ITextViewer
,ITextViewerExtension
,ITextViewerExtension2
,ITextViewerExtension3
,ITextViewerExtension4
,ITextViewerExtension5
,ITextViewerExtension6
,ITextViewerExtension7
,ITextViewerExtension8
,ITextViewerExtension9
,IWidgetTokenOwner
,IWidgetTokenOwnerExtension
,ISourceViewer
,ISourceViewerExtension
,ISourceViewerExtension2
,ISourceViewerExtension3
,ISourceViewerExtension4
,ISourceViewerExtension5
,IInputProvider
,IInputSelectionProvider
,IPostSelectionProvider
,ISelectionProvider
public class XtextSourceViewerEx extends org.eclipse.xtext.ui.editor.XtextSourceViewer
Source viewer replacement that implements a workaround for Eclipse bug #352847 to enable that offsets are respected.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.eclipse.xtext.ui.editor.XtextSourceViewer
org.eclipse.xtext.ui.editor.XtextSourceViewer.DefaultFactory, org.eclipse.xtext.ui.editor.XtextSourceViewer.Factory
-
Nested classes/interfaces inherited from class org.eclipse.jface.text.source.SourceViewer
SourceViewer.RulerLayout
-
Nested classes/interfaces inherited from class org.eclipse.jface.text.TextViewer
TextViewer.TextHoverKey, TextViewer.WidgetCommand
-
Nested classes/interfaces inherited from interface org.eclipse.jface.text.ITextViewerExtension8
ITextViewerExtension8.EnrichMode
-
-
Field Summary
-
Fields inherited from class org.eclipse.jface.text.source.projection.ProjectionViewer
COLLAPSE, COLLAPSE_ALL, EXPAND, EXPAND_ALL, TOGGLE
-
Fields inherited from class org.eclipse.jface.text.source.SourceViewer
_SELECTION_POSITION_CATEGORY, fAnnotationHover, fContentAssistant, fContentAssistantInstalled, fContentFormatter, fInformationPresenter, fOverviewRulerAnnotationHover, fPresentationReconciler, fQuickAssistAssistant, fQuickAssistAssistantInstalled, fReconciler, fSelectionCategory, fSelections, fSelectionUpdater, GAP_SIZE, GAP_SIZE_1, MODEL_ANNOTATION_MODEL
-
Fields inherited from class org.eclipse.jface.text.TextViewer
fAutoIndentStrategies, fDefaultPrefixChars, fDoubleClickStrategies, fEventConsumer, fFindReplaceDocumentAdapter, fHoverControlCreator, fHyperlinkDetectors, fHyperlinkManager, fHyperlinkPresenter, fHyperlinkStateMask, fIgnoreAutoIndent, fIndentChars, fInformationMapping, fLastTopPixel, fMarkPosition, fPaintManager, fPartitioning, fReplaceTextPresentation, fTextHovers, fTextInputListeners, fTextListeners, fTextPresentationListeners, fUndoManager, fViewportListeners, INTERNAL, KEY, MOUSE, MOUSE_END, RESIZE, SCROLLER, SHIFTING, TRACE_ERRORS
-
Fields inherited from class org.eclipse.jface.viewers.Viewer
WIDGET_DATA_KEY
-
Fields inherited from interface org.eclipse.jface.text.source.ISourceViewer
CONTENTASSIST_CONTEXT_INFORMATION, CONTENTASSIST_PROPOSALS, FORMAT, INFORMATION, QUICK_ASSIST
-
Fields inherited from interface org.eclipse.jface.text.ITextOperationTarget
COPY, CUT, DELETE, PASTE, PREFIX, PRINT, REDO, SELECT_ALL, SHIFT_LEFT, SHIFT_RIGHT, STRIP_PREFIX, UNDO
-
Fields inherited from interface org.eclipse.jface.text.ITextViewerExtension2
DEFAULT_HOVER_STATE_MASK
-
-
Constructor Summary
Constructors Constructor Description XtextSourceViewerEx(StyledText styledText, IPreferenceStore preferenceStore)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
configure(SourceViewerConfiguration configuration)
protected void
createControl(Composite parent, int styles)
protected StyledText
createTextWidget(Composite parent, int styles)
protected void
setPrivateHandleProjectionChangesField(boolean value)
Set the private fHandleProjectionChanges field value.protected boolean
updateSlaveDocument(IDocument slaveDocument, int modelRangeOffset, int modelRangeLength)
Overwritten to handle offset properly.-
Methods inherited from class org.eclipse.xtext.ui.editor.XtextSourceViewer
getAdapter, getContentAssistant, getXtextDocument, prependTextPresentationListener, updateTextListeners
-
Methods inherited from class org.eclipse.jface.text.source.projection.ProjectionViewer
addProjectionListener, canDoOperation, computeCollapsedRegion, computeCollapsedRegionAnchor, copyMarkedRegion, createSlaveDocumentManager, createVisualAnnotationModel, disableProjection, doOperation, enableProjection, exposeModelRange, findAndSelect, findAndSelectInRange, fireProjectionDisabled, fireProjectionEnabled, getCoveredModelRanges, getFindReplaceDocumentAdapter, getProjectionAnnotationModel, getVisibleRegion, handleDispose, handleVerifyEvent, handleVisibleDocumentAboutToBeChanged, handleVisibleDocumentChanged, isProjectionMode, overlapsWithVisibleRegion, postCatchupRequest, processCatchupRequest, reinitializeProjection, removeProjectionListener, resetVisibleRegion, setDocument, setProjectionSummary, setRangeIndication, setVisibleDocument, setVisibleRegion, widgetSelection2ModelSelection
-
Methods inherited from class org.eclipse.jface.text.source.SourceViewer
activatePlugins, addVerticalRulerColumn, clearRememberedSelection, createFormattingContext, createFormattingContext, createLayout, disposeVisualAnnotationModel, enableOperation, ensureAnnotationHoverManagerInstalled, ensureOverviewHoverManagerInstalled, getAnnotationModel, getContentAssistantFacade, getControl, getCurrentAnnotationHover, getQuickAssistAssistant, getQuickAssistInvocationContext, getRangeIndication, getVerticalRuler, getVisualAnnotationModel, hasCodeMiningProviders, rememberSelection, removeRangeIndication, removeVerticalRulerColumn, restoreSelection, setAnnotationHover, setCodeMiningAnnotationPainter, setCodeMiningProviders, setDocument, setDocument, setDocument, setHoverEnrichMode, setOverviewRulerAnnotationHover, setRangeIndicator, showAnnotations, showAnnotationsOverview, unconfigure, updateCodeMinings, updateSlaveDocuments
-
Methods inherited from class org.eclipse.jface.text.TextViewer
_getVisibleRegionOffset, _internalGetVisibleRegion, addPainter, addPostSelectionChangedListener, addTextInputListener, addTextListener, addTextPresentationListener, addViewportListener, appendVerifyKeyListener, areMultipleLinesSelected, canPerformFind, changeTextPresentation, createDocumentAdapter, createSlaveDocument, customizeDocumentCommand, deleteText, disableRedrawing, enabledRedrawing, enabledRedrawing, event2ModelRange, findAndSelect, fireInputDocumentAboutToBeChanged, fireInputDocumentChanged, firePostSelectionChanged, fireSelectionChanged, freeSlaveDocument, getAverageCharWidth, getBottomIndex, getBottomIndexEndOffset, getClosestWidgetLineForModelLine, getCurrentTextHover, getDocument, getDocumentPartitioning, getEmptySelectionChangedEventDelay, getExtent, getFindReplaceTarget, getHoverEventLocation, getInput, getLastKnownSelection, getMark, getModelCoverage, getPaintManager, getRegisteredSupports, getRewriteTarget, getSelectedRange, getSelection, getSelectionProvider, getSlaveDocumentManager, getTextHover, getTextHover, getTextHoveringController, getTextOperationTarget, getTextWidget, getTopIndex, getTopIndexStartOffset, getTopInset, getUndoManager, getVisibleDocument, getVisibleLinesInViewport, getWidthInPixels, getWidthInPixels, ignoreAutoEditStrategies, initializeDocumentInformationMapping, inputChanged, internalRevealRange, invalidateTextPresentation, invalidateTextPresentation, isBlockSelected, isEditable, isIgnoringAutoEditStrategies, isPrintable, markChanged, modelLine2WidgetLine, modelOffset2WidgetOffset, modelRange2ClosestWidgetRange, modelRange2WidgetRange, modelRange2WidgetRange, modelSelection2WidgetSelection, modelStyleRange2WidgetStyleRange, moveFocusToWidgetToken, prependAutoEditStrategy, prependVerifyKeyListener, print, print, redraws, refresh, register, releaseWidgetToken, removeAutoEditStrategy, removePainter, removePostSelectionChangedListener, removeTextHovers, removeTextInputListener, removeTextListener, removeTextPresentationListener, removeVerifyKeyListener, removeViewportListener, requestWidgetToken, requestWidgetToken, resetPlugins, revealRange, selectContentTypePlugin, selectionChanged, setAutoEditStrategies, setAutoIndentStrategy, setDefaultPrefixes, setDocumentPartitioning, setEditable, setEventConsumer, setHoverControlCreator, setHyperlinkDetectors, setHyperlinkPresenter, setIndentPrefixes, setInput, setMark, setRedraw, setRedraw, setSelectedRange, setSelection, setTabsToSpacesConverter, setTextColor, setTextColor, setTextDoubleClickStrategy, setTextHover, setTextHover, setTopIndex, setUndoManager, shift, shift, startSequentialRewriteMode, stopSequentialRewriteMode, unregister, updateViewportListeners, updateVisibleDocument, validateSelectionRange, widgetLine2ModelLine, widgetLineOfWidgetOffset, widgetlLine2ModelLine, widgetOffset2ModelOffset, widgetRange2ModelRange
-
Methods inherited from class org.eclipse.jface.viewers.Viewer
addHelpListener, addSelectionChangedListener, fireHelpRequested, fireSelectionChanged, getData, handleHelpRequest, removeHelpListener, removeSelectionChangedListener, scrollDown, scrollUp, setData, setSelection
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.eclipse.jface.viewers.ISelectionProvider
addSelectionChangedListener, removeSelectionChangedListener, setSelection
-
Methods inherited from interface org.eclipse.jface.text.ITextViewer
addTextInputListener, addTextListener, addViewportListener, changeTextPresentation, getBottomIndex, getBottomIndexEndOffset, getDocument, getFindReplaceTarget, getSelectedRange, getSelectionProvider, getTextOperationTarget, getTextWidget, getTopIndex, getTopIndexStartOffset, getTopInset, invalidateTextPresentation, isEditable, removeTextInputListener, removeTextListener, removeViewportListener, resetPlugins, revealRange, setAutoIndentStrategy, setDefaultPrefixes, setEditable, setEventConsumer, setIndentPrefixes, setSelectedRange, setTextColor, setTextColor, setTextDoubleClickStrategy, setTextHover, setTopIndex, setUndoManager
-
Methods inherited from interface org.eclipse.jface.text.ITextViewerExtension3
widgetlLine2ModelLine
-
Methods inherited from interface org.eclipse.jface.text.ITextViewerExtension5
getModelCoverage, modelLine2WidgetLine, modelOffset2WidgetOffset, modelRange2WidgetRange, widgetLine2ModelLine, widgetLineOfWidgetOffset, widgetOffset2ModelOffset, widgetRange2ModelRange
-
-
-
-
Constructor Detail
-
XtextSourceViewerEx
public XtextSourceViewerEx(StyledText styledText, IPreferenceStore preferenceStore)
-
-
Method Detail
-
createControl
protected void createControl(Composite parent, int styles)
- Overrides:
createControl
in classSourceViewer
-
createTextWidget
protected StyledText createTextWidget(Composite parent, int styles)
- Overrides:
createTextWidget
in classTextViewer
-
updateSlaveDocument
protected boolean updateSlaveDocument(IDocument slaveDocument, int modelRangeOffset, int modelRangeLength) throws BadLocationException
Overwritten to handle offset properly.- Overrides:
updateSlaveDocument
in classProjectionViewer
- Throws:
BadLocationException
-
configure
public void configure(SourceViewerConfiguration configuration)
- Specified by:
configure
in interfaceISourceViewer
- Overrides:
configure
in classSourceViewer
-
setPrivateHandleProjectionChangesField
protected void setPrivateHandleProjectionChangesField(boolean value)
Set the private fHandleProjectionChanges field value.- Parameters:
value
- the new value.
-
-