SWT LPEX
v3.0.5

com.ibm.lpex.alef
Class LpexAbstractDecoratedTextEditor

java.lang.Object
  extended byorg.eclipse.ui.part.WorkbenchPart
      extended byorg.eclipse.ui.part.EditorPart
          extended bycom.ibm.lpex.alef.LpexAbstractTextEditor
              extended bycom.ibm.lpex.alef.LpexStatusTextEditor
                  extended bycom.ibm.lpex.alef.LpexAbstractDecoratedTextEditor
All Implemented Interfaces:
IAdaptable, IEditorPart, IExecutableExtension, IReusableEditor, ISaveablePart, ITextEditor, ITextEditorExtension, IWorkbenchPart, IWorkbenchPart2
Direct Known Subclasses:
LpexTextEditor

public abstract class LpexAbstractDecoratedTextEditor
extends LpexStatusTextEditor

A line oriented, LPEX-based abstract base implementation of an extended text editor. An intermediate editor comprising functionality not present in the leaner LpexAbstractTextEditor, but which may be used in heavy weight (and especially source editing) editors, such as overview ruler, etc.


Field Summary
protected  IAnnotationAccess fAnnotationAccess
          Helper for accessing annotation from the perspective of this editor.
 
Fields inherited from class com.ibm.lpex.alef.LpexAbstractTextEditor
ACTION_MAP, DEFAULT_EDITOR_CONTEXT_MENU_ID, DEFAULT_RULER_CONTEXT_MENU_ID, fErrorLabel, 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
 
Constructor Summary
LpexAbstractDecoratedTextEditor()
          Creates a new LPEX text editor.
 
Method Summary
protected  void createActions()
          Creates this editor's standard actions.
protected  IAnnotationAccess createAnnotationAccess()
          Creates the annotation access for this editor.
protected  IVerticalRuler createVerticalRuler()
          Override LpexAbstractTextEditor's to create the vertical ruler (an LpexVerticalRuler) used by this editor.
 void dispose()
          Dispose this part and discard all part state.
protected  void disposeDocumentProvider()
          Disposes of the connection with the document provider.
 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  IAnnotationAccess getAnnotationAccess()
          Returns the annotation access.
 IDocumentProvider getDocumentProvider()
          Returns this text editor's document provider.
 void gotoMarker(IMarker marker)
          Deprecated. Visibility will be reduced, use getAdapter(IGotoMarker.class) for accessing this method.
protected  void initializeEditor()
          Initializes this editor.
protected  boolean isErrorStatus(IStatus status)
          Returns whether the given status indicates an error.
protected  boolean isLineNumberRulerVisible()
          This method returns false.
protected  void setDocumentProvider(IEditorInput input)
          Hook method for setting the document provider for the given input.
 
Methods inherited from class com.ibm.lpex.alef.LpexStatusTextEditor
createPartControl, createStatusControl, doRevertToSaved, doSetInput, getStatusBanner, getStatusHeader, getStatusMessage, sanityCheckState, updatePartControl, updateStatusField
 
Methods inherited from class com.ibm.lpex.alef.LpexAbstractTextEditor
addAction, addAction, addGroup, addLines, addRulerContextMenuListener, adjustHighlightRange, affectsTextPresentation, availableOpenNewView, canHandleMove, close, createEmptyNavigationLocation, createNavigationActions, createNavigationLocation, createSourceViewer, createViewPreferenceNodes, createViewPreferencePage, doSave, doSaveAs, editorContextMenuAboutToShow, editorSaved, enableSanityChecking, enableStateValidation, firePropertyChange, getAction, getActiveLpexView, getActiveLpexWindow, getContextMenuListener, getCoverage, getCursorPosition, getEditorContextMenuId, getEOL, getFirstLpexView, getFirstLpexWindow, getHelpContextId, getHighlightRange, getInputResource, getKeyBindingScopes, getLpexView, getLpexWindow, getPreferenceStore, getProgressMonitor, getRangeIndicator, getRulerContextMenuId, getRulerMouseListener, getSelectionProvider, getSourceViewer, getSourceViewerConfiguration, getStatusField, getVerticalRuler, handleDelegate, handleEditorInputChanged, handleElementContentReplaced, handleExceptionOnSave, handlePreferenceStoreChanged, init, initializeLpexView, internalInit, isChangeInformationShowing, isDirty, isEditable, isEditorInputModifiable, isEditorInputReadOnly, isSaveAsAllowed, isSaveOnCloseNeeded, isVisible, markAsPropertyDependentAction, markInNavigationHistory, modelOffset2WidgetOffset, performLpexCommand, performRevert, performSave, performSaveAs, performSaveAs, rememberSelection, removeActionActivationCode, removeRulerContextMenuListener, resetHighlightRange, restoreSelection, rulerContextMenuAboutToShow, safelySanityCheckState, selectAndReveal, setAction, setActionActivationCode, setCompatibilityMode, setDocumentProvider, setDocumentSection, setEditorContextMenuId, setFocus, setHelpContextId, setHighlightRange, setInput, setKeyBindingScopes, setKeyBindingScopes, setLanguageHelp, setPreferenceStore, setRangeIndicator, setRulerContextMenuId, setSourceViewerConfiguration, setStatusField, showChangeInformation, showHighlightRangeOnly, showsHighlightRangeOnly, updateProfile, updateProfile, updatePropertyDependentActions, updateState, updateStatusFields, validateState, widgetContentsSet, 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
 

Field Detail

fAnnotationAccess

protected IAnnotationAccess fAnnotationAccess
Helper for accessing annotation from the perspective of this editor.

This field should not be referenced by subclasses. It is protected for API compatibility reasons and will be made private soon. Use getAnnotationAccess() instead.

Constructor Detail

LpexAbstractDecoratedTextEditor

public LpexAbstractDecoratedTextEditor()
Creates a new LPEX text editor.

Method Detail

initializeEditor

protected void initializeEditor()
Initializes this editor. Subclasses may reimplement.

The implementation of this method in LpexAbstractDecoratedTextEditor does nothing. In Eclipse's AbstractDecoratedTextEditor it is indicated that if subclasses do not change the contract, this method should not be extended, i.e., do not call super.initializeEditor(), in order to avoid the temporary creation of objects that are immediately overwritten by subclasses.


createVerticalRuler

protected IVerticalRuler createVerticalRuler()
Override LpexAbstractTextEditor's to create the vertical ruler (an LpexVerticalRuler) used by this editor.

Overrides:
createVerticalRuler in class LpexAbstractTextEditor
Returns:
the vertical ruler

dispose

public void dispose()
Description copied from class: LpexAbstractTextEditor
Dispose this part and discard all part state. From this point on, the part will not be referenced within the workbench. Note that many query methods may return null after the editor is disposed.

The AbstractTextEditor implementation of this IWorkbenchPart method may be extended by subclasses. Subclasses must call super.dispose().

This method is called at the end of the part lifecycle: release any resources, fonts, images, etc. held by the part. The part control has already been disposed, so there is no need to dispose it here.

Specified by:
dispose in interface IWorkbenchPart
Overrides:
dispose in class LpexAbstractTextEditor
See Also:
IWorkbenchPart.dispose()

createAnnotationAccess

protected IAnnotationAccess createAnnotationAccess()
Creates the annotation access for this editor.

Returns:
the created annotation access

isLineNumberRulerVisible

protected boolean isLineNumberRulerVisible()
This method returns false. LPEX has its own prefix area to display line or sequence numbers. AbstractDecoratedTextEditor: this method returns whether the line number ruler column should be visible according to the preference store settings; subclasses may override this method to provide a custom preference setting.

Returns:
true if the line numbers should be visible

getAnnotationAccess

protected IAnnotationAccess getAnnotationAccess()
Returns the annotation access.

Returns:
the annotation access

gotoMarker

public void gotoMarker(IMarker marker)
Deprecated. Visibility will be reduced, use getAdapter(IGotoMarker.class) for accessing this method.

Sets the cursor in the primary window of the editor to the specified marker, and selects its corresponding text using the default selection mode.

If the editor is dirty (can be saved), all the marker ranges have been changed according to the text manipulations. However, those changes are not yet propagated to the marker manager. Therefore, when opening a marker, the marker's position in the editor must be determined as it might differ from the position stated in the marker.

Parameters:
marker - the marker to go to

isErrorStatus

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

Overrides:
isErrorStatus in class LpexStatusTextEditor
Parameters:
status - the status to be checked
Returns:
true if the status indicates an error, or
false otherwise
See Also:
StatusTextEditor.isErrorStatus(org.eclipse.core.runtime.IStatus)

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 LpexAbstractTextEditor

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.

Specified by:
getAdapter in interface IAdaptable
Overrides:
getAdapter in class LpexAbstractTextEditor
See Also:
IAdaptable.getAdapter(java.lang.Class)

setDocumentProvider

protected void setDocumentProvider(IEditorInput input)
Description copied from class: LpexAbstractTextEditor
Hook method for setting the document provider for the given input. Called while updating the document provider for the new editor input. This default implementation does nothing. Clients may reimplement: this is the method in which you can configure the appropriate implicit document provider for the given editor input.

Overrides:
setDocumentProvider in class LpexAbstractTextEditor
Parameters:
input - the input of this editor

getDocumentProvider

public IDocumentProvider getDocumentProvider()
Description copied from class: LpexAbstractTextEditor
Returns this text editor's document provider.

Specified by:
getDocumentProvider in interface ITextEditor
Overrides:
getDocumentProvider in class LpexAbstractTextEditor
See Also:
ITextEditor.getDocumentProvider()

disposeDocumentProvider

protected void disposeDocumentProvider()
Description copied from class: LpexAbstractTextEditor
Disposes of the connection with the document provider. Subclasses may extend.

Overrides:
disposeDocumentProvider in class LpexAbstractTextEditor

SWT LPEX
v3.0.5

(C) Copyright IBM Corporation 1998, 2005.  All Rights Reserved.