|
LPEX 4.4.0 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.ObjectEditorPart
com.ibm.lpex.alef.LpexAbstractTextEditor
com.ibm.lpex.alef.LpexStatusTextEditor
com.ibm.lpex.alef.LpexAbstractDecoratedTextEditor
public abstract class LpexAbstractDecoratedTextEditor
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 a change (quick diff) ruler.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class com.ibm.lpex.alef.LpexAbstractTextEditor |
|---|
LpexAbstractTextEditor.ColumnSupport, LpexAbstractTextEditor.IdMapEntry, LpexAbstractTextEditor.TextEditorSavable |
| Field Summary | |
|---|---|
protected IAnnotationAccess |
fAnnotationAccess
Helper for accessing annotation from the perspective of this editor. |
protected SourceViewerDecorationSupport |
fSourceViewerDecorationSupport
Helper for managing the decoration support of this editor's viewer. |
| Constructor Summary | |
|---|---|
LpexAbstractDecoratedTextEditor()
Creates a new LPEX text editor. |
|
| Method Summary | |
|---|---|
protected void |
configureSourceViewerDecorationSupport(SourceViewerDecorationSupport support)
Configures the decoration support for this editor's source viewer. |
protected void |
createActions()
Creates this editor's standard actions. |
protected IAnnotationAccess |
createAnnotationAccess()
Creates the annotation access for this editor. |
protected IVerticalRulerColumn |
createAnnotationRulerColumn(CompositeRuler ruler)
Creates the annotation ruler column. |
protected LineChangeHover |
createChangeHover()
Creates and returns a LineChangeHover to be used on this
editor's change ruler column. |
protected IColumnSupport |
createColumnSupport()
Creates the column support to be used by this editor to manage the contributed ruler columns. |
protected CompositeRuler |
createCompositeRuler()
Creates a composite ruler to be used as the vertical ruler for annotations, quick diff, and revision annotations by this editor. |
protected IVerticalRulerColumn |
createLineNumberRulerColumn()
Creates a new line number change ruler column (quick diff, revisions) that is appropriately initialized. |
protected IOverviewRuler |
createOverviewRuler(ISharedTextColors sharedColors)
|
void |
createPartControl(Composite parent)
Creates the SWT controls for this workbench part. |
protected ISourceViewer |
createSourceViewer(Composite parent,
IVerticalRuler ruler,
int styles)
Create the source viewer (an LpexSourceViewer) to be used by this editor. |
protected IVerticalRuler |
createVerticalRuler()
Overrides LpexAbstractTextEditor's to create the composite ruler used by this editor. |
void |
dispose()
Disposes this part and discards all part state. |
protected void |
disposeDocumentProvider()
Disposes of the connection with the document provider. |
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 IAnnotationAccess |
getAnnotationAccess()
Returns the annotation access. |
protected MarkerAnnotationPreferences |
getAnnotationPreferences()
Returns the annotation preferences. |
IDocumentProvider |
getDocumentProvider()
Returns this text editor's document provider. |
protected IOverviewRuler |
getOverviewRuler()
Optionally creates and returns the overview ruler. |
protected ISharedTextColors |
getSharedColors()
|
protected SourceViewerDecorationSupport |
getSourceViewerDecorationSupport(ISourceViewer viewer)
Returns the source viewer decoration support. |
void |
gotoMarker(IMarker marker)
Sets the cursor in the primary window of the editor to the specified marker, and selects its corresponding text using the default selection mode. |
protected void |
handlePreferenceStoreChanged(PropertyChangeEvent event)
Handles a property-change event describing a change of the editor's preference store. |
protected void |
hideOverviewRuler()
Hides the overview ruler. |
protected void |
initializeEditor()
Initializes this editor. |
protected void |
initializeLineNumberRulerColumn(LpexLineNumberChangeRulerColumn rulerColumn)
Initializes the given line number change ruler column from the preference store. |
boolean |
isChangeInformationShowing()
Returns the quick diff display state. |
boolean |
isEditable()
Returns whether the text in this text editor can be changed by the user. |
protected boolean |
isErrorStatus(IStatus status)
Returns whether the given status indicates an error. |
protected boolean |
isLineNumberRulerVisible()
This method returns false. |
protected boolean |
isOverviewRulerVisible()
Returns whether the overview ruler should be visible. |
protected boolean |
isPrefQuickDiffAlwaysOn()
Returns whether quick diff info should be visible upon opening an editor according to the Eclipse preference store settings. |
protected void |
performSaveAs(IProgressMonitor progressMonitor)
Prompts the user for the workspace path of a file resource, and saves the document there. |
protected void |
performSaveAs(IProgressMonitor progressMonitor,
IFile original)
Prompts the user for the workspace path of a file resource, and saves the document there. |
protected void |
performSaveAs(IProgressMonitor progressMonitor,
String fileName)
Prompts the user for the workspace path of a file resource, and saves the document there. |
protected void |
rulerContextMenuAboutToShow(IMenuManager menu)
Sets up the vertical ruler's context (pop-up) menu before it is made visible. |
protected void |
setDocumentProvider(IEditorInput input)
Hook method for setting the document provider for the given input. |
void |
showChangeInformation(boolean show)
Sets the display of quick diff information. |
protected void |
showOverviewRuler()
Shows the overview ruler. |
void |
showRevisionInformation(RevisionInformation info,
String quickDiffProviderId)
|
boolean |
validateEditorInputState()
Validates the state of the given editor input. |
| Methods inherited from class com.ibm.lpex.alef.LpexStatusTextEditor |
|---|
createStatusControl, doRevertToSaved, getStatusBanner, getStatusHeader, getStatusMessage, handleEditorInputChanged, handleElementContentReplaced, sanityCheckState, setFocus, updatePartControl, updateStatusField |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected IAnnotationAccess fAnnotationAccess
This field should not be referenced by subclasses.
It is protected for API compatibility reasons and will be
made private soon. Use getAnnotationAccess() instead.
protected SourceViewerDecorationSupport fSourceViewerDecorationSupport
This field should not be referenced by subclasses.
It is protected for API compatibility reasons and will be
made private soon.
Use getSourceViewerDecorationSupport(ISourceViewer) instead.
| Constructor Detail |
|---|
public LpexAbstractDecoratedTextEditor()
| Method Detail |
|---|
protected void initializeEditor()
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.
public void dispose()
LpexAbstractTextEditornull 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.
dispose in class LpexAbstractTextEditorIWorkbenchPart
protected ISourceViewer createSourceViewer(Composite parent,
IVerticalRuler ruler,
int styles)
LpexAbstractTextEditorCalled from createPartControl().
createSourceViewer in class LpexAbstractTextEditorparent - the parent controlruler - the vertical rulerstyles - style bits, SWT.WRAP is currently not supported
protected ISharedTextColors getSharedColors()
protected IOverviewRuler createOverviewRuler(ISharedTextColors sharedColors)
protected IAnnotationAccess createAnnotationAccess()
protected void configureSourceViewerDecorationSupport(SourceViewerDecorationSupport support)
support - the decoration support to configurepublic void createPartControl(Composite parent)
LpexStatusTextEditorFor 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).
createPartControl in class LpexStatusTextEditorparent - the parent controlIWorkbenchPartprotected boolean isOverviewRulerVisible()
public void showChangeInformation(boolean show)
showChangeInformation in class LpexAbstractTextEditorITextEditorExtension3public boolean isChangeInformationShowing()
isChangeInformationShowing in class LpexAbstractTextEditorITextEditorExtension3
public void showRevisionInformation(RevisionInformation info,
String quickDiffProviderId)
showRevisionInformation in class LpexAbstractTextEditorprotected boolean isLineNumberRulerVisible()
false.
LPEX has its own prefix area to display line or sequence numbers.
See the prefixArea parameter.
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.
true if the line numbers should be visibleprotected boolean isPrefQuickDiffAlwaysOn()
true if the quick diff should be visibleprotected void initializeLineNumberRulerColumn(LpexLineNumberChangeRulerColumn rulerColumn)
rulerColumn - the ruler column to be initializedprotected IVerticalRulerColumn createLineNumberRulerColumn()
protected LineChangeHover createChangeHover()
LineChangeHover to be used on this
editor's change ruler column. This hover determines the text to show as
hover for a certain line or range of lines in the document.
The implementation of this method returns an LpexLineChangeHover.
Subclasses may override.
protected IVerticalRuler createVerticalRuler()
createCompositeRuler().
Subclasses should not override this method, but rather
createCompositeRuler if they want to contribute their own
vertical ruler implementation. If not an instance of LpexCompositeRuler
is returned, the built-in ruler columns (line numbers, annotations) will
not work.
May become final in the future.
createVerticalRuler in class LpexAbstractTextEditorLpexAbstractTextEditor.createVerticalRuler()protected CompositeRuler createCompositeRuler()
protected IVerticalRulerColumn createAnnotationRulerColumn(CompositeRuler ruler)
ruler - the composite ruler that the column will be added to
protected final IColumnSupport createColumnSupport()
LpexAbstractTextEditornull. Subclasses may re-implement this method using the LpexAbstractTextEditor.ColumnSupport, e.g., by
returning new ColumnSupport(this, RulerColumnRegistry.getDefault());.
Note: If you override this method to provide column support, you must also override LpexAbstractTextEditor.createVerticalRuler() to return an
LpexCompositeRuler.
createColumnSupport in class LpexAbstractTextEditornull if noneprotected void handlePreferenceStoreChanged(PropertyChangeEvent event)
LpexAbstractTextEditorLPEX's own default settings are stored in its own defaultProfile. In AbstractTextEditor this method updates any preference-related editor properties (its font; foreground, background, selection, and find-scope colours, carets), most of which are not used in LpexAbstractTextEditor.
handlePreferenceStoreChanged in class LpexAbstractTextEditorevent - the property change eventprotected void showOverviewRuler()
protected void hideOverviewRuler()
protected IAnnotationAccess getAnnotationAccess()
protected IOverviewRuler getOverviewRuler()
protected SourceViewerDecorationSupport getSourceViewerDecorationSupport(ISourceViewer viewer)
viewer - the viewer for which to return a decoration support
protected MarkerAnnotationPreferences getAnnotationPreferences()
public void gotoMarker(IMarker marker)
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.
marker - the marker to go topublic boolean isEditable()
LpexAbstractTextEditor
isEditable in class LpexAbstractTextEditortrue if it can be edited, or false if it is read onlyITextEditorpublic boolean validateEditorInputState()
LpexAbstractTextEditor
validateEditorInputState in class LpexStatusTextEditortrue if the input was validated, false otherwiseITextEditorExtension2protected boolean isErrorStatus(IStatus status)
isErrorStatus in class LpexStatusTextEditorstatus - the status to be checked
true if the status indicates an error, or false otherwiseStatusTextEditorprotected void createActions()
LpexAbstractTextEditorActions 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.
createActions in class LpexAbstractTextEditorpublic Object getAdapter(Class adapter)
LpexAbstractTextEditornull 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.
getAdapter in class LpexAbstractTextEditorIAdaptableprotected void setDocumentProvider(IEditorInput input)
LpexAbstractTextEditor
setDocumentProvider in class LpexAbstractTextEditorinput - the input of this editorpublic IDocumentProvider getDocumentProvider()
LpexAbstractTextEditor
getDocumentProvider in class LpexAbstractTextEditorITextEditorprotected void disposeDocumentProvider()
LpexAbstractTextEditor
disposeDocumentProvider in class LpexAbstractTextEditor
protected void doSetInput(IEditorInput input)
throws CoreException
LpexAbstractTextEditor
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.
doSetInput in class LpexStatusTextEditorinput - the (new) input to be set; if null, this text editor is being closed
CoreException - if the input cannot be connected to the document provider (i.e., it is not understood by this part)protected void performSaveAs(IProgressMonitor progressMonitor)
performSaveAs in class LpexAbstractTextEditorprogressMonitor - the progress monitor to be usedperformSaveAs(IProgressMonitor,String),
performSaveAs(IProgressMonitor,IFile)
protected void performSaveAs(IProgressMonitor progressMonitor,
String fileName)
performSaveAs in class LpexAbstractTextEditorprogressMonitor - the progress monitor to be usedfileName - initial file name in the dialogperformSaveAs(IProgressMonitor),
performSaveAs(IProgressMonitor,IFile)
protected void performSaveAs(IProgressMonitor progressMonitor,
IFile original)
All the 'save as' operations (Eclipse "File" -> "Save file As...", Eclipse workbench toolbar, LPEX saveAs action, LPEX save prompt command) eventually use this method to put up the "Save File As" dialog.
performSaveAs in class LpexAbstractTextEditorprogressMonitor - the progress monitor to be usedoriginal - initial file in the dialogperformSaveAs(IProgressMonitor),
performSaveAs(IProgressMonitor,String)protected void rulerContextMenuAboutToShow(IMenuManager menu)
LpexAbstractTextEditorSubclasses may extend to add other actions.
rulerContextMenuAboutToShow in class LpexAbstractTextEditormenu - the menu
|
LPEX 4.4.0 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||