public class TextEditor extends AbstractDecoratedTextEditor
IFile).
This editor has id "org.eclipse.ui.DefaultTextEditor".
The editor's context menu has id #TextEditorContext.
The editor's ruler context menu has id #TextRulerContext.
The workbench will automatically instantiate this class when the default editor is needed for a workbench window.
AbstractTextEditor.AbstractSelectionChangedListener, AbstractTextEditor.LineStartActionITextEditorExtension3.InsertMode| Modifier and Type | Field and Description |
|---|---|
protected DefaultEncodingSupport |
fEncodingSupport
The encoding support for the editor.
|
fAnnotationAccess, fIsUpdatingMarkerViews, fLineNumberRulerColumn, fOverviewRuler, fSourceViewerDecorationSupportACTION_MAP, 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_HYPERLINK_KEY_MODIFIER, PREFERENCE_HYPERLINK_KEY_MODIFIER_MASK, PREFERENCE_HYPERLINKS_ENABLED, PREFERENCE_NAVIGATION_SMART_HOME_END, PREFERENCE_USE_CUSTOM_CARETS, PREFERENCE_WIDE_CARET, VERTICAL_RULER_WIDTHPROP_DIRTY, PROP_INPUTPROP_TITLEINSERT, SMART_INSERT| Constructor and Description |
|---|
TextEditor()
Creates a new text editor.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
createActions()
Creates this editor's standard actions and connects them with the global
workbench actions.
|
void |
dispose()
The
AbstractTextEditor implementation of this
IWorkbenchPart method may be extended by subclasses. |
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 String |
getStatusBanner(IStatus status)
Returns a banner for the given status.
|
protected String |
getStatusHeader(IStatus status)
Returns a header for the given status
|
protected String |
getStatusMessage(IStatus status)
Returns a message for the given status.
|
protected void |
initializeEditor()
Initializes this editor.
|
protected void |
installEncodingSupport()
Installs the encoding support on the given text editor.
|
boolean |
isSaveAsAllowed()
The
AbstractTextEditor implementation of this
IEditorPart method returns false. |
protected void |
performSaveAs(IProgressMonitor progressMonitor)
The
TextEditor implementation of this AbstractTextEditor
method asks the user for the workspace path of a file resource and saves the document there. |
protected void |
updatePropertyDependentActions()
Updates all property dependent actions.
|
collectContextMenuPreferencePages, collectRulerMenuPreferencePages, configureSourceViewerDecorationSupport, createAnnotationAccess, createAnnotationRulerColumn, createChangeHover, createChangeRulerColumn, createCompositeRuler, createLineNumberRulerColumn, createOverviewRuler, createPartControl, createSourceViewer, createStatusControl, createVerticalRuler, disposeDocumentProvider, getAnnotationAccess, getAnnotationPreferenceLookup, getAnnotationPreferences, getDocumentProvider, getOverviewRuler, getSharedColors, getSourceViewerDecorationSupport, getUndoRedoOperationApprover, gotoAnnotation, gotoMarker, handlePreferenceStoreChanged, hideOverviewRuler, initializeKeyBindingScopes, initializeLineNumberRulerColumn, isChangeInformationShowing, isErrorStatus, isLineNumberRulerVisible, isNavigationTarget, isOverviewRulerVisible, isOverwriteModeEnabled, isPrefQuickDiffAlwaysOn, rulerContextMenuAboutToShow, setDocumentProvider, showChangeInformation, showOverviewRuler, showRevisionInformation, updateMarkerViewsdoRevertToSaved, handleEditorInputChanged, handleElementContentReplaced, sanityCheckState, updatePartControl, updateStatusFieldaddAction, addAction, addGroup, addRulerContextMenuListener, adjustHighlightRange, affectsTextPresentation, canHandleMove, close, configureInsertMode, createEmptyNavigationLocation, createNavigationActions, createNavigationLocation, createUndoRedoActions, doGetSelection, doSave, doSaveAs, doSetSelection, editorSaved, enableOverwriteMode, enableSanityChecking, enableStateValidation, findAnnotation, firePropertyChange, getAction, getContextMenuListener, getCoverage, getCursorListener, getCursorPosition, getEditorContextMenuId, getFontPropertyPreferenceKey, getHelpContextId, getHighlightRange, getInsertMode, getLegalInsertModes, getPreferenceStore, getProgressMonitor, getRangeIndicator, getRulerContextMenuId, getRulerMouseListener, getSelectionChangedListener, getSelectionProvider, getSourceViewer, getSourceViewerConfiguration, getStatusField, getVerticalRuler, handleCursorPositionChanged, handleExceptionOnSave, handleInsertModeChanged, init, initializeDragAndDrop, initializeViewerColors, internalInit, isDirty, isEditable, isEditorInputIncludedInContextMenu, isEditorInputModifiable, isEditorInputReadOnly, isInInsertMode, isVisible, markAsContentDependentAction, markAsPropertyDependentAction, markAsSelectionDependentAction, markAsStateDependentAction, markInNavigationHistory, modelOffset2WidgetOffset, performRevert, performSave, rememberSelection, removeActionActivationCode, removeRulerContextMenuListener, resetHighlightRange, restoreSelection, safelySanityCheckState, selectAndReveal, selectAndReveal, setAction, setActionActivationCode, setCompatibilityMode, setDocumentProvider, setEditorContextMenuId, setFocus, setHelpContextId, setHighlightRange, setInput, setInputWithNotify, setInsertMode, setKeyBindingScopes, setPreferenceStore, setRangeIndicator, setRulerContextMenuId, setSourceViewerConfiguration, setStatusField, setStatusLineErrorMessage, setStatusLineMessage, showHighlightRangeOnly, showsHighlightRangeOnly, updateContentDependentActions, updateSelectionDependentActions, updateState, updateStateDependentActions, updateStatusFields, validateEditorInputState, validateState, widgetOffset2ModelOffsetcheckSite, getEditorInput, getEditorSite, getTitleToolTip, isSaveOnCloseNeeded, setContentDescription, setInitializationData, setPartNameaddPropertyListener, getConfigurationElement, getContentDescription, getDefaultImage, getOrientation, getPartName, getSite, getTitle, getTitleImage, removePropertyListener, setSite, setTitle, setTitleImage, setTitleToolTip, showBusyaddListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObjectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetEditorInput, getEditorSiteaddPropertyListener, getSite, getTitle, getTitleImage, getTitleToolTip, removePropertyListenerisSaveOnCloseNeededprotected DefaultEncodingSupport fEncodingSupport
protected void initializeEditor()
super.initializeEditor() in order to avoid the
temporary creation of objects that are immediately overwritten by
subclasses.
This method configures the editor but does not define a
SourceViewerConfiguration. When only interested in
providing a custom source viewer configuration, subclasses may extend
this method.initializeEditor in class AbstractDecoratedTextEditorpublic void dispose()
AbstractTextEditorAbstractTextEditor 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 IWorkbenchPartdispose in class AbstractDecoratedTextEditorprotected void installEncodingSupport()
Subclasses may override to install their own encoding support or to disable the default encoding support.
protected void performSaveAs(IProgressMonitor progressMonitor)
TextEditor implementation of this AbstractTextEditor
method asks the user for the workspace path of a file resource and saves the document there.
XXX: This method will be removed in 3.3: for now tell the subclass to handle it.
performSaveAs in class AbstractDecoratedTextEditorprogressMonitor - the progress monitor to be usedpublic boolean isSaveAsAllowed()
AbstractTextEditorAbstractTextEditor implementation of this
IEditorPart method returns false.
Subclasses may override.isSaveAsAllowed in interface ISaveablePartisSaveAsAllowed in class AbstractTextEditorfalseprotected void createActions()
AbstractTextEditorSubclasses may extend.
createActions in class AbstractDecoratedTextEditorprotected String getStatusHeader(IStatus status)
StatusTextEditorgetStatusHeader in class StatusTextEditorstatus - the status whose message is returnedprotected String getStatusBanner(IStatus status)
StatusTextEditorgetStatusBanner in class StatusTextEditorstatus - the status whose message is returnedprotected String getStatusMessage(IStatus status)
StatusTextEditorgetStatusMessage in class StatusTextEditorstatus - the status whose message is returnedprotected void doSetInput(IEditorInput input) throws CoreException
AbstractTextEditorsetInput 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 AbstractDecoratedTextEditorinput - the input to be setCoreException - if input cannot be connected to the document
providerpublic Object getAdapter(Class adapter)
WorkbenchPartnull 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 IAdaptablegetAdapter in class AbstractDecoratedTextEditoradapter - the adapter class to look upnull if this object does not
have an adapter for the given classprotected void updatePropertyDependentActions()
AbstractTextEditorupdatePropertyDependentActions in class AbstractTextEditorprotected void editorContextMenuAboutToShow(IMenuManager menu)
AbstractTextEditorSubclasses may extend to add other actions.
editorContextMenuAboutToShow in class AbstractDecoratedTextEditormenu - the menuGuidelines for using Eclipse APIs. Copyright (c) IBM Corp. and others 2000, 2006. All rights reserved.