|
Eclipse Platform Release 3.1 |
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.ui.part.WorkbenchPart
org.eclipse.ui.part.EditorPart
org.eclipse.ui.texteditor.AbstractTextEditor
org.eclipse.ui.texteditor.StatusTextEditor
org.eclipse.ui.texteditor.AbstractDecoratedTextEditor
An intermediate editor comprising functionality not present in the leaner AbstractTextEditor
,
but used in many heavy weight (and especially source editing) editors, such as line numbers,
change ruler, overview ruler, print margins, current line highlighting, etc.
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 | |
---|---|
protected IAnnotationAccess |
fAnnotationAccess
Helper for accessing annotation from the perspective of this editor. |
protected LineNumberRulerColumn |
fLineNumberRulerColumn
The line number column. |
protected IOverviewRuler |
fOverviewRuler
The overview ruler of this editor. |
protected SourceViewerDecorationSupport |
fSourceViewerDecorationSupport
Helper for managing the decoration support of this editor's viewer. |
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 | |
---|---|
AbstractDecoratedTextEditor()
Creates a new text editor. |
Method Summary | |
---|---|
protected String[] |
collectContextMenuPreferencePages()
Returns the preference page ids of the preference pages to be shown when executing the preferences action from the editor context menu. |
protected String[] |
collectRulerMenuPreferencePages()
Returns the preference page ids of the preference pages to be shown when executing the preferences action from the editor ruler context menu. |
protected void |
configureSourceViewerDecorationSupport(SourceViewerDecorationSupport support)
Configures the decoration support for this editor's source viewer. |
protected void |
createActions()
Creates this editor's standard actions and connects them with the global workbench actions. |
protected IAnnotationAccess |
createAnnotationAccess()
Creates the annotation access for this editor. |
protected LineChangeHover |
createChangeHover()
Creates and returns a LineChangeHover to be used on this editor's change
ruler column. |
protected IChangeRulerColumn |
createChangeRulerColumn()
Creates a new change ruler column for quick diff display independent of the line number ruler column |
protected CompositeRuler |
createCompositeRuler()
Creates a composite ruler to be used as the vertical ruler by this editor. |
protected IVerticalRulerColumn |
createLineNumberRulerColumn()
Creates a new line number ruler column that is appropriately initialized. |
protected IOverviewRuler |
createOverviewRuler(ISharedTextColors sharedColors)
|
void |
createPartControl(Composite parent)
The AbstractTextEditor implementation of this
IWorkbenchPart method creates the vertical ruler and
source viewer.
|
protected ISourceViewer |
createSourceViewer(Composite parent,
IVerticalRuler ruler,
int styles)
Creates the source viewer to be used by this editor. |
protected Control |
createStatusControl(Composite parent,
IStatus status)
Creates the status control for the given status. |
protected IVerticalRuler |
createVerticalRuler()
Returns createCompositeRuler() . |
void |
dispose()
The AbstractTextEditor implementation of this
IWorkbenchPart method may be extended by subclasses.
|
protected void |
disposeDocumentProvider()
Disposes of the connection with the document provider. |
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 void |
editorContextMenuAboutToShow(IMenuManager menu)
Sets up this editor's context menu before it is made visible. |
Object |
getAdapter(Class adapter)
Returns an object which is an instance of the given class associated with this object. |
protected IAnnotationAccess |
getAnnotationAccess()
Returns the annotation access. |
protected AnnotationPreferenceLookup |
getAnnotationPreferenceLookup()
Returns the annotation preference lookup. |
protected MarkerAnnotationPreferences |
getAnnotationPreferences()
Returns the annotation preferences. |
IDocumentProvider |
getDocumentProvider()
Returns this text editor's document provider. |
protected IOverviewRuler |
getOverviewRuler()
Returns the overview ruler. |
protected ISharedTextColors |
getSharedColors()
|
protected SourceViewerDecorationSupport |
getSourceViewerDecorationSupport(ISourceViewer viewer)
Returns the source viewer decoration support. |
protected IOperationApprover |
getUndoRedoOperationApprover(IUndoContext undoContext)
Return an IOperationApprover appropriate for approving the undo and
redo of operations that have the specified undo context.
|
void |
gotoMarker(IMarker marker)
Deprecated. visibility will be reduced, use getAdapter(IGotoMarker.class) for accessing this method |
protected void |
handlePreferenceStoreChanged(PropertyChangeEvent event)
Handles a property change event describing a change of the editor's preference store and updates the preference related editor properties. |
protected void |
hideOverviewRuler()
Hides the overview ruler. |
protected void |
initializeEditor()
Initializes this editor. |
protected void |
initializeKeyBindingScopes()
Initializes the key binding scopes of this editor. |
protected void |
initializeLineNumberRulerColumn(LineNumberRulerColumn rulerColumn)
Initializes the given line number ruler column from the preference store. |
boolean |
isChangeInformationShowing()
Returns the quick diff display state. |
protected boolean |
isErrorStatus(IStatus status)
Returns whether the given status indicates an error. |
protected boolean |
isLineNumberRulerVisible()
Returns whether the line number ruler column should be visible according to the preference store settings. |
protected boolean |
isOverviewRulerVisible()
Tells whether the overview ruler is visible. |
protected boolean |
isOverwriteModeEnabled()
Returns whether the overwrite mode is enabled according to the preference store settings. |
protected boolean |
isPrefQuickDiffAlwaysOn()
Returns whether quick diff info should be visible upon opening an editor according to the preference store settings. |
protected void |
rulerContextMenuAboutToShow(IMenuManager menu)
Sets up the ruler context 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. |
Methods inherited from class org.eclipse.ui.texteditor.StatusTextEditor |
---|
doRevertToSaved, getStatusBanner, getStatusHeader, getStatusMessage, handleEditorInputChanged, handleElementContentReplaced, sanityCheckState, updatePartControl, updateStatusField |
Methods inherited from class org.eclipse.ui.part.EditorPart |
---|
checkSite, getEditorInput, getEditorSite, getTitleToolTip, isSaveOnCloseNeeded, setContentDescription, setInitializationData, setPartName |
Methods inherited from class org.eclipse.ui.part.WorkbenchPart |
---|
addPropertyListener, getConfigurationElement, getContentDescription, getDefaultImage, getOrientation, 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 |
Methods inherited from interface org.eclipse.ui.ISaveablePart |
---|
isSaveOnCloseNeeded |
Field Detail |
protected IOverviewRuler fOverviewRuler
This field should not be referenced by subclasses. It is protected
for API
compatibility reasons and will be made private
soon. Use
getOverviewRuler()
instead.
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.
protected LineNumberRulerColumn fLineNumberRulerColumn
This field should not be referenced by subclasses. It is protected
for API
compatibility reasons and will be made private
soon. Use
AbstractTextEditor.getVerticalRuler()
to access the vertical bar instead.
Constructor Detail |
public AbstractDecoratedTextEditor()
Method Detail |
protected void initializeEditor()
super.initializeEditor()
in order to avoid the
temporary creation of objects that are immediately overwritten by
subclasses.
protected void initializeKeyBindingScopes()
public void dispose()
AbstractTextEditor
AbstractTextEditor
implementation of this
IWorkbenchPart
method may be extended by subclasses.
Subclasses must call super.dispose()
.
Note that many methods may return null
after the editor is
disposed.
dispose
in interface IWorkbenchPart
dispose
in class AbstractTextEditor
protected ISourceViewer createSourceViewer(Composite parent, IVerticalRuler ruler, int styles)
AbstractTextEditor
createSourceViewer
in class AbstractTextEditor
parent
- 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)
AbstractTextEditor
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:
createPartControl
:
createPartControl
:
createPartControl
in interface IWorkbenchPart
createPartControl
in class StatusTextEditor
protected Control createStatusControl(Composite parent, IStatus status)
StatusTextEditor
createStatusControl
in class StatusTextEditor
parent
- the parent controlstatus
- the status
protected boolean isOverviewRulerVisible()
public void showChangeInformation(boolean show)
ITextEditorExtension3
showChangeInformation
in interface ITextEditorExtension3
showChangeInformation
in class AbstractTextEditor
public boolean isChangeInformationShowing()
ITextEditorExtension3
isChangeInformationShowing
in interface ITextEditorExtension3
isChangeInformationShowing
in class AbstractTextEditor
protected boolean isLineNumberRulerVisible()
true
if the line numbers should be visibleprotected boolean isOverwriteModeEnabled()
true
if overwrite mode is enabledprotected boolean isPrefQuickDiffAlwaysOn()
true
if the line numbers should be visibleprotected void initializeLineNumberRulerColumn(LineNumberRulerColumn 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 default implementation returns a plain LineChangeHover
.
Subclasses may override.
protected IChangeRulerColumn createChangeRulerColumn()
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 CompositeRuler
is returned, the built-in ruler
columns (line numbers, annotations) will not work.
May become final
in the future.
createVerticalRuler
in class AbstractTextEditor
AbstractTextEditor.createVerticalRuler()
protected CompositeRuler createCompositeRuler()
protected void handlePreferenceStoreChanged(PropertyChangeEvent event)
AbstractTextEditor
Subclasses may extend.
handlePreferenceStoreChanged
in class AbstractTextEditor
event
- the property change eventprotected void showOverviewRuler()
protected void hideOverviewRuler()
protected IAnnotationAccess getAnnotationAccess()
protected AnnotationPreferenceLookup getAnnotationPreferenceLookup()
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)
getAdapter(IGotoMarker.class) for accessing this method
marker
- the marker to go toprotected boolean isErrorStatus(IStatus status)
StatusTextEditor
isErrorStatus
in class StatusTextEditor
status
- the status to be checked
true
if the status indicates an error, false
otherwise\protected void createActions()
AbstractTextEditor
Subclasses may extend.
createActions
in class AbstractTextEditor
public Object getAdapter(Class adapter)
IAdaptable
null
if
no such object can be found.
getAdapter
in interface IAdaptable
getAdapter
in class AbstractTextEditor
protected void setDocumentProvider(IEditorInput input)
AbstractTextEditor
setDocumentProvider
in class AbstractTextEditor
input
- the input of this editor.public IDocumentProvider getDocumentProvider()
ITextEditor
getDocumentProvider
in interface ITextEditor
getDocumentProvider
in class AbstractTextEditor
protected void disposeDocumentProvider()
AbstractTextEditor
disposeDocumentProvider
in class AbstractTextEditor
protected void doSetInput(IEditorInput input) throws CoreException
AbstractTextEditor
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.
doSetInput
in class StatusTextEditor
CoreException
protected void rulerContextMenuAboutToShow(IMenuManager menu)
AbstractTextEditor
Subclasses may extend to add other actions.
rulerContextMenuAboutToShow
in class AbstractTextEditor
menu
- the menuprotected void editorContextMenuAboutToShow(IMenuManager menu)
AbstractTextEditor
Subclasses may extend to add other actions.
editorContextMenuAboutToShow
in class AbstractTextEditor
menu
- the menuprotected String[] collectContextMenuPreferencePages()
Subclasses may extend or replace.
protected String[] collectRulerMenuPreferencePages()
The default is to return the same list as
collectContextMenuPreferencePages
.
Subclasses may extend or replace.
protected IOperationApprover getUndoRedoOperationApprover(IUndoContext undoContext)
AbstractTextEditor
IOperationApprover
appropriate for approving the undo and
redo of operations that have the specified undo context.
Subclasses may override.
getUndoRedoOperationApprover
in class AbstractTextEditor
undoContext
- the IUndoContext of operations that should be examined
by the operation approver
IOperationApprover
appropriate for approving undo
and redo operations inside this editor, or null
if no
approval is needed
|
Eclipse Platform Release 3.1 |
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Guidelines for using Eclipse APIs.
Copyright (c) IBM Corp. and others 2000, 2005. All rights reserved.