Class AbstractDecoratedTextEditor
- All Implemented Interfaces:
IAdaptable,IExecutableExtension,IEditorPart,INavigationLocationProvider,IPersistable,IPersistableEditor,IReusableEditor,ISaveablePart,ISaveablesSource,IWorkbenchPart,IWorkbenchPart2,IWorkbenchPart3,IWorkbenchPartOrientation,ITextEditor,ITextEditorExtension,ITextEditorExtension2,ITextEditorExtension3,ITextEditorExtension4,ITextEditorExtension5,ITextEditorExtension6
- Direct Known Subclasses:
TextEditor
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.- Since:
- 3.0
-
Nested Class Summary
Nested classes/interfaces inherited from class org.eclipse.ui.texteditor.AbstractTextEditor
AbstractTextEditor.AbstractSelectionChangedListener, AbstractTextEditor.ColumnSupport, AbstractTextEditor.IdMapEntry, AbstractTextEditor.LineEndAction, AbstractTextEditor.LineStartAction, AbstractTextEditor.SelectionProvider, AbstractTextEditor.TextEditorSavableNested classes/interfaces inherited from interface org.eclipse.ui.texteditor.ITextEditorExtension3
ITextEditorExtension3.InsertMode -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringMenu id for the overview ruler context menu.protected IAnnotationAccessHelper for accessing annotation from the perspective of this editor.protected booleanIndicates whether this editor is updating views that show markers.protected LineNumberRulerColumnThe line number column.protected IOverviewRulerThe overview ruler of this editor.protected SourceViewerDecorationSupportHelper for managing the decoration support of this editor's viewer.Fields inherited from class org.eclipse.ui.texteditor.AbstractTextEditor
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_CARET_OFFSET, 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_SELECTION_SIZE, 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, PREFERENCE_WORD_WRAP_ENABLED, TAG_SELECTION_HORIZONTAL_PIXEL, TAG_SELECTION_LENGTH, TAG_SELECTION_OFFSET, TAG_SELECTION_TOP_PIXEL, VERTICAL_RULER_WIDTHFields inherited from interface org.eclipse.ui.IEditorPart
PROP_DIRTY, PROP_INPUTFields inherited from interface org.eclipse.ui.texteditor.ITextEditorExtension3
INSERT, SMART_INSERTFields inherited from interface org.eclipse.ui.IWorkbenchPart
PROP_TITLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected String[]Returns the preference page ids of the preference pages to be shown when executing the preferences action from the editor context menu.protected String[]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[]Returns the preference page ids of the preference pages to be shown when executing the preferences action from the editor ruler context menu.protected voidConfigures the decoration support for this editor's source viewer.protected voidCreates this editor's standard actions and connects them with the global workbench actions.protected IAnnotationAccessCreates the annotation access for this editor.protected IVerticalRulerColumnCreates the annotation ruler column.protected LineChangeHoverCreates and returns aLineChangeHoverto be used on this editor's change ruler column.protected IChangeRulerColumnDeprecated.as of 3.3.protected final IColumnSupportCreates the column support to be used by this editor to manage the contributed ruler columns.protected CompositeRulerCreates a composite ruler to be used as the vertical ruler by this editor.protected IMenuListenerCreates the listener on this editor's context menus.protected IVerticalRulerColumnCreates a new line number ruler column that is appropriately initialized.protected IOverviewRulercreateOverviewRuler(ISharedTextColors sharedColors) protected voidCreates the context menu for the overview ruler.voidcreatePartControl(Composite parent) TheAbstractTextEditorimplementation of thisIWorkbenchPartmethod creates the vertical ruler and source viewer.protected String[]Creates and returns the list of target part IDs for the Show In menuprotected ISourceViewercreateSourceViewer(Composite parent, IVerticalRuler ruler, int styles) Creates the source viewer to be used by this editor.protected ControlcreateStatusControl(Composite parent, IStatus status) Creates the status control for the given status.protected IVerticalRulerReturnscreateCompositeRuler().voiddispose()TheAbstractTextEditorimplementation of thisIWorkbenchPartmethod may be extended by subclasses.protected voidDisposes of the connection with the document provider.protected voiddoSetInput(IEditorInput input) Called directly fromsetInputand from within a workspace runnable frominit, this method does the actual setting of the editor input.protected voidSets up this editor's context menu before it is made visible.<T> TgetAdapter(Class<T> adapter) Returns an object which is an instance of the given class associated with this object.protected IAnnotationAccessReturns the annotation access.protected AnnotationPreferenceLookupReturns the annotation preference lookup.protected MarkerAnnotationPreferencesReturns the annotation preferences.Returns this text editor's document provider.protected IOverviewRulerReturns the overview ruler.protected final StringReturns the ruler's overview context menu id.protected ISharedTextColorsprotected SourceViewerDecorationSupportReturns the source viewer decoration support.protected IOperationApprovergetUndoRedoOperationApprover(IUndoContext undoContext) Return anIOperationApproverappropriate for approving the undo and redo of operations that have the specified undo context.gotoAnnotation(boolean forward) Jumps to the next annotation according to the given direction.voidgotoMarker(IMarker marker) Deprecated.visibility will be reduced, usegetAdapter(IGotoMarker.class) for accessing this methodprotected voidHandles an external change of the editor's input element.protected voidHandles a property change event describing a change of the editor's preference store and updates the preference related editor properties.protected voidHides the overview ruler.protected voidInitializes this editor.protected voidInitializes the key binding scopes of this editor.protected voidinitializeLineNumberRulerColumn(LineNumberRulerColumn rulerColumn) Initializes the given line number ruler column from the preference store.booleanReturns the quick diff display state.booleanReturns whether the text in this text editor can be changed by the user.protected booleanisErrorStatus(IStatus status) Returns whether the given status indicates an error.protected booleanReturns whether the line number ruler column should be visible according to the preference store settings.protected booleanisNavigationTarget(Annotation annotation) Returns whether the given annotation is configured as a target for the "Go to Next/Previous Annotation" actions.protected booleanTells whether the overview ruler is visible.protected booleanReturns whether the overwrite mode is enabled according to the preference store settings.protected booleanReturns whether quick diff info should be visible upon opening an editor according to the preference store settings.protected booleanTells whether delete and backspace keys should remove multiple spaces as if they were a tab.protected booleanTells whether tabs should be converted to spaces while editing inside this editor.protected voidopenSaveErrorDialog(String title, String message, CoreException exception) Presents an error dialog to the user when a problem happens during save.protected voidSets up the overview ruler context menu before it is made visible.protected voidperformSaveAs(IProgressMonitor progressMonitor) This implementation asks the user for the workspace path of a file resource and saves the document there.protected voidSets up the ruler context menu before it is made visible.protected voidsetDocumentProvider(IEditorInput input) Hook method for setting the document provider for the given input.protected voidsetOverviewRulerContextMenuId(String contextMenuId) Sets the ruler's overview context menu id.voidshowChangeInformation(boolean show) Sets the display of quick diff information.protected voidShows the overview ruler.voidshowRevisionInformation(RevisionInformation info, String quickDiffProviderId) Shows revision information in this editor.protected voidupdateMarkerViews(Annotation annotation) Updates visible views that show markers.booleanValidates the state of the given editor input.Methods inherited from class org.eclipse.ui.texteditor.StatusTextEditor
doRevertToSaved, getStatusBanner, getStatusHeader, getStatusMessage, handleElementContentReplaced, sanityCheckState, setFocus, updatePartControl, updateStatusFieldMethods inherited from class org.eclipse.ui.texteditor.AbstractTextEditor
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, getInitialWordWrapStatus, getInsertMode, getLegalInsertModes, getPreferenceStore, getProgressMonitor, getRangeIndicator, getRulerContextMenuId, getRulerMouseListener, getSaveables, getSelectionChangedListener, getSelectionProvider, getSourceViewer, getSourceViewerConfiguration, getStatusField, getStatusLineManager, getVerticalRuler, handleCursorPositionChanged, handleExceptionOnSave, handleInsertModeChanged, init, initializeDragAndDrop, initializeViewerColors, installCodeMiningProviders, installTabsToSpacesConverter, installTextDragAndDrop, internalInit, isBlockSelectionModeEnabled, isBlockSelectionModeSupported, isDirty, isEditorInputIncludedInContextMenu, isEditorInputModifiable, isEditorInputReadOnly, isInInsertMode, isSaveAsAllowed, isVisible, isWordWrapEnabled, isWordWrapSupported, 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, setWordWrap, showHighlightRangeOnly, showsHighlightRangeOnly, uninstallTabsToSpacesConverter, uninstallTextDragAndDrop, updateContentDependentActions, updateContributedRulerColumns, updateIndentPrefixes, updatePropertyDependentActions, updateSelectionDependentActions, updateState, updateStateDependentActions, updateStatusFields, validateState, widgetOffset2ModelOffsetMethods inherited from class org.eclipse.ui.part.EditorPart
checkSite, getEditorInput, getEditorSite, getTitleToolTip, isSaveOnCloseNeeded, setContentDescription, setInitializationData, setPartNameMethods inherited from class org.eclipse.ui.part.WorkbenchPart
addPartPropertyListener, addPropertyListener, firePartPropertyChanged, getConfigurationElement, getContentDescription, getDefaultImage, getOrientation, getPartName, getPartProperties, getPartProperty, getSite, getTitle, getTitleImage, removePartPropertyListener, removePropertyListener, setPartProperty, setSite, setTitle, setTitleImage, setTitleToolTip, showBusyMethods inherited from class org.eclipse.core.commands.common.EventManager
addListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObjectMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.eclipse.ui.IEditorPart
getEditorInput, getEditorSiteMethods inherited from interface org.eclipse.ui.ISaveablePart
isSaveOnCloseNeededMethods inherited from interface org.eclipse.ui.IWorkbenchPart
addPropertyListener, getSite, getTitle, getTitleImage, getTitleToolTip, removePropertyListener
-
Field Details
-
DEFAULT_OVERVIEW_RULER_CONTEXT_MENU_ID
Menu id for the overview ruler context menu.- Since:
- 3.4
- See Also:
-
fOverviewRuler
The overview ruler of this editor.This field should not be referenced by subclasses. It is
protectedfor API compatibility reasons and will be madeprivatesoon. UsegetOverviewRuler()instead. -
fAnnotationAccess
Helper for accessing annotation from the perspective of this editor.This field should not be referenced by subclasses. It is
protectedfor API compatibility reasons and will be madeprivatesoon. UsegetAnnotationAccess()instead. -
fSourceViewerDecorationSupport
Helper for managing the decoration support of this editor's viewer.This field should not be referenced by subclasses. It is
protectedfor API compatibility reasons and will be madeprivatesoon. UsegetSourceViewerDecorationSupport(ISourceViewer)instead. -
fLineNumberRulerColumn
The line number column.This field should not be referenced by subclasses. It is
protectedfor API compatibility reasons and will be madeprivatesoon. UseAbstractTextEditor.getVerticalRuler()to access the vertical bar instead. -
fIsUpdatingMarkerViews
protected boolean fIsUpdatingMarkerViewsIndicates whether this editor is updating views that show markers.- Since:
- 3.2
- See Also:
-
-
Constructor Details
-
AbstractDecoratedTextEditor
public AbstractDecoratedTextEditor()Creates a new text editor.- See Also:
-
-
Method Details
-
initializeEditor
protected void initializeEditor()Initializes this editor. Subclasses may re-implement. If sub-classes do not change the contract, this method should not be extended, i.e. do not callsuper.initializeEditor()in order to avoid the temporary creation of objects that are immediately overwritten by subclasses. -
initializeKeyBindingScopes
protected void initializeKeyBindingScopes()Initializes the key binding scopes of this editor. -
dispose
public void dispose()Description copied from class:AbstractTextEditorTheAbstractTextEditorimplementation of thisIWorkbenchPartmethod may be extended by subclasses. Subclasses must callsuper.dispose().Note that many methods may return
nullafter the editor is disposed.- Specified by:
disposein interfaceIWorkbenchPart- Overrides:
disposein classAbstractTextEditor
-
createSourceViewer
Description copied from class:AbstractTextEditorCreates the source viewer to be used by this editor. Subclasses may re-implement this method.- Overrides:
createSourceViewerin classAbstractTextEditor- Parameters:
parent- the parent controlruler- the vertical rulerstyles- style bits,SWT.WRAPis currently not supported- Returns:
- the source viewer
-
createAnnotationAccess
Creates the annotation access for this editor.- Returns:
- the created annotation access
-
configureSourceViewerDecorationSupport
Configures the decoration support for this editor's source viewer. Subclasses may override this method, but should call their superclass' implementation at some point.- Parameters:
support- the decoration support to configure
-
createPartControl
Description copied from class:AbstractTextEditorTheAbstractTextEditorimplementation of thisIWorkbenchPartmethod creates the vertical ruler and source viewer.Subclasses may extend this method. Besides extending this method, the behavior of
createPartControlmay be customized by calling, extending or replacing the following methods:
Subclasses may supply customized implementations for some members using the following methods beforecreatePartControlis invoked:- setSourceViewerConfiguration to supply a custom source viewer configuration,
- setRangeIndicator to provide a range indicator,
- setHelpContextId to provide a help context id,
- setEditorContextMenuId to set a custom context menu id,
- setRulerContextMenuId to set a custom ruler context menu id.
Subclasses may replace the following methods called from withincreatePartControl:- createVerticalRuler to supply a custom vertical ruler,
- createSourceViewer to supply a custom source viewer,
- getSelectionProvider to supply a custom selection provider.
Subclasses may extend the following methods called from withincreatePartControl:- initializeViewerColors to customize the viewer color scheme (may also be replaced),
- initializeDragAndDrop to customize drag and drop (may also be replaced),
- createNavigationActions to add navigation actions,
- createActions to add text editor actions.
- Specified by:
createPartControlin interfaceIWorkbenchPart- Overrides:
createPartControlin classStatusTextEditor- Parameters:
parent- the parent composite
-
createOverviewRulerContextMenu
protected void createOverviewRulerContextMenu()Creates the context menu for the overview ruler.Subclasses may extend or replace this method.
- Since:
- 3.4
-
createContextMenuListener
Description copied from class:AbstractTextEditorCreates the listener on this editor's context menus.- Overrides:
createContextMenuListenerin classAbstractTextEditor- Returns:
- the created menu listener
-
createStatusControl
Description copied from class:StatusTextEditorCreates the status control for the given status. May be overridden by subclasses.- Overrides:
createStatusControlin classStatusTextEditor- Parameters:
parent- the parent controlstatus- the status- Returns:
- the new status control
-
isOverviewRulerVisible
protected boolean isOverviewRulerVisible()Tells whether the overview ruler is visible.- Returns:
- whether the overview ruler is visible
-
showChangeInformation
public void showChangeInformation(boolean show) Description copied from interface:ITextEditorExtension3Sets the display of quick diff information.- Specified by:
showChangeInformationin interfaceITextEditorExtension3- Overrides:
showChangeInformationin classAbstractTextEditor- Parameters:
show-trueif quick diff information should be shown,falseotherwise
-
isChangeInformationShowing
public boolean isChangeInformationShowing()Description copied from interface:ITextEditorExtension3Returns the quick diff display state.- Specified by:
isChangeInformationShowingin interfaceITextEditorExtension3- Overrides:
isChangeInformationShowingin classAbstractTextEditor- Returns:
trueif quick diff info is displayed,falseotherwise
-
showRevisionInformation
Description copied from interface:ITextEditorExtension4Shows revision information in this editor.- Specified by:
showRevisionInformationin interfaceITextEditorExtension4- Overrides:
showRevisionInformationin classAbstractTextEditor- Parameters:
info- the revision information to displayquickDiffProviderId- the quick diff provider that matches the source of the revision information
-
isLineNumberRulerVisible
protected boolean isLineNumberRulerVisible()Returns whether the line number ruler column should be visible according to the preference store settings. Subclasses may override this method to provide a custom preference setting.- Returns:
trueif the line numbers should be visible
-
isOverwriteModeEnabled
protected boolean isOverwriteModeEnabled()Returns whether the overwrite mode is enabled according to the preference store settings. Subclasses may override this method to provide a custom preference setting.- Returns:
trueif overwrite mode is enabled- Since:
- 3.1
-
isPrefQuickDiffAlwaysOn
protected boolean isPrefQuickDiffAlwaysOn()Returns whether quick diff info should be visible upon opening an editor according to the preference store settings.- Returns:
trueif the line numbers should be visible
-
initializeLineNumberRulerColumn
Initializes the given line number ruler column from the preference store.- Parameters:
rulerColumn- the ruler column to be initialized
-
createLineNumberRulerColumn
Creates a new line number ruler column that is appropriately initialized.- Returns:
- the created line number column
-
createChangeHover
Creates and returns aLineChangeHoverto be used on this editor's change ruler column. This default implementation returns a plainLineChangeHover. Subclasses may override.- Returns:
- the change hover to be used by this editors quick diff display
-
createChangeRulerColumn
Deprecated.as of 3.3. Not called any longer, replaced bycreateLineNumberRulerColumn()Creates a new change ruler column for quick diff display independent of the line number ruler column- Returns:
- a new change ruler column
-
createVerticalRuler
ReturnscreateCompositeRuler(). Subclasses should not override this method, but rathercreateCompositeRulerif they want to contribute their own vertical ruler implementation. If not an instance ofCompositeRuleris returned, the built-in ruler columns (line numbers, annotations) will not work.May become
finalin the future.- Overrides:
createVerticalRulerin classAbstractTextEditor- Returns:
- the vertical ruler
- See Also:
-
createCompositeRuler
Creates a composite ruler to be used as the vertical ruler by this editor. Subclasses may re-implement this method.- Returns:
- the vertical ruler
-
createAnnotationRulerColumn
Creates the annotation ruler column. Subclasses may re-implement or extend.- Parameters:
ruler- the composite ruler that the column will be added- Returns:
- an annotation ruler column
- Since:
- 3.2
-
createColumnSupport
Description copied from class:AbstractTextEditorCreates the column support to be used by this editor to manage the contributed ruler columns. Subclasses may re-implement this method using theAbstractTextEditor.ColumnSupport, e.g. by returningnew ColumnSupport(this, RulerColumnRegistry.getDefault());.Note: If you override this method to provide column support you will also need to override
AbstractTextEditor.createVerticalRuler()to return aCompositeRuler.Out of the box this class does not install this support and hence this implementation always returns
null.- Overrides:
createColumnSupportin classAbstractTextEditor- Returns:
- the column support or
nullif none
-
handlePreferenceStoreChanged
Description copied from class:AbstractTextEditorHandles a property change event describing a change of the editor's preference store and updates the preference related editor properties.Subclasses may extend.
- Overrides:
handlePreferenceStoreChangedin classAbstractTextEditor- Parameters:
event- the property change event
-
showOverviewRuler
protected void showOverviewRuler()Shows the overview ruler. -
hideOverviewRuler
protected void hideOverviewRuler()Hides the overview ruler. -
getAnnotationAccess
Returns the annotation access.- Returns:
- the annotation access
-
getAnnotationPreferenceLookup
Returns the annotation preference lookup.- Returns:
- the annotation preference lookup
-
getOverviewRuler
Returns the overview ruler.- Returns:
- the overview ruler
-
getSourceViewerDecorationSupport
Returns the source viewer decoration support.- Parameters:
viewer- the viewer for which to return a decoration support- Returns:
- the source viewer decoration support
-
getAnnotationPreferences
Returns the annotation preferences.- Returns:
- the annotation preferences
-
gotoMarker
Deprecated.visibility will be reduced, usegetAdapter(IGotoMarker.class) for accessing this methodIf the editor can be saved all marker ranges have been changed according to the text manipulations. However, those changes are not yet propagated to the marker manager. Thus, when opening a marker, the marker's position in the editor must be determined as it might differ from the position stated in the marker.- Parameters:
marker- the marker to go to
-
isEditable
public boolean isEditable()Description copied from interface:ITextEditorReturns whether the text in this text editor can be changed by the user.- Specified by:
isEditablein interfaceITextEditor- Overrides:
isEditablein classAbstractTextEditor- Returns:
trueif it can be edited, andfalseif it is read-only
-
validateEditorInputState
public boolean validateEditorInputState()Description copied from interface:ITextEditorExtension2Validates the state of the given editor input. The predominate intent of this method is to take any action probably necessary to ensure that the input can persistently be changed.- Specified by:
validateEditorInputStatein interfaceITextEditorExtension2- Overrides:
validateEditorInputStatein classStatusTextEditor- Returns:
trueif the input was validated,falseotherwise
-
isErrorStatus
Description copied from class:StatusTextEditorReturns whether the given status indicates an error. Subclasses may override.- Overrides:
isErrorStatusin classStatusTextEditor- Parameters:
status- the status to be checked- Returns:
trueif the status indicates an error,falseotherwise\
-
createActions
protected void createActions()Description copied from class:AbstractTextEditorCreates this editor's standard actions and connects them with the global workbench actions.Subclasses may extend.
- Overrides:
createActionsin classAbstractTextEditor
-
getAdapter
Description copied from class:WorkbenchPartReturns an object which is an instance of the given class associated with this object. Returnsnullif no such object can be found.Clients may implement this method but should generally call
Adapters.adapt(Object, Class, boolean)rather than invoking it directly. 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).- Specified by:
getAdapterin interfaceIAdaptable- Overrides:
getAdapterin classAbstractTextEditor- Type Parameters:
T- the class type- Parameters:
adapter- the adapter class to look up- Returns:
- a object of the given class, or
nullif this object does not have an adapter for the given class
-
setDocumentProvider
Description copied from class:AbstractTextEditorHook method for setting the document provider for the given input. This default implementation does nothing. Clients may reimplement.- Overrides:
setDocumentProviderin classAbstractTextEditor- Parameters:
input- the input of this editor.
-
getDocumentProvider
Description copied from interface:ITextEditorReturns this text editor's document provider.- Specified by:
getDocumentProviderin interfaceITextEditor- Overrides:
getDocumentProviderin classAbstractTextEditor- Returns:
- the document provider or
nullif none, e.g. after closing the editor
-
disposeDocumentProvider
protected void disposeDocumentProvider()Description copied from class:AbstractTextEditorDisposes of the connection with the document provider. Subclasses may extend.- Overrides:
disposeDocumentProviderin classAbstractTextEditor
-
doSetInput
Description copied from class:AbstractTextEditorCalled directly fromsetInputand from within a workspace runnable frominit, this method does the actual setting of the editor input. Closes the editor ifinputisnull. Disconnects from any previous editor input and its document provider and connects to the new one.Subclasses may extend.
- Overrides:
doSetInputin classStatusTextEditor- Parameters:
input- the input to be set- Throws:
CoreException- if input cannot be connected to the document provider
-
handleEditorInputChanged
protected void handleEditorInputChanged()Description copied from class:AbstractTextEditorHandles an external change of the editor's input element. Subclasses may extend.- Overrides:
handleEditorInputChangedin classStatusTextEditor
-
performSaveAs
This implementation asks the user for the workspace path of a file resource and saves the document there.- Overrides:
performSaveAsin classAbstractTextEditor- Parameters:
progressMonitor- the progress monitor to be used- Since:
- 3.2
-
openSaveErrorDialog
Presents an error dialog to the user when a problem happens during save.Overrides the default behavior by showing a more advanced error dialog in case of encoding problems.
- Overrides:
openSaveErrorDialogin classAbstractTextEditor- Parameters:
title- the dialog titlemessage- the message to displayexception- the exception to handle- Since:
- 3.6
-
setOverviewRulerContextMenuId
Sets the ruler's overview context menu id.- Parameters:
contextMenuId- the overview ruler context menu id- Since:
- 3.4
-
getOverviewRulerContextMenuId
Returns the ruler's overview context menu id. May returnnullbefore the editor's part has been created.- Returns:
- the ruler's context menu id which may be
null - Since:
- 3.4
-
overviewRulerContextMenuAboutToShow
Sets up the overview ruler context menu before it is made visible.Subclasses may extend to add other actions.
- Parameters:
menu- the menu- Since:
- 3.4
-
rulerContextMenuAboutToShow
Description copied from class:AbstractTextEditorSets up the ruler context menu before it is made visible.Subclasses may extend to add other actions.
- Overrides:
rulerContextMenuAboutToShowin classAbstractTextEditor- Parameters:
menu- the menu
-
editorContextMenuAboutToShow
Description copied from class:AbstractTextEditorSets up this editor's context menu before it is made visible.Subclasses may extend to add other actions.
- Overrides:
editorContextMenuAboutToShowin classAbstractTextEditor- Parameters:
menu- the menu
-
createShowInTargetList
Creates and returns the list of target part IDs for the Show In menu- Returns:
- the 'Show In' target part IDs
- Since:
- 3.13
-
collectContextMenuPreferencePages
Returns the preference page ids of the preference pages to be shown when executing the preferences action from the editor context menu. The first page will be selected.Subclasses may extend or replace.
- Returns:
- the preference page ids to show, may be empty
- Since:
- 3.1
-
collectRulerMenuPreferencePages
Returns the preference page ids of the preference pages to be shown when executing the preferences action from the editor ruler context menu. The first page will be selected.The default is to return the same list as
collectContextMenuPreferencePages.Subclasses may extend or replace.
- Returns:
- the preference page ids to show, may be empty
- Since:
- 3.1
-
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. The first page will be selected.The default is to select the 'Annotations' preference page.
Subclasses may extend or replace.
- Returns:
- the preference page ids to show, may be empty
- Since:
- 3.4
-
getUndoRedoOperationApprover
Description copied from class:AbstractTextEditorReturn anIOperationApproverappropriate for approving the undo and redo of operations that have the specified undo context.Subclasses may override.
- Overrides:
getUndoRedoOperationApproverin classAbstractTextEditor- Parameters:
undoContext- the IUndoContext of operations that should be examined by the operation approver- Returns:
- the
IOperationApproverappropriate for approving undo and redo operations inside this editor, ornullif no approval is needed
-
gotoAnnotation
Jumps to the next annotation according to the given direction.This extended implementation updates views that also show the select marker annotation.
- Specified by:
gotoAnnotationin interfaceITextEditorExtension4- Overrides:
gotoAnnotationin classAbstractTextEditor- Parameters:
forward-trueif search direction is forward,falseif backward- Returns:
- the selected annotation or
nullif none - Since:
- 3.2
- See Also:
-
updateMarkerViews
Updates visible views that show markers.If the given annotation can be associated with a marker then this method tries select the this marker in views that show markers.
- Parameters:
annotation- the annotation- Since:
- 3.2
-
isTabsToSpacesConversionEnabled
protected boolean isTabsToSpacesConversionEnabled()Description copied from class:AbstractTextEditorTells whether tabs should be converted to spaces while editing inside this editor.Subclasses may override this method.
- Overrides:
isTabsToSpacesConversionEnabledin classAbstractTextEditor- Returns:
trueif tabs should be converted to spaces
-
isSpacesAsTabsDeletionEnabled
protected boolean isSpacesAsTabsDeletionEnabled()Description copied from class:AbstractTextEditorTells whether delete and backspace keys should remove multiple spaces as if they were a tab. Only relevant whenAbstractTextEditor.isTabsToSpacesConversionEnabled()returns true.Subclasses may override this method.
- Overrides:
isSpacesAsTabsDeletionEnabledin classAbstractTextEditor- Returns:
trueif spaces should be removed as tabs- Since:
- 3.13
-