Eclipse Platform
Release 3.0

org.eclipse.ui.texteditor
Class StatusTextEditor

java.lang.Object
  extended byorg.eclipse.ui.part.WorkbenchPart
      extended byorg.eclipse.ui.part.EditorPart
          extended byorg.eclipse.ui.texteditor.AbstractTextEditor
              extended byorg.eclipse.ui.texteditor.StatusTextEditor
All Implemented Interfaces:
IAdaptable, IEditorPart, IExecutableExtension, INavigationLocationProvider, IReusableEditor, ISaveablePart, ITextEditor, ITextEditorExtension, ITextEditorExtension2, ITextEditorExtension3, IWorkbenchPart, IWorkbenchPart2
Direct Known Subclasses:
AbstractDecoratedTextEditor

public class StatusTextEditor
extends AbstractTextEditor

Capable of handling input elements that have an associated status with them.

Since:
2.0

Nested Class Summary
 
Nested classes inherited from class org.eclipse.ui.texteditor.AbstractTextEditor
AbstractTextEditor.AbstractSelectionChangedListener, AbstractTextEditor.LineStartAction
 
Nested classes inherited from class org.eclipse.ui.texteditor.ITextEditorExtension3
ITextEditorExtension3.InsertMode
 
Field Summary
 
Fields inherited from class org.eclipse.ui.texteditor.AbstractTextEditor
ACTION_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_NAVIGATION_SMART_HOME_END, PREFERENCE_USE_CUSTOM_CARETS, PREFERENCE_WIDE_CARET, VERTICAL_RULER_WIDTH
 
Fields inherited from interface org.eclipse.ui.IEditorPart
PROP_DIRTY, PROP_INPUT
 
Fields inherited from interface org.eclipse.ui.IWorkbenchPart
PROP_TITLE
 
Fields inherited from interface org.eclipse.ui.texteditor.ITextEditorExtension3
INSERT, SMART_INSERT
 
Constructor Summary
StatusTextEditor()
           
 
Method Summary
 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  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 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.
 
Methods inherited from class org.eclipse.ui.texteditor.AbstractTextEditor
addAction, addAction, addGroup, addRulerContextMenuListener, adjustHighlightRange, affectsTextPresentation, canHandleMove, close, configureInsertMode, createActions, createEmptyNavigationLocation, createNavigationActions, createNavigationLocation, createSourceViewer, createVerticalRuler, dispose, disposeDocumentProvider, doGetSelection, doSave, doSaveAs, doSetSelection, editorContextMenuAboutToShow, editorSaved, enableOverwriteMode, enableSanityChecking, enableStateValidation, firePropertyChange, getAction, getAdapter, getContextMenuListener, getCoverage, getCursorListener, getCursorPosition, getDocumentProvider, getEditorContextMenuId, getFontPropertyPreferenceKey, getHelpContextId, getHighlightRange, getInsertMode, getLegalInsertModes, getPreferenceStore, getProgressMonitor, getRangeIndicator, getRulerContextMenuId, getRulerMouseListener, getSelectionChangedListener, getSelectionProvider, getSourceViewer, getSourceViewerConfiguration, getStatusField, getVerticalRuler, handleCursorPositionChanged, handleEditorInputChanged, handleElementContentReplaced, handleExceptionOnSave, handleInsertModeChanged, handlePreferenceStoreChanged, init, initializeDragAndDrop, initializeViewerColors, internalInit, isChangeInformationShowing, isDirty, isEditable, isEditorInputModifiable, isEditorInputReadOnly, isInInsertMode, isSaveAsAllowed, isSaveOnCloseNeeded, isVisible, markAsContentDependentAction, markAsPropertyDependentAction, markAsSelectionDependentAction, markAsStateDependentAction, markInNavigationHistory, modelOffset2WidgetOffset, performRevert, performSave, performSaveAs, rememberSelection, removeActionActivationCode, removeRulerContextMenuListener, resetHighlightRange, restoreSelection, rulerContextMenuAboutToShow, safelySanityCheckState, selectAndReveal, selectAndReveal, setAction, setActionActivationCode, setCompatibilityMode, setDocumentProvider, setDocumentProvider, setEditorContextMenuId, setFocus, setHelpContextId, setHighlightRange, setInput, setInsertMode, setKeyBindingScopes, setPreferenceStore, setRangeIndicator, setRulerContextMenuId, setSourceViewerConfiguration, setStatusField, showChangeInformation, showHighlightRangeOnly, showsHighlightRangeOnly, updateContentDependentActions, updatePropertyDependentActions, updateSelectionDependentActions, updateState, updateStateDependentActions, updateStatusFields, validateEditorInputState, validateState, widgetOffset2ModelOffset
 
Methods inherited from class org.eclipse.ui.part.EditorPart
getEditorInput, getEditorSite, getTitleToolTip, setContentDescription, setInitializationData, setPartName
 
Methods inherited from class org.eclipse.ui.part.WorkbenchPart
addPropertyListener, getConfigurationElement, getContentDescription, getDefaultImage, getPartName, getSite, getTitle, getTitleImage, removePropertyListener, setSite, setTitle, setTitleImage, setTitleToolTip, showBusy
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eclipse.ui.IEditorPart
getEditorInput, getEditorSite
 
Methods inherited from interface org.eclipse.ui.IWorkbenchPart
addPropertyListener, getSite, getTitle, getTitleImage, getTitleToolTip, removePropertyListener
 

Constructor Detail

StatusTextEditor

public StatusTextEditor()
Method Detail

createPartControl

public void createPartControl(Composite parent)
Description copied from class: AbstractTextEditor
The 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:


Subclasses may replace the following methods called from within createPartControl:
Subclasses may extend the following methods called from within createPartControl:

Specified by:
createPartControl in interface IWorkbenchPart
Overrides:
createPartControl in class AbstractTextEditor
Parameters:
parent - the parent composite

updatePartControl

public void updatePartControl(IEditorInput input)
Checks if the status of the given input is OK. If not the status control is shown rather than the default control.

Parameters:
input - the input whose status is checked

isErrorStatus

protected boolean isErrorStatus(IStatus status)
Returns whether the given status indicates an error. Subclasses may override.

Parameters:
status - the status to be checked
Returns:
true if the status indicates an error, false otherwise\
Since:
3.0

createStatusControl

protected Control createStatusControl(Composite parent,
                                      IStatus status)
Creates the status control for the given status. May be overridden by subclasses.

Parameters:
parent - the parent control
status - the status
Returns:
the new status control

getStatusHeader

protected String getStatusHeader(IStatus status)
Returns a header for the given status

Parameters:
status - the status whose message is returned
Returns:
a header for the given status

getStatusBanner

protected String getStatusBanner(IStatus status)
Returns a banner for the given status.

Parameters:
status - the status whose message is returned
Returns:
a banner for the given status

getStatusMessage

protected String getStatusMessage(IStatus status)
Returns a message for the given status.

Parameters:
status - the status whose message is returned
Returns:
a message for the given status

updateStatusField

protected void updateStatusField(String category)
Description copied from class: AbstractTextEditor
Updates the status fields for the given category.

Overrides:
updateStatusField in class AbstractTextEditor
Parameters:
category -

doSetInput

protected void doSetInput(IEditorInput input)
                   throws CoreException
Description copied from class: AbstractTextEditor
Called directly from 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.

Overrides:
doSetInput in class AbstractTextEditor
Parameters:
input - the input to be set
Throws:
CoreException - if input cannot be connected to the document provider

doRevertToSaved

public void doRevertToSaved()
Description copied from class: AbstractTextEditor
The AbstractTextEditor implementation of this ITextEditor method may be extended by subclasses.

Specified by:
doRevertToSaved in interface ITextEditor
Overrides:
doRevertToSaved in class AbstractTextEditor

sanityCheckState

protected void sanityCheckState(IEditorInput input)
Description copied from class: AbstractTextEditor
Checks the state of the given editor input.

Overrides:
sanityCheckState in class AbstractTextEditor
Parameters:
input - the editor input whose state is to be checked

Eclipse Platform
Release 3.0

Guidelines for using Eclipse APIs.

Copyright (c) IBM Corp. and others 2000, 2004. All rights reserved.