Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSam Davis2015-05-29 16:51:14 +0000
committerSam Davis2015-05-29 16:51:14 +0000
commitf59937ca20402419dcd3caf4e52e58353fec1cac (patch)
treee8869dd0577e5c7cab20ef02de894f431d6c5723
parentd94377deedc3698c8952ce87c8744783a5d84440 (diff)
downloadorg.eclipse.mylyn.tasks-f59937ca20402419dcd3caf4e52e58353fec1cac.tar.gz
org.eclipse.mylyn.tasks-f59937ca20402419dcd3caf4e52e58353fec1cac.tar.xz
org.eclipse.mylyn.tasks-f59937ca20402419dcd3caf4e52e58353fec1cac.zip
423848: move RepositoryTextViewerConfiguration reference to new class
Change-Id: I6872754a4ed407216884aaf116069027d867b560 Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=423848
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/RichTextEditor.java8
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/ViewerConfigurator.java27
2 files changed, 31 insertions, 4 deletions
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/RichTextEditor.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/RichTextEditor.java
index 7ccdf3fde..51e4683e6 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/RichTextEditor.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/RichTextEditor.java
@@ -29,6 +29,7 @@ import org.eclipse.jface.text.source.AnnotationModel;
import org.eclipse.jface.text.source.IAnnotationAccess;
import org.eclipse.jface.text.source.ISourceViewer;
import org.eclipse.jface.text.source.SourceViewer;
+import org.eclipse.jface.text.source.SourceViewerConfiguration;
import org.eclipse.mylyn.commons.ui.FillWidthLayout;
import org.eclipse.mylyn.commons.ui.compatibility.CommonThemes;
import org.eclipse.mylyn.commons.workbench.editors.CommonTextSupport;
@@ -339,10 +340,9 @@ public class RichTextEditor {
}
private void configureDefaultEditor(SourceViewer defaultEditor) {
- RepositoryTextViewerConfiguration viewerConfig = new RepositoryTextViewerConfiguration(repository, task,
- isSpellCheckingEnabled() && !isReadOnly());
- viewerConfig.setMode(getMode());
- defaultEditor.configure(viewerConfig);
+ SourceViewerConfiguration configuration = ViewerConfigurator.configure(repository, task,
+ isSpellCheckingEnabled() && !isReadOnly(), getMode());
+ defaultEditor.configure(configuration);
}
private BrowserPreviewViewer getBrowserViewer() {
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/ViewerConfigurator.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/ViewerConfigurator.java
new file mode 100644
index 000000000..cc4b2eb5d
--- /dev/null
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/ViewerConfigurator.java
@@ -0,0 +1,27 @@
+/*******************************************************************************
+ * Copyright (c) 2015 Tasktop Technologies and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Tasktop Technologies - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.mylyn.internal.tasks.ui.editors;
+
+import org.eclipse.jface.text.source.SourceViewerConfiguration;
+import org.eclipse.mylyn.internal.tasks.ui.editors.RepositoryTextViewerConfiguration.Mode;
+import org.eclipse.mylyn.tasks.core.ITask;
+import org.eclipse.mylyn.tasks.core.TaskRepository;
+
+class ViewerConfigurator {
+
+ static SourceViewerConfiguration configure(TaskRepository repository, ITask task, boolean spellCheck, Mode mode) {
+ RepositoryTextViewerConfiguration viewerConfig = new RepositoryTextViewerConfiguration(repository, task,
+ spellCheck);
+ viewerConfig.setMode(mode);
+ return viewerConfig;
+ }
+}

Back to the top