public class StatusTextEditor extends AbstractTextEditor
AbstractTextEditor.AbstractSelectionChangedListener, AbstractTextEditor.ColumnSupport, AbstractTextEditor.IdMapEntry, AbstractTextEditor.LineEndAction, AbstractTextEditor.LineStartAction, AbstractTextEditor.SelectionProvider, AbstractTextEditor.TextEditorSavable
ITextEditorExtension3.InsertMode
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, PREFERENCE_WORD_WRAP_ENABLED, 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 |
---|
StatusTextEditor() |
Modifier and Type | Method and Description |
---|---|
void |
createPartControl(Composite parent)
The
AbstractTextEditor implementation of this
IWorkbenchPart method creates the vertical ruler and
source viewer. |
protected Control |
createStatusControl(Composite parent,
IStatus status)
Creates the status control for the given status.
|
void |
doRevertToSaved()
The
AbstractTextEditor implementation of this
ITextEditor 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 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 |
handleEditorInputChanged()
Handles an external change of the editor's input element.
|
protected void |
handleElementContentReplaced()
Performs any additional action necessary to perform after the input
document's content has been replaced.
|
protected boolean |
isErrorStatus(IStatus status)
Returns whether the given status indicates an error.
|
protected void |
sanityCheckState(IEditorInput input)
Checks the state of the given editor input.
|
void |
setFocus()
Asks this part to take focus within the workbench.
|
void |
updatePartControl(IEditorInput input)
Checks if the status of the given input is OK.
|
protected void |
updateStatusField(String category)
Updates the status fields for the given category.
|
boolean |
validateEditorInputState()
Validates the state of the given editor input.
|
addAction, addAction, addGroup, addRulerContextMenuListener, adjustHighlightRange, affectsTextPresentation, canHandleMove, close, configureInsertMode, containsSavedState, createActions, createColumnSupport, createContextMenuListener, createEmptyNavigationLocation, createNavigationActions, createNavigationLocation, createSourceViewer, createUndoRedoActions, createVerticalRuler, dispose, disposeDocumentProvider, doGetSelection, doRestoreState, doSave, doSaveAs, doSetSelection, editorContextMenuAboutToShow, editorSaved, enableOverwriteMode, enableSanityChecking, enableStateValidation, findAnnotation, firePropertyChange, getAction, getActiveSaveables, getAdapter, getContextMenuListener, getCoverage, getCursorListener, getCursorPosition, getDocumentProvider, getEditorContextMenuId, getFontPropertyPreferenceKey, getHelpContextId, getHighlightRange, getInitialWordWrapStatus, getInsertMode, getLegalInsertModes, getPreferenceStore, getProgressMonitor, getRangeIndicator, getRulerContextMenuId, getRulerMouseListener, getSaveables, getSelectionChangedListener, getSelectionProvider, getSourceViewer, getSourceViewerConfiguration, getStatusField, getStatusLineManager, getUndoRedoOperationApprover, getVerticalRuler, gotoAnnotation, handleCursorPositionChanged, handleExceptionOnSave, handleInsertModeChanged, handlePreferenceStoreChanged, init, initializeDragAndDrop, initializeViewerColors, installCodeMiningProviders, installTabsToSpacesConverter, installTextDragAndDrop, internalInit, isBlockSelectionModeEnabled, isBlockSelectionModeSupported, isChangeInformationShowing, isDirty, isEditable, isEditorInputIncludedInContextMenu, isEditorInputModifiable, isEditorInputReadOnly, isInInsertMode, isNavigationTarget, isSaveAsAllowed, isTabsToSpacesConversionEnabled, isVisible, isWordWrapEnabled, isWordWrapSupported, markAsContentDependentAction, markAsPropertyDependentAction, markAsSelectionDependentAction, markAsStateDependentAction, markInNavigationHistory, modelOffset2WidgetOffset, openSaveErrorDialog, performRevert, performSave, performSaveAs, rememberSelection, removeActionActivationCode, removeRulerContextMenuListener, resetHighlightRange, restoreSelection, restoreState, rulerContextMenuAboutToShow, safelySanityCheckState, saveState, selectAndReveal, selectAndReveal, setAction, setActionActivationCode, setBlockSelectionMode, setCompatibilityMode, setDocumentProvider, setDocumentProvider, setEditorContextMenuId, setHelpContextId, setHighlightRange, setInput, setInputWithNotify, setInsertMode, setKeyBindingScopes, setPreferenceStore, setRangeIndicator, setRulerContextMenuId, setSourceViewerConfiguration, setStatusField, setStatusLineErrorMessage, setStatusLineMessage, setWordWrap, showChangeInformation, showHighlightRangeOnly, showRevisionInformation, 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 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 AbstractTextEditor
parent
- the parent compositepublic void updatePartControl(IEditorInput input)
input
- the input whose status is checkedpublic void setFocus()
IWorkbenchPart
Clients should not call this method (the workbench calls this method at
appropriate times). To have the workbench activate a part, use
IWorkbenchPage.activate(IWorkbenchPart) instead
.
setFocus
in interface IWorkbenchPart
setFocus
in class AbstractTextEditor
public boolean validateEditorInputState()
ITextEditorExtension2
validateEditorInputState
in interface ITextEditorExtension2
validateEditorInputState
in class AbstractTextEditor
true
if the input was validated, false
otherwiseprotected boolean isErrorStatus(IStatus status)
status
- the status to be checkedtrue
if the status indicates an error, false
otherwise\protected Control createStatusControl(Composite parent, IStatus status)
parent
- the parent controlstatus
- the statusprotected String getStatusHeader(IStatus status)
status
- the status whose message is returnedprotected String getStatusBanner(IStatus status)
status
- the status whose message is returnedprotected String getStatusMessage(IStatus status)
status
- the status whose message is returnedprotected void updateStatusField(String category)
AbstractTextEditor
updateStatusField
in class AbstractTextEditor
category
- the categoryprotected 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 AbstractTextEditor
input
- the input to be setCoreException
- if input cannot be connected to the document
providerpublic void doRevertToSaved()
AbstractTextEditor
AbstractTextEditor
implementation of this
ITextEditor
method may be extended by subclasses.doRevertToSaved
in interface ITextEditor
doRevertToSaved
in class AbstractTextEditor
protected void sanityCheckState(IEditorInput input)
AbstractTextEditor
sanityCheckState
in class AbstractTextEditor
input
- the editor input whose state is to be checkedprotected void handleEditorInputChanged()
AbstractTextEditor
handleEditorInputChanged
in class AbstractTextEditor
protected void handleElementContentReplaced()
AbstractTextEditor
Clients may extended this method.
handleElementContentReplaced
in class AbstractTextEditor
Copyright (c) 2000, 2018 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.