summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin Muskalla2012-11-16 06:53:13 (EST)
committerSteffen Pingel2013-07-04 17:09:42 (EDT)
commit4de53483f9cbdc8556101045d7dfa4d3402caf54 (patch)
tree0fc91a8cb9d991ef94293eba56619ec278cba32e
parentf82af84a906206b9f3cdbf92132bf0db1f4832f9 (diff)
downloadorg.eclipse.mylyn.tasks-4de53483f9cbdc8556101045d7dfa4d3402caf54.zip
org.eclipse.mylyn.tasks-4de53483f9cbdc8556101045d7dfa4d3402caf54.tar.gz
org.eclipse.mylyn.tasks-4de53483f9cbdc8556101045d7dfa4d3402caf54.tar.bz2
386764: [api] TaskMapping should be able to handle custom attributesrefs/changes/35/8735/9
Added new API called TaskInitializationData to provide common mutators for ITaskMapping to be used for task data initialization. Also-By: Steffen Pingel <steffen.pingel@tasktop.com> Change-Id: I13c88b5e33a8ab097953833627383ae85cfa692f Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=386764 Signed-off-by: Benjamin Muskalla <benjamin.muskalla@tasktop.com>
-rw-r--r--org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaTaskDataHandlerTest.java4
-rw-r--r--org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/DefaultTaskMapping.java3
-rw-r--r--org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/TaskInitializationData.java249
-rw-r--r--org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/data/AbstractTaskDataHandler.java12
-rw-r--r--org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/AllTasksTests.java2
-rw-r--r--org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/core/TaskInitializationDataTest.java126
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/CloneTaskAction.java48
7 files changed, 421 insertions, 23 deletions
diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaTaskDataHandlerTest.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaTaskDataHandlerTest.java
index d99d53f..32cf291 100644
--- a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaTaskDataHandlerTest.java
+++ b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/tests/BugzillaTaskDataHandlerTest.java
@@ -18,8 +18,8 @@ import org.eclipse.mylyn.commons.sdk.util.CommonTestUtil.PrivilegeLevel;
import org.eclipse.mylyn.internal.bugzilla.core.BugzillaAttribute;
import org.eclipse.mylyn.internal.bugzilla.core.BugzillaRepositoryConnector;
import org.eclipse.mylyn.internal.bugzilla.core.IBugzillaConstants;
-import org.eclipse.mylyn.internal.tasks.core.DefaultTaskMapping;
import org.eclipse.mylyn.tasks.core.ITaskMapping;
+import org.eclipse.mylyn.tasks.core.TaskInitializationData;
import org.eclipse.mylyn.tasks.core.TaskMapping;
import org.eclipse.mylyn.tasks.core.TaskRepository;
import org.eclipse.mylyn.tasks.core.data.AbstractTaskDataHandler;
@@ -48,7 +48,7 @@ public class BugzillaTaskDataHandlerTest extends TestCase {
"test description for clone");
taskData.getRoot().getMappedAttribute(TaskAttribute.PRIORITY).setValue("P5");
ITaskMapping mapping = connector.getTaskMapping(taskData);
- DefaultTaskMapping taskSelection = new DefaultTaskMapping();
+ TaskInitializationData taskSelection = new TaskInitializationData();
taskSelection.setDescription("Test description");
TaskAttribute attrDescription = mapping.getTaskData().getRoot().getMappedAttribute(TaskAttribute.DESCRIPTION);
diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/DefaultTaskMapping.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/DefaultTaskMapping.java
index a4bbceb..cfdbf42 100644
--- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/DefaultTaskMapping.java
+++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/DefaultTaskMapping.java
@@ -14,12 +14,15 @@ package org.eclipse.mylyn.internal.tasks.core;
import java.util.HashMap;
import java.util.Map;
+import org.eclipse.mylyn.tasks.core.TaskInitializationData;
import org.eclipse.mylyn.tasks.core.TaskMapping;
import org.eclipse.mylyn.tasks.core.data.TaskAttribute;
/**
* @author Steffen Pingel
+ * @deprecated use {@link TaskInitializationData} instead
*/
+@Deprecated
public class DefaultTaskMapping extends TaskMapping {
public Map<String, String> values = new HashMap<String, String>();
diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/TaskInitializationData.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/TaskInitializationData.java
new file mode 100644
index 0000000..6f8e4ea
--- /dev/null
+++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/TaskInitializationData.java
@@ -0,0 +1,249 @@
+/*******************************************************************************
+ * Copyright (c) 2012 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.tasks.core;
+
+import java.util.Date;
+import java.util.List;
+
+import org.eclipse.jdt.annotation.NonNull;
+import org.eclipse.jdt.annotation.Nullable;
+import org.eclipse.mylyn.internal.tasks.core.AttributeMap;
+import org.eclipse.mylyn.tasks.core.ITask.PriorityLevel;
+import org.eclipse.mylyn.tasks.core.data.AbstractTaskDataHandler;
+import org.eclipse.mylyn.tasks.core.data.TaskAttribute;
+import org.eclipse.mylyn.tasks.core.data.TaskData;
+
+/**
+ * TaskInitialzationData should be used as alternative to implementing {@link ITaskMapping} when passing initialization
+ * data into {@link AbstractTaskDataHandler#initializeTaskData()}. It provides common accessors and mutators for a set
+ * of fields used during task data initialization. Only attributes of type {@link String} are supported, other accessors
+ * throw {@link UnsupportedOperationException} as documented for each method.
+ *
+ * @author Benjamin Muskalla
+ * @since 3.10
+ * @noextend This class is not intended to be subclassed by clients.
+ */
+public class TaskInitializationData implements ITaskMapping {
+
+ private final AttributeMap attributesById = new AttributeMap();
+
+ @Nullable
+ public String getAttribute(String key) {
+ return attributesById.getAttribute(key);
+ }
+
+ /**
+ * Throws {@link UnsupportedOperationException}.
+ */
+ @Nullable
+ public List<String> getCc() {
+ throw new UnsupportedOperationException();
+ }
+
+ /**
+ * Throws {@link UnsupportedOperationException}.
+ */
+ @Nullable
+ public Date getCompletionDate() {
+ throw new UnsupportedOperationException();
+ }
+
+ @Nullable
+ public String getComponent() {
+ return attributesById.getAttribute(TaskAttribute.COMPONENT);
+ }
+
+ /**
+ * Throws {@link UnsupportedOperationException}.
+ */
+ @Nullable
+ public Date getCreationDate() {
+ throw new UnsupportedOperationException();
+ }
+
+ @Nullable
+ public String getDescription() {
+ return attributesById.getAttribute(TaskAttribute.DESCRIPTION);
+ }
+
+ /**
+ * Throws {@link UnsupportedOperationException}.
+ */
+ @Nullable
+ public Date getDueDate() {
+ throw new UnsupportedOperationException();
+ }
+
+ /**
+ * Throws {@link UnsupportedOperationException}.
+ */
+ @Nullable
+ public List<String> getKeywords() {
+ throw new UnsupportedOperationException();
+ }
+
+ /**
+ * Throws {@link UnsupportedOperationException}.
+ */
+ @Nullable
+ public Date getModificationDate() {
+ throw new UnsupportedOperationException();
+ }
+
+ /**
+ * Throws {@link UnsupportedOperationException}.
+ */
+ @Nullable
+ public String getOwner() {
+ throw new UnsupportedOperationException();
+ }
+
+ @Nullable
+ public String getPriority() {
+ return attributesById.getAttribute(TaskAttribute.PRIORITY);
+ }
+
+ /**
+ * Throws {@link UnsupportedOperationException}.
+ */
+ @Nullable
+ public PriorityLevel getPriorityLevel() {
+ throw new UnsupportedOperationException();
+ }
+
+ @Nullable
+ public String getProduct() {
+ return attributesById.getAttribute(TaskAttribute.PRODUCT);
+ }
+
+ @Nullable
+ public String getReporter() {
+ return attributesById.getAttribute(TaskAttribute.USER_REPORTER);
+ }
+
+ @Nullable
+ public String getResolution() {
+ return attributesById.getAttribute(TaskAttribute.RESOLUTION);
+ }
+
+ @Nullable
+ public String getSeverity() {
+ return attributesById.getAttribute(TaskAttribute.SEVERITY);
+ }
+
+ @Nullable
+ public String getStatus() {
+ return attributesById.getAttribute(TaskAttribute.STATUS);
+ }
+
+ @Nullable
+ public String getSummary() {
+ return attributesById.getAttribute(TaskAttribute.SUMMARY);
+ }
+
+ /**
+ * Throws {@link UnsupportedOperationException}.
+ */
+ @Nullable
+ public TaskData getTaskData() {
+ throw new UnsupportedOperationException();
+ }
+
+ @Nullable
+ public String getTaskKey() {
+ return attributesById.getAttribute(TaskAttribute.TASK_KEY);
+ }
+
+ @Nullable
+ public String getTaskKind() {
+ return attributesById.getAttribute(TaskAttribute.TASK_KIND);
+ }
+
+ /**
+ * Does not map to a common attribute and hence throws {@link UnsupportedOperationException}.
+ */
+ @Nullable
+ public String getTaskStatus() {
+ throw new UnsupportedOperationException();
+ }
+
+ @Nullable
+ public String getTaskUrl() {
+ return attributesById.getAttribute(TaskAttribute.TASK_URL);
+ }
+
+ @Nullable
+ public String getVersion() {
+ return attributesById.getAttribute(TaskAttribute.VERSION);
+ }
+
+ /**
+ * Throws {@link UnsupportedOperationException}.
+ */
+ @Nullable
+ public void merge(ITaskMapping source) {
+ throw new UnsupportedOperationException();
+ }
+
+ public void setAttribute(@NonNull String key, @Nullable String value) {
+ attributesById.setAttribute(key, value);
+ }
+
+ public void setComponent(@Nullable String newComponent) {
+ attributesById.setAttribute(TaskAttribute.COMPONENT, newComponent);
+ }
+
+ public void setDescription(@Nullable String description) {
+ attributesById.setAttribute(TaskAttribute.DESCRIPTION, description);
+ }
+
+ public void setPriority(@Nullable String priority) {
+ attributesById.setAttribute(TaskAttribute.PRIORITY, priority);
+ }
+
+ public void setProduct(@Nullable String product) {
+ attributesById.setAttribute(TaskAttribute.PRODUCT, product);
+ }
+
+ public void setResolution(@Nullable String resolution) {
+ attributesById.setAttribute(TaskAttribute.RESOLUTION, resolution);
+ }
+
+ public void setSeverity(@Nullable String severity) {
+ attributesById.setAttribute(TaskAttribute.SEVERITY, severity);
+ }
+
+ public void setStatus(@Nullable String status) {
+ attributesById.setAttribute(TaskAttribute.STATUS, status);
+ }
+
+ public void setSummary(@Nullable String summary) {
+ attributesById.setAttribute(TaskAttribute.SUMMARY, summary);
+ }
+
+ public void setTaskKey(@Nullable String taskKey) {
+ attributesById.setAttribute(TaskAttribute.TASK_KEY, taskKey);
+ }
+
+ public void setTaskKind(@Nullable String taskKind) {
+ attributesById.setAttribute(TaskAttribute.TASK_KIND, taskKind);
+ }
+
+ public void setTaskUrl(@Nullable String newKind) {
+ attributesById.setAttribute(TaskAttribute.TASK_URL, newKind);
+ }
+
+ public void setVersion(@Nullable String version) {
+ attributesById.setAttribute(TaskAttribute.VERSION, version);
+ }
+
+}
diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/data/AbstractTaskDataHandler.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/data/AbstractTaskDataHandler.java
index 05d70a2..a3781ab 100644
--- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/data/AbstractTaskDataHandler.java
+++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/tasks/core/data/AbstractTaskDataHandler.java
@@ -21,6 +21,7 @@ import org.eclipse.jdt.annotation.Nullable;
import org.eclipse.mylyn.tasks.core.ITask;
import org.eclipse.mylyn.tasks.core.ITaskMapping;
import org.eclipse.mylyn.tasks.core.RepositoryResponse;
+import org.eclipse.mylyn.tasks.core.TaskInitializationData;
import org.eclipse.mylyn.tasks.core.TaskRepository;
/**
@@ -55,6 +56,17 @@ public abstract class AbstractTaskDataHandler {
/**
* Initialize a new task data object with default attributes and values
*
+ * @param repository
+ * The {@code TaskRepository} the taskdata belongs to.
+ * @param data
+ * The {@code TaskData} to be initialized
+ * @param initializationData
+ * the {@link ITaskMapping} to initialize the {@link TaskData}. It is recommended to pass in a
+ * {@link TaskInitializationData}.
+ * @param monitor
+ * The {@link IProgressMonitor} that will be used during initialization.
+ * @return whether the initialization of the {@code TaskData} was successful. Implementations can alternativly throw
+ * a {@code CoreException} with further details.
* @since 3.0
*/
public abstract boolean initializeTaskData(@NonNull TaskRepository repository, @NonNull TaskData data,
diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/AllTasksTests.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/AllTasksTests.java
index f118023..1cc3127 100644
--- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/AllTasksTests.java
+++ b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/AllTasksTests.java
@@ -21,6 +21,7 @@ import org.eclipse.mylyn.tasks.tests.core.PriorityLevelTest;
import org.eclipse.mylyn.tasks.tests.core.RepositoryClientManagerTest;
import org.eclipse.mylyn.tasks.tests.core.RepositoryConnectorContributorTest;
import org.eclipse.mylyn.tasks.tests.core.SynchronizeTasksJobTest;
+import org.eclipse.mylyn.tasks.tests.core.TaskInitializationDataTest;
import org.eclipse.mylyn.tasks.tests.core.TaskListUnmatchedContainerTest;
import org.eclipse.mylyn.tasks.tests.core.TaskRepositoryLocationTest;
import org.eclipse.mylyn.tasks.tests.core.TaskRepositoryTest;
@@ -141,6 +142,7 @@ public class AllTasksTests {
suite.addTestSuite(TaskAttributeTest.class);
suite.addTestSuite(ScheduledTaskContainerTest.class);
suite.addTestSuite(RepositoryConnectorContributorTest.class);
+ suite.addTestSuite(TaskInitializationDataTest.class);
return suite;
}
diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/core/TaskInitializationDataTest.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/core/TaskInitializationDataTest.java
new file mode 100644
index 0000000..3da37a2
--- /dev/null
+++ b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/core/TaskInitializationDataTest.java
@@ -0,0 +1,126 @@
+/*******************************************************************************
+ * Copyright (c) 2012 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.tasks.tests.core;
+
+import junit.framework.TestCase;
+
+import org.eclipse.mylyn.tasks.core.TaskInitializationData;
+import org.eclipse.mylyn.tasks.core.data.TaskAttribute;
+
+/**
+ * @author Benjamin Muskalla
+ */
+public class TaskInitializationDataTest extends TestCase {
+
+ private TaskInitializationData data;
+
+ @Override
+ protected void setUp() throws Exception {
+ data = new TaskInitializationData();
+ }
+
+ public void testNotSupported() {
+ try {
+ data.merge(null);
+ fail("Should not be supported");
+ } catch (UnsupportedOperationException e) {
+ // expected
+ }
+ try {
+ data.getTaskStatus();
+ fail("Should not be supported");
+ } catch (UnsupportedOperationException e) {
+ // expected
+ }
+ try {
+ data.getTaskData();
+ fail("Should not be supported");
+ } catch (UnsupportedOperationException e) {
+ // expected
+ }
+ try {
+ data.getPriorityLevel();
+ fail("Should not be supported");
+ } catch (UnsupportedOperationException e) {
+ // expected
+ }
+ try {
+ data.getModificationDate();
+ fail("Should not be supported");
+ } catch (UnsupportedOperationException e) {
+ // expected
+ }
+ try {
+ data.getKeywords();
+ fail("Should not be supported");
+ } catch (UnsupportedOperationException e) {
+ // expected
+ }
+ try {
+ data.getDueDate();
+ fail("Should not be supported");
+ } catch (UnsupportedOperationException e) {
+ // expected
+ }
+ try {
+ data.getCreationDate();
+ fail("Should not be supported");
+ } catch (UnsupportedOperationException e) {
+ // expected
+ }
+ try {
+ data.getCompletionDate();
+ fail("Should not be supported");
+ } catch (UnsupportedOperationException e) {
+ // expected
+ }
+ try {
+ data.getCc();
+ fail("Should not be supported");
+ } catch (UnsupportedOperationException e) {
+ // expected
+ }
+ }
+
+ public void testTaskKind() throws Exception {
+ data.setTaskKind("foo");
+ assertEquals("foo", data.getTaskKind());
+ assertEquals("foo", data.getAttribute(TaskAttribute.TASK_KIND));
+ }
+
+ public void testProduct() throws Exception {
+ data.setProduct("product");
+ assertEquals("product", data.getProduct());
+ assertEquals("product", data.getAttribute(TaskAttribute.PRODUCT));
+ }
+
+ public void testComponent() throws Exception {
+ data.setComponent("component");
+ assertEquals("component", data.getComponent());
+ assertEquals("component", data.getAttribute(TaskAttribute.COMPONENT));
+ }
+
+ public void testSetAttributeComponent() throws Exception {
+ data.setAttribute(TaskAttribute.COMPONENT, "component");
+ assertEquals("component", data.getComponent());
+ assertEquals("component", data.getAttribute(TaskAttribute.COMPONENT));
+ }
+
+ public void testGetAttribute() throws Exception {
+ assertNull(data.getAttribute("custom"));
+ data.setAttribute("custom", "value");
+ assertEquals("value", data.getAttribute("custom"));
+ data.setAttribute("custom", null);
+ assertNull(data.getAttribute("custom"));
+ }
+
+}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/CloneTaskAction.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/CloneTaskAction.java
index b8b7ad6..1ed7445 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/CloneTaskAction.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/CloneTaskAction.java
@@ -17,11 +17,11 @@ import org.eclipse.jface.action.IAction;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.mylyn.internal.tasks.core.AbstractTask;
-import org.eclipse.mylyn.internal.tasks.core.DefaultTaskMapping;
import org.eclipse.mylyn.internal.tasks.core.LocalTask;
import org.eclipse.mylyn.internal.tasks.ui.util.TasksUiInternal;
import org.eclipse.mylyn.tasks.core.AbstractRepositoryConnector;
import org.eclipse.mylyn.tasks.core.ITaskMapping;
+import org.eclipse.mylyn.tasks.core.TaskInitializationData;
import org.eclipse.mylyn.tasks.core.data.TaskAttribute;
import org.eclipse.mylyn.tasks.core.data.TaskData;
import org.eclipse.mylyn.tasks.ui.TasksUi;
@@ -68,8 +68,8 @@ public class CloneTaskAction extends BaseSelectionListenerAction implements IVie
}
}
- ITaskMapping taskSelection = new DefaultTaskMapping();
- ((DefaultTaskMapping) taskSelection).setDescription(description);
+ TaskInitializationData initializationData = new TaskInitializationData();
+ initializationData.setDescription(description);
TaskData taskData;
try {
@@ -79,24 +79,7 @@ public class CloneTaskAction extends BaseSelectionListenerAction implements IVie
continue;
}
- if (taskData != null) {
- AbstractRepositoryConnector connector = TasksUi.getRepositoryConnector(taskData.getConnectorKind());
- ITaskMapping mapping = connector.getTaskMapping(taskData);
- if (mapping.getDescription() != null) {
- ((DefaultTaskMapping) taskSelection).setDescription(description + "\n\n" //$NON-NLS-1$
- + mapping.getDescription());
-
- TaskAttribute attrDescription = mapping.getTaskData()
- .getRoot()
- .getMappedAttribute(TaskAttribute.DESCRIPTION);
- if (attrDescription != null) {
- attrDescription.getMetaData().setReadOnly(false);
- }
-
- }
- mapping.merge(taskSelection);
- taskSelection = mapping;
- }
+ ITaskMapping taskSelection = getTaskMapping(initializationData, taskData);
Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
if (!TasksUiUtil.openNewTaskEditor(shell, taskSelection, null)) {
@@ -107,6 +90,29 @@ public class CloneTaskAction extends BaseSelectionListenerAction implements IVie
}
}
+ public ITaskMapping getTaskMapping(TaskInitializationData initializationData, TaskData taskData) {
+ if (taskData != null) {
+ AbstractRepositoryConnector connector = TasksUi.getRepositoryConnector(taskData.getConnectorKind());
+ ITaskMapping mapping = connector.getTaskMapping(taskData);
+ if (mapping.getDescription() != null) {
+ initializationData.setDescription(initializationData.getDescription() + "\n\n" //$NON-NLS-1$
+ + mapping.getDescription());
+
+ TaskAttribute attrDescription = mapping.getTaskData()
+ .getRoot()
+ .getMappedAttribute(TaskAttribute.DESCRIPTION);
+ if (attrDescription != null) {
+ attrDescription.getMetaData().setReadOnly(false);
+ }
+
+ }
+ mapping.merge(initializationData);
+ return mapping;
+ } else {
+ return initializationData;
+ }
+ }
+
public void run(IAction action) {
run();
}