summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrank Becker2018-03-10 12:23:16 -0500
committerFrank Becker2018-06-18 15:26:07 -0400
commitb65458b4c9707dcbbc0deaca9b65508f0b5c1a20 (patch)
tree7ba534ac67089d1d865ae89f561f62d31b1672f0
parent9a7b4807f5dc6062d1834e763943cd09ef24d77e (diff)
downloadorg.eclipse.mylyn.tasks-b65458b4c9707dcbbc0deaca9b65508f0b5c1a20.tar.gz
org.eclipse.mylyn.tasks-b65458b4c9707dcbbc0deaca9b65508f0b5c1a20.tar.xz
org.eclipse.mylyn.tasks-b65458b4c9707dcbbc0deaca9b65508f0b5c1a20.zip
532275: store the template property values in the task repository
Change-Id: I263dc190aba5cdb8556fe7ba2ffac5f62f731ce8 Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=532275
-rw-r--r--org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/IRepositoryConstants.java2
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TasksUiPlugin.java21
2 files changed, 14 insertions, 9 deletions
diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/IRepositoryConstants.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/IRepositoryConstants.java
index b22848d67..c5c3b2c52 100644
--- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/IRepositoryConstants.java
+++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/IRepositoryConstants.java
@@ -67,4 +67,6 @@ public interface IRepositoryConstants {
public static final String CATEGORY_OTHER = "org.eclipse.mylyn.category.other"; //$NON-NLS-1$
+ public static final String TEMPLATE_VALUE_PREFIX = "template.value.prefix."; //$NON-NLS-1$
+
}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TasksUiPlugin.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TasksUiPlugin.java
index ef7f09191..bb9702d90 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TasksUiPlugin.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TasksUiPlugin.java
@@ -66,6 +66,7 @@ import org.eclipse.mylyn.internal.discovery.ui.DiscoveryUi;
import org.eclipse.mylyn.internal.monitor.ui.MonitorUiPlugin;
import org.eclipse.mylyn.internal.tasks.core.AbstractSearchHandler;
import org.eclipse.mylyn.internal.tasks.core.AbstractTask;
+import org.eclipse.mylyn.internal.tasks.core.IRepositoryConstants;
import org.eclipse.mylyn.internal.tasks.core.IRepositoryModelListener;
import org.eclipse.mylyn.internal.tasks.core.ITasksCoreConstants;
import org.eclipse.mylyn.internal.tasks.core.LocalRepositoryConnector;
@@ -740,6 +741,11 @@ public class TasksUiPlugin extends AbstractUIPlugin {
repositoryManager.addRepository(taskRepository);
repositoryManager.applyMigrators(taskRepository);
}
+ Map<String, String> templateAttributes = template.getAttributes();
+ for (Map.Entry<String, String> entry : templateAttributes.entrySet()) {
+ taskRepository.setProperty(IRepositoryConstants.TEMPLATE_VALUE_PREFIX + entry.getKey(),
+ entry.getValue());
+ }
} catch (Throwable t) {
StatusHandler.log(new Status(IStatus.WARNING, TasksUiPlugin.ID_PLUGIN, NLS.bind(
"Could not load repository template for repository {0}", template.repositoryUrl), t)); //$NON-NLS-1$
@@ -923,17 +929,15 @@ public class TasksUiPlugin extends AbstractUIPlugin {
}
}
- if (!MonitorUiPlugin.getDefault()
- .getPreferenceStore()
- .getBoolean(MonitorUiPlugin.ACTIVITY_TRACKING_ENABLED + ".checked")) { //$NON-NLS-1$
+ if (!MonitorUiPlugin.getDefault().getPreferenceStore().getBoolean(
+ MonitorUiPlugin.ACTIVITY_TRACKING_ENABLED + ".checked")) { //$NON-NLS-1$
if (!taskActivityMonitor.getActivationHistory().isEmpty()) {
// tasks have been active before so fore preference enabled
MonitorUiPlugin.getDefault().getPreferenceStore().setValue(MonitorUiPlugin.ACTIVITY_TRACKING_ENABLED,
true);
}
- MonitorUiPlugin.getDefault()
- .getPreferenceStore()
- .setValue(MonitorUiPlugin.ACTIVITY_TRACKING_ENABLED + ".checked", true); //$NON-NLS-1$
+ MonitorUiPlugin.getDefault().getPreferenceStore().setValue(
+ MonitorUiPlugin.ACTIVITY_TRACKING_ENABLED + ".checked", true); //$NON-NLS-1$
MonitorUiPlugin.getDefault().savePluginPreferences();
}
@@ -1008,9 +1012,8 @@ public class TasksUiPlugin extends AbstractUIPlugin {
}
public boolean groupSubtasks(ITaskContainer element) {
- boolean groupSubtasks = TasksUiPlugin.getDefault()
- .getPreferenceStore()
- .getBoolean(ITasksUiPreferenceConstants.GROUP_SUBTASKS);
+ boolean groupSubtasks = TasksUiPlugin.getDefault().getPreferenceStore().getBoolean(
+ ITasksUiPreferenceConstants.GROUP_SUBTASKS);
if (element instanceof ITask) {
AbstractRepositoryConnectorUi connectorUi = TasksUiPlugin