Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKai Maetzel2004-03-16 17:28:18 +0000
committerKai Maetzel2004-03-16 17:28:18 +0000
commit6bb3934f89c76d8ad009d0dc8764134fe0255917 (patch)
treebed13655f18a778a6541d4eaae624ac74c3957cb /org.eclipse.ui.editors
parent9e61e462e164d0305f13d0a1656e745653011cdb (diff)
downloadeclipse.platform.text-6bb3934f89c76d8ad009d0dc8764134fe0255917.tar.gz
eclipse.platform.text-6bb3934f89c76d8ad009d0dc8764134fe0255917.tar.xz
eclipse.platform.text-6bb3934f89c76d8ad009d0dc8764134fe0255917.zip
clean up
Diffstat (limited to 'org.eclipse.ui.editors')
-rw-r--r--org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/TextEditor.java13
-rw-r--r--org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/ExtendedTextEditor.java6
2 files changed, 16 insertions, 3 deletions
diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/TextEditor.java b/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/TextEditor.java
index 52781be84..5533346d5 100644
--- a/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/TextEditor.java
+++ b/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/TextEditor.java
@@ -71,13 +71,22 @@ public class TextEditor extends ExtendedTextEditor {
*/
public TextEditor() {
super();
+ if (getSourceViewerConfiguration() == null) {
+ // configuration not yet set by subclass
+ setSourceViewerConfiguration(new TextSourceViewerConfiguration(getNewPreferenceStore()));
+ }
+
}
/**
- * Initializes this editor.
+ * @inheritDoc
+ *
+ * This method configures the editor but does not define a
+ * <code>SourceViewerConfiguration</code>. When only interested in
+ * providing a custom source viewer configuration, subclasses may extend
+ * this method.
*/
protected void initializeEditor() {
- setSourceViewerConfiguration(new TextSourceViewerConfiguration(getNewPreferenceStore()));
setEditorContextMenuId("#TextEditorContext"); //$NON-NLS-1$
setRulerContextMenuId("#TextRulerContext"); //$NON-NLS-1$
setHelpContextId(ITextEditorHelpContextIds.TEXT_EDITOR);
diff --git a/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/ExtendedTextEditor.java b/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/ExtendedTextEditor.java
index 62cda150b..51e921259 100644
--- a/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/ExtendedTextEditor.java
+++ b/org.eclipse.ui.editors/src/org/eclipse/ui/texteditor/ExtendedTextEditor.java
@@ -181,7 +181,11 @@ public abstract class ExtendedTextEditor extends StatusTextEditor {
}
/**
- * Initializes this editor.
+ * Initializes this editor. Subclasses may re-implement. If sub-classes do
+ * not change the contract, this method should not be extended, i.e. do not
+ * call <code>super.initializeEditor()</code> in order to avoid the
+ * temporary creation of objects that are immediately overwritten by
+ * subclasses.
*/
protected void initializeEditor() {
setPreferenceStore(EditorsPlugin.getDefault().getPreferenceStore());

Back to the top