Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordonald.g.dunne2018-06-14 12:28:53 -0400
committerDonald Dunne2018-06-26 10:26:01 -0400
commit08d69e4cd80cc3ab8e4e0a23853d19af124a400f (patch)
treeec40c1527108a97aa6fa864bd0056315d43e6eb7
parenta596368dd4214f48d96347de173b9f34e635c3c4 (diff)
downloadorg.eclipse.osee-08d69e4cd80cc3ab8e4e0a23853d19af124a400f.tar.gz
org.eclipse.osee-08d69e4cd80cc3ab8e4e0a23853d19af124a400f.tar.xz
org.eclipse.osee-08d69e4cd80cc3ab8e4e0a23853d19af124a400f.zip
feature: Add ability to create task from WorldView
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/AddTaskAction.java42
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/task/TaskXViewer.java4
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldXViewer.java8
3 files changed, 54 insertions, 0 deletions
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/AddTaskAction.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/AddTaskAction.java
new file mode 100644
index 0000000000..872beabd09
--- /dev/null
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/actions/AddTaskAction.java
@@ -0,0 +1,42 @@
+/*******************************************************************************
+ * Copyright (c) 2018 Boeing.
+ * 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:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.ats.actions;
+
+import java.util.Set;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.osee.ats.AtsImage;
+import org.eclipse.osee.ats.workflow.task.TaskXViewer;
+import org.eclipse.osee.ats.workflow.teamwf.TeamWorkFlowArtifact;
+import org.eclipse.osee.framework.ui.swt.ImageManager;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class AddTaskAction extends AbstractAtsAction {
+ private final ISelectedTeamWorkflowArtifacts selectedTeamWfs;
+
+ public AddTaskAction(ISelectedTeamWorkflowArtifacts selectedTeamWfs) {
+ super("Add Task", IAction.AS_PUSH_BUTTON);
+ this.selectedTeamWfs = selectedTeamWfs;
+ setImageDescriptor(ImageManager.getImageDescriptor(AtsImage.TEAM_WORKFLOW));
+ setToolTipText(getText());
+ }
+
+ public void updateEnablement(Set<TeamWorkFlowArtifact> set) {
+ setEnabled(set.size() == 1 && set.iterator().next().isInWork());
+ }
+
+ @Override
+ public void run() {
+ TaskXViewer.handleNewTask(selectedTeamWfs.getSelectedTeamWorkflowArtifacts().iterator().next());
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/task/TaskXViewer.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/task/TaskXViewer.java
index 8910340db9..95b0551ab3 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/task/TaskXViewer.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/workflow/task/TaskXViewer.java
@@ -123,6 +123,10 @@ public class TaskXViewer extends WorldXViewer {
}
public TaskArtifact handleNewTask() {
+ return handleNewTask(teamWf);
+ }
+
+ public static TaskArtifact handleNewTask(IAtsTeamWorkflow teamWf) {
TaskArtifact taskArt = null;
try {
EntryComboDialog ed = new EntryComboDialog("Create New Task", "Enter Task Title",
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldXViewer.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldXViewer.java
index 10b0f3c566..7ec4afddbd 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldXViewer.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/world/WorldXViewer.java
@@ -32,6 +32,7 @@ import org.eclipse.nebula.widgets.xviewer.XViewerTextFilter;
import org.eclipse.nebula.widgets.xviewer.action.ColumnMultiEditAction;
import org.eclipse.nebula.widgets.xviewer.core.model.XViewerColumn;
import org.eclipse.nebula.widgets.xviewer.customize.XViewerCustomMenu;
+import org.eclipse.osee.ats.actions.AddTaskAction;
import org.eclipse.osee.ats.actions.DeletePurgeAtsArtifactsAction;
import org.eclipse.osee.ats.actions.DeleteTasksAction;
import org.eclipse.osee.ats.actions.DeleteTasksAction.TaskArtifactProvider;
@@ -155,6 +156,7 @@ public class WorldXViewer extends XViewer implements ISelectedAtsArtifacts, IPer
EmailActionAction emailAction;
Action resetActionArtifactAction;
DeleteTasksAction deleteTasksAction;
+ AddTaskAction addTaskAction;
public void createMenuActions() {
@@ -164,6 +166,7 @@ public class WorldXViewer extends XViewer implements ISelectedAtsArtifacts, IPer
emailAction = new EmailActionAction(this);
editStatusAction = new EditStatusAction(this, this, this);
editAssigneeAction = new EditAssigneeAction(this, this);
+ addTaskAction = new AddTaskAction(this);
TaskArtifactProvider taskProvider = new TaskArtifactProvider() {
@Override
@@ -372,6 +375,11 @@ public class WorldXViewer extends XViewer implements ISelectedAtsArtifacts, IPer
deletePurgeAtsObjectAction.setEnabled(getSelectedAtsArtifacts().size() > 0);
}
+ mm.insertBefore(XViewer.MENU_GROUP_PRE, new Separator());
+
+ mm.insertBefore(XViewer.MENU_GROUP_PRE, addTaskAction);
+ addTaskAction.updateEnablement(getSelectedTeamWorkflowArtifacts());
+
mm.insertBefore(XViewer.MENU_GROUP_PRE, deleteTasksAction);
deleteTasksAction.updateEnablement(getSelectedArtifacts());

Back to the top