LPEX
4.4.0

com.ibm.lpex.alef
Class LpexTextEditor

java.lang.Object
  extended by EditorPart
      extended by com.ibm.lpex.alef.LpexAbstractTextEditor
          extended by com.ibm.lpex.alef.LpexStatusTextEditor
              extended by com.ibm.lpex.alef.LpexAbstractDecoratedTextEditor
                  extended by com.ibm.lpex.alef.LpexTextEditor

public class LpexTextEditor
extends LpexAbstractDecoratedTextEditor

A line-oriented, LPEX-based version of TextEditor. This is a text editor for IFile resources and IStorage objects.

The editor's context menu id is defined in EDITOR_CONTEXT_MENU_ID; its ruler context menu id is defined in RULER_CONTEXT_MENU_ID.

See Also:
LpexAbstractTextEditor

Nested Class Summary
 
Nested classes/interfaces inherited from class com.ibm.lpex.alef.LpexAbstractTextEditor
LpexAbstractTextEditor.ColumnSupport, LpexAbstractTextEditor.IdMapEntry, LpexAbstractTextEditor.TextEditorSavable
 
Field Summary
static String EDITOR_CONTEXT_MENU_ID
          This editor's pop-up (context) menu id ("#LpexTextEditorContext").
static String RULER_CONTEXT_MENU_ID
          This editor's ruler pop-up (context) menu id ("#LpexTextRulerContext").
 
Fields inherited from class com.ibm.lpex.alef.LpexAbstractDecoratedTextEditor
fAnnotationAccess, fSourceViewerDecorationSupport
 
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
LpexTextEditor()
          Creates a new LPEX text editor.
 
Method Summary
protected  void createActions()
          Creates this editor's standard actions.
 void dispose()
          Disposes of this workbench part.
protected  void doSetInput(IEditorInput input)
          Internal processing of setting/changing the input to this editor.
 Object getAdapter(Class adapter)
          Return the object which is an instance of the given class associated with this object, or null if no such object can be found.
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 default encoding support on the given LPEX text editor.
 boolean isSaveAsAllowed()
          The LpexTextEditor implementation of this EditorPart method returns true.
protected  void updatePropertyDependentActions()
          Updates all property dependent actions.
 
Methods inherited from class com.ibm.lpex.alef.LpexAbstractDecoratedTextEditor
configureSourceViewerDecorationSupport, createAnnotationAccess, createAnnotationRulerColumn, createChangeHover, createColumnSupport, createCompositeRuler, createLineNumberRulerColumn, createOverviewRuler, createPartControl, createSourceViewer, createVerticalRuler, disposeDocumentProvider, getAnnotationAccess, getAnnotationPreferences, getDocumentProvider, getOverviewRuler, getSharedColors, getSourceViewerDecorationSupport, gotoMarker, handlePreferenceStoreChanged, hideOverviewRuler, initializeLineNumberRulerColumn, isChangeInformationShowing, isEditable, isErrorStatus, isLineNumberRulerVisible, isOverviewRulerVisible, isPrefQuickDiffAlwaysOn, performSaveAs, performSaveAs, performSaveAs, rulerContextMenuAboutToShow, setDocumentProvider, showChangeInformation, showOverviewRuler, showRevisionInformation, validateEditorInputState
 
Methods inherited from class com.ibm.lpex.alef.LpexStatusTextEditor
createStatusControl, doRevertToSaved, handleEditorInputChanged, handleElementContentReplaced, sanityCheckState, setFocus, updatePartControl, updateStatusField
 
Methods inherited from class com.ibm.lpex.alef.LpexAbstractTextEditor
addAction, addAction, addGroup, addLines, addRulerContextMenuListener, adjustHighlightRange, affectsTextPresentation, availableOpenNewView, canHandleMove, close, createContextMenuListener, createContextMenuManager, createEmptyNavigationLocation, createNavigationActions, createNavigationLocation, createViewPreferenceNodes, createViewPreferencePage, doSave, doSaveAs, editorContextMenuAboutToShow, editorSaved, enableSanityChecking, enableStateValidation, findAnnotation, firePropertyChange, getAction, getActiveLpexView, getActiveLpexWindow, getActiveSaveables, getContextMenuListener, getCoverage, getCursorPosition, 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, init, initializeDragAndDrop, initializeLpexView, internalInit, isDirty, isEditorInputIncludedInContextMenu, isEditorInputModifiable, isEditorInputReadOnly, isNavigationTarget, isVisible, markAsPropertyDependentAction, markInNavigationHistory, modelOffset2WidgetOffset, openSaveErrorDialog, performLpexCommand, performRevert, performSave, rememberSelection, removeActionActivationCode, removeRulerContextMenuListener, resetHighlightRange, restoreSelection, safelySanityCheckState, selectAndReveal, selectAndReveal, setAction, setActionActivationCode, setCompatibilityMode, setDocumentSection, setEditorContextMenuId, setHelpContextId, setHighlightRange, setInput, setInputWithNotify, setKeyBindingScopes, setKeyBindingScopes, setLanguageHelp, setPreferenceStore, setRangeIndicator, setRulerContextMenuId, setSourceViewerConfiguration, setStatusField, setStatusLineErrorMessage, setStatusLineMessage, showHighlightRangeOnly, showsHighlightRangeOnly, updateContributedRulerColumns, updateProfile, updateState, updateStatusFields, validateState, widgetContentsSet, widgetOffset2ModelOffset
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EDITOR_CONTEXT_MENU_ID

public static final String EDITOR_CONTEXT_MENU_ID
This editor's pop-up (context) menu id ("#LpexTextEditorContext").

See Also:
Constant Field Values

RULER_CONTEXT_MENU_ID

public static final String RULER_CONTEXT_MENU_ID
This editor's ruler pop-up (context) menu id ("#LpexTextRulerContext").

See Also:
Constant Field Values
Constructor Detail

LpexTextEditor

public LpexTextEditor()
Creates a new LPEX text editor.

Method Detail

initializeEditor

protected void initializeEditor()
Initializes this editor. This method is called during the construction of LpexAbstractDecoratedTextEditor.

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.

Overrides:
initializeEditor in class LpexAbstractDecoratedTextEditor

dispose

public void dispose()
Disposes of this workbench part. This is the last method called on the IWorkbenchPart. At this point, the part controls (if they were ever created) have been disposed as part of an SWT composite. There is no guarantee that createPartControl() has been called, so the part controls may never have been created. Within this method, a part may release any resources, fonts, images, etc. held by it. It is also very important to deregister all listeners from the workbench. Clients should not call this method - the workbench calls this method at appropriate times.

Overrides:
dispose in class LpexAbstractDecoratedTextEditor
See Also:
IWorkbenchPart

installEncodingSupport

protected void installEncodingSupport()
Installs the default encoding support on the given LPEX text editor. This is com.ibm.lpex.alef.DefaultEncodingSupport. Subclasses may override to install their own encoding support or to disable the default encoding support.


isSaveAsAllowed

public boolean isSaveAsAllowed()
The LpexTextEditor implementation of this EditorPart method returns true.

Overrides:
isSaveAsAllowed in class LpexAbstractTextEditor
Returns:
false
See Also:
EditorPart

createActions

protected void createActions()
Description copied from class: LpexAbstractTextEditor
Creates this editor's standard actions.

Actions handled in here are the standard Eclipse editor actions defined in ITextEditorActionConstants and IWorkbenchActionConstants, and some of the context menu actions.

The standard editor actions will be connected to the workbench global actions in LpexContextContributor -> BasicTextEditorActionContributor (see #doSetActiveEditor(): setGlobalActionHandler() for ITextEditorActionConstants.UNDO, REDO, CUT, COPY, PASTE, DELETE, SELECT_ALL, FIND, PRINT, REVERT; and setAction() for retargeted ITextEditorActionConstants.FIND_NEXT, FIND_PREVIOUS, FIND_INCREMENTAL, GOTO_LINE).

For LPEX's contributions to the Eclipse context, see LpexContextContributor.

Subclasses may extend.

Overrides:
createActions in class LpexAbstractDecoratedTextEditor

getStatusHeader

protected String getStatusHeader(IStatus status)
Description copied from class: LpexStatusTextEditor
Returns a header for the given status.

Overrides:
getStatusHeader in class LpexStatusTextEditor
Parameters:
status - the status whose message is returned
Returns:
a header for the given status

getStatusBanner

protected String getStatusBanner(IStatus status)
Description copied from class: LpexStatusTextEditor
Returns a banner for the given status.

Overrides:
getStatusBanner in class LpexStatusTextEditor
Parameters:
status - the status whose message is returned
Returns:
a banner for the given status

getStatusMessage

protected String getStatusMessage(IStatus status)
Description copied from class: LpexStatusTextEditor
Returns a message for the given status.

Overrides:
getStatusMessage in class LpexStatusTextEditor
Parameters:
status - the status whose message is returned
Returns:
a message for the given status

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 LpexAbstractDecoratedTextEditor
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)

getAdapter

public Object getAdapter(Class adapter)
Description copied from class: LpexAbstractTextEditor
Return the object which is an instance of the given class associated with this object, or null if no such object can be found.

IAdaptable is an interface for an adaptable object. Adaptable objects can be dynamically extended to provide different interfaces (or "adapters"). Adapters are created by adapter factories, which are in turn managed by type by adapter managers.

Overrides:
getAdapter in class LpexAbstractDecoratedTextEditor
See Also:
IAdaptable

updatePropertyDependentActions

protected void updatePropertyDependentActions()
Description copied from class: LpexAbstractTextEditor
Updates all property dependent actions.

Overrides:
updatePropertyDependentActions in class LpexAbstractTextEditor

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.