Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorddunne2010-09-16 13:26:30 -0400
committerRyan D. Brooks2010-09-16 13:26:30 -0400
commite08eb4385412b697367a66d3ca5eae25e3a739e8 (patch)
treec67bd0d2f20ee0cbbd6433cc6a077ff39177eff1 /plugins
parent34bf2ce1486d300e71ffdf5f0e3909f3991306ab (diff)
downloadorg.eclipse.osee-e08eb4385412b697367a66d3ca5eae25e3a739e8.tar.gz
org.eclipse.osee-e08eb4385412b697367a66d3ca5eae25e3a739e8.tar.xz
org.eclipse.osee-e08eb4385412b697367a66d3ca5eae25e3a739e8.zip
feature[ats_UYPM6]: Partial - coverage tool needs ability to link ATS to coverage methods
Diffstat (limited to 'plugins')
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/internal/OseeAtsServiceImpl.java53
-rw-r--r--plugins/org.eclipse.osee.coverage.test/src/org/eclipse/osee/coverage/test/CoveragePackageImportTest.java5
-rw-r--r--plugins/org.eclipse.osee.coverage.test/src/org/eclipse/osee/coverage/test/MatchTypeTest.java4
-rw-r--r--plugins/org.eclipse.osee.coverage.test/src/org/eclipse/osee/coverage/test/VectorCastImportTest.java5
-rw-r--r--plugins/org.eclipse.osee.coverage.test/src/org/eclipse/osee/coverage/test/model/CoverageItemTest.java9
-rw-r--r--plugins/org.eclipse.osee.coverage.test/src/org/eclipse/osee/coverage/test/model/CoverageOptionManagerStoreTest.java3
-rw-r--r--plugins/org.eclipse.osee.coverage.test/src/org/eclipse/osee/coverage/test/model/CoverageUnitPersistTest.java8
-rw-r--r--plugins/org.eclipse.osee.coverage.test/src/org/eclipse/osee/coverage/test/model/CoverageUnitTest.java7
-rw-r--r--plugins/org.eclipse.osee.coverage.test/src/org/eclipse/osee/coverage/test/package1/CoveragePackage1.java4
-rw-r--r--plugins/org.eclipse.osee.coverage.test/src/org/eclipse/osee/coverage/test/util/CpCreateAndImportItem.java4
-rw-r--r--plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/action/CreateWorkProductTaskAction.java73
-rw-r--r--plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/action/NewCoveragePackageAction.java4
-rw-r--r--plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/action/OpenMultipleWorkProductsAction.java49
-rw-r--r--plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/action/RemoveRelatedWorkProductAction.java59
-rw-r--r--plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/editor/CoverageEditor.java11
-rw-r--r--plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/editor/CoverageEditorCoverageTab.java13
-rw-r--r--plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/editor/CoverageEditorImportTab.java7
-rw-r--r--plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/editor/CoverageEditorMergeTab.java6
-rw-r--r--plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/editor/CoverageEditorOverviewTab.java6
-rw-r--r--plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/editor/CoverageEditorWorkProductTab.java85
-rw-r--r--plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/editor/xcover/CoverageXViewer.java13
-rw-r--r--plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/editor/xcover/XCoverageViewer.java9
-rw-r--r--plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/editor/xmerge/XCoverageMergeViewer.java2
-rw-r--r--plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/model/CoverageItem.java14
-rw-r--r--plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/model/CoveragePackage.java17
-rw-r--r--plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/model/CoverageUnit.java5
-rw-r--r--plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/model/IWorkProductRelatable.java13
-rw-r--r--plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/model/IWorkProductTaskProvider.java27
-rw-r--r--plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/model/SimpleWorkProductTaskProvider.java67
-rw-r--r--plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/model/WorkProductAction.java75
-rw-r--r--plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/model/WorkProductTask.java85
-rw-r--r--plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/store/CoverageAttributeTypes.java1
-rw-r--r--plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/store/DbWorkProductTaskProvider.java124
-rw-r--r--plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/store/OseeCoveragePackageStore.java4
-rw-r--r--plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/store/OseeCoverageUnitStore.java5
-rw-r--r--plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/util/TeamWorkflowLabelProvider.java55
-rw-r--r--plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/util/dialog/WorkProductListDialog.java52
-rw-r--r--plugins/org.eclipse.osee.coverage/support/OseeTypes_Coverage.osee8
-rw-r--r--plugins/org.eclipse.osee.framework.ui.plugin/src/org/eclipse/osee/framework/ui/plugin/util/StringLabelProvider.java2
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/cm/IOseeCmService.java9
40 files changed, 824 insertions, 178 deletions
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/internal/OseeAtsServiceImpl.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/internal/OseeAtsServiceImpl.java
index 8828588088..47c7b6cd87 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/internal/OseeAtsServiceImpl.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/internal/OseeAtsServiceImpl.java
@@ -10,12 +10,22 @@
*******************************************************************************/
package org.eclipse.osee.ats.internal;
+import java.util.ArrayList;
import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
+import java.util.logging.Level;
import org.eclipse.osee.ats.AtsImage;
+import org.eclipse.osee.ats.artifact.StateMachineArtifact;
+import org.eclipse.osee.ats.artifact.TaskableStateMachineArtifact;
import org.eclipse.osee.ats.util.AtsUtil;
import org.eclipse.osee.ats.world.WorldEditor;
import org.eclipse.osee.ats.world.WorldEditorSimpleProvider;
+import org.eclipse.osee.framework.core.exception.OseeCoreException;
+import org.eclipse.osee.framework.logging.OseeLevel;
+import org.eclipse.osee.framework.logging.OseeLog;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactQuery;
import org.eclipse.osee.framework.ui.skynet.FrameworkImage;
import org.eclipse.osee.framework.ui.skynet.cm.IOseeCmService;
import org.eclipse.osee.framework.ui.skynet.cm.OseeCmEditor;
@@ -56,4 +66,47 @@ public class OseeAtsServiceImpl implements IOseeCmService {
return FrameworkImage.LASER;
}
+ @Override
+ public boolean isPcrArtifact(Artifact artifact) {
+ return artifact instanceof StateMachineArtifact;
+ }
+
+ @Override
+ public boolean isCompleted(Artifact artifact) {
+ if (isPcrArtifact(artifact)) {
+ try {
+ return ((StateMachineArtifact) artifact).isCancelledOrCompleted();
+ } catch (OseeCoreException ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ }
+ }
+ return false;
+ }
+
+ @Override
+ public List<Artifact> getTaskArtifacts(Artifact pcrArtifact) {
+ if (pcrArtifact instanceof TaskableStateMachineArtifact) {
+ try {
+ List<Artifact> arts = new ArrayList<Artifact>();
+ arts.addAll(((TaskableStateMachineArtifact) pcrArtifact).getTaskArtifacts());
+ return arts;
+ } catch (OseeCoreException ex) {
+ OseeLog.log(AtsPlugin.class, Level.SEVERE, ex);
+ }
+ }
+ return Collections.emptyList();
+ }
+
+ @Override
+ public Artifact createWorkTask(String name, String parentPcrGuid) {
+ try {
+ Artifact artifact = ArtifactQuery.getArtifactFromId(parentPcrGuid, AtsUtil.getAtsBranch());
+ if (artifact instanceof TaskableStateMachineArtifact) {
+ return ((TaskableStateMachineArtifact) artifact).createNewTask(name);
+ }
+ } catch (OseeCoreException ex) {
+ OseeLog.log(AtsPlugin.class, OseeLevel.SEVERE_POPUP, ex);
+ }
+ return null;
+ }
}
diff --git a/plugins/org.eclipse.osee.coverage.test/src/org/eclipse/osee/coverage/test/CoveragePackageImportTest.java b/plugins/org.eclipse.osee.coverage.test/src/org/eclipse/osee/coverage/test/CoveragePackageImportTest.java
index 65be00417c..b25b9de79e 100644
--- a/plugins/org.eclipse.osee.coverage.test/src/org/eclipse/osee/coverage/test/CoveragePackageImportTest.java
+++ b/plugins/org.eclipse.osee.coverage.test/src/org/eclipse/osee/coverage/test/CoveragePackageImportTest.java
@@ -26,6 +26,7 @@ import org.eclipse.osee.coverage.model.CoverageOptionManagerDefault;
import org.eclipse.osee.coverage.model.CoveragePackage;
import org.eclipse.osee.coverage.model.CoverageUnit;
import org.eclipse.osee.coverage.model.ICoverage;
+import org.eclipse.osee.coverage.model.SimpleWorkProductTaskProvider;
import org.eclipse.osee.coverage.store.OseeCoveragePackageStore;
import org.eclipse.osee.coverage.store.OseeCoverageStore;
import org.eclipse.osee.coverage.test.import1.CoverageImport1TestBlam;
@@ -122,7 +123,9 @@ public class CoveragePackageImportTest {
}
// Test MergeManager
- coveragePackage = new CoveragePackage("Test Coverage Package", CoverageOptionManagerDefault.instance());
+ coveragePackage =
+ new CoveragePackage("Test Coverage Package", CoverageOptionManagerDefault.instance(),
+ new SimpleWorkProductTaskProvider());
MergeManager mergeManager = new MergeManager(coveragePackage, coverageImport);
Assert.assertEquals(4, mergeManager.getMergeItems().size());
for (IMergeItem mergeItem : mergeManager.getMergeItems()) {
diff --git a/plugins/org.eclipse.osee.coverage.test/src/org/eclipse/osee/coverage/test/MatchTypeTest.java b/plugins/org.eclipse.osee.coverage.test/src/org/eclipse/osee/coverage/test/MatchTypeTest.java
index 3b20d8dffe..3a2209fa49 100644
--- a/plugins/org.eclipse.osee.coverage.test/src/org/eclipse/osee/coverage/test/MatchTypeTest.java
+++ b/plugins/org.eclipse.osee.coverage.test/src/org/eclipse/osee/coverage/test/MatchTypeTest.java
@@ -20,6 +20,7 @@ import org.eclipse.osee.coverage.model.CoveragePackageBase;
import org.eclipse.osee.coverage.model.CoverageUnit;
import org.eclipse.osee.coverage.model.ICoverageUnitFileContentsProvider;
import org.eclipse.osee.coverage.model.SimpleCoverageUnitFileContentsProvider;
+import org.eclipse.osee.coverage.model.SimpleWorkProductTaskProvider;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
import org.junit.Assert;
import org.junit.Test;
@@ -32,7 +33,8 @@ public class MatchTypeTest {
public static ICoverageUnitFileContentsProvider fileContentsProvider = new SimpleCoverageUnitFileContentsProvider();
public CoveragePackage getCoveragePackage() throws OseeCoreException {
- CoveragePackage coveragePackage = new CoveragePackage("Package", CoverageOptionManagerDefault.instance());
+ CoveragePackage coveragePackage =
+ new CoveragePackage("Package", CoverageOptionManagerDefault.instance(), new SimpleWorkProductTaskProvider());
CoverageUnit packageCu = new CoverageUnit(coveragePackage, "Top", "C:/UserData/", fileContentsProvider);
packageCu.setNamespace("org.this");
CoverageItem packageCi = new CoverageItem(packageCu, CoverageOptionManager.Deactivated_Code, "1");
diff --git a/plugins/org.eclipse.osee.coverage.test/src/org/eclipse/osee/coverage/test/VectorCastImportTest.java b/plugins/org.eclipse.osee.coverage.test/src/org/eclipse/osee/coverage/test/VectorCastImportTest.java
index fcb5e32491..e5ff504a06 100644
--- a/plugins/org.eclipse.osee.coverage.test/src/org/eclipse/osee/coverage/test/VectorCastImportTest.java
+++ b/plugins/org.eclipse.osee.coverage.test/src/org/eclipse/osee/coverage/test/VectorCastImportTest.java
@@ -24,6 +24,7 @@ import org.eclipse.osee.coverage.model.CoverageOptionManager;
import org.eclipse.osee.coverage.model.CoverageOptionManagerDefault;
import org.eclipse.osee.coverage.model.CoveragePackage;
import org.eclipse.osee.coverage.model.ICoverage;
+import org.eclipse.osee.coverage.model.SimpleWorkProductTaskProvider;
import org.eclipse.osee.coverage.store.OseeCoveragePackageStore;
import org.eclipse.osee.coverage.store.OseeCoverageStore;
import org.eclipse.osee.coverage.test.util.CoverageTestUtil;
@@ -131,7 +132,9 @@ public class VectorCastImportTest {
}
// Test MergeManager
- coveragePackage = new CoveragePackage("Test Coverage Package", CoverageOptionManagerDefault.instance());
+ coveragePackage =
+ new CoveragePackage("Test Coverage Package", CoverageOptionManagerDefault.instance(),
+ new SimpleWorkProductTaskProvider());
MergeManager mergeManager = new MergeManager(coveragePackage, coverageImport);
Assert.assertEquals(1, mergeManager.getMergeItems().size());
Assert.assertEquals(MergeType.Add, mergeManager.getMergeItems().iterator().next().getMergeType());
diff --git a/plugins/org.eclipse.osee.coverage.test/src/org/eclipse/osee/coverage/test/model/CoverageItemTest.java b/plugins/org.eclipse.osee.coverage.test/src/org/eclipse/osee/coverage/test/model/CoverageItemTest.java
index d3d8d37c13..144edee923 100644
--- a/plugins/org.eclipse.osee.coverage.test/src/org/eclipse/osee/coverage/test/model/CoverageItemTest.java
+++ b/plugins/org.eclipse.osee.coverage.test/src/org/eclipse/osee/coverage/test/model/CoverageItemTest.java
@@ -17,6 +17,7 @@ import org.eclipse.osee.coverage.model.CoverageOptionManagerDefault;
import org.eclipse.osee.coverage.model.CoverageUnit;
import org.eclipse.osee.coverage.model.SimpleTestUnitProvider;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
+import org.eclipse.osee.framework.jdk.core.util.GUID;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -93,6 +94,13 @@ public class CoverageItemTest {
Assert.assertEquals(CoverageOptionManager.Deactivated_Code, ci1.getCoverageMethod());
}
+ @Test
+ public void testSetGetWorkProductGuid() {
+ String guid = GUID.create();
+ ci1.setWorkProductGuid(guid);
+ Assert.assertEquals(guid, ci1.getWorkProductGuid());
+ }
+
/**
* Test method for {@link org.eclipse.osee.coverage.model.CoverageItem#getExecuteNum()}.
*/
@@ -224,6 +232,7 @@ public class CoverageItemTest {
Assert.assertEquals(ci1.getCoverageMethod(), ci.getCoverageMethod());
Assert.assertEquals(ci1.getFileContents(), ci.getFileContents());
Assert.assertEquals(ci1.getRationale(), ci.getRationale());
+ Assert.assertEquals(ci1.getWorkProductGuid(), ci.getWorkProductGuid());
}
/**
diff --git a/plugins/org.eclipse.osee.coverage.test/src/org/eclipse/osee/coverage/test/model/CoverageOptionManagerStoreTest.java b/plugins/org.eclipse.osee.coverage.test/src/org/eclipse/osee/coverage/test/model/CoverageOptionManagerStoreTest.java
index 771eb480cc..32423709ae 100644
--- a/plugins/org.eclipse.osee.coverage.test/src/org/eclipse/osee/coverage/test/model/CoverageOptionManagerStoreTest.java
+++ b/plugins/org.eclipse.osee.coverage.test/src/org/eclipse/osee/coverage/test/model/CoverageOptionManagerStoreTest.java
@@ -15,6 +15,7 @@ import org.eclipse.osee.coverage.model.CoverageOption;
import org.eclipse.osee.coverage.model.CoverageOptionManager;
import org.eclipse.osee.coverage.model.CoverageOptionManagerDefault;
import org.eclipse.osee.coverage.model.CoveragePackage;
+import org.eclipse.osee.coverage.model.SimpleWorkProductTaskProvider;
import org.eclipse.osee.coverage.store.CoverageArtifactTypes;
import org.eclipse.osee.coverage.store.CoverageOptionManagerStore;
import org.eclipse.osee.coverage.store.CoverageOptionManagerStore.StoreLocation;
@@ -60,7 +61,7 @@ public class CoverageOptionManagerStoreTest {
CoverageUtil.setNavigatorSelectedBranch(BranchManager.getCommonBranch());
CoveragePackage coveragePackage =
new CoveragePackage(CoverageOptionManagerStoreTest.class.getSimpleName(),
- CoverageOptionManagerDefault.instance());
+ CoverageOptionManagerDefault.instance(), new SimpleWorkProductTaskProvider());
OseeCoveragePackageStore store = new OseeCoveragePackageStore(coveragePackage, BranchManager.getCommonBranch());
store.save();
diff --git a/plugins/org.eclipse.osee.coverage.test/src/org/eclipse/osee/coverage/test/model/CoverageUnitPersistTest.java b/plugins/org.eclipse.osee.coverage.test/src/org/eclipse/osee/coverage/test/model/CoverageUnitPersistTest.java
index d92d9c0ac1..ed0907114e 100644
--- a/plugins/org.eclipse.osee.coverage.test/src/org/eclipse/osee/coverage/test/model/CoverageUnitPersistTest.java
+++ b/plugins/org.eclipse.osee.coverage.test/src/org/eclipse/osee/coverage/test/model/CoverageUnitPersistTest.java
@@ -29,6 +29,7 @@ import org.eclipse.osee.coverage.model.CoverageUnit;
import org.eclipse.osee.coverage.model.ICoverage;
import org.eclipse.osee.coverage.model.SimpleCoverageUnitFileContentsProvider;
import org.eclipse.osee.coverage.model.SimpleTestUnitProvider;
+import org.eclipse.osee.coverage.model.SimpleWorkProductTaskProvider;
import org.eclipse.osee.coverage.store.CoverageArtifactTypes;
import org.eclipse.osee.coverage.store.DbTestUnitProvider;
import org.eclipse.osee.coverage.store.OseeCoveragePackageStore;
@@ -43,6 +44,7 @@ import org.eclipse.osee.framework.core.exception.ArtifactDoesNotExist;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
import org.eclipse.osee.framework.core.model.Branch;
import org.eclipse.osee.framework.jdk.core.util.GUID;
+import org.eclipse.osee.framework.jdk.core.util.Strings;
import org.eclipse.osee.framework.logging.OseeLevel;
import org.eclipse.osee.framework.logging.OseeLog;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
@@ -111,7 +113,8 @@ public class CoverageUnitPersistTest {
@Test
public void testSaveLoadDelete() throws OseeCoreException {
// TEST SAVE
- saveCoveragePackage = new CoveragePackage("CU Test", CoverageOptionManagerDefault.instance());
+ saveCoveragePackage =
+ new CoveragePackage("CU Test", CoverageOptionManagerDefault.instance(), new SimpleWorkProductTaskProvider());
MergeManager mergeManager = new MergeManager(saveCoveragePackage, coverageImport);
List<IMergeItem> mergeItems = new ArrayList<IMergeItem>();
for (IMergeItem mergeItem : mergeManager.getMergeItems()) {
@@ -191,6 +194,7 @@ public class CoverageUnitPersistTest {
TestUnitStore.clearStore();
String cuName = DbTestUnitProviderTest.class.getSimpleName() + "-" + GUID.create();
CoverageUnit unit = new CoverageUnit(null, cuName, "location", new SimpleCoverageUnitFileContentsProvider());
+ unit.setWorkProductGuid(GUID.create());
CoverageItem item = new CoverageItem(unit, CoverageOptionManager.Test_Unit, "1");
item.setTestUnitProvider(new SimpleTestUnitProvider());
for (int x = 0; x < 10; x++) {
@@ -214,6 +218,8 @@ public class CoverageUnitPersistTest {
Assert.assertEquals(10, dbItem.getTestUnits().size());
Assert.assertTrue(dbItem.getTestUnits().iterator().next().startsWith("Test Unit "));
Assert.assertEquals(10, TestUnitStore.getTestUnitCount());
+ Assert.assertTrue(Strings.isValid(dbUnit.getWorkProductGuid()));
+ Assert.assertEquals(unit.getWorkProductGuid(), dbUnit.getWorkProductGuid());
TestUnitStore.clearStore();
}
}
diff --git a/plugins/org.eclipse.osee.coverage.test/src/org/eclipse/osee/coverage/test/model/CoverageUnitTest.java b/plugins/org.eclipse.osee.coverage.test/src/org/eclipse/osee/coverage/test/model/CoverageUnitTest.java
index 7a6f430f3c..655a7540df 100644
--- a/plugins/org.eclipse.osee.coverage.test/src/org/eclipse/osee/coverage/test/model/CoverageUnitTest.java
+++ b/plugins/org.eclipse.osee.coverage.test/src/org/eclipse/osee/coverage/test/model/CoverageUnitTest.java
@@ -145,6 +145,13 @@ public class CoverageUnitTest {
Assert.assertEquals(current, cu.getName());
}
+ @Test
+ public void testSetGetWorkProductGuid() {
+ String guid = GUID.create();
+ cu.setWorkProductGuid(guid);
+ Assert.assertEquals(guid, cu.getWorkProductGuid());
+ }
+
/**
* Test method for {@link org.eclipse.osee.coverage.model.CoverageUnit#getLocation()}.
*/
diff --git a/plugins/org.eclipse.osee.coverage.test/src/org/eclipse/osee/coverage/test/package1/CoveragePackage1.java b/plugins/org.eclipse.osee.coverage.test/src/org/eclipse/osee/coverage/test/package1/CoveragePackage1.java
index f39cad4b54..c0759d5b4d 100644
--- a/plugins/org.eclipse.osee.coverage.test/src/org/eclipse/osee/coverage/test/package1/CoveragePackage1.java
+++ b/plugins/org.eclipse.osee.coverage.test/src/org/eclipse/osee/coverage/test/package1/CoveragePackage1.java
@@ -14,6 +14,7 @@ import org.eclipse.osee.coverage.editor.CoverageEditor;
import org.eclipse.osee.coverage.editor.CoverageEditorInput;
import org.eclipse.osee.coverage.model.CoverageOptionManagerDefault;
import org.eclipse.osee.coverage.model.CoveragePackage;
+import org.eclipse.osee.coverage.model.SimpleWorkProductTaskProvider;
import org.eclipse.osee.framework.ui.plugin.xnavigate.XNavigateComposite.TableLoadOption;
import org.eclipse.osee.framework.ui.plugin.xnavigate.XNavigateItem;
import org.eclipse.osee.framework.ui.plugin.xnavigate.XNavigateItemAction;
@@ -34,7 +35,8 @@ public class CoveragePackage1 extends XNavigateItemAction {
@Override
public void run(TableLoadOption... tableLoadOptions) throws Exception {
CoveragePackage coveragePackage =
- new CoveragePackage("Coverage Package 1", CoverageOptionManagerDefault.instance());
+ new CoveragePackage("Coverage Package 1", CoverageOptionManagerDefault.instance(),
+ new SimpleWorkProductTaskProvider());
CoverageEditor.open(new CoverageEditorInput(coveragePackage.getName(), null, coveragePackage, true));
}
}
diff --git a/plugins/org.eclipse.osee.coverage.test/src/org/eclipse/osee/coverage/test/util/CpCreateAndImportItem.java b/plugins/org.eclipse.osee.coverage.test/src/org/eclipse/osee/coverage/test/util/CpCreateAndImportItem.java
index 184698c199..eb223e497f 100644
--- a/plugins/org.eclipse.osee.coverage.test/src/org/eclipse/osee/coverage/test/util/CpCreateAndImportItem.java
+++ b/plugins/org.eclipse.osee.coverage.test/src/org/eclipse/osee/coverage/test/util/CpCreateAndImportItem.java
@@ -14,6 +14,7 @@ import org.eclipse.osee.coverage.editor.CoverageEditor;
import org.eclipse.osee.coverage.editor.CoverageEditorInput;
import org.eclipse.osee.coverage.model.CoverageOptionManagerDefault;
import org.eclipse.osee.coverage.model.CoveragePackage;
+import org.eclipse.osee.coverage.model.SimpleWorkProductTaskProvider;
import org.eclipse.osee.coverage.store.OseeCoveragePackageStore;
import org.eclipse.osee.framework.skynet.core.artifact.BranchManager;
import org.eclipse.osee.framework.skynet.core.utility.IncrementingNum;
@@ -38,7 +39,8 @@ public class CpCreateAndImportItem extends XNavigateItemAction {
@Override
public void run(TableLoadOption... tableLoadOptions) throws Exception {
coveragePackage =
- new CoveragePackage(getName() + " - #" + IncrementingNum.get(), CoverageOptionManagerDefault.instance());
+ new CoveragePackage(getName() + " - #" + IncrementingNum.get(), CoverageOptionManagerDefault.instance(),
+ new SimpleWorkProductTaskProvider());
OseeCoveragePackageStore store = new OseeCoveragePackageStore(coveragePackage, BranchManager.getCommonBranch());
store.save();
CoverageEditor.open(new CoverageEditorInput(coveragePackage.getName(), store.getArtifact(false), coveragePackage,
diff --git a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/action/CreateWorkProductTaskAction.java b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/action/CreateWorkProductTaskAction.java
index aef92dde67..f5779c0211 100644
--- a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/action/CreateWorkProductTaskAction.java
+++ b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/action/CreateWorkProductTaskAction.java
@@ -10,12 +10,26 @@
*******************************************************************************/
package org.eclipse.osee.coverage.action;
+import java.util.ArrayList;
+import java.util.List;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.osee.coverage.editor.xcover.CoverageXViewer;
+import org.eclipse.osee.coverage.internal.Activator;
+import org.eclipse.osee.coverage.model.ICoverage;
+import org.eclipse.osee.coverage.model.IWorkProductRelatable;
+import org.eclipse.osee.coverage.model.WorkProductAction;
+import org.eclipse.osee.coverage.util.ISaveable;
+import org.eclipse.osee.coverage.util.dialog.WorkProductListDialog;
+import org.eclipse.osee.framework.core.exception.OseeCoreException;
+import org.eclipse.osee.framework.logging.OseeLevel;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
import org.eclipse.osee.framework.ui.skynet.FrameworkImage;
import org.eclipse.osee.framework.ui.skynet.SkynetGuiPlugin;
import org.eclipse.osee.framework.ui.skynet.cm.IOseeCmService;
+import org.eclipse.osee.framework.ui.skynet.widgets.dialog.EntryDialog;
import org.eclipse.osee.framework.ui.swt.ImageManager;
/**
@@ -24,10 +38,14 @@ import org.eclipse.osee.framework.ui.swt.ImageManager;
public class CreateWorkProductTaskAction extends Action {
private final ISelectedCoverageEditorItem selectedCoverageEditorItem;
+ private final ISaveable saveable;
+ private final CoverageXViewer coverageXViewer;
- public CreateWorkProductTaskAction(ISelectedCoverageEditorItem selectedCoverageEditorItem) {
+ public CreateWorkProductTaskAction(CoverageXViewer coverageXViewer, ISelectedCoverageEditorItem selectedCoverageEditorItem, ISaveable saveable) {
super("Create Work Product Task");
+ this.coverageXViewer = coverageXViewer;
this.selectedCoverageEditorItem = selectedCoverageEditorItem;
+ this.saveable = saveable;
}
@Override
@@ -37,10 +55,59 @@ public class CreateWorkProductTaskAction extends Action {
@Override
public void run() {
+ if (coverageXViewer.getWorkProductTaskProvider().getWorkProductRelatedActions().isEmpty()) {
+ AWorkbench.popup("No Work Product related Actions.\n\nMust related Work Product Actions first.");
+ return;
+ }
+
if (selectedCoverageEditorItem.getSelectedCoverageEditorItems().isEmpty()) {
- AWorkbench.popup("Select Coverage Item");
+ AWorkbench.popup("Select Coverage Item(s) or Coverage Units(s)");
+ return;
+ }
+
+ List<ICoverage> relateableCoverageItems = new ArrayList<ICoverage>();
+ for (ICoverage coverage : selectedCoverageEditorItem.getSelectedCoverageEditorItems()) {
+ if (coverage instanceof IWorkProductRelatable) {
+ relateableCoverageItems.add(coverage);
+ }
+ }
+ if (relateableCoverageItems.isEmpty()) {
+ AWorkbench.popup("Only Coverage Item(s) and Coverage Units(s) can be related to Work Products");
+ return;
+ }
+ IOseeCmService cm = SkynetGuiPlugin.getInstance().getOseeCmService();
+ if (cm == null) {
+ AWorkbench.popup("Unable to connect to CM service.");
return;
}
- IOseeCmService service = SkynetGuiPlugin.getInstance().getOseeCmService();
+
+ WorkProductListDialog dialog = new WorkProductListDialog(getText(), "Select Work Product to add task");
+ dialog.setInput(coverageXViewer.getWorkProductTaskProvider().getWorkProductRelatedActions());
+ if (dialog.open() != 0) {
+ return;
+ }
+ WorkProductAction action = (WorkProductAction) dialog.getResult()[0];
+ EntryDialog eDialog = new EntryDialog(getText(), "Enter Task Title");
+ if (eDialog.open() != 0) {
+ return;
+ }
+ String taskTitle = eDialog.getEntry();
+ Artifact newTaskArt = cm.createWorkTask(taskTitle, action.getGuid());
+ if (newTaskArt == null) {
+ AWorkbench.popup("Unable to create new Work Product task.");
+ return;
+ }
+
+ try {
+ for (ICoverage coverage : relateableCoverageItems) {
+ if (coverage instanceof IWorkProductRelatable) {
+ ((IWorkProductRelatable) coverage).setWorkProductGuid(newTaskArt.getGuid());
+ }
+ }
+ newTaskArt.persist(getText());
+ saveable.save(relateableCoverageItems);
+ } catch (OseeCoreException ex) {
+ OseeLog.log(Activator.class, OseeLevel.SEVERE_POPUP, ex);
+ }
}
}
diff --git a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/action/NewCoveragePackageAction.java b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/action/NewCoveragePackageAction.java
index 1014f404ff..effa3f5e4b 100644
--- a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/action/NewCoveragePackageAction.java
+++ b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/action/NewCoveragePackageAction.java
@@ -17,6 +17,7 @@ import org.eclipse.osee.coverage.editor.CoverageEditorInput;
import org.eclipse.osee.coverage.internal.Activator;
import org.eclipse.osee.coverage.model.CoverageOptionManagerDefault;
import org.eclipse.osee.coverage.model.CoveragePackage;
+import org.eclipse.osee.coverage.store.DbWorkProductTaskProvider;
import org.eclipse.osee.coverage.store.OseeCoveragePackageStore;
import org.eclipse.osee.coverage.util.CoverageImage;
import org.eclipse.osee.coverage.util.CoverageUtil;
@@ -55,7 +56,8 @@ public class NewCoveragePackageAction extends Action {
EntryDialog dialog = new EntryDialog(getText(), "Enter Coverage Package Name");
if (dialog.open() == 0) {
CoveragePackage coveragePackage =
- new CoveragePackage(dialog.getEntry(), CoverageOptionManagerDefault.instance());
+ new CoveragePackage(dialog.getEntry(), CoverageOptionManagerDefault.instance(),
+ new DbWorkProductTaskProvider(branch));
SkynetTransaction transaction = new SkynetTransaction(branch, "Add Coverage Package");
OseeCoveragePackageStore.get(coveragePackage, branch).save(transaction);
transaction.execute();
diff --git a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/action/OpenMultipleWorkProductsAction.java b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/action/OpenMultipleWorkProductsAction.java
index 7d3e2cf540..b60d1ac6d6 100644
--- a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/action/OpenMultipleWorkProductsAction.java
+++ b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/action/OpenMultipleWorkProductsAction.java
@@ -10,10 +10,24 @@
*******************************************************************************/
package org.eclipse.osee.coverage.action;
+import java.util.ArrayList;
+import java.util.List;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.osee.coverage.editor.CoverageEditor;
-import org.eclipse.osee.coverage.editor.CoverageEditorWorkProductTab;
+import org.eclipse.osee.coverage.internal.Activator;
+import org.eclipse.osee.coverage.model.IWorkProductTaskProvider;
+import org.eclipse.osee.coverage.model.WorkProductAction;
+import org.eclipse.osee.framework.core.exception.OseeCoreException;
+import org.eclipse.osee.framework.logging.OseeLevel;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.plugin.core.util.Jobs;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.artifact.search.ArtifactQuery;
import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
import org.eclipse.osee.framework.ui.skynet.FrameworkImage;
import org.eclipse.osee.framework.ui.skynet.SkynetGuiPlugin;
@@ -28,13 +42,13 @@ import org.eclipse.osee.framework.ui.swt.KeyedImage;
public class OpenMultipleWorkProductsAction extends Action {
private KeyedImage image = null;
+ private final IWorkProductTaskProvider provider;
private final CoverageEditor coverageEditor;
- private final CoverageEditorWorkProductTab coverageEditorWorkProductTab;
- public OpenMultipleWorkProductsAction(CoverageEditor coverageEditor, CoverageEditorWorkProductTab coverageEditorWorkProductTab) {
- super("Create Work Product Task");
+ public OpenMultipleWorkProductsAction(CoverageEditor coverageEditor, IWorkProductTaskProvider provider) {
+ super("Open Work Products");
this.coverageEditor = coverageEditor;
- this.coverageEditorWorkProductTab = coverageEditorWorkProductTab;
+ this.provider = provider;
}
@Override
@@ -53,12 +67,29 @@ public class OpenMultipleWorkProductsAction extends Action {
@Override
public void run() {
- if (coverageEditorWorkProductTab.getWorkProductArtifacts().isEmpty()) {
+ if (provider.getWorkProductRelatedActions().isEmpty()) {
AWorkbench.popup("No Work Products to open");
return;
}
- IOseeCmService service = SkynetGuiPlugin.getInstance().getOseeCmService();
- service.openArtifacts(coverageEditor.getTitle() + " - Work Products",
- coverageEditorWorkProductTab.getWorkProductArtifacts(), OseeCmEditor.CmMultiPcrEditor);
+ Job job = new Job(getText()) {
+
+ @Override
+ protected IStatus run(IProgressMonitor monitor) {
+ try {
+ IOseeCmService service = SkynetGuiPlugin.getInstance().getOseeCmService();
+ List<String> guids = new ArrayList<String>();
+ for (WorkProductAction action : provider.getWorkProductRelatedActions()) {
+ guids.add(action.getGuid());
+ }
+ List<Artifact> artifacts = ArtifactQuery.getArtifactListFromIds(guids, coverageEditor.getBranch());
+ service.openArtifacts(coverageEditor.getTitle() + " - Work Products", artifacts,
+ OseeCmEditor.CmMultiPcrEditor);
+ } catch (OseeCoreException ex) {
+ OseeLog.log(Activator.class, OseeLevel.SEVERE_POPUP, ex);
+ }
+ return Status.OK_STATUS;
+ }
+ };
+ Jobs.startJob(job);
}
}
diff --git a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/action/RemoveRelatedWorkProductAction.java b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/action/RemoveRelatedWorkProductAction.java
index 98e2549c3d..fdf717a1f5 100644
--- a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/action/RemoveRelatedWorkProductAction.java
+++ b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/action/RemoveRelatedWorkProductAction.java
@@ -10,21 +10,20 @@
*******************************************************************************/
package org.eclipse.osee.coverage.action;
+import java.util.ArrayList;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.osee.coverage.editor.CoverageEditor;
-import org.eclipse.osee.coverage.internal.Activator;
-import org.eclipse.osee.coverage.model.CoveragePackage;
-import org.eclipse.osee.coverage.store.OseeCoveragePackageStore;
-import org.eclipse.osee.framework.core.enums.CoreRelationTypes;
-import org.eclipse.osee.framework.core.exception.OseeCoreException;
-import org.eclipse.osee.framework.logging.OseeLevel;
-import org.eclipse.osee.framework.logging.OseeLog;
-import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
-import org.eclipse.osee.framework.skynet.core.artifact.ISelectedArtifacts;
+import org.eclipse.osee.coverage.editor.CoverageEditorWorkProductTab;
+import org.eclipse.osee.coverage.model.WorkProductAction;
+import org.eclipse.osee.framework.plugin.core.util.Jobs;
import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
import org.eclipse.osee.framework.ui.skynet.FrameworkImage;
+import org.eclipse.osee.framework.ui.swt.Displays;
import org.eclipse.osee.framework.ui.swt.ImageManager;
import org.eclipse.swt.widgets.Display;
@@ -33,13 +32,11 @@ import org.eclipse.swt.widgets.Display;
*/
public class RemoveRelatedWorkProductAction extends Action {
- private final ISelectedArtifacts selectedArtifacts;
- private final CoverageEditor coverageEditor;
+ private final CoverageEditorWorkProductTab coverageEditorWorkProductTab;
- public RemoveRelatedWorkProductAction(CoverageEditor coverageEditor, ISelectedArtifacts selectedArtifacts, IRefreshable refreshable) {
+ public RemoveRelatedWorkProductAction(CoverageEditorWorkProductTab coverageEditorWorkProductTab) {
super("Remove Related Work Product Action");
- this.coverageEditor = coverageEditor;
- this.selectedArtifacts = selectedArtifacts;
+ this.coverageEditorWorkProductTab = coverageEditorWorkProductTab;
}
@Override
@@ -49,23 +46,33 @@ public class RemoveRelatedWorkProductAction extends Action {
@Override
public void run() {
- if (selectedArtifacts.getSelectedArtifacts().isEmpty()) {
+ final ArrayList<WorkProductAction> selActions = coverageEditorWorkProductTab.getSelectedActions();
+
+ if (selActions.isEmpty()) {
AWorkbench.popup("Please select work product to remove");
return;
}
if (MessageDialog.openConfirm(Display.getCurrent().getActiveShell(), getText(),
"Remove selected work product actions?")) {
- try {
- CoveragePackage coveragePackage = (CoveragePackage) coverageEditor.getCoveragePackageBase();
- OseeCoveragePackageStore store = OseeCoveragePackageStore.get(coveragePackage, coverageEditor.getBranch());
- for (Artifact artifact : selectedArtifacts.getSelectedArtifacts()) {
- store.getArtifact(false).deleteRelation(CoreRelationTypes.SupportingInfo_SupportingInfo, artifact);
- }
- store.getArtifact(false).persist("Un-Relate Coverage work product Actions");
- } catch (OseeCoreException ex) {
- OseeLog.log(Activator.class, OseeLevel.SEVERE_POPUP, ex);
- }
+ Job job = new Job(getText()) {
+
+ @Override
+ protected IStatus run(IProgressMonitor monitor) {
+ coverageEditorWorkProductTab.getCoveragePackage().getWorkProductTaskProvider().removeWorkProductAction(
+ selActions.iterator().next());
+ Displays.ensureInDisplayThread(new Runnable() {
+
+ @Override
+ public void run() {
+ coverageEditorWorkProductTab.getCoveragePackage().getWorkProductTaskProvider().reload();
+ coverageEditorWorkProductTab.refresh();
+ }
+ });
+ return Status.OK_STATUS;
+ }
+ };
+ Jobs.startJob(job);
}
}
}
diff --git a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/editor/CoverageEditor.java b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/editor/CoverageEditor.java
index 9e5f73301a..2b7919ad7e 100644
--- a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/editor/CoverageEditor.java
+++ b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/editor/CoverageEditor.java
@@ -139,8 +139,11 @@ public class CoverageEditor extends FormEditor implements IActionable {
addFormPage(coverageEditorOverviewTab);
coverageEditorCoverageTab = new CoverageEditorCoverageTab("Coverage Items", this, getCoveragePackageBase());
addFormPage(coverageEditorCoverageTab);
- coverageEditorWorkProductTab =
- new CoverageEditorWorkProductTab("Work Product Tracking", this, getCoveragePackageBase());
+ if (getCoveragePackageBase() instanceof CoveragePackage) {
+ coverageEditorWorkProductTab =
+ new CoverageEditorWorkProductTab("Work Product Tracking", this,
+ (CoveragePackage) getCoveragePackageBase());
+ }
addFormPage(coverageEditorWorkProductTab);
if (getCoveragePackageBase().isImportAllowed()) {
coverageEditorImportTab = new CoverageEditorImportTab(this);
@@ -159,12 +162,12 @@ public class CoverageEditor extends FormEditor implements IActionable {
if (coverageEditorImportTab == null) {
throw new OseeStateException("Import page == null");
}
- setActivePage(2);
+ setActivePage(CoverageEditorImportTab.PAGE_ID);
coverageEditorImportTab.simulateImport(importName);
}
public void simulateImportPostRun() throws OseeCoreException {
- setActivePage(5);
+ setActivePage(CoverageEditorMergeTab.PAGE_ID);
coverageEditorImportTab.simulateImportSearch();
}
diff --git a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/editor/CoverageEditorCoverageTab.java b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/editor/CoverageEditorCoverageTab.java
index 9546be8229..b9fb68a22f 100644
--- a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/editor/CoverageEditorCoverageTab.java
+++ b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/editor/CoverageEditorCoverageTab.java
@@ -22,6 +22,7 @@ import org.eclipse.osee.coverage.model.CoverageImport;
import org.eclipse.osee.coverage.model.CoveragePackage;
import org.eclipse.osee.coverage.model.CoveragePackageBase;
import org.eclipse.osee.coverage.model.ICoverage;
+import org.eclipse.osee.coverage.model.IWorkProductTaskProvider;
import org.eclipse.osee.coverage.model.MessageCoverageItem;
import org.eclipse.osee.coverage.store.OseeCoveragePackageStore;
import org.eclipse.osee.coverage.util.CoverageUtil;
@@ -61,6 +62,7 @@ public class CoverageEditorCoverageTab extends FormPage implements ISaveable {
private final CoverageEditor coverageEditor;
private CoverageParameters coverageParameters;
private CoverageParametersTextFilter parametersFilter;
+ public static String PAGE_ID = "coverage.items";
public CoverageEditorCoverageTab(String name, CoverageEditor coverageEditor, CoveragePackageBase provider) {
super(coverageEditor, name, name);
@@ -97,8 +99,12 @@ public class CoverageEditorCoverageTab extends FormPage implements ISaveable {
tableComp.setLayoutData(tableData);
coverageEditor.getToolkit().adapt(tableComp);
+ IWorkProductTaskProvider provider = null;
+ if (coveragePackageBase instanceof CoveragePackage) {
+ provider = ((CoveragePackage) coveragePackageBase).getWorkProductTaskProvider();
+ }
xCoverageViewer =
- new XCoverageViewer(this, coveragePackageBase.getCoverageOptionManager(),
+ new XCoverageViewer(this, coveragePackageBase.getCoverageOptionManager(), provider,
coveragePackageBase instanceof CoverageImport ? TableType.Import : TableType.Package);
xCoverageViewer.setDisplayLabel(false);
xCoverageViewer.createWidgets(managedForm, tableComp, 1);
@@ -185,4 +191,9 @@ public class CoverageEditorCoverageTab extends FormPage implements ISaveable {
return coverageEditor.getBranch();
}
+ @Override
+ public String getId() {
+ return PAGE_ID;
+ }
+
}
diff --git a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/editor/CoverageEditorImportTab.java b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/editor/CoverageEditorImportTab.java
index 22ff9bf681..42a2675d20 100644
--- a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/editor/CoverageEditorImportTab.java
+++ b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/editor/CoverageEditorImportTab.java
@@ -77,6 +77,7 @@ public class CoverageEditorImportTab extends FormPage {
private int coverageImportIndex, coverageImportOverviewIndex, coverageEditorMergeIndex;
private Composite destroyableComposite;
private boolean isSimulateImput = false;
+ public static String PAGE_ID = "coverage.import";
public CoverageEditorImportTab(CoverageEditor coverageEditor) throws OseeCoreException {
super(coverageEditor, "Import", "Import");
@@ -390,4 +391,10 @@ public class CoverageEditorImportTab extends FormPage {
}
});
}
+
+ @Override
+ public String getId() {
+ return PAGE_ID;
+ }
+
}
diff --git a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/editor/CoverageEditorMergeTab.java b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/editor/CoverageEditorMergeTab.java
index c3dc365f84..0a69acaf92 100644
--- a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/editor/CoverageEditorMergeTab.java
+++ b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/editor/CoverageEditorMergeTab.java
@@ -95,6 +95,7 @@ public class CoverageEditorMergeTab extends FormPage implements ISaveable {
private MergeManager mergeManager;
private boolean loading = false;
private CoverageParametersTextFilter parametersFilter;
+ public static String PAGE_ID = "coverage.merge";
public CoverageEditorMergeTab(String name, CoverageEditor coverageEditor, CoveragePackage provider1, CoverageImport provider2) {
super(coverageEditor, name, name);
@@ -441,4 +442,9 @@ public class CoverageEditorMergeTab extends FormPage implements ISaveable {
public Branch getBranch() throws OseeCoreException {
return coverageEditor.getBranch();
}
+
+ @Override
+ public String getId() {
+ return PAGE_ID;
+ }
}
diff --git a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/editor/CoverageEditorOverviewTab.java b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/editor/CoverageEditorOverviewTab.java
index 61db703d73..6c54972731 100644
--- a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/editor/CoverageEditorOverviewTab.java
+++ b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/editor/CoverageEditorOverviewTab.java
@@ -51,6 +51,7 @@ public class CoverageEditorOverviewTab extends FormPage implements IRefreshActio
XResultsComposite xResultsComp;
private static String ALL_COVERAGE_METHODS = " ALL Coverage Methods";
private static String ALL_TOP_FOLDERS = " ALL Top Folders";
+ public static String PAGE_ID = "coverage.overview";
public CoverageEditorOverviewTab(String name, CoverageEditor coverageEditor, CoveragePackageBase provider) {
super(coverageEditor, name, name);
@@ -256,4 +257,9 @@ public class CoverageEditorOverviewTab extends FormPage implements IRefreshActio
return coveragePackageBase;
}
+ @Override
+ public String getId() {
+ return PAGE_ID;
+ }
+
}
diff --git a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/editor/CoverageEditorWorkProductTab.java b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/editor/CoverageEditorWorkProductTab.java
index 83331872e2..5b6d59748c 100644
--- a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/editor/CoverageEditorWorkProductTab.java
+++ b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/editor/CoverageEditorWorkProductTab.java
@@ -11,22 +11,20 @@ package org.eclipse.osee.coverage.editor;
import java.util.ArrayList;
import java.util.Collection;
-import java.util.Collections;
-import java.util.logging.Level;
import org.eclipse.jface.action.IToolBarManager;
+import org.eclipse.jface.viewers.ArrayContentProvider;
import org.eclipse.osee.coverage.action.IRefreshable;
import org.eclipse.osee.coverage.action.OpenMultipleWorkProductsAction;
import org.eclipse.osee.coverage.action.RemoveRelatedWorkProductAction;
import org.eclipse.osee.coverage.internal.Activator;
import org.eclipse.osee.coverage.model.CoverageImport;
import org.eclipse.osee.coverage.model.CoveragePackage;
-import org.eclipse.osee.coverage.model.CoveragePackageBase;
import org.eclipse.osee.coverage.model.ICoverage;
+import org.eclipse.osee.coverage.model.WorkProductAction;
import org.eclipse.osee.coverage.store.CoverageArtifactTypes;
import org.eclipse.osee.coverage.store.OseeCoveragePackageStore;
import org.eclipse.osee.coverage.util.CoverageUtil;
import org.eclipse.osee.coverage.util.ISaveable;
-import org.eclipse.osee.coverage.util.TeamWorkflowLabelProvider;
import org.eclipse.osee.framework.core.enums.CoreRelationTypes;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
import org.eclipse.osee.framework.core.model.Branch;
@@ -34,11 +32,10 @@ import org.eclipse.osee.framework.jdk.core.util.DateUtil;
import org.eclipse.osee.framework.logging.OseeLevel;
import org.eclipse.osee.framework.logging.OseeLog;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
-import org.eclipse.osee.framework.skynet.core.artifact.ISelectedArtifacts;
import org.eclipse.osee.framework.skynet.core.transaction.SkynetTransaction;
import org.eclipse.osee.framework.ui.plugin.util.AWorkbench;
import org.eclipse.osee.framework.ui.plugin.util.Result;
-import org.eclipse.osee.framework.ui.skynet.ArtifactContentProvider;
+import org.eclipse.osee.framework.ui.plugin.util.StringLabelProvider;
import org.eclipse.osee.framework.ui.skynet.SkynetGuiPlugin;
import org.eclipse.osee.framework.ui.skynet.artifact.editor.ArtifactEditor;
import org.eclipse.osee.framework.ui.skynet.cm.IOseeCmService;
@@ -61,17 +58,17 @@ import org.eclipse.ui.forms.widgets.ScrolledForm;
/**
* @author Donald G. Dunne
*/
-public class CoverageEditorWorkProductTab extends FormPage implements ISaveable, ISelectedArtifacts, IRefreshable {
+public class CoverageEditorWorkProductTab extends FormPage implements ISaveable, IRefreshable {
private ScrolledForm scrolledForm;
- private final CoveragePackageBase coveragePackageBase;
+ private final CoveragePackage coveragePackage;
private final CoverageEditor coverageEditor;
private XListViewer actionListViewer;
- public CoverageEditorWorkProductTab(String name, CoverageEditor coverageEditor, CoveragePackageBase provider) {
+ public CoverageEditorWorkProductTab(String name, CoverageEditor coverageEditor, CoveragePackage coveragePackage) {
super(coverageEditor, name, name);
this.coverageEditor = coverageEditor;
- this.coveragePackageBase = provider;
+ this.coveragePackage = coveragePackage;
}
@Override
@@ -79,8 +76,8 @@ public class CoverageEditorWorkProductTab extends FormPage implements ISaveable,
super.createFormContent(managedForm);
scrolledForm = managedForm.getForm();
- scrolledForm.setText(coveragePackageBase.getName() + " - " + DateUtil.getMMDDYYHHMM(coveragePackageBase.getDate()) + " - " + coveragePackageBase.getCoverageItems().size() + " Coverage Items");
- scrolledForm.setImage(ImageManager.getImage(CoverageUtil.getCoveragePackageBaseImage(coveragePackageBase)));
+ scrolledForm.setText(coveragePackage.getName() + " - " + DateUtil.getMMDDYYHHMM(coveragePackage.getDate()) + " - " + coveragePackage.getCoverageItems().size() + " Coverage Items");
+ scrolledForm.setImage(ImageManager.getImage(CoverageUtil.getCoveragePackageBaseImage(coveragePackage)));
scrolledForm.getBody().setLayout(new GridLayout(2, false));
Composite mainComp = scrolledForm.getBody();
coverageEditor.getToolkit().adapt(mainComp);
@@ -100,17 +97,17 @@ public class CoverageEditorWorkProductTab extends FormPage implements ISaveable,
@Override
public void handleEvent(Event event) {
IOseeCmService cmService = SkynetGuiPlugin.getInstance().getOseeCmService();
- cmService.openArtifact(getSelectedArtifactItems().iterator().next(), OseeCmEditor.CmPcrEditor);
+ cmService.openArtifact(getSelectedActions().iterator().next().getGuid(), OseeCmEditor.CmPcrEditor);
}
});
}
- public ArrayList<Artifact> getSelectedArtifactItems() {
- ArrayList<Artifact> arts = new ArrayList<Artifact>();
+ public ArrayList<WorkProductAction> getSelectedActions() {
+ ArrayList<WorkProductAction> arts = new ArrayList<WorkProductAction>();
TableItem items[] = actionListViewer.getTable().getSelection();
if (items.length > 0) {
for (TableItem item : items) {
- arts.add((Artifact) item.getData());
+ arts.add((WorkProductAction) item.getData());
}
}
return arts;
@@ -129,15 +126,10 @@ public class CoverageEditorWorkProductTab extends FormPage implements ISaveable,
}
}
try {
- if (!(coveragePackageBase instanceof CoveragePackage)) {
- AWorkbench.popup("Must be coverage package");
- return;
- }
if (coverageEditor.getBranch() == null) {
AWorkbench.popup("Coverage Package must have imports before work package applied");
return;
}
- CoveragePackage coveragePackage = (CoveragePackage) coveragePackageBase;
OseeCoveragePackageStore store =
OseeCoveragePackageStore.get(coveragePackage, coverageEditor.getBranch());
for (Artifact artifact : dropArtifacts) {
@@ -158,28 +150,15 @@ public class CoverageEditorWorkProductTab extends FormPage implements ISaveable,
};
}
- public Collection<Artifact> getWorkProductArtifacts() {
- try {
- CoveragePackage coveragePackage = (CoveragePackage) coveragePackageBase;
- OseeCoveragePackageStore store = OseeCoveragePackageStore.get(coveragePackage, coverageEditor.getBranch());
- Artifact art = store.getArtifact(false);
- if (art != null) {
- return art.getRelatedArtifacts(CoreRelationTypes.SupportingInfo_SupportingInfo);
- }
- } catch (OseeCoreException ex) {
- OseeLog.log(Activator.class, Level.SEVERE, ex);
- }
- return Collections.emptyList();
- }
-
- private void refresh() {
- actionListViewer.setInput(getWorkProductArtifacts());
+ public void refresh() {
+ coveragePackage.getWorkProductTaskProvider().reload();
+ actionListViewer.setInput(coveragePackage.getWorkProductTaskProvider().getWorkProductRelatedActions());
}
private XListViewer createActionListViewer(Composite parent) {
actionListViewer = new XListViewer("Drag in Actions related to changing work products");
- actionListViewer.setContentProvider(new ArtifactContentProvider());
- actionListViewer.setLabelProvider(new TeamWorkflowLabelProvider());
+ actionListViewer.setContentProvider(new ArrayContentProvider());
+ actionListViewer.setLabelProvider(new StringLabelProvider());
actionListViewer.createWidgets(parent, 2);
coverageEditor.getToolkit().adapt(actionListViewer.getTable());
coverageEditor.getToolkit().adapt(actionListViewer.getLabelWidget(), true, true);
@@ -191,8 +170,9 @@ public class CoverageEditorWorkProductTab extends FormPage implements ISaveable,
public void createToolbar() {
IToolBarManager toolBarManager = scrolledForm.getToolBarManager();
- toolBarManager.add(new OpenMultipleWorkProductsAction(coverageEditor, this));
- toolBarManager.add(new RemoveRelatedWorkProductAction(coverageEditor, this, this));
+ toolBarManager.add(new OpenMultipleWorkProductsAction(coverageEditor,
+ coveragePackage.getWorkProductTaskProvider()));
+ toolBarManager.add(new RemoveRelatedWorkProductAction(this));
CoverageEditor.addToToolBar(scrolledForm.getToolBarManager(), coverageEditor);
scrolledForm.updateToolBar();
}
@@ -204,18 +184,17 @@ public class CoverageEditorWorkProductTab extends FormPage implements ISaveable,
@Override
public Result isEditable() {
- return coveragePackageBase.isEditable();
+ return coveragePackage.isEditable();
}
@Override
public Result save() throws OseeCoreException {
- return OseeCoveragePackageStore.get((CoveragePackage) coveragePackageBase, coverageEditor.getBranch()).save();
+ return OseeCoveragePackageStore.get(coveragePackage, coverageEditor.getBranch()).save();
}
@Override
public Result save(Collection<ICoverage> coverages) throws OseeCoreException {
- return OseeCoveragePackageStore.get((CoveragePackage) coveragePackageBase, coverageEditor.getBranch()).save(
- coverages);
+ return OseeCoveragePackageStore.get(coveragePackage, coverageEditor.getBranch()).save(coverages);
}
@Override
@@ -228,28 +207,24 @@ public class CoverageEditorWorkProductTab extends FormPage implements ISaveable,
return coverageEditor.getBranch();
}
- @Override
- public Collection<Artifact> getSelectedArtifacts() {
- return getSelectedArtifactItems();
+ public XListViewer getActionListViewer() {
+ return actionListViewer;
+ }
+
+ public CoveragePackage getCoveragePackage() {
+ return coveragePackage;
}
@Override
public void refresh(Object element) {
- refresh();
}
@Override
public void update(Object element) {
- // do nothing
}
@Override
public void remove(Object element) {
- // do nothing
- }
-
- public XListViewer getActionListViewer() {
- return actionListViewer;
}
}
diff --git a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/editor/xcover/CoverageXViewer.java b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/editor/xcover/CoverageXViewer.java
index ac24caf503..302d2be533 100644
--- a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/editor/xcover/CoverageXViewer.java
+++ b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/editor/xcover/CoverageXViewer.java
@@ -36,6 +36,7 @@ import org.eclipse.osee.coverage.model.CoverageItem;
import org.eclipse.osee.coverage.model.CoverageOptionManager;
import org.eclipse.osee.coverage.model.CoverageUnit;
import org.eclipse.osee.coverage.model.ICoverage;
+import org.eclipse.osee.coverage.model.IWorkProductTaskProvider;
import org.eclipse.osee.coverage.util.ISaveable;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
import org.eclipse.osee.framework.core.model.Branch;
@@ -81,7 +82,7 @@ public class CoverageXViewer extends XViewer implements ISelectedCoverageEditorI
editCoverageStatusAction = new EditCoverageNotesAction(this, this, this);
editRationaleAction = new EditRationaleAction(this, this, this);
deleteCoverUnitAction = new DeleteCoverUnitAction(this, this, this);
- createWorkProductTaskAction = new CreateWorkProductTaskAction(this);
+ createWorkProductTaskAction = new CreateWorkProductTaskAction(this, this, this);
}
}
@@ -132,6 +133,10 @@ public class CoverageXViewer extends XViewer implements ISelectedCoverageEditorI
return true;
}
+ public IWorkProductTaskProvider getWorkProductTaskProvider() {
+ return xCoverageViewer.getWorkProductTaskProvider();
+ }
+
private boolean isEditMetricsEnabled() {
if (xCoverageViewer.getSelectedCoverageItems().isEmpty()) {
return false;
@@ -165,8 +170,10 @@ public class CoverageXViewer extends XViewer implements ISelectedCoverageEditorI
mm.insertBefore(MENU_GROUP_PRE, new Separator());
- mm.insertBefore(MENU_GROUP_PRE, createWorkProductTaskAction);
- createWorkProductTaskAction.setEnabled(isCreateWorkProductTaskActionEnabled());
+ if (xCoverageViewer.getWorkProductTaskProvider() != null) {
+ mm.insertBefore(MENU_GROUP_PRE, createWorkProductTaskAction);
+ createWorkProductTaskAction.setEnabled(isCreateWorkProductTaskActionEnabled());
+ }
mm.insertBefore(MENU_GROUP_PRE, new Separator());
diff --git a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/editor/xcover/XCoverageViewer.java b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/editor/xcover/XCoverageViewer.java
index 037813a1d6..b4aa0a6038 100644
--- a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/editor/xcover/XCoverageViewer.java
+++ b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/editor/xcover/XCoverageViewer.java
@@ -19,6 +19,7 @@ import org.eclipse.core.runtime.Status;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.osee.coverage.model.CoverageOptionManager;
import org.eclipse.osee.coverage.model.ICoverage;
+import org.eclipse.osee.coverage.model.IWorkProductTaskProvider;
import org.eclipse.osee.coverage.util.ISaveable;
import org.eclipse.osee.framework.jdk.core.util.AHTML;
import org.eclipse.osee.framework.jdk.core.util.Collections;
@@ -48,16 +49,18 @@ public class XCoverageViewer extends XWidget {
private final Collection<TableType> tableTypes;
private final ISaveable saveable;
private final CoverageOptionManager coverageOptionManager;
+ private final IWorkProductTaskProvider workProductTaskProvider;
public static enum TableType {
Package,
Merge,
Import
};
- public XCoverageViewer(ISaveable saveable, CoverageOptionManager coverageOptionManager, TableType tableType, TableType... types) {
+ public XCoverageViewer(ISaveable saveable, CoverageOptionManager coverageOptionManager, IWorkProductTaskProvider workProductTaskProvider, TableType tableType, TableType... types) {
super("Coverage Items");
this.saveable = saveable;
this.coverageOptionManager = coverageOptionManager;
+ this.workProductTaskProvider = workProductTaskProvider;
this.tableTypes = Collections.getAggregate(types);
this.tableTypes.add(tableType);
}
@@ -245,4 +248,8 @@ public class XCoverageViewer extends XWidget {
return coverageOptionManager;
}
+ public IWorkProductTaskProvider getWorkProductTaskProvider() {
+ return workProductTaskProvider;
+ }
+
}
diff --git a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/editor/xmerge/XCoverageMergeViewer.java b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/editor/xmerge/XCoverageMergeViewer.java
index fd8ff67073..ba01f2e040 100644
--- a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/editor/xmerge/XCoverageMergeViewer.java
+++ b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/editor/xmerge/XCoverageMergeViewer.java
@@ -32,7 +32,7 @@ public class XCoverageMergeViewer extends XCoverageViewer implements IRefreshAct
private final MergeManager mergeManager;
public XCoverageMergeViewer(MergeManager mergeManager, ISaveable saveable, CoverageMergeXViewerFactory coverageMergeXViewerFactory, CoverageOptionManager coverageOptionManager, TableType tableType, TableType... types) {
- super(saveable, coverageOptionManager, tableType, types);
+ super(saveable, coverageOptionManager, null, tableType, types);
this.mergeManager = mergeManager;
this.coverageMergeXViewerFactory = coverageMergeXViewerFactory;
}
diff --git a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/model/CoverageItem.java b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/model/CoverageItem.java
index a582a4e7ca..082c7466b3 100644
--- a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/model/CoverageItem.java
+++ b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/model/CoverageItem.java
@@ -28,7 +28,7 @@ import org.eclipse.osee.framework.ui.swt.KeyedImage;
/**
* @author Donald G. Dunne
*/
-public class CoverageItem extends NamedIdentity implements ICoverage {
+public class CoverageItem extends NamedIdentity implements ICoverage, IWorkProductRelatable {
CoverageOption coverageMethod = CoverageOptionManager.Not_Covered;
String rationale;
@@ -81,6 +81,7 @@ public class CoverageItem extends NamedIdentity implements ICoverage {
coverageitem.setOrderNumber(orderNumber);
coverageitem.setRationale(rationale);
coverageitem.setTestUnitProvider(testUnitProvider);
+ coverageitem.setWorkProductGuid(workProductGuid);
return coverageitem;
}
@@ -251,6 +252,9 @@ public class CoverageItem extends NamedIdentity implements ICoverage {
if (Strings.isValid(store.get("rationale"))) {
setRationale(store.get("rationale"));
}
+ if (Strings.isValid(store.get("workProductGuid"))) {
+ setWorkProductGuid(store.get("workProductGuid"));
+ }
if (testUnitProvider == null) {
testUnitProvider = new SimpleTestUnitProvider();
}
@@ -273,6 +277,9 @@ public class CoverageItem extends NamedIdentity implements ICoverage {
if (Strings.isValid(orderNumber)) {
store.put("order", orderNumber);
}
+ if (Strings.isValid(workProductGuid)) {
+ store.put("workProductGuid", workProductGuid);
+ }
store.put("methodType", coverageMethod.getName());
if (testUnitProvider != null) {
if (Strings.isValid(testUnitProvider.toXml(this))) {
@@ -282,9 +289,6 @@ public class CoverageItem extends NamedIdentity implements ICoverage {
if (Strings.isValid(getName())) {
store.put("name", getName());
}
- if (Strings.isValid(getName())) {
- store.put("name", getName());
- }
String toReturn = null;
try {
toReturn = store.save();
@@ -306,10 +310,12 @@ public class CoverageItem extends NamedIdentity implements ICoverage {
return "";
}
+ @Override
public String getWorkProductGuid() {
return workProductGuid;
}
+ @Override
public void setWorkProductGuid(String workProductGuid) {
this.workProductGuid = workProductGuid;
}
diff --git a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/model/CoveragePackage.java b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/model/CoveragePackage.java
index f6d01ddacc..7335a4d018 100644
--- a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/model/CoveragePackage.java
+++ b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/model/CoveragePackage.java
@@ -20,17 +20,20 @@ import org.eclipse.osee.framework.ui.skynet.results.XResultData;
public class CoveragePackage extends CoveragePackageBase {
Date creationDate;
+ IWorkProductTaskProvider workProductTaskProvider;
- public CoveragePackage(String guid, String name, CoverageOptionManager coverageOptionManager) {
- this(guid, name, new Date(), coverageOptionManager);
+ public CoveragePackage(String guid, String name, CoverageOptionManager coverageOptionManager, IWorkProductTaskProvider workProductTaskProvider) {
+ this(guid, name, new Date(), coverageOptionManager, workProductTaskProvider);
}
- public CoveragePackage(String name, CoverageOptionManager coverageOptionManager) {
- this(null, name, coverageOptionManager);
+ public CoveragePackage(String name, CoverageOptionManager coverageOptionManager, IWorkProductTaskProvider workProductTaskProvider) {
+ this(null, name, coverageOptionManager, workProductTaskProvider);
}
- public CoveragePackage(String guid, String name, Date runDate, CoverageOptionManager coverageOptionManager) {
+ public CoveragePackage(String guid, String name, Date runDate, CoverageOptionManager coverageOptionManager, IWorkProductTaskProvider workProductTaskProvider) {
super(guid, name, coverageOptionManager);
+ this.workProductTaskProvider = workProductTaskProvider;
+ this.workProductTaskProvider.setCoveragePackage(this);
this.creationDate = runDate;
}
@@ -75,4 +78,8 @@ public class CoveragePackage extends CoveragePackageBase {
return "";
}
+ public IWorkProductTaskProvider getWorkProductTaskProvider() {
+ return workProductTaskProvider;
+ }
+
}
diff --git a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/model/CoverageUnit.java b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/model/CoverageUnit.java
index 46723868be..efe85ade68 100644
--- a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/model/CoverageUnit.java
+++ b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/model/CoverageUnit.java
@@ -30,7 +30,7 @@ import org.eclipse.osee.framework.ui.swt.KeyedImage;
*
* @author Donald G. Dunne
*/
-public class CoverageUnit extends NamedIdentity implements ICoverage, ICoverageUnitProvider, ICoverageItemProvider {
+public class CoverageUnit extends NamedIdentity implements IWorkProductRelatable, ICoverage, ICoverageUnitProvider, ICoverageItemProvider {
String namespace;
boolean folder;
@@ -292,6 +292,7 @@ public class CoverageUnit extends NamedIdentity implements ICoverage, ICoverageU
coverageUnit.setOrderNumber(orderNumber);
coverageUnit.setFolder(folder);
coverageUnit.setAssignees(assignees);
+ coverageUnit.setWorkProductGuid(workProductGuid);
coverageUnit.setLocation(location);
if (includeItems) {
for (CoverageItem coverageItem : coverageItems) {
@@ -363,10 +364,12 @@ public class CoverageUnit extends NamedIdentity implements ICoverage, ICoverageU
return "";
}
+ @Override
public String getWorkProductGuid() {
return workProductGuid;
}
+ @Override
public void setWorkProductGuid(String workProductGuid) {
this.workProductGuid = workProductGuid;
}
diff --git a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/model/IWorkProductRelatable.java b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/model/IWorkProductRelatable.java
new file mode 100644
index 0000000000..4ac03170bc
--- /dev/null
+++ b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/model/IWorkProductRelatable.java
@@ -0,0 +1,13 @@
+/*
+ * Created on Sep 15, 2010
+ *
+ * PLACE_YOUR_DISTRIBUTION_STATEMENT_RIGHT_HERE
+ */
+package org.eclipse.osee.coverage.model;
+
+public interface IWorkProductRelatable {
+
+ public String getWorkProductGuid();
+
+ public void setWorkProductGuid(String workProductGuid);
+}
diff --git a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/model/IWorkProductTaskProvider.java b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/model/IWorkProductTaskProvider.java
new file mode 100644
index 0000000000..3f462b8a90
--- /dev/null
+++ b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/model/IWorkProductTaskProvider.java
@@ -0,0 +1,27 @@
+/*
+ * Created on Sep 15, 2010
+ *
+ * PLACE_YOUR_DISTRIBUTION_STATEMENT_RIGHT_HERE
+ */
+package org.eclipse.osee.coverage.model;
+
+import java.util.List;
+
+public interface IWorkProductTaskProvider {
+
+ public List<WorkProductAction> getWorkProductRelatedActions();
+
+ public void removeWorkProductAction(WorkProductAction action);
+
+ public void addWorkProductAction(WorkProductAction action);
+
+ public List<WorkProductTask> getWorkProductTasks();
+
+ public WorkProductTask getWorkProductTask(String guid);
+
+ public void setCoveragePackage(CoveragePackage coveragePackage);
+
+ public CoveragePackage getCoveragePackage();
+
+ public void reload();
+}
diff --git a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/model/SimpleWorkProductTaskProvider.java b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/model/SimpleWorkProductTaskProvider.java
new file mode 100644
index 0000000000..27f451699f
--- /dev/null
+++ b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/model/SimpleWorkProductTaskProvider.java
@@ -0,0 +1,67 @@
+/*
+ * Created on Sep 15, 2010
+ *
+ * PLACE_YOUR_DISTRIBUTION_STATEMENT_RIGHT_HERE
+ */
+package org.eclipse.osee.coverage.model;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class SimpleWorkProductTaskProvider implements IWorkProductTaskProvider {
+
+ List<WorkProductAction> actions = new ArrayList<WorkProductAction>();
+ private CoveragePackage coveragePackage;
+
+ @Override
+ public List<WorkProductAction> getWorkProductRelatedActions() {
+ return actions;
+ }
+
+ @Override
+ public void removeWorkProductAction(WorkProductAction action) {
+ actions.remove(action);
+ }
+
+ @Override
+ public void addWorkProductAction(WorkProductAction action) {
+ actions.add(action);
+ }
+
+ @Override
+ public List<WorkProductTask> getWorkProductTasks() {
+ List<WorkProductTask> tasks = new ArrayList<WorkProductTask>();
+ for (WorkProductAction action : actions) {
+ tasks.addAll(action.getTasks());
+ }
+ return tasks;
+ }
+
+ @Override
+ public WorkProductTask getWorkProductTask(String guid) {
+ for (WorkProductAction action : actions) {
+ for (WorkProductTask task : action.getTasks()) {
+ if (task.getGuid().equals(guid)) {
+ return task;
+ }
+ }
+ }
+ return null;
+ }
+
+ @Override
+ public void setCoveragePackage(CoveragePackage coveragePackage) {
+ this.coveragePackage = coveragePackage;
+ }
+
+ @Override
+ public CoveragePackage getCoveragePackage() {
+ return coveragePackage;
+ }
+
+ @Override
+ public void reload() {
+ // do nothing
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/model/WorkProductAction.java b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/model/WorkProductAction.java
new file mode 100644
index 0000000000..51713b6c18
--- /dev/null
+++ b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/model/WorkProductAction.java
@@ -0,0 +1,75 @@
+/*
+ * Created on Sep 15, 2010
+ *
+ * PLACE_YOUR_DISTRIBUTION_STATEMENT_RIGHT_HERE
+ */
+package org.eclipse.osee.coverage.model;
+
+import java.util.HashSet;
+import java.util.Set;
+
+public class WorkProductAction {
+
+ String guid;
+ String name;
+ boolean completed;
+ Set<WorkProductTask> tasks = new HashSet<WorkProductTask>();
+
+ public WorkProductAction(String guid, String name, boolean completed) {
+ super();
+ this.guid = guid;
+ this.name = name;
+ this.completed = completed;
+ }
+
+ public String getGuid() {
+ return guid;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public boolean isCompleted() {
+ return completed;
+ }
+
+ public Set<WorkProductTask> getTasks() {
+ return tasks;
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((guid == null) ? 0 : guid.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (obj == null) {
+ return false;
+ }
+ if (getClass() != obj.getClass()) {
+ return false;
+ }
+ WorkProductAction other = (WorkProductAction) obj;
+ if (guid == null) {
+ if (other.guid != null) {
+ return false;
+ }
+ } else if (!guid.equals(other.guid)) {
+ return false;
+ }
+ return true;
+ }
+
+ @Override
+ public String toString() {
+ return getName() + " - " + (completed ? "[Completed]" : "[InWork]");
+ }
+}
diff --git a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/model/WorkProductTask.java b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/model/WorkProductTask.java
new file mode 100644
index 0000000000..7eddce81c5
--- /dev/null
+++ b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/model/WorkProductTask.java
@@ -0,0 +1,85 @@
+/*
+ * Created on Sep 15, 2010
+ *
+ * PLACE_YOUR_DISTRIBUTION_STATEMENT_RIGHT_HERE
+ */
+package org.eclipse.osee.coverage.model;
+
+public class WorkProductTask {
+
+ String guid;
+ String name;
+ boolean completed;
+ WorkProductAction parent;
+
+ public WorkProductTask(String guid, String name, boolean completed, WorkProductAction parent) {
+ super();
+ this.guid = guid;
+ this.name = name;
+ this.completed = completed;
+ this.parent = parent;
+ }
+
+ public String getGuid() {
+ return guid;
+ }
+
+ public void setGuid(String guid) {
+ this.guid = guid;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public boolean isCompleted() {
+ return completed;
+ }
+
+ public void setCompleted(boolean completed) {
+ this.completed = completed;
+ }
+
+ public WorkProductAction getParent() {
+ return parent;
+ }
+
+ public void setParent(WorkProductAction parent) {
+ this.parent = parent;
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((guid == null) ? 0 : guid.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (obj == null) {
+ return false;
+ }
+ if (getClass() != obj.getClass()) {
+ return false;
+ }
+ WorkProductTask other = (WorkProductTask) obj;
+ if (guid == null) {
+ if (other.guid != null) {
+ return false;
+ }
+ } else if (!guid.equals(other.guid)) {
+ return false;
+ }
+ return true;
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/store/CoverageAttributeTypes.java b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/store/CoverageAttributeTypes.java
index 68968b1fed..1ffe7d3cdf 100644
--- a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/store/CoverageAttributeTypes.java
+++ b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/store/CoverageAttributeTypes.java
@@ -24,6 +24,7 @@ public class CoverageAttributeTypes extends NamedIdentity implements IAttributeT
public static final IAttributeType FileContents = new CoverageAttributeTypes("AARDJK8YAT3SDnghjQgA", "coverage.File Contents");
public static final IAttributeType Location = new CoverageAttributeTypes("AARA2XwhNRddgQrd0iwA", "coverage.Location");
public static final IAttributeType Namespace = new CoverageAttributeTypes("AAQ_v6uUrh0j39+4D5gA", "coverage.Namespace");
+ public static final IAttributeType WorkProductGuid = new CoverageAttributeTypes("A+m7Y2sV2z83QUlkzIAA", "coverage.WorkProductGuid");
public static final IAttributeType Notes = new CoverageAttributeTypes("AARERmIjazD1udUwfLgA", "coverage.Notes");
public static final IAttributeType Order = new CoverageAttributeTypes("AD72opMBR1pFxB0hVpQA", "coverage.Order");
// @formatter:on
diff --git a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/store/DbWorkProductTaskProvider.java b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/store/DbWorkProductTaskProvider.java
new file mode 100644
index 0000000000..5bd8fe3fe1
--- /dev/null
+++ b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/store/DbWorkProductTaskProvider.java
@@ -0,0 +1,124 @@
+/*
+ * Created on Sep 15, 2010
+ *
+ * PLACE_YOUR_DISTRIBUTION_STATEMENT_RIGHT_HERE
+ */
+package org.eclipse.osee.coverage.store;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.logging.Level;
+import org.eclipse.osee.coverage.internal.Activator;
+import org.eclipse.osee.coverage.model.CoveragePackage;
+import org.eclipse.osee.coverage.model.IWorkProductTaskProvider;
+import org.eclipse.osee.coverage.model.WorkProductAction;
+import org.eclipse.osee.coverage.model.WorkProductTask;
+import org.eclipse.osee.framework.core.enums.CoreRelationTypes;
+import org.eclipse.osee.framework.core.exception.OseeCoreException;
+import org.eclipse.osee.framework.core.model.Branch;
+import org.eclipse.osee.framework.logging.OseeLevel;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.ui.skynet.SkynetGuiPlugin;
+import org.eclipse.osee.framework.ui.skynet.cm.IOseeCmService;
+
+public class DbWorkProductTaskProvider implements IWorkProductTaskProvider {
+
+ private CoveragePackage coveragePackage;
+ private final Branch branch;
+ List<WorkProductAction> actions = new ArrayList<WorkProductAction>();
+ Map<String, WorkProductTask> guidToTasks = new HashMap<String, WorkProductTask>();
+
+ public DbWorkProductTaskProvider(Branch branch) {
+ this.branch = branch;
+ }
+
+ @Override
+ public List<WorkProductAction> getWorkProductRelatedActions() {
+ return actions;
+ }
+
+ @Override
+ public void reload() {
+ actions.clear();
+ guidToTasks.clear();
+ try {
+ OseeCoveragePackageStore store = OseeCoveragePackageStore.get(coveragePackage, branch);
+ IOseeCmService cm = SkynetGuiPlugin.getInstance().getOseeCmService();
+ Artifact packageArt = store.getArtifact(false);
+ if (packageArt != null) {
+ for (Artifact pcrArt : packageArt.getRelatedArtifacts(CoreRelationTypes.SupportingInfo_SupportingInfo)) {
+ if (cm.isPcrArtifact(pcrArt)) {
+ WorkProductAction action =
+ new WorkProductAction(pcrArt.getGuid(), pcrArt.getName(), cm.isCompleted(pcrArt));
+ actions.add(action);
+ for (Artifact taskArt : cm.getTaskArtifacts(pcrArt)) {
+ action.getTasks().add(
+ new WorkProductTask(taskArt.getGuid(), taskArt.getName(), cm.isCompleted(taskArt), action));
+ }
+ }
+ }
+ }
+ } catch (OseeCoreException ex) {
+ OseeLog.log(Activator.class, Level.SEVERE, ex);
+ }
+ }
+
+ @Override
+ public void removeWorkProductAction(WorkProductAction action) {
+ try {
+ OseeCoveragePackageStore store = OseeCoveragePackageStore.get(coveragePackage, branch);
+ for (Artifact artifact : store.getArtifact(false).getRelatedArtifacts(
+ CoreRelationTypes.SupportingInfo_SupportingInfo)) {
+ if (artifact.getGuid().equals(action.getGuid())) {
+ store.getArtifact(false).deleteRelation(CoreRelationTypes.SupportingInfo_SupportingInfo, artifact);
+ }
+ }
+ store.getArtifact(false).persist("Un-Relate Coverage work product Actions");
+ reload();
+ } catch (OseeCoreException ex) {
+ OseeLog.log(Activator.class, OseeLevel.SEVERE_POPUP, ex);
+ }
+ }
+
+ @Override
+ public void addWorkProductAction(WorkProductAction action) {
+ reload();
+ }
+
+ @Override
+ public List<WorkProductTask> getWorkProductTasks() {
+ List<WorkProductTask> tasks = new ArrayList<WorkProductTask>();
+ for (WorkProductAction action : actions) {
+ tasks.addAll(action.getTasks());
+ }
+ return tasks;
+
+ }
+
+ @Override
+ public WorkProductTask getWorkProductTask(String guid) {
+ for (WorkProductAction action : actions) {
+ for (WorkProductTask task : action.getTasks()) {
+ if (task.getGuid().equals(guid)) {
+ return task;
+ }
+ }
+ }
+ return null;
+ }
+
+ @Override
+ public void setCoveragePackage(CoveragePackage coveragePackage) {
+ this.coveragePackage = coveragePackage;
+ reload();
+ }
+
+ @Override
+ public CoveragePackage getCoveragePackage() {
+ return coveragePackage;
+ }
+
+}
diff --git a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/store/OseeCoveragePackageStore.java b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/store/OseeCoveragePackageStore.java
index 50db31a81d..7f17716777 100644
--- a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/store/OseeCoveragePackageStore.java
+++ b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/store/OseeCoveragePackageStore.java
@@ -53,7 +53,9 @@ public class OseeCoveragePackageStore extends OseeCoverageStore implements ISave
super(null, CoverageArtifactTypes.CoveragePackage, artifact.getBranch());
this.artifact = artifact;
coverageOptionManager = new CoverageOptionManagerStore(this).getCoverageOptionManager();
- this.coveragePackage = new CoveragePackage(artifact.getGuid(), artifact.getName(), coverageOptionManager);
+ this.coveragePackage =
+ new CoveragePackage(artifact.getGuid(), artifact.getName(), coverageOptionManager,
+ new DbWorkProductTaskProvider(this.artifact.getBranch()));
load(coverageOptionManager);
}
diff --git a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/store/OseeCoverageUnitStore.java b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/store/OseeCoverageUnitStore.java
index fa1617e1bb..cc1c4a50ae 100644
--- a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/store/OseeCoverageUnitStore.java
+++ b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/store/OseeCoverageUnitStore.java
@@ -90,6 +90,8 @@ public class OseeCoverageUnitStore extends OseeCoverageStore {
coverageUnit.setNotes(artifact.getSoleAttributeValueAsString(CoverageAttributeTypes.Notes, ""));
coverageUnit.setFolder(artifact.isOfType(CoverageArtifactTypes.CoverageFolder));
coverageUnit.setAssignees(artifact.getSoleAttributeValueAsString(CoverageAttributeTypes.Assignees, ""));
+ coverageUnit.setWorkProductGuid(artifact.getSoleAttributeValueAsString(CoverageAttributeTypes.WorkProductGuid,
+ ""));
coverageUnit.setNamespace(artifact.getSoleAttributeValueAsString(CoverageAttributeTypes.Namespace, ""));
coverageUnit.setOrderNumber(artifact.getSoleAttributeValueAsString(CoverageAttributeTypes.Order, ""));
coverageUnit.setLocation(artifact.getSoleAttributeValueAsString(CoverageAttributeTypes.Location, ""));
@@ -125,6 +127,9 @@ public class OseeCoverageUnitStore extends OseeCoverageStore {
if (Strings.isValid(coverageUnit.getNamespace())) {
artifact.setSoleAttributeFromString(CoverageAttributeTypes.Namespace, coverageUnit.getNamespace());
}
+ if (Strings.isValid(coverageUnit.getWorkProductGuid())) {
+ artifact.setSoleAttributeFromString(CoverageAttributeTypes.WorkProductGuid, coverageUnit.getWorkProductGuid());
+ }
if (coverageUnit.getFileContentsProvider() != null && coverageUnit.getFileContentsProvider() != OseeCoverageUnitFileContentsProvider.getInstance(branch)) {
String fileContents = coverageUnit.getFileContents();
if (Strings.isValid(fileContents)) {
diff --git a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/util/TeamWorkflowLabelProvider.java b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/util/TeamWorkflowLabelProvider.java
deleted file mode 100644
index 0b849eef58..0000000000
--- a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/util/TeamWorkflowLabelProvider.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2007 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.coverage.util;
-
-import org.eclipse.osee.coverage.internal.Activator;
-import org.eclipse.osee.coverage.store.CoverageRelationTypes;
-import org.eclipse.osee.framework.core.exception.ArtifactDoesNotExist;
-import org.eclipse.osee.framework.core.exception.OseeCoreException;
-import org.eclipse.osee.framework.logging.OseeLevel;
-import org.eclipse.osee.framework.logging.OseeLog;
-import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
-import org.eclipse.osee.framework.ui.skynet.ArtifactLabelProvider;
-
-/**
- * @author Donald G. Dunne
- */
-public class TeamWorkflowLabelProvider extends ArtifactLabelProvider {
-
- public TeamWorkflowLabelProvider() {
- super();
- }
-
- @Override
- public String getText(Object element) {
- Artifact teamWf = (Artifact) element;
- try {
- Artifact version = getTargetedForVersion(teamWf);
- if (version != null) {
- return "[" + teamWf.getArtifactTypeName() + "][" + version.getName() + "] - " + teamWf.getName();
- } else {
- return "[" + teamWf.getArtifactTypeName() + "] - " + teamWf.getName();
- }
- } catch (OseeCoreException ex) {
- OseeLog.log(Activator.class, OseeLevel.SEVERE_POPUP, ex);
- return "Exception: " + ex.getLocalizedMessage();
- }
- }
-
- private Artifact getTargetedForVersion(Artifact teamWf) throws OseeCoreException {
- try {
- return teamWf.getRelatedArtifact(CoverageRelationTypes.TeamWorkflowTargetedForVersion_Version);
- } catch (ArtifactDoesNotExist ex) {
- // do nothing;
- }
- return null;
- }
-}
diff --git a/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/util/dialog/WorkProductListDialog.java b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/util/dialog/WorkProductListDialog.java
new file mode 100644
index 0000000000..2cdb4afb37
--- /dev/null
+++ b/plugins/org.eclipse.osee.coverage/src/org/eclipse/osee/coverage/util/dialog/WorkProductListDialog.java
@@ -0,0 +1,52 @@
+/*******************************************************************************
+ * Copyright (c) 2010 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.coverage.util.dialog;
+
+import java.util.Collection;
+import org.eclipse.jface.viewers.IStructuredContentProvider;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.osee.framework.ui.swt.Displays;
+
+/**
+ * @author Donald G. Dunne
+ */
+public class WorkProductListDialog extends org.eclipse.ui.dialogs.ListDialog {
+
+ public WorkProductListDialog(String title, String message) {
+ super(Displays.getActiveShell());
+ setTitle(title);
+ setMessage(message);
+ setContentProvider(new IStructuredContentProvider() {
+ @Override
+ public Object[] getElements(Object arg0) {
+ return ((Collection<?>) arg0).toArray();
+ }
+
+ @Override
+ public void dispose() {
+ // do nothing
+ }
+
+ @Override
+ public void inputChanged(Viewer arg0, Object arg1, Object arg2) {
+ // do nothing
+ }
+ });
+ setLabelProvider(new LabelProvider() {
+ @Override
+ public String getText(Object element) {
+ return element.toString();
+ }
+ });
+
+ }
+}
diff --git a/plugins/org.eclipse.osee.coverage/support/OseeTypes_Coverage.osee b/plugins/org.eclipse.osee.coverage/support/OseeTypes_Coverage.osee
index af426c4f11..2f2a1327e0 100644
--- a/plugins/org.eclipse.osee.coverage/support/OseeTypes_Coverage.osee
+++ b/plugins/org.eclipse.osee.coverage/support/OseeTypes_Coverage.osee
@@ -31,6 +31,14 @@ attributeType "coverage.File Contents" extends StringAttribute {
fileExtension "txt"
}
+attributeType "coverage.WorkProductGuid" extends StringAttribute {
+ guid "A+m7Y2sV2z83QUlkzIAA"
+ dataProvider DefaultAttributeDataProvider
+ min 0
+ max 1
+ fileExtension "txt"
+}
+
attributeType "coverage.Assignees" extends StringAttribute {
guid "AARCA+XjSyKjnh3sweQA"
dataProvider DefaultAttributeDataProvider
diff --git a/plugins/org.eclipse.osee.framework.ui.plugin/src/org/eclipse/osee/framework/ui/plugin/util/StringLabelProvider.java b/plugins/org.eclipse.osee.framework.ui.plugin/src/org/eclipse/osee/framework/ui/plugin/util/StringLabelProvider.java
index e8ddac5879..1754a38507 100644
--- a/plugins/org.eclipse.osee.framework.ui.plugin/src/org/eclipse/osee/framework/ui/plugin/util/StringLabelProvider.java
+++ b/plugins/org.eclipse.osee.framework.ui.plugin/src/org/eclipse/osee/framework/ui/plugin/util/StringLabelProvider.java
@@ -28,7 +28,7 @@ public class StringLabelProvider implements ILabelProvider {
@Override
public String getText(Object arg0) {
- return (String) arg0;
+ return arg0.toString();
}
@Override
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/cm/IOseeCmService.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/cm/IOseeCmService.java
index d70d45871f..231fe1f944 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/cm/IOseeCmService.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/cm/IOseeCmService.java
@@ -11,6 +11,7 @@
package org.eclipse.osee.framework.ui.skynet.cm;
import java.util.Collection;
+import java.util.List;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
import org.eclipse.osee.framework.ui.swt.KeyedImage;
@@ -28,5 +29,13 @@ public interface IOseeCmService {
void openArtifacts(String name, Collection<Artifact> artifacts, OseeCmEditor oseeCmEditor);
+ boolean isPcrArtifact(Artifact artifact);
+
+ boolean isCompleted(Artifact artifact);
+
+ List<Artifact> getTaskArtifacts(Artifact pcrArtifact);
+
KeyedImage getOpenImage(OseeCmEditor oseeCmEditor);
+
+ Artifact createWorkTask(String name, String parentPcrGuid);
}

Back to the top