LPEX
4.4.0

com.ibm.lpex.alef
Class LpexStatusTextEditor

java.lang.Object
  extended by EditorPart
      extended by com.ibm.lpex.alef.LpexAbstractTextEditor
          extended by com.ibm.lpex.alef.LpexStatusTextEditor
Direct Known Subclasses:
LpexAbstractDecoratedTextEditor

public class LpexStatusTextEditor
extends LpexAbstractTextEditor

A line-oriented, LPEX-based version of StatusTextEditor. A status text editor is capable of handling input elements that have an associated status.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.ibm.lpex.alef.LpexAbstractTextEditor
LpexAbstractTextEditor.ColumnSupport, LpexAbstractTextEditor.IdMapEntry, LpexAbstractTextEditor.TextEditorSavable
 
Field Summary
 
Fields inherited from class com.ibm.lpex.alef.LpexAbstractTextEditor
DEFAULT_EDITOR_CONTEXT_MENU_ID, DEFAULT_RULER_CONTEXT_MENU_ID, fErrorLabel, PREFERENCE_COLOR_BACKGROUND, PREFERENCE_COLOR_BACKGROUND_SYSTEM_DEFAULT, PREFERENCE_HYPERLINK_KEY_MODIFIER, PREFERENCE_HYPERLINK_KEY_MODIFIER_MASK, PREFERENCE_HYPERLINKS_ENABLED, PREFERENCE_RULER_CONTRIBUTIONS, VERTICAL_RULER_WIDTH
 
Constructor Summary
LpexStatusTextEditor()
           
 
Method Summary
 void createPartControl(Composite parent)
          Creates the SWT controls for this workbench part.
protected  Control createStatusControl(Composite parent, IStatus status)
          Creates the status control for the given status.
 void doRevertToSaved()
          Abandons all modifications applied to the editor's input element's textual presentation since the last save operation.
protected  void doSetInput(IEditorInput input)
          Internal processing of setting/changing the input to this editor.
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 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()
          Ask the part to take focus within the workbench.
 void updatePartControl(IEditorInput input)
          Checks whether the status of the given input is OK.
protected  void updateStatusField(String category)
          Updates the Eclipse status field for the given category.
 boolean validateEditorInputState()
          Validates the state of the given editor input.
 
Methods inherited from class com.ibm.lpex.alef.LpexAbstractTextEditor
addAction, addAction, addGroup, addLines, addRulerContextMenuListener, adjustHighlightRange, affectsTextPresentation, availableOpenNewView, canHandleMove, close, createActions, createColumnSupport, createContextMenuListener, createContextMenuManager, createEmptyNavigationLocation, createNavigationActions, createNavigationLocation, createSourceViewer, createVerticalRuler, createViewPreferenceNodes, createViewPreferencePage, dispose, disposeDocumentProvider, doSave, doSaveAs, editorContextMenuAboutToShow, editorSaved, enableSanityChecking, enableStateValidation, findAnnotation, firePropertyChange, getAction, getActiveLpexView, getActiveLpexWindow, getActiveSaveables, getAdapter, getContextMenuListener, getCoverage, getCursorPosition, getDocumentProvider, getEditorContextMenuId, getFirstLpexView, getFirstLpexWindow, getHelpContextId, getHighlightRange, getInputResource, getKeyBindingScopes, getLpexView, getLpexWindow, getOrientation, getPreferenceStore, getProgressMonitor, getRangeIndicator, getReadonlyTitleImage, getRulerContextMenuId, getRulerMouseListener, getSaveables, getSelectionProvider, getSourceViewer, getSourceViewerConfiguration, getStatusField, getStatusLineManager, getVerticalRuler, gotoAnnotation, handleCursorPositionChanged, handleDelegate, handleExceptionOnSave, handlePreferenceStoreChanged, init, initializeDragAndDrop, initializeLpexView, internalInit, isChangeInformationShowing, isDirty, isEditable, isEditorInputIncludedInContextMenu, isEditorInputModifiable, isEditorInputReadOnly, isNavigationTarget, isSaveAsAllowed, isVisible, markAsPropertyDependentAction, markInNavigationHistory, modelOffset2WidgetOffset, openSaveErrorDialog, performLpexCommand, performRevert, performSave, performSaveAs, performSaveAs, rememberSelection, removeActionActivationCode, removeRulerContextMenuListener, resetHighlightRange, restoreSelection, rulerContextMenuAboutToShow, safelySanityCheckState, selectAndReveal, selectAndReveal, setAction, setActionActivationCode, setCompatibilityMode, setDocumentProvider, setDocumentProvider, setDocumentSection, setEditorContextMenuId, setHelpContextId, setHighlightRange, setInput, setInputWithNotify, setKeyBindingScopes, setKeyBindingScopes, setLanguageHelp, setPreferenceStore, setRangeIndicator, setRulerContextMenuId, setSourceViewerConfiguration, setStatusField, setStatusLineErrorMessage, setStatusLineMessage, showChangeInformation, showHighlightRangeOnly, showRevisionInformation, showsHighlightRangeOnly, updateContributedRulerColumns, updateProfile, updatePropertyDependentActions, updateState, updateStatusFields, validateState, widgetContentsSet, widgetOffset2ModelOffset
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LpexStatusTextEditor

public LpexStatusTextEditor()
Method Detail

createPartControl

public void createPartControl(Composite parent)
Creates the SWT controls for this workbench part. Clients should not call this method (the workbench calls this method when it needs to, which may be never).

For implementors, this is a multi-step process: 1. Create one or more controls within the parent; 2. Set the parent layout as needed; 3. Register any global actions with the IActionService; 4. Register any popup menus with the IActionService; 5. Register a selection provider with the ISelectionService (optional).

Overrides:
createPartControl in class LpexAbstractTextEditor
Parameters:
parent - the parent control
See Also:
IWorkbenchPart

updatePartControl

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

Parameters:
input - the editor input whose status is checked

validateEditorInputState

public boolean validateEditorInputState()
Description copied from class: LpexAbstractTextEditor
Validates 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 be persistently changed.

Overrides:
validateEditorInputState in class LpexAbstractTextEditor
Returns:
true if the input was validated, false otherwise
See Also:
ITextEditorExtension2

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, or
false otherwise

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: LpexAbstractTextEditor
Updates the Eclipse status field for the given category.

Overrides:
updateStatusField in class LpexAbstractTextEditor
Parameters:
category - the status category

doSetInput

protected void doSetInput(IEditorInput input)
                   throws CoreException
Description copied from class: LpexAbstractTextEditor
Internal processing of setting/changing the input to this editor. Called from within a workspace runnable from init() (shortly after the part construction), directly from setInput(), and from handleEditorInputChanged().

This method does the actual setting of the editor input. It closes the editor if input is null. It disconnects from any previous editor input and its document provider, and connects to the new one. Subclasses may extend.

Overrides:
doSetInput in class LpexAbstractTextEditor
Parameters:
input - the (new) input to be set; if null, this text editor is being closed
Throws:
CoreException - if the input cannot be connected to the document provider (i.e., it is not understood by this part)

doRevertToSaved

public void doRevertToSaved()
Description copied from class: LpexAbstractTextEditor
Abandons all modifications applied to the editor's input element's textual presentation since the last save operation.

The implementation of this ITextEditor method may be extended by subclasses.

Overrides:
doRevertToSaved in class LpexAbstractTextEditor
See Also:
ITextEditor

sanityCheckState

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

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

handleEditorInputChanged

protected void handleEditorInputChanged()
Description copied from class: LpexAbstractTextEditor
Handles an external change of the editor's input element. Subclasses may extend.

Overrides:
handleEditorInputChanged in class LpexAbstractTextEditor

handleElementContentReplaced

protected void handleElementContentReplaced()
Description copied from class: LpexAbstractTextEditor
Performs any additional action necessary after the input document's content has been replaced. Clients may extend this method.

Overrides:
handleElementContentReplaced in class LpexAbstractTextEditor

setFocus

public void setFocus()
Description copied from class: LpexAbstractTextEditor
Ask the part to take focus within the workbench. Gives keyboard input focus to the last-focused widget in the last-focused LpexWindow.

Overrides:
setFocus in class LpexAbstractTextEditor
See Also:
IWorkbenchPart

LPEX
4.4.0

Copyright � 2016 IBM Corp. All Rights Reserved.

Note: This documentation is for part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.