public abstract class AbstractDecoratedTextEditor extends StatusTextEditor
AbstractTextEditor
,
but used in many heavy weight (and especially source editing) editors, such as line numbers,
change ruler, overview ruler, print margins, current line highlighting, etc.AbstractTextEditor.AbstractSelectionChangedListener, AbstractTextEditor.ColumnSupport, AbstractTextEditor.IdMapEntry, AbstractTextEditor.LineEndAction, AbstractTextEditor.LineStartAction, AbstractTextEditor.SelectionProvider, AbstractTextEditor.TextEditorSavable
ITextEditorExtension3.InsertMode
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_OVERVIEW_RULER_CONTEXT_MENU_ID
Menu id for the overview ruler context menu.
|
protected IAnnotationAccess |
fAnnotationAccess
Helper for accessing annotation from the perspective of this editor.
|
protected boolean |
fIsUpdatingMarkerViews
Indicates whether this editor is updating views that show markers.
|
protected LineNumberRulerColumn |
fLineNumberRulerColumn
The line number column.
|
protected IOverviewRuler |
fOverviewRuler
The overview ruler of this editor.
|
protected SourceViewerDecorationSupport |
fSourceViewerDecorationSupport
Helper for managing the decoration support of this editor's viewer.
|
ACTION_MAP, COMMON_EDITOR_CONTEXT_MENU_ID, COMMON_RULER_CONTEXT_MENU_ID, DEFAULT_EDITOR_CONTEXT_MENU_ID, DEFAULT_RULER_CONTEXT_MENU_ID, fErrorLabel, PREFERENCE_COLOR_BACKGROUND, PREFERENCE_COLOR_BACKGROUND_SYSTEM_DEFAULT, PREFERENCE_COLOR_FIND_SCOPE, PREFERENCE_COLOR_FOREGROUND, PREFERENCE_COLOR_FOREGROUND_SYSTEM_DEFAULT, PREFERENCE_COLOR_SELECTION_BACKGROUND, PREFERENCE_COLOR_SELECTION_BACKGROUND_SYSTEM_DEFAULT, PREFERENCE_COLOR_SELECTION_FOREGROUND, PREFERENCE_COLOR_SELECTION_FOREGROUND_SYSTEM_DEFAULT, PREFERENCE_FONT, PREFERENCE_HOVER_ENRICH_MODE, PREFERENCE_HYPERLINK_KEY_MODIFIER, PREFERENCE_HYPERLINK_KEY_MODIFIER_MASK, PREFERENCE_HYPERLINKS_ENABLED, PREFERENCE_NAVIGATION_SMART_HOME_END, PREFERENCE_RULER_CONTRIBUTIONS, PREFERENCE_SHOW_CARRIAGE_RETURN, PREFERENCE_SHOW_ENCLOSED_IDEOGRAPHIC_SPACES, PREFERENCE_SHOW_ENCLOSED_SPACES, PREFERENCE_SHOW_ENCLOSED_TABS, PREFERENCE_SHOW_LEADING_IDEOGRAPHIC_SPACES, PREFERENCE_SHOW_LEADING_SPACES, PREFERENCE_SHOW_LEADING_TABS, PREFERENCE_SHOW_LINE_FEED, PREFERENCE_SHOW_TRAILING_IDEOGRAPHIC_SPACES, PREFERENCE_SHOW_TRAILING_SPACES, PREFERENCE_SHOW_TRAILING_TABS, PREFERENCE_SHOW_WHITESPACE_CHARACTERS, PREFERENCE_TEXT_DRAG_AND_DROP_ENABLED, PREFERENCE_USE_CUSTOM_CARETS, PREFERENCE_WHITESPACE_CHARACTER_ALPHA_VALUE, PREFERENCE_WIDE_CARET, TAG_SELECTION_HORIZONTAL_PIXEL, TAG_SELECTION_LENGTH, TAG_SELECTION_OFFSET, TAG_SELECTION_TOP_PIXEL, VERTICAL_RULER_WIDTH
PROP_DIRTY, PROP_INPUT
PROP_TITLE
INSERT, SMART_INSERT
Constructor and Description |
---|
AbstractDecoratedTextEditor()
Creates a new text editor.
|
Modifier and Type | Method and Description |
---|---|
protected String[] |
collectContextMenuPreferencePages()
Returns the preference page ids of the preference pages to be shown when executing the
preferences action from the editor context menu.
|
protected String[] |
collectOverviewRulerMenuPreferencePages()
Returns the preference page ids of the preference pages to be shown when executing the
preferences action from the editor overview ruler context menu.
|
protected String[] |
collectRulerMenuPreferencePages()
Returns the preference page ids of the preference pages to be shown when executing the
preferences action from the editor ruler context menu.
|
protected void |
configureSourceViewerDecorationSupport(SourceViewerDecorationSupport support)
Configures the decoration support for this editor's source viewer.
|
protected void |
createActions()
Creates this editor's standard actions and connects them with the global
workbench actions.
|
protected IAnnotationAccess |
createAnnotationAccess()
Creates the annotation access for this editor.
|
protected IVerticalRulerColumn |
createAnnotationRulerColumn(CompositeRuler ruler)
Creates the annotation ruler column.
|
protected LineChangeHover |
createChangeHover()
Creates and returns a
LineChangeHover to be used on this editor's change
ruler column. |
protected IChangeRulerColumn |
createChangeRulerColumn()
Deprecated.
as of 3.3. Not called any longer, replaced by
createLineNumberRulerColumn() |
protected IColumnSupport |
createColumnSupport()
Creates the column support to be used by this editor to manage the
contributed ruler columns.
|
protected CompositeRuler |
createCompositeRuler()
Creates a composite ruler to be used as the vertical ruler by this editor.
|
protected IMenuListener |
createContextMenuListener()
Creates the listener on this editor's context menus.
|
protected IVerticalRulerColumn |
createLineNumberRulerColumn()
Creates a new line number ruler column that is appropriately initialized.
|
protected IOverviewRuler |
createOverviewRuler(ISharedTextColors sharedColors) |
protected void |
createOverviewRulerContextMenu()
Creates the context menu for the overview ruler.
|
void |
createPartControl(Composite parent)
The
AbstractTextEditor implementation of this
IWorkbenchPart method creates the vertical ruler and
source viewer. |
protected ISourceViewer |
createSourceViewer(Composite parent,
IVerticalRuler ruler,
int styles)
Creates the source viewer to be used by this editor.
|
protected Control |
createStatusControl(Composite parent,
IStatus status)
Creates the status control for the given status.
|
protected IVerticalRuler |
createVerticalRuler()
Returns
createCompositeRuler() . |
void |
dispose()
The
AbstractTextEditor implementation of this
IWorkbenchPart method may be extended by subclasses. |
protected void |
disposeDocumentProvider()
Disposes of the connection with the document provider.
|
protected void |
doSetInput(IEditorInput input)
Called directly from
setInput and from within a workspace
runnable from init , this method does the actual setting
of the editor input. |
protected void |
editorContextMenuAboutToShow(IMenuManager menu)
Sets up this editor's context menu before it is made visible.
|
Object |
getAdapter(Class adapter)
Returns an object which is an instance of the given class
associated with this object.
|
protected IAnnotationAccess |
getAnnotationAccess()
Returns the annotation access.
|
protected AnnotationPreferenceLookup |
getAnnotationPreferenceLookup()
Returns the annotation preference lookup.
|
protected MarkerAnnotationPreferences |
getAnnotationPreferences()
Returns the annotation preferences.
|
IDocumentProvider |
getDocumentProvider()
Returns this text editor's document provider.
|
protected IOverviewRuler |
getOverviewRuler()
Returns the overview ruler.
|
protected String |
getOverviewRulerContextMenuId()
Returns the ruler's overview context menu id.
|
protected ISharedTextColors |
getSharedColors() |
protected SourceViewerDecorationSupport |
getSourceViewerDecorationSupport(ISourceViewer viewer)
Returns the source viewer decoration support.
|
protected IOperationApprover |
getUndoRedoOperationApprover(IUndoContext undoContext)
Return an
IOperationApprover appropriate for approving the undo and
redo of operations that have the specified undo context. |
Annotation |
gotoAnnotation(boolean forward)
Jumps to the next annotation according to the given direction.
|
void |
gotoMarker(IMarker marker)
Deprecated.
visibility will be reduced, use
getAdapter(IGotoMarker.class) for accessing this method |
protected void |
handleEditorInputChanged()
Handles an external change of the editor's input element.
|
protected void |
handlePreferenceStoreChanged(PropertyChangeEvent event)
Handles a property change event describing a change of the editor's
preference store and updates the preference related editor properties.
|
protected void |
hideOverviewRuler()
Hides the overview ruler.
|
protected void |
initializeEditor()
Initializes this editor.
|
protected void |
initializeKeyBindingScopes()
Initializes the key binding scopes of this editor.
|
protected void |
initializeLineNumberRulerColumn(LineNumberRulerColumn rulerColumn)
Initializes the given line number ruler column from the preference store.
|
boolean |
isChangeInformationShowing()
Returns the quick diff display state.
|
boolean |
isEditable()
Returns whether the text in this text editor can be changed by the user.
|
protected boolean |
isErrorStatus(IStatus status)
Returns whether the given status indicates an error.
|
protected boolean |
isLineNumberRulerVisible()
Returns whether the line number ruler column should be
visible according to the preference store settings.
|
protected boolean |
isNavigationTarget(Annotation annotation)
Returns whether the given annotation is configured as a target for the
"Go to Next/Previous Annotation" actions.
|
protected boolean |
isOverviewRulerVisible()
Tells whether the overview ruler is visible.
|
protected boolean |
isOverwriteModeEnabled()
Returns whether the overwrite mode is enabled according to the preference
store settings.
|
protected boolean |
isPrefQuickDiffAlwaysOn()
Returns whether quick diff info should be visible upon opening an editor
according to the preference store settings.
|
protected boolean |
isTabsToSpacesConversionEnabled()
Tells whether tabs should be converted to
spaces while editing inside this editor.
|
protected void |
openSaveErrorDialog(String title,
String message,
CoreException exception)
Presents an error dialog to the user when a problem happens during save.
|
protected void |
overviewRulerContextMenuAboutToShow(IMenuManager menu)
Sets up the overview ruler context menu before it is made visible.
|
protected void |
performSaveAs(IProgressMonitor progressMonitor)
This implementation asks the user for the workspace path of a file resource and saves the document there.
|
protected void |
rulerContextMenuAboutToShow(IMenuManager menu)
Sets up the ruler context menu before it is made visible.
|
protected void |
setDocumentProvider(IEditorInput input)
Hook method for setting the document provider for the given input.
|
protected void |
setOverviewRulerContextMenuId(String contextMenuId)
Sets the ruler's overview context menu id.
|
void |
showChangeInformation(boolean show)
Sets the display of quick diff information.
|
protected void |
showOverviewRuler()
Shows the overview ruler.
|
void |
showRevisionInformation(RevisionInformation info,
String quickDiffProviderId)
Shows revision information in this editor.
|
protected void |
updateMarkerViews(Annotation annotation)
Updates visible views that show markers.
|
boolean |
validateEditorInputState()
Validates the state of the given editor input.
|
doRevertToSaved, getStatusBanner, getStatusHeader, getStatusMessage, handleElementContentReplaced, sanityCheckState, setFocus, updatePartControl, updateStatusField
addAction, addAction, addGroup, addRulerContextMenuListener, adjustHighlightRange, affectsTextPresentation, canHandleMove, close, configureInsertMode, containsSavedState, createEmptyNavigationLocation, createNavigationActions, createNavigationLocation, createUndoRedoActions, doGetSelection, doRestoreState, doSave, doSaveAs, doSetSelection, editorSaved, enableOverwriteMode, enableSanityChecking, enableStateValidation, findAnnotation, firePropertyChange, getAction, getActiveSaveables, getContextMenuListener, getCoverage, getCursorListener, getCursorPosition, getEditorContextMenuId, getFontPropertyPreferenceKey, getHelpContextId, getHighlightRange, getInsertMode, getLegalInsertModes, getPreferenceStore, getProgressMonitor, getRangeIndicator, getRulerContextMenuId, getRulerMouseListener, getSaveables, getSelectionChangedListener, getSelectionProvider, getSourceViewer, getSourceViewerConfiguration, getStatusField, getStatusLineManager, getVerticalRuler, handleCursorPositionChanged, handleExceptionOnSave, handleInsertModeChanged, init, initializeDragAndDrop, initializeViewerColors, installTabsToSpacesConverter, installTextDragAndDrop, internalInit, isBlockSelectionModeEnabled, isBlockSelectionModeSupported, isDirty, isEditorInputIncludedInContextMenu, isEditorInputModifiable, isEditorInputReadOnly, isInInsertMode, isSaveAsAllowed, isVisible, markAsContentDependentAction, markAsPropertyDependentAction, markAsSelectionDependentAction, markAsStateDependentAction, markInNavigationHistory, modelOffset2WidgetOffset, performRevert, performSave, rememberSelection, removeActionActivationCode, removeRulerContextMenuListener, resetHighlightRange, restoreSelection, restoreState, safelySanityCheckState, saveState, selectAndReveal, selectAndReveal, setAction, setActionActivationCode, setBlockSelectionMode, setCompatibilityMode, setDocumentProvider, setEditorContextMenuId, setHelpContextId, setHighlightRange, setInput, setInputWithNotify, setInsertMode, setKeyBindingScopes, setPreferenceStore, setRangeIndicator, setRulerContextMenuId, setSourceViewerConfiguration, setStatusField, setStatusLineErrorMessage, setStatusLineMessage, showHighlightRangeOnly, showsHighlightRangeOnly, uninstallTabsToSpacesConverter, uninstallTextDragAndDrop, updateContentDependentActions, updateContributedRulerColumns, updateIndentPrefixes, updatePropertyDependentActions, updateSelectionDependentActions, updateState, updateStateDependentActions, updateStatusFields, validateState, widgetOffset2ModelOffset
checkSite, getEditorInput, getEditorSite, getTitleToolTip, isSaveOnCloseNeeded, setContentDescription, setInitializationData, setPartName
addPartPropertyListener, addPropertyListener, firePartPropertyChanged, getConfigurationElement, getContentDescription, getDefaultImage, getOrientation, getPartName, getPartProperties, getPartProperty, getSite, getTitle, getTitleImage, removePartPropertyListener, removePropertyListener, setPartProperty, setSite, setTitle, setTitleImage, setTitleToolTip, showBusy
addListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObject
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getEditorInput, getEditorSite
addPropertyListener, getSite, getTitle, getTitleImage, getTitleToolTip, removePropertyListener
isSaveOnCloseNeeded
public static final String DEFAULT_OVERVIEW_RULER_CONTEXT_MENU_ID
protected IOverviewRuler fOverviewRuler
This field should not be referenced by subclasses. It is protected
for API
compatibility reasons and will be made private
soon. Use
getOverviewRuler()
instead.
protected IAnnotationAccess fAnnotationAccess
This field should not be referenced by subclasses. It is protected
for API
compatibility reasons and will be made private
soon. Use
getAnnotationAccess()
instead.
protected SourceViewerDecorationSupport fSourceViewerDecorationSupport
This field should not be referenced by subclasses. It is protected
for API
compatibility reasons and will be made private
soon. Use
getSourceViewerDecorationSupport(ISourceViewer)
instead.
protected LineNumberRulerColumn fLineNumberRulerColumn
This field should not be referenced by subclasses. It is protected
for API
compatibility reasons and will be made private
soon. Use
AbstractTextEditor.getVerticalRuler()
to access the vertical bar instead.
protected boolean fIsUpdatingMarkerViews
updateMarkerViews(Annotation)
public AbstractDecoratedTextEditor()
initializeEditor()
,
initializeKeyBindingScopes()
protected void initializeEditor()
super.initializeEditor()
in order to avoid the
temporary creation of objects that are immediately overwritten by
subclasses.protected void initializeKeyBindingScopes()
public void dispose()
AbstractTextEditor
AbstractTextEditor
implementation of this
IWorkbenchPart
method may be extended by subclasses.
Subclasses must call super.dispose()
.
Note that many methods may return null
after the editor is
disposed.
dispose
in interface IWorkbenchPart
dispose
in class AbstractTextEditor
protected ISourceViewer createSourceViewer(Composite parent, IVerticalRuler ruler, int styles)
AbstractTextEditor
createSourceViewer
in class AbstractTextEditor
parent
- the parent controlruler
- the vertical rulerstyles
- style bits, SWT.WRAP
is currently not supportedprotected ISharedTextColors getSharedColors()
protected IOverviewRuler createOverviewRuler(ISharedTextColors sharedColors)
protected IAnnotationAccess createAnnotationAccess()
protected void configureSourceViewerDecorationSupport(SourceViewerDecorationSupport support)
support
- the decoration support to configurepublic void createPartControl(Composite parent)
AbstractTextEditor
AbstractTextEditor
implementation of this
IWorkbenchPart
method creates the vertical ruler and
source viewer.
Subclasses may extend this method. Besides extending this method, the
behavior of createPartControl
may be customized by
calling, extending or replacing the following methods:
Subclasses may supply customized implementations for some members using
the following methods before createPartControl
is invoked:
createPartControl
:
createPartControl
:
createPartControl
in interface IWorkbenchPart
createPartControl
in class StatusTextEditor
parent
- the parent compositeprotected void createOverviewRulerContextMenu()
Subclasses may extend or replace this method.
protected IMenuListener createContextMenuListener()
AbstractTextEditor
createContextMenuListener
in class AbstractTextEditor
protected Control createStatusControl(Composite parent, IStatus status)
StatusTextEditor
createStatusControl
in class StatusTextEditor
parent
- the parent controlstatus
- the statusprotected boolean isOverviewRulerVisible()
public void showChangeInformation(boolean show)
ITextEditorExtension3
showChangeInformation
in interface ITextEditorExtension3
showChangeInformation
in class AbstractTextEditor
show
- true
if quick diff information should be shown, false
otherwisepublic boolean isChangeInformationShowing()
ITextEditorExtension3
isChangeInformationShowing
in interface ITextEditorExtension3
isChangeInformationShowing
in class AbstractTextEditor
true
if quick diff info is displayed, false
otherwisepublic void showRevisionInformation(RevisionInformation info, String quickDiffProviderId)
ITextEditorExtension4
showRevisionInformation
in interface ITextEditorExtension4
showRevisionInformation
in class AbstractTextEditor
info
- the revision information to displayquickDiffProviderId
- the quick diff provider that matches the source of the revision
informationprotected boolean isLineNumberRulerVisible()
true
if the line numbers should be visibleprotected boolean isOverwriteModeEnabled()
true
if overwrite mode is enabledprotected boolean isPrefQuickDiffAlwaysOn()
true
if the line numbers should be visibleprotected void initializeLineNumberRulerColumn(LineNumberRulerColumn rulerColumn)
rulerColumn
- the ruler column to be initializedprotected IVerticalRulerColumn createLineNumberRulerColumn()
protected LineChangeHover createChangeHover()
LineChangeHover
to be used on this editor's change
ruler column. This default implementation returns a plain LineChangeHover
.
Subclasses may override.protected IChangeRulerColumn createChangeRulerColumn()
createLineNumberRulerColumn()
protected IVerticalRuler createVerticalRuler()
createCompositeRuler()
. Subclasses should not override this method, but
rather createCompositeRuler
if they want to contribute their own vertical ruler
implementation. If not an instance of CompositeRuler
is returned, the built-in ruler
columns (line numbers, annotations) will not work.
May become final
in the future.
createVerticalRuler
in class AbstractTextEditor
AbstractTextEditor.createVerticalRuler()
protected CompositeRuler createCompositeRuler()
protected IVerticalRulerColumn createAnnotationRulerColumn(CompositeRuler ruler)
ruler
- the composite ruler that the column will be addedprotected final IColumnSupport createColumnSupport()
AbstractTextEditor
AbstractTextEditor.ColumnSupport
,
e.g. by returning new ColumnSupport(this, RulerColumnRegistry.getDefault());
.
Note: If you override this method to provide column support you will
also need to override AbstractTextEditor.createVerticalRuler()
to return a CompositeRuler
.
Out of the box this class does not install this support and hence this
implementation always returns null
.
createColumnSupport
in class AbstractTextEditor
null
if noneprotected void handlePreferenceStoreChanged(PropertyChangeEvent event)
AbstractTextEditor
Subclasses may extend.
handlePreferenceStoreChanged
in class AbstractTextEditor
event
- the property change eventprotected void showOverviewRuler()
protected void hideOverviewRuler()
protected IAnnotationAccess getAnnotationAccess()
protected AnnotationPreferenceLookup getAnnotationPreferenceLookup()
protected IOverviewRuler getOverviewRuler()
protected SourceViewerDecorationSupport getSourceViewerDecorationSupport(ISourceViewer viewer)
viewer
- the viewer for which to return a decoration supportprotected MarkerAnnotationPreferences getAnnotationPreferences()
public void gotoMarker(IMarker marker)
getAdapter(IGotoMarker.class) for accessing this method
marker
- the marker to go topublic boolean isEditable()
ITextEditor
isEditable
in interface ITextEditor
isEditable
in class AbstractTextEditor
true
if it can be edited, and false
if it is read-onlypublic boolean validateEditorInputState()
ITextEditorExtension2
validateEditorInputState
in interface ITextEditorExtension2
validateEditorInputState
in class StatusTextEditor
true
if the input was validated, false
otherwiseprotected boolean isErrorStatus(IStatus status)
StatusTextEditor
isErrorStatus
in class StatusTextEditor
status
- the status to be checkedtrue
if the status indicates an error, false
otherwise\protected void createActions()
AbstractTextEditor
Subclasses may extend.
createActions
in class AbstractTextEditor
public Object getAdapter(Class adapter)
WorkbenchPart
null
if
no such object can be found.
Subclasses may override this method (however, if they do so, they
should invoke the method on their superclass to ensure that the
Platform's adapter manager is consulted).getAdapter
in interface IAdaptable
getAdapter
in class AbstractTextEditor
adapter
- the adapter class to look upnull
if this object does not
have an adapter for the given classprotected void setDocumentProvider(IEditorInput input)
AbstractTextEditor
setDocumentProvider
in class AbstractTextEditor
input
- the input of this editor.public IDocumentProvider getDocumentProvider()
ITextEditor
getDocumentProvider
in interface ITextEditor
getDocumentProvider
in class AbstractTextEditor
null
if none, e.g. after closing the editorprotected void disposeDocumentProvider()
AbstractTextEditor
disposeDocumentProvider
in class AbstractTextEditor
protected void doSetInput(IEditorInput input) throws CoreException
AbstractTextEditor
setInput
and from within a workspace
runnable from init
, this method does the actual setting
of the editor input. Closes the editor if input
is
null
. Disconnects from any previous editor input and its
document provider and connects to the new one.
Subclasses may extend.
doSetInput
in class StatusTextEditor
input
- the input to be setCoreException
- if input cannot be connected to the document
providerprotected void handleEditorInputChanged()
AbstractTextEditor
handleEditorInputChanged
in class StatusTextEditor
protected void performSaveAs(IProgressMonitor progressMonitor)
performSaveAs
in class AbstractTextEditor
progressMonitor
- the progress monitor to be usedprotected void openSaveErrorDialog(String title, String message, CoreException exception)
Overrides the default behavior by showing a more advanced error dialog in case of encoding problems.
openSaveErrorDialog
in class AbstractTextEditor
title
- the dialog titlemessage
- the message to displayexception
- the exception to handleprotected void setOverviewRulerContextMenuId(String contextMenuId)
contextMenuId
- the overview ruler context menu idprotected final String getOverviewRulerContextMenuId()
null
before the editor's part has been created.null
protected void overviewRulerContextMenuAboutToShow(IMenuManager menu)
Subclasses may extend to add other actions.
menu
- the menuprotected void rulerContextMenuAboutToShow(IMenuManager menu)
AbstractTextEditor
Subclasses may extend to add other actions.
rulerContextMenuAboutToShow
in class AbstractTextEditor
menu
- the menuprotected void editorContextMenuAboutToShow(IMenuManager menu)
AbstractTextEditor
Subclasses may extend to add other actions.
editorContextMenuAboutToShow
in class AbstractTextEditor
menu
- the menuprotected String[] collectContextMenuPreferencePages()
Subclasses may extend or replace.
protected String[] collectRulerMenuPreferencePages()
The default is to return the same list as collectContextMenuPreferencePages
.
Subclasses may extend or replace.
protected String[] collectOverviewRulerMenuPreferencePages()
The default is to select the 'Annotations' preference page.
Subclasses may extend or replace.
protected IOperationApprover getUndoRedoOperationApprover(IUndoContext undoContext)
AbstractTextEditor
IOperationApprover
appropriate for approving the undo and
redo of operations that have the specified undo context.
Subclasses may override.
getUndoRedoOperationApprover
in class AbstractTextEditor
undoContext
- the IUndoContext of operations that should be examined
by the operation approverIOperationApprover
appropriate for approving undo
and redo operations inside this editor, or null
if no
approval is neededprotected boolean isNavigationTarget(Annotation annotation)
The annotation is a target if their annotation type is configured to be in the Next/Previous tool bar drop down menu and if it is checked.
isNavigationTarget
in class AbstractTextEditor
annotation
- the annotationtrue
if this is a target, false
otherwisepublic Annotation gotoAnnotation(boolean forward)
This extended implementation updates views that also show the select marker annotation.
gotoAnnotation
in interface ITextEditorExtension4
gotoAnnotation
in class AbstractTextEditor
forward
- true
if search direction is forward, false
if backwardnull
if noneAbstractTextEditor.isNavigationTarget(Annotation)
,
AbstractTextEditor.findAnnotation(int, int, boolean, Position)
protected void updateMarkerViews(Annotation annotation)
If the given annotation can be associated with a marker then this method tries select the this marker in views that show markers.
annotation
- the annotationprotected boolean isTabsToSpacesConversionEnabled()
AbstractTextEditor
Subclasses may override this method.
isTabsToSpacesConversionEnabled
in class AbstractTextEditor
true
if tabs should be converted to spaces
Copyright (c) 2000, 2015 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.