From eece3f7a33f5ba3fd5e7f6c2fd7d9397d6f338e6 Mon Sep 17 00:00:00 2001 From: teicher Date: Wed, 23 Jun 2004 13:53:54 +0000 Subject: 3.0 javadoc pass --- .../ui/texteditor/AbstractDecoratedTextEditor.java | 2 +- .../ui/contentassist/ContentAssistHandler.java | 3 +- .../ui/texteditor/AbstractDocumentProvider.java | 17 +- .../ui/texteditor/AbstractRulerActionDelegate.java | 1 + .../eclipse/ui/texteditor/AbstractTextEditor.java | 300 ++++++++++++++------- .../ui/texteditor/AnnotationPreference.java | 66 +++-- .../BasicTextEditorActionContributor.java | 26 +- .../ui/texteditor/ConfigurationElementSorter.java | 4 +- .../ui/texteditor/ConvertLineDelimitersAction.java | 5 +- .../eclipse/ui/texteditor/DeleteLineAction.java | 4 +- .../org/eclipse/ui/texteditor/FindNextAction.java | 7 +- .../IAbstractTextEditorHelpContextIds.java | 4 - .../eclipse/ui/texteditor/IDocumentProvider.java | 48 ++-- .../ui/texteditor/IDocumentProviderExtension.java | 2 +- .../ui/texteditor/IDocumentProviderExtension2.java | 2 +- .../ui/texteditor/IDocumentProviderExtension3.java | 2 +- .../ui/texteditor/IElementStateListener.java | 11 + .../texteditor/IElementStateListenerExtension.java | 2 +- .../texteditor/IFindReplaceTargetExtension2.java | 6 +- .../org/eclipse/ui/texteditor/IStatusField.java | 13 +- .../ui/texteditor/IStatusFieldExtension.java | 4 +- .../src/org/eclipse/ui/texteditor/ITextEditor.java | 37 ++- .../ui/texteditor/ITextEditorActionConstants.java | 4 +- .../texteditor/ITextEditorActionDefinitionIds.java | 6 +- .../ui/texteditor/ITextEditorExtension.java | 3 +- .../ui/texteditor/ITextEditorExtension2.java | 9 +- .../ui/texteditor/ITextEditorExtension3.java | 5 +- .../ui/texteditor/IncrementalFindAction.java | 2 +- .../eclipse/ui/texteditor/InsertLineAction.java | 4 +- .../ui/texteditor/RetargetTextEditorAction.java | 3 - .../texteditor/SourceViewerDecorationSupport.java | 39 ++- .../eclipse/ui/texteditor/TextEditorAction.java | 7 + .../eclipse/ui/texteditor/quickdiff/QuickDiff.java | 4 +- .../templates/TemplatePreferencePage.java | 4 +- .../templates/TemplateVariableProcessor.java | 4 + .../templates/TemplateVariableProposal.java | 7 +- 36 files changed, 435 insertions(+), 232 deletions(-) diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/AbstractDecoratedTextEditor.java b/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/AbstractDecoratedTextEditor.java index 438cb864fd4..91f604509ba 100644 --- a/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/AbstractDecoratedTextEditor.java +++ b/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/AbstractDecoratedTextEditor.java @@ -252,7 +252,7 @@ public abstract class AbstractDecoratedTextEditor extends StatusTextEditor { } /** - * Configures the decoration support for this editor's the source viewer. Subclasses may override this + * Configures the decoration support for this editor's source viewer. Subclasses may override this * method, but should call their superclass' implementation at some point. * * @param support the decoration support to configure diff --git a/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/contentassist/ContentAssistHandler.java b/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/contentassist/ContentAssistHandler.java index 45a7ca50d9b..0689fe5a9de 100644 --- a/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/contentassist/ContentAssistHandler.java +++ b/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/contentassist/ContentAssistHandler.java @@ -43,7 +43,8 @@ import org.eclipse.ui.texteditor.ITextEditorActionDefinitionIds; /** * A content assistant handler which handles the key binding and - * the cue for a content assist and its subject adapter. + * the cue for a {@link org.eclipse.jface.text.contentassist.ContentAssistant} + * and its subject adapter. * * @since 3.0 */ diff --git a/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/AbstractDocumentProvider.java b/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/AbstractDocumentProvider.java index 622b65a6d31..7a822fad0bd 100644 --- a/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/AbstractDocumentProvider.java +++ b/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/AbstractDocumentProvider.java @@ -42,7 +42,7 @@ import org.eclipse.ui.internal.texteditor.TextEditorPlugin; /** - * An abstract implementation of a shareable document provider. + * An abstract implementation of a sharable document provider. *
* Subclasses must implement createDocument
,
* createAnnotationModel
, and doSaveDocument
.
@@ -176,7 +176,7 @@ public abstract class AbstractDocumentProvider implements IDocumentProvider, IDo
static final protected boolean PR14469_ENABLED= false;
/**
- * Constant for representing the ok status. This is considered a value object.
+ * Constant for representing the OK status. This is considered a value object.
* @since 2.0
*/
static final protected IStatus STATUS_OK= new Status(IStatus.OK, TextEditorPlugin.PLUGIN_ID, IStatus.OK, EditorMessages.getString("AbstractDocumentProvider.ok"), null); //$NON-NLS-1$
@@ -217,8 +217,9 @@ public abstract class AbstractDocumentProvider implements IDocumentProvider, IDo
protected abstract IDocument createDocument(Object element) throws CoreException;
/**
- * Creates an annotation model for the given element.
- * Subclasses must implement this method. + * Creates an annotation model for the given element. + *
+ * Subclasses must implement this method.
* * @param element the element * @return the annotation model @@ -595,7 +596,7 @@ public abstract class AbstractDocumentProvider implements IDocumentProvider, IDo /* * @see org.eclipse.ui.texteditor.AbstractDocumentProvider.DocumentProviderOperation#execute(org.eclipse.core.runtime.IProgressMonitor) */ - protected void execute(IProgressMonitor monitor) throws CoreException { + protected void execute(IProgressMonitor pm) throws CoreException { ElementInfo info= (ElementInfo) fElementInfoMap.get(element); if (info != null) { if (info.fDocument != document) { @@ -603,9 +604,9 @@ public abstract class AbstractDocumentProvider implements IDocumentProvider, IDo throw new CoreException(status); } - doSaveDocument(monitor, element, document, overwrite); + doSaveDocument(pm, element, document, overwrite); - if (monitor != null && monitor.isCanceled()) + if (pm != null && pm.isCanceled()) return; info.fCanBeSaved= false; @@ -613,7 +614,7 @@ public abstract class AbstractDocumentProvider implements IDocumentProvider, IDo fireElementDirtyStateChanged(element, false); } else { - doSaveDocument(monitor, element, document, overwrite); + doSaveDocument(pm, element, document, overwrite); } } diff --git a/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/AbstractRulerActionDelegate.java b/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/AbstractRulerActionDelegate.java index 188f9f3c061..ea34452220f 100644 --- a/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/AbstractRulerActionDelegate.java +++ b/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/AbstractRulerActionDelegate.java @@ -33,6 +33,7 @@ import org.eclipse.ui.IEditorPart; * adapter (inner) action on menu and mouse action on the vertical ruler.
* Extending classes must implement the factory method
* createAction(ITextEditor editor, IVerticalRulerInfo)
.
+ *
* @since 2.0
*/
public abstract class AbstractRulerActionDelegate implements IEditorActionDelegate, MouseListener, IMenuListener {
diff --git a/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/AbstractTextEditor.java b/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/AbstractTextEditor.java
index deb8d66fcb9..9909f1c888d 100644
--- a/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/AbstractTextEditor.java
+++ b/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/AbstractTextEditor.java
@@ -1453,7 +1453,8 @@ public abstract class AbstractTextEditor extends EditorPart implements ITextEdit
protected final static int VERTICAL_RULER_WIDTH= 12;
/**
- * The complete mapping between action definition ids used by eclipse and StyledText actions.
+ * The complete mapping between action definition IDs used by eclipse and StyledText actions.
+ *
* @since 2.0
*/
protected final static IdMapEntry[] ACTION_MAP= new IdMapEntry[] {
@@ -1776,72 +1777,80 @@ public abstract class AbstractTextEditor extends EditorPart implements ITextEdit
}
/**
- * Returns the editor's range indicator.
+ * Returns the editor's range indicator. May return null
if no
+ * range indicator is installed.
*
- * @return the editor's range indicator
+ * @return the editor's range indicator which may be null
*/
protected final Annotation getRangeIndicator() {
return fRangeIndicator;
}
/**
- * Returns the editor's source viewer configuration.
+ * Returns the editor's source viewer configuration. May return null
+ * before the editor's part has been created and after disposal.
*
- * @return the editor's source viewer configuration
+ * @return the editor's source viewer configuration which may be null
*/
protected final SourceViewerConfiguration getSourceViewerConfiguration() {
return fConfiguration;
}
/**
- * Returns the editor's source viewer.
+ * Returns the editor's source viewer. May return null
before
+ * the editor's part has been created and after disposal.
*
- * @return the editor's source viewer
+ * @return the editor's source viewer which may be null
*/
protected final ISourceViewer getSourceViewer() {
return fSourceViewer;
}
/**
- * Returns the editor's vertical ruler.
+ * Returns the editor's vertical ruler. May return null
before
+ * the editor's part has been created and after disposal.
*
- * @return the editor's vertical ruler
+ * @return the editor's vertical ruler which may be null
*/
protected final IVerticalRuler getVerticalRuler() {
return fVerticalRuler;
}
/**
- * Returns the editor's context menu id.
+ * Returns the editor's context menu id. May return null
before
+ * the editor's part has been created.
*
- * @return the editor's context menu id
+ * @return the editor's context menu id which may be null
*/
protected final String getEditorContextMenuId() {
return fEditorContextMenuId;
}
/**
- * Returns the ruler's context menu id.
+ * Returns the ruler's context menu id. May return null
before
+ * the editor's part has been created.
*
- * @return the ruler's context menu id
+ * @return the ruler's context menu id which may be null
*/
protected final String getRulerContextMenuId() {
return fRulerContextMenuId;
}
/**
- * Returns the editor's help context id.
+ * Returns the editor's help context id or null
if none has
+ * been set.
*
- * @return the editor's help context id
+ * @return the editor's help context id which may be null
*/
protected final String getHelpContextId() {
return fHelpContextId;
}
/**
- * Returns this editor's preference store.
+ * Returns this editor's preference store or null
if none has
+ * been set.
*
- * @return this editor's preference store
+ * @return this editor's preference store which may be null
*/
protected final IPreferenceStore getPreferenceStore() {
return fPreferenceStore;
@@ -1873,7 +1882,7 @@ public abstract class AbstractTextEditor extends EditorPart implements ITextEdit
/**
* Sets the annotation which this editor uses to represent the highlight
* range if the editor is configured to show the entire document. If the
- * range indicator is not set, this editor uses a DefaultRangeIndicator
.
+ * range indicator is not set, this editor will not show a range indication.
*
* @param rangeIndicator the annotation
*/
@@ -1926,7 +1935,7 @@ public abstract class AbstractTextEditor extends EditorPart implements ITextEdit
/**
* Sets the keybinding scopes for this editor.
*
- * @param scopes the scopes
+ * @param scopes a non-empty array of keybinding scope identifiers
* @since 2.1
*/
protected void setKeyBindingScopes(String[] scopes) {
@@ -1938,7 +1947,8 @@ public abstract class AbstractTextEditor extends EditorPart implements ITextEdit
* Sets this editor's preference store. This method must be
* called before the editor's control is created.
*
- * @param store the preference store
+ * @param store the preference store or null
to unset the
+ * preference store
*/
protected void setPreferenceStore(IPreferenceStore store) {
if (fPreferenceStore != null)
@@ -1962,8 +1972,14 @@ public abstract class AbstractTextEditor extends EditorPart implements ITextEdit
return false;
}
- /*
- * @see ITextEditor#getSelectionProvider()
+ /**
+ * {@inheritDoc}
+ *
+ * Returns null
after disposal.
+ *
null
if the editor has
+ * been disposed
*/
public ISelectionProvider getSelectionProvider() {
return fSelectionProvider;
@@ -2189,8 +2205,17 @@ public abstract class AbstractTextEditor extends EditorPart implements ITextEdit
return fCursorListener;
}
- /*
- * @see IEditorPart#init(org.eclipse.ui.IEditorSite, org.eclipse.ui.IEditorInput)
+ /**
+ * Implements the init
method of IEditorPart
.
+ * Subclasses replacing init
may choose to call this method in
+ * their implementation.
+ *
+ * @param window the site's workbench window
+ * @param site the editor's site
+ * @param input the editor input for the editor being created
+ * @throws PartInitException if {@link #doSetInput(IEditorInput)} fails or gets canceled
+ *
+ * @see org.eclipse.ui.IEditorPart#init(org.eclipse.ui.IEditorSite, org.eclipse.ui.IEditorInput)
* @since 2.1
*/
protected final void internalInit(IWorkbenchWindow window, final IEditorSite site, final IEditorInput input) throws PartInitException {
@@ -2289,10 +2314,55 @@ public abstract class AbstractTextEditor extends EditorPart implements ITextEdit
}
/**
- * The AbstractTextEditor
implementation of this
+ * The AbstractTextEditor
implementation of this
* IWorkbenchPart
method creates the vertical ruler and
* source viewer.
- * Subclasses may extend.
+ *
+ * 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
:
+ * setInput
method.
- *
+ * Called directly from 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. + *
+ * * @param input the input to be set - * @exception CoreException if input cannot be connected to the document provider + * @exception CoreException if input cannot be connected to the document + * provider */ protected void doSetInput(IEditorInput input) throws CoreException { @@ -2841,6 +2923,10 @@ public abstract class AbstractTextEditor extends EditorPart implements ITextEdit * TheAbstractTextEditor
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.
+ *
null
if none is defined
+ * @return a String with the symbolic font name or null
if
+ * none is defined
* @since 2.1
*/
private String getSymbolicFontName() {
@@ -3031,7 +3117,8 @@ public abstract class AbstractTextEditor extends EditorPart implements ITextEdit
}
/**
- * Returns the property preference key for the editor font.
+ * Returns the property preference key for the editor font. Subclasses may
+ * replace this method.
*
* @return a String with the key
* @since 2.1
@@ -3046,9 +3133,11 @@ public abstract class AbstractTextEditor extends EditorPart implements ITextEdit
}
/**
- * Handles a property change event describing a change
- * of the editor's preference store and updates the preference
- * related editor properties.
+ * Handles a property change event describing a change of the editor's
+ * preference store and updates the preference related editor properties.
+ * + * Subclasses may extend. + *
* * @param event the property change event */ @@ -3081,7 +3170,8 @@ public abstract class AbstractTextEditor extends EditorPart implements ITextEdit } /** - * Returns the progress monitor related to this editor. + * Returns the progress monitor related to this editor. It should not be + * necessary to extend this method. * * @return the progress monitor related to this editor * @since 2.1 @@ -3097,80 +3187,81 @@ public abstract class AbstractTextEditor extends EditorPart implements ITextEdit return pm != null ? pm : new NullProgressMonitor(); } - /** - * Handles an external change of the editor's input element. - */ - protected void handleEditorInputChanged() { - - String title; - String msg; - Shell shell= getSite().getShell(); - - final IDocumentProvider provider= getDocumentProvider(); - if (provider == null) { - // fix for http://dev.eclipse.org/bugs/show_bug.cgi?id=15066 - close(false); - return; - } + /** + * Handles an external change of the editor's input element. Subclasses may + * extend. + */ + protected void handleEditorInputChanged() { + + String title; + String msg; + Shell shell= getSite().getShell(); + + final IDocumentProvider provider= getDocumentProvider(); + if (provider == null) { + // fix for http://dev.eclipse.org/bugs/show_bug.cgi?id=15066 + close(false); + return; + } + + final IEditorInput input= getEditorInput(); + if (provider.isDeleted(input)) { - final IEditorInput input= getEditorInput(); - if (provider.isDeleted(input)) { + if (isSaveAsAllowed()) { - if (isSaveAsAllowed()) { + title= EditorMessages.getString("Editor.error.activated.deleted.save.title"); //$NON-NLS-1$ + msg= EditorMessages.getString("Editor.error.activated.deleted.save.message"); //$NON-NLS-1$ - title= EditorMessages.getString("Editor.error.activated.deleted.save.title"); //$NON-NLS-1$ - msg= EditorMessages.getString("Editor.error.activated.deleted.save.message"); //$NON-NLS-1$ - - String[] buttons= { + String[] buttons= { EditorMessages.getString("Editor.error.activated.deleted.save.button.save"), //$NON-NLS-1$ EditorMessages.getString("Editor.error.activated.deleted.save.button.close"), //$NON-NLS-1$ - }; - - MessageDialog dialog= new MessageDialog(shell, title, null, msg, MessageDialog.QUESTION, buttons, 0); - - if (dialog.open() == 0) { - IProgressMonitor pm= getProgressMonitor(); - performSaveAs(pm); - if (pm.isCanceled()) - handleEditorInputChanged(); - } else { - close(false); - } - + }; + + MessageDialog dialog= new MessageDialog(shell, title, null, msg, MessageDialog.QUESTION, buttons, 0); + + if (dialog.open() == 0) { + IProgressMonitor pm= getProgressMonitor(); + performSaveAs(pm); + if (pm.isCanceled()) + handleEditorInputChanged(); } else { - - title= EditorMessages.getString("Editor.error.activated.deleted.close.title"); //$NON-NLS-1$ - msg= EditorMessages.getString("Editor.error.activated.deleted.close.message"); //$NON-NLS-1$ - if (MessageDialog.openConfirm(shell, title, msg)) - close(false); + close(false); } } else { - title= EditorMessages.getString("Editor.error.activated.outofsync.title"); //$NON-NLS-1$ - msg= EditorMessages.getString("Editor.error.activated.outofsync.message"); //$NON-NLS-1$ + title= EditorMessages.getString("Editor.error.activated.deleted.close.title"); //$NON-NLS-1$ + msg= EditorMessages.getString("Editor.error.activated.deleted.close.message"); //$NON-NLS-1$ + if (MessageDialog.openConfirm(shell, title, msg)) + close(false); + } + + } else { + + title= EditorMessages.getString("Editor.error.activated.outofsync.title"); //$NON-NLS-1$ + msg= EditorMessages.getString("Editor.error.activated.outofsync.message"); //$NON-NLS-1$ + + if (MessageDialog.openQuestion(shell, title, msg)) { - if (MessageDialog.openQuestion(shell, title, msg)) { - - - try { - if (provider instanceof IDocumentProviderExtension) { - IDocumentProviderExtension extension= (IDocumentProviderExtension) provider; - extension.synchronize(input); - } else { - doSetInput(input); - } - } catch (CoreException x) { - IStatus status= x.getStatus(); - if (status == null || status.getSeverity() != IStatus.CANCEL) { - title= EditorMessages.getString("Editor.error.refresh.outofsync.title"); //$NON-NLS-1$ - msg= EditorMessages.getString("Editor.error.refresh.outofsync.message"); //$NON-NLS-1$ - ErrorDialog.openError(shell, title, msg, x.getStatus()); - } + + try { + if (provider instanceof IDocumentProviderExtension) { + IDocumentProviderExtension extension= (IDocumentProviderExtension) provider; + extension.synchronize(input); + } else { + doSetInput(input); + } + } catch (CoreException x) { + IStatus status= x.getStatus(); + if (status == null || status.getSeverity() != IStatus.CANCEL) { + title= EditorMessages.getString("Editor.error.refresh.outofsync.title"); //$NON-NLS-1$ + msg= EditorMessages.getString("Editor.error.refresh.outofsync.message"); //$NON-NLS-1$ + ErrorDialog.openError(shell, title, msg, x.getStatus()); } } } } + } /** * TheAbstractTextEditor
implementation of this
@@ -3557,6 +3648,9 @@ public abstract class AbstractTextEditor extends EditorPart implements ITextEdit
/**
* Performs revert and handles errors appropriately.
+ * + * Subclasses may extend. + *
* * @since 3.0 */ @@ -3586,9 +3680,9 @@ public abstract class AbstractTextEditor extends EditorPart implements ITextEdit } /** - * Performs any additional action necessary to perform after - * the input document's content has been replaced. - *+ * Performs any additional action necessary to perform after the input + * document's content has been replaced. + *
* Clients may extended this method.
*
* @since 3.0
@@ -4652,6 +4746,10 @@ public abstract class AbstractTextEditor extends EditorPart implements ITextEdit
}
/**
+ * Sets the overwrite mode enablement.
+ *
+ * @param enable true
to enable new overwrite mode,
+ * false
to disable
* @since 3.0
*/
protected void enableOverwriteMode(boolean enable) {
diff --git a/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/AnnotationPreference.java b/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/AnnotationPreference.java
index caf2584cadb..74bd58c5387 100644
--- a/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/AnnotationPreference.java
+++ b/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/AnnotationPreference.java
@@ -27,28 +27,50 @@ import org.eclipse.ui.internal.texteditor.TextEditorPlugin;
/**
- * An annotation preference provides all the information required for handing the preferences for the presentation of annotations of a specified type.
- * The provided information covers:
+ * An annotation preference provides all the information required for handing
+ * the preferences for the presentation of annotations of a specified type. The
+ * type can be changed and retrieved using the getAnnotationType
+ * and setAnnotationType
methods. For each preference, getter and
+ * setter methods are provided.
+ *
+ * Preferences that may be changed by the user also have a corresponding key
+ * that can be used to obtain the currently set value from an
+ * IPreferenceStore
.
+ *
IMarker
- * IMarker
- * * If instantiated and used as-is, this contributor connects to all of the workbench defined @@ -270,28 +270,4 @@ public class BasicTextEditorActionContributor extends EditorActionBarContributor doSetActiveEditor(null); super.dispose(); } - - -// /* (non-Javadoc) -// * @see org.eclipse.ui.IEditorActionBarContributor#init(org.eclipse.ui.IActionBars, org.eclipse.ui.IWorkbenchPage) -// */ -// public void init(IActionBars bars, IWorkbenchPage page) { -// -// if (page != null) { -// IWorkbenchWindow window= page.getWorkbenchWindow(); -// if (window instanceof WorkbenchWindow) { -// WorkbenchWindow wWindow= (WorkbenchWindow) window; -// WWinKeyBindingService service= wWindow.getKeyBindingService(); -// if (service != null) { -// service.registerGlobalAction(fFindNext); -// service.registerGlobalAction(fFindPrevious); -// service.registerGlobalAction(fIncrementalFind); -// service.registerGlobalAction(fIncrementalFindReverse); -// service.registerGlobalAction(fGotoLine); -// } -// } -// } -// super.init(bars, page); -// } - } diff --git a/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/ConfigurationElementSorter.java b/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/ConfigurationElementSorter.java index 6f23bdb0bba..5515e5668b8 100644 --- a/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/ConfigurationElementSorter.java +++ b/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/ConfigurationElementSorter.java @@ -34,7 +34,7 @@ import org.osgi.framework.Constants; * Allows to sort an array based on their elements' configuration elements * according to the prerequisite relation of their defining plug-ins. *
- * This class can directly be used or subclassed. + * This class may be subclassed. *
* * @since 3.0 @@ -114,7 +114,7 @@ public abstract class ConfigurationElementSorter { } /** - * Initialize this comarator. + * Initialize this comparator. * * @param elements an array of Java editor hover descriptors */ diff --git a/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/ConvertLineDelimitersAction.java b/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/ConvertLineDelimitersAction.java index 439e2ae671a..4566a80b456 100644 --- a/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/ConvertLineDelimitersAction.java +++ b/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/ConvertLineDelimitersAction.java @@ -33,8 +33,9 @@ import org.eclipse.jface.text.TextUtilities; /** - * An action to convert line delimiters of a text editor document to a particular line - * delimiter. + * An action to convert line delimiters of a text editor document to a + * particular line delimiter. + * * @since 2.0 */ public class ConvertLineDelimitersAction extends TextEditorAction { diff --git a/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/DeleteLineAction.java b/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/DeleteLineAction.java index da8419bd36a..17fde01528f 100644 --- a/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/DeleteLineAction.java +++ b/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/DeleteLineAction.java @@ -58,7 +58,7 @@ public class DeleteLineAction extends TextEditorAction { /** * Creates a line delimiter conversion action. * - * @param bundle the resource bundle for ui strings + * @param bundle the resource bundle for UI strings * @param prefix the prefix for the property keys intobundle
* @param editor the editor
* @param type the line deletion type, must be one of
@@ -71,7 +71,7 @@ public class DeleteLineAction extends TextEditorAction {
/**
* Creates a line deletion action.
*
- * @param bundle the resource bundle for ui strings
+ * @param bundle the resource bundle for UI strings
* @param prefix the prefix for the property keys into bundle
* @param editor the editor
* @param type the line deletion type, must be one of
diff --git a/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/FindNextAction.java b/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/FindNextAction.java
index 6afa1938990..77c51242405 100644
--- a/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/FindNextAction.java
+++ b/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/FindNextAction.java
@@ -36,11 +36,12 @@ import org.eclipse.ui.part.EditorActionBarContributor;
/**
- * An action which finds the next/previous occurrence of the last search or
- * the current selection if present.
+ * An action which finds the next/previous occurrence of the last search or the
+ * current selection if present.
* * This class may be instantiated; it is not intended to be subclassed. *
+ * * @since 2.0 */ public class FindNextAction extends ResourceAction implements IUpdate { @@ -382,7 +383,7 @@ public class FindNextAction extends ResourceAction implements IUpdate { /* * 1GF86V3: ITPUI:WINNT - Internal errors using Find/Replace Dialog - * Now uses TextUtilities rather than focussing on '\n' + * Now uses TextUtilities rather than focusing on '\n' */ String selection= fTarget.getSelectionText(); if (selection != null && selection.length() > 0) { diff --git a/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/IAbstractTextEditorHelpContextIds.java b/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/IAbstractTextEditorHelpContextIds.java index 54e1a33ef50..488f1fbbe1a 100644 --- a/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/IAbstractTextEditorHelpContextIds.java +++ b/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/IAbstractTextEditorHelpContextIds.java @@ -35,10 +35,6 @@ public interface IAbstractTextEditorHelpContextIds { */ public static final String ACTION_POSTFIX= "_action_context"; //$NON-NLS-1$ - - - - /** * Help context id for the action. * Value:"org.eclipse.ui.undo_action_context"
diff --git a/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/IDocumentProvider.java b/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/IDocumentProvider.java
index 35de8b77042..baca61b061d 100644
--- a/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/IDocumentProvider.java
+++ b/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/IDocumentProvider.java
@@ -22,28 +22,44 @@ import org.eclipse.core.runtime.IProgressMonitor;
/**
- * A document provider maps between domain elements and documents.
- * A document provider has the following responsibilities:
+ * A document provider maps between domain elements and documents. A document provider has the
+ * following responsibilities:
*
- * This interface may be implemented by clients; or subclass the standard
- * abstract base class AbstractDocumentProvider
.
AbstractDocumentProvider
.
+ *
+ *
+ * In order to provided backward compatibility for clients of IDocumentProvider
,
+ * extension interfaces are used to provide a means of evolution. The following extension interfaces
+ * exist:
+ *
IDocumentProvider
. It adds the following
+ * Extension interface for {@link IDocumentProvider}. It adds the following
* functions:
* IDocumentProvider
. It adds the following
+ * Extension interface for {@link org.eclipse.ui.texteditor.IDocumentProvider}. It adds the following
* functions:
* IDocumentProvider
. The method
+ * Extension interface for {@link org.eclipse.ui.texteditor.IDocumentProvider}. The method
* isSynchronized
replaces the original getSynchronizationStamp
method.
*
* @since 3.0
diff --git a/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/IElementStateListener.java b/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/IElementStateListener.java
index f9cb3adf540..f1482dcac88 100644
--- a/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/IElementStateListener.java
+++ b/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/IElementStateListener.java
@@ -23,6 +23,17 @@ package org.eclipse.ui.texteditor;
* The notifications sent to the element state listeners inform about those standardized,
* abstract changes. The concrete change applied might differ from the one the listeners
* are notified about, but should be interpreted as the one the listeners receive.
+ *
+ * In order to provided backward compatibility for clients of IElementStateListener
,
+ * extension interfaces are used to provide a means of evolution. The following extension interface
+ * exists:
+ *
IElementStateListener
.
+ * Extension interface for {@link org.eclipse.ui.texteditor.IElementStateListener}.
* It adds
* IFindReplaceTarget
. Extends the find replace target with
- * the concept of state validation.
+ * Extension interface for {@link org.eclipse.jface.text.IFindReplaceTarget}.
+ * Extends the find replace target with the concept of state validation.
*
* @since 2.1
*/
@@ -20,7 +20,7 @@ public interface IFindReplaceTargetExtension2 {
/**
* Validates the state of this target. The predominate intent of this method
- * is to take any action propably necessary to ensure that the target can
+ * is to take any action probably necessary to ensure that the target can
* persistently be changed.
*
* @return true
if the target was validated, false
otherwise
diff --git a/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/IStatusField.java b/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/IStatusField.java
index 3696a620e75..d59a968b95d 100644
--- a/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/IStatusField.java
+++ b/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/IStatusField.java
@@ -16,8 +16,19 @@ import org.eclipse.swt.graphics.Image;
/**
- * Interface of a status field of a text editor. The field that shows up in the
+ * Interface of a status field of a text editor. The field that shows up in the
* workbench's status line if the contributing editor is active.
+ *
+ * In order to provided backward compatibility for clients of
+ * IStatusField
, extension interfaces are used to provide a
+ * means of evolution. The following extension interface exists:
+ *
IStatusField
with the following concepts:
+ * Extends {@link org.eclipse.ui.texteditor.IStatusField} with the following
+ * concepts:
* IEditorPart
as well as the configuration capabilities of a text editor.
+ * IEditorPart
as well as the configuration capabilities of a
+ * text editor.
*
- * Text editors are configured with an IDocumentProvider
which
- * delivers a textual presentation (IDocument
) of the editor's input.
- * The editor works on the document and forwards all input element related calls,
- * such as save
, to the document provider. The provider also delivers
- * the input's annotation model which is used to control the editor's vertical ruler.
IDocumentProvider
which
+ * delivers a textual presentation (IDocument
) of the editor's
+ * input. The editor works on the document and forwards all input element
+ * related calls, such as save
, to the document provider. The
+ * provider also delivers the input's annotation model which is used to control
+ * the editor's vertical ruler.
+ *
+ *
+ * Clients may implement this interface from scratch, but the recommended way is
+ * to subclass the abstract base class AbstractTextEditor
.
+ *
- * Clients may implement this interface from scratch, but the recommended way is to
- * subclass the abstract base class AbstractTextEditor
.
+ * In order to provided backward compatibility for clients of
+ * ITextEditor
, extension interfaces are used to provide a means
+ * of evolution. The following extension interfaces exist:
+ *
"RulerDoubleClick"
@@ -311,7 +309,7 @@ public interface ITextEditorActionConstants extends IWorkbenchActionConstants {
/**
* Status line category "findField".
- * Value: "FindField"
+ * Value: "findField"
* @since 3.0
*/
static final String STATUS_CATEGORY_FIND_FIELD= "findField"; //$NON-NLS-1$
diff --git a/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/ITextEditorActionDefinitionIds.java b/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/ITextEditorActionDefinitionIds.java
index 9b32e9bb2a7..2a09e2ec82d 100644
--- a/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/ITextEditorActionDefinitionIds.java
+++ b/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/ITextEditorActionDefinitionIds.java
@@ -329,7 +329,7 @@ public interface ITextEditorActionDefinitionIds extends IWorkbenchActionDefiniti
// modification
/**
- * Action definition id of the edit delet previous character action.
+ * Action definition id of the edit delete previous character action.
* Value: "org.eclipse.ui.edit.text.deletePrevious"
*/
public static final String DELETE_PREVIOUS= "org.eclipse.ui.edit.text.deletePrevious"; //$NON-NLS-1$
@@ -373,13 +373,13 @@ public interface ITextEditorActionDefinitionIds extends IWorkbenchActionDefiniti
public static final String CONVERT_LINE_DELIMITERS_TO_WINDOWS= "org.eclipse.ui.edit.text.convert.lineDelimiters.toWindows"; //$NON-NLS-1$
/**
- * Action definition id of the edit convert to unix' line delimiter action.
+ * Action definition id of the edit convert to unix line delimiter action.
* Value: "org.eclipse.ui.edit.text.convert.lineDelimiters.toUNIX"
*/
public static final String CONVERT_LINE_DELIMITERS_TO_UNIX= "org.eclipse.ui.edit.text.convert.lineDelimiters.toUNIX"; //$NON-NLS-1$
/**
- * Action definition id of the edit convert to mac' line delimiter action.
+ * Action definition id of the edit convert to mac line delimiter action.
* Value: "org.eclipse.ui.edit.text.convert.lineDelimiters.toMac"
*/
public static final String CONVERT_LINE_DELIMITERS_TO_MAC= "org.eclipse.ui.edit.text.convert.lineDelimiters.toMac"; //$NON-NLS-1$
diff --git a/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/ITextEditorExtension.java b/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/ITextEditorExtension.java
index b362f6aa221..4ca0722a418 100644
--- a/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/ITextEditorExtension.java
+++ b/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/ITextEditorExtension.java
@@ -16,7 +16,8 @@ import org.eclipse.jface.action.IMenuListener;
/**
- * Extension interface for ITextEditor
. Adds the following functions:
+ * Extension interface for {@link org.eclipse.ui.texteditor.ITextEditor}. Adds
+ * the following functions:
* ITextEditor
. Adds the following functions:
+ * Extension interface for {@link org.eclipse.ui.texteditor.ITextEditor}. Adds
+ * the following functions:
* true
if the input was validated, false
otherwise
diff --git a/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/ITextEditorExtension3.java b/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/ITextEditorExtension3.java
index 68ee6624ee5..a780cd2e8a2 100644
--- a/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/ITextEditorExtension3.java
+++ b/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/ITextEditorExtension3.java
@@ -12,9 +12,10 @@
package org.eclipse.ui.texteditor;
/**
- * Extension interface for ITextEditor
. Adds the following functions:
+ * Extension interface for {@link org.eclipse.ui.texteditor.ITextEditor}. Adds
+ * the following functions:
* * diff --git a/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/IncrementalFindAction.java b/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/IncrementalFindAction.java index 5325e518e76..7dbcd0141af 100644 --- a/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/IncrementalFindAction.java +++ b/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/IncrementalFindAction.java @@ -21,7 +21,7 @@ import org.eclipse.ui.IWorkbenchWindow; /** - * An action which enters the incremental find mode à la emacs. + * An action which enters the incremental find mode a la emacs. *
* This class may be instantiated; it is not intended to be subclassed. *
diff --git a/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/InsertLineAction.java b/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/InsertLineAction.java index 5b07a6ec1b7..f5f2e512b1a 100644 --- a/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/InsertLineAction.java +++ b/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/InsertLineAction.java @@ -33,7 +33,7 @@ import org.eclipse.swt.custom.StyledText; *- * This class may be instantiated; it is not intended to be subclassed. - *
*/ public final class RetargetTextEditorAction extends ResourceAction { diff --git a/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/SourceViewerDecorationSupport.java b/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/SourceViewerDecorationSupport.java index bcc870e2a1b..bd659e997c6 100644 --- a/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/SourceViewerDecorationSupport.java +++ b/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/SourceViewerDecorationSupport.java @@ -43,8 +43,41 @@ import org.eclipse.jface.text.source.MatchingCharacterPainter; import org.eclipse.jface.text.source.AnnotationPainter.IDrawingStrategy; /** - * Support for source viewer decoration. + * Support class used by text editors to draw and update decorations on the + * source viewer and its rulers. An instance of this class is independent of a + * certain editor and must be configured with the needed preference keys and + * helper objects before it can be used. + *
+ * Once configured, an instance may be installed (see
+ * {@link #install(IPreferenceStore) install}) on a preference store, from then
+ * on monitoring the configured preference settings and changing the respective
+ * decorations. Calling {@link #uninstall() uninstall} will unregister the
+ * listeners with the preferences store and must be called before changing the
+ * preference store by another call to install
.
+ * {@link #dispose() dispose} will uninstall the support and remove any
+ * decorations from the viewer. It is okay to reuse a
+ * SourceViewerDecorationSupport
instance after disposing it.
+ *
+ * SourceViewerDecorationSupport
can draw the following
+ * decorations:
+ *
+ * Subclasses may add decorations but should adhere to the lifecyle described + * above. + *
* + * @see org.eclipse.jface.text.source.AnnotationPainter * @since 2.1 */ public class SourceViewerDecorationSupport { @@ -896,7 +929,7 @@ public class SourceViewerDecorationSupport { * Enable annotation overview for the given annotation type. * * @param annotationType the annotation type - * @param updatetrue
iff the overview should be updated
+ * @param update true
if the overview should be updated
*/
private void showAnnotationOverview(Object annotationType, boolean update) {
if (fOverviewRuler != null) {
@@ -911,7 +944,7 @@ public class SourceViewerDecorationSupport {
/**
* Hides the annotation overview for the given type.
* @param annotationType the annotation type
- * @param update true
iff the overview should be updated
+ * @param update true
if the overview should be updated
*/
private void hideAnnotationOverview(Object annotationType, boolean update) {
if (fOverviewRuler != null) {
diff --git a/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/TextEditorAction.java b/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/TextEditorAction.java
index 446d2cf1141..9d165c90a11 100644
--- a/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/TextEditorAction.java
+++ b/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/TextEditorAction.java
@@ -19,6 +19,13 @@ import java.util.ResourceBundle;
* but can subsequently be changed using setEditor
.
* Subclasses must implement the run
method and if
* required override the update
method.
+ *
+ * Subclasses that may modify the editor content should use {@link #canModifyEditor()}
+ * in their update
code to check whether updating the editor is most
+ * likely possible (even if it is read-only - this may change for editor contents
+ * that are under version control) and {@link #validateEditorInputState()} before
+ * actually modifying the editor contents.
+ *
+ * This class may be instantiated, it is not intended to be subclassed. + *
* @since 3.0 */ public class QuickDiff { diff --git a/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/templates/TemplatePreferencePage.java b/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/templates/TemplatePreferencePage.java index 03c53f35698..89a56eb9496 100644 --- a/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/templates/TemplatePreferencePage.java +++ b/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/templates/TemplatePreferencePage.java @@ -144,7 +144,7 @@ public abstract class TemplatePreferencePage extends PreferencePage implements I /** The viewer displays the pattern of selected template. */ private SourceViewer fPatternViewer; - /** Format checkbox. This gets conditionaly added. */ + /** Format checkbox. This gets conditionally added. */ private Button fFormatButton; /** The store for our templates. */ private TemplateStore fTemplateStore; @@ -153,7 +153,7 @@ public abstract class TemplatePreferencePage extends PreferencePage implements I /** - * Creates a new template preferenc page. + * Creates a new template preference page. */ protected TemplatePreferencePage() { super(); diff --git a/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/templates/TemplateVariableProcessor.java b/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/templates/TemplateVariableProcessor.java index 94022123b54..ba242a5fa53 100644 --- a/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/templates/TemplateVariableProcessor.java +++ b/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/templates/TemplateVariableProcessor.java @@ -28,6 +28,10 @@ import org.eclipse.jface.text.templates.TemplateVariableResolver; /** * A content assist processor for template variables. + *+ * This class should not be used by clients and may become package visible in + * the future. + *
* * @since 3.0 */ diff --git a/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/templates/TemplateVariableProposal.java b/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/templates/TemplateVariableProposal.java index 1a7e59b6e2e..1e867832ff3 100644 --- a/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/templates/TemplateVariableProposal.java +++ b/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/templates/TemplateVariableProposal.java @@ -24,8 +24,11 @@ import org.eclipse.jface.text.contentassist.IContextInformation; import org.eclipse.jface.text.templates.TemplateVariableResolver; /** - * A proposal for insertion of template variables. Clients ususally do not have - * to instantiate this class. + * A proposal for insertion of template variables. + *+ * This class should not be used by clients and may become package visible in + * the future. + *
* * @since 3.0 */ -- cgit v1.2.3