Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRyan D. Brooks2020-02-20 16:56:13 +0000
committerRyan D. Brooks2020-12-15 21:40:31 +0000
commit2ef4d681f4f34b8061f8c2a77071c98db0b06188 (patch)
tree695cd9219226fb7c479d7c8ed11d9ceff2221478
parent07c8a8974fcb71794b223539b886d0736a106733 (diff)
downloadorg.eclipse.osee-2ef4d681f4f34b8061f8c2a77071c98db0b06188.tar.gz
org.eclipse.osee-2ef4d681f4f34b8061f8c2a77071c98db0b06188.tar.xz
org.eclipse.osee-2ef4d681f4f34b8061f8c2a77071c98db0b06188.zip
refactor[TW16547]: Use AttributeTypeGeneric with ArtifactPrompt
-rw-r--r--plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/column/PriorityColumnUI.java4
-rw-r--r--plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/util/PromptChangeUtil.java12
-rw-r--r--plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/world/WorldXViewer.java3
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet.test/src/org/eclipse/osee/framework/ui/skynet/artifact/ArtifactPromptChangeTest.java5
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/ArtifactPrompt.java6
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/ArtifactPromptChange.java6
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/massEditor/MassXViewer.java8
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/prompt/IPromptFactory.java4
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/prompt/PromptFactory.java4
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/prompt/StringHandlePromptChange.java7
10 files changed, 33 insertions, 26 deletions
diff --git a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/column/PriorityColumnUI.java b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/column/PriorityColumnUI.java
index 3e84e84eaf3..54f0b8aca07 100644
--- a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/column/PriorityColumnUI.java
+++ b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/column/PriorityColumnUI.java
@@ -32,7 +32,7 @@ import org.eclipse.osee.ats.ide.util.PromptChangeUtil;
import org.eclipse.osee.ats.ide.util.xviewer.column.XViewerAtsAttributeValueColumn;
import org.eclipse.osee.ats.ide.workflow.teamwf.TeamWorkFlowArtifact;
import org.eclipse.osee.framework.core.data.AttributeTypeEnum;
-import org.eclipse.osee.framework.core.data.AttributeTypeToken;
+import org.eclipse.osee.framework.core.data.AttributeTypeGeneric;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
import org.eclipse.osee.framework.logging.OseeLevel;
import org.eclipse.osee.framework.logging.OseeLog;
@@ -83,7 +83,7 @@ public class PriorityColumnUI extends XViewerAtsAttributeValueColumn {
return newXCol;
}
- public static boolean promptChangePriority(final Collection<? extends TeamWorkFlowArtifact> teams, AttributeTypeToken attrTypeToken, boolean persist) {
+ public static boolean promptChangePriority(final Collection<? extends TeamWorkFlowArtifact> teams, AttributeTypeGeneric<?> attrTypeToken, boolean persist) {
try {
for (TeamWorkFlowArtifact team : teams) {
diff --git a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/util/PromptChangeUtil.java b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/util/PromptChangeUtil.java
index 5e6a34eb047..db33d4fc8cb 100644
--- a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/util/PromptChangeUtil.java
+++ b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/util/PromptChangeUtil.java
@@ -20,7 +20,7 @@ import java.util.List;
import org.eclipse.osee.ats.api.IAtsWorkItem;
import org.eclipse.osee.ats.ide.internal.Activator;
import org.eclipse.osee.ats.ide.workflow.AbstractWorkflowArtifact;
-import org.eclipse.osee.framework.core.data.AttributeTypeToken;
+import org.eclipse.osee.framework.core.data.AttributeTypeGeneric;
import org.eclipse.osee.framework.logging.OseeLevel;
import org.eclipse.osee.framework.logging.OseeLog;
import org.eclipse.osee.framework.ui.skynet.artifact.ArtifactPromptChange;
@@ -34,7 +34,7 @@ public final class PromptChangeUtil {
// Utility class
}
- public static boolean promptChangeAttributeWI(final Collection<? extends IAtsWorkItem> workItems, AttributeTypeToken attributeType, boolean persist, boolean multiLine) {
+ public static boolean promptChangeAttributeWI(final Collection<? extends IAtsWorkItem> workItems, AttributeTypeGeneric<?> attributeType, boolean persist, boolean multiLine) {
List<AbstractWorkflowArtifact> awas = new LinkedList<>();
for (IAtsWorkItem workItem : workItems) {
awas.add((AbstractWorkflowArtifact) workItem.getStoreObject());
@@ -42,11 +42,11 @@ public final class PromptChangeUtil {
return ArtifactPromptChange.promptChangeAttribute(attributeType, awas, persist, multiLine);
}
- public static boolean promptChangeAttribute(final Collection<? extends AbstractWorkflowArtifact> awas, AttributeTypeToken attributeType, boolean persist, boolean multiLine) {
+ public static boolean promptChangeAttribute(final Collection<? extends AbstractWorkflowArtifact> awas, AttributeTypeGeneric<?> attributeType, boolean persist, boolean multiLine) {
return ArtifactPromptChange.promptChangeAttribute(attributeType, awas, persist, multiLine);
}
- public static boolean promptChangeAttribute(AbstractWorkflowArtifact sma, AttributeTypeToken attributeType, final boolean persist, boolean multiLine) {
+ public static boolean promptChangeAttribute(AbstractWorkflowArtifact sma, AttributeTypeGeneric<?> attributeType, final boolean persist, boolean multiLine) {
try {
return ArtifactPromptChange.promptChangeAttribute(attributeType, Arrays.asList(sma), persist, multiLine);
} catch (Exception ex) {
@@ -55,13 +55,11 @@ public final class PromptChangeUtil {
return false;
}
- public static boolean promptChangeAttribute(IAtsWorkItem workItem, AttributeTypeToken attributeType, boolean persist, boolean multiLine) {
+ public static boolean promptChangeAttribute(IAtsWorkItem workItem, AttributeTypeGeneric<?> attributeType, boolean persist, boolean multiLine) {
if (workItem.getStoreObject() instanceof AbstractWorkflowArtifact) {
return promptChangeAttribute((AbstractWorkflowArtifact) workItem.getStoreObject(), attributeType, persist,
multiLine);
}
return false;
-
}
-
} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/world/WorldXViewer.java b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/world/WorldXViewer.java
index 7a7ef943803..fc68504ff93 100644
--- a/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/world/WorldXViewer.java
+++ b/plugins/org.eclipse.osee.ats.ide/src/org/eclipse/osee/ats/ide/world/WorldXViewer.java
@@ -64,6 +64,7 @@ import org.eclipse.osee.ats.ide.workflow.sprint.SprintArtifact;
import org.eclipse.osee.ats.ide.workflow.task.TaskArtifact;
import org.eclipse.osee.ats.ide.workflow.teamwf.TeamWorkFlowArtifact;
import org.eclipse.osee.ats.ide.workflow.transition.TransitionToMenu;
+import org.eclipse.osee.framework.core.data.AttributeTypeGeneric;
import org.eclipse.osee.framework.core.data.AttributeTypeToken;
import org.eclipse.osee.framework.core.enums.PresentationType;
import org.eclipse.osee.framework.jdk.core.result.XResultData;
@@ -247,7 +248,7 @@ public class WorldXViewer extends XViewer implements ISelectedAtsArtifacts, IPer
}
XResultData rData = new XResultData();
- AttributeTypeToken attributeType = null;
+ AttributeTypeGeneric<?> attributeType = null;
if (treeColumn.getData() instanceof IAttributeColumn) {
attributeType = ((IAttributeColumn) treeColumn.getData()).getAttributeType();
}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet.test/src/org/eclipse/osee/framework/ui/skynet/artifact/ArtifactPromptChangeTest.java b/plugins/org.eclipse.osee.framework.ui.skynet.test/src/org/eclipse/osee/framework/ui/skynet/artifact/ArtifactPromptChangeTest.java
index 1ebb75e739d..cffe7d69fcb 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet.test/src/org/eclipse/osee/framework/ui/skynet/artifact/ArtifactPromptChangeTest.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet.test/src/org/eclipse/osee/framework/ui/skynet/artifact/ArtifactPromptChangeTest.java
@@ -22,6 +22,7 @@ import java.util.logging.Level;
import org.eclipse.osee.framework.core.access.PermissionStatus;
import org.eclipse.osee.framework.core.data.ArtifactToken;
import org.eclipse.osee.framework.core.data.ArtifactTypeId;
+import org.eclipse.osee.framework.core.data.AttributeTypeGeneric;
import org.eclipse.osee.framework.core.data.AttributeTypeId;
import org.eclipse.osee.framework.core.data.AttributeTypeToken;
import org.eclipse.osee.framework.core.data.BranchId;
@@ -119,7 +120,11 @@ public class ArtifactPromptChangeTest {
private static class MockPromptFactory implements IPromptFactory {
@Override
+<<<<<<< HEAD
public IHandlePromptChange createPrompt(AttributeTypeToken attributeType, String displayName, Collection<? extends Artifact> artifacts, boolean persist, boolean multiLine) {
+=======
+ public IHandlePromptChange createPrompt(AttributeTypeGeneric<?> attributeType, String displayName, Collection<? extends Artifact> artifacts, boolean persist, boolean multiLine) {
+>>>>>>> f09ad7a724... refactor[TW16547]: Use AttributeTypeGeneric with ArtifactPrompt
return new TestPromptChange(attributeType, persist);
}
}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/ArtifactPrompt.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/ArtifactPrompt.java
index 828c5c97238..0b0c39ec904 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/ArtifactPrompt.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/ArtifactPrompt.java
@@ -14,7 +14,7 @@
package org.eclipse.osee.framework.ui.skynet.artifact;
import java.util.Collection;
-import org.eclipse.osee.framework.core.data.AttributeTypeToken;
+import org.eclipse.osee.framework.core.data.AttributeTypeGeneric;
import org.eclipse.osee.framework.core.enums.PermissionEnum;
import org.eclipse.osee.framework.logging.OseeLevel;
import org.eclipse.osee.framework.skynet.core.AccessPolicy;
@@ -36,7 +36,7 @@ public final class ArtifactPrompt {
this.policyHandler = policyHandler;
}
- public boolean promptChangeAttribute(AttributeTypeToken attributeType, final Collection<? extends Artifact> artifacts, boolean persist, boolean multiLine) {
+ public boolean promptChangeAttribute(AttributeTypeGeneric<?> attributeType, final Collection<? extends Artifact> artifacts, boolean persist, boolean multiLine) {
boolean toReturn = false;
boolean hasPermission = policyHandler.hasAttributeTypePermission(artifacts, attributeType, PermissionEnum.WRITE,
OseeLevel.SEVERE_POPUP).matched();
@@ -50,4 +50,4 @@ public final class ArtifactPrompt {
}
return toReturn;
}
-}
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/ArtifactPromptChange.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/ArtifactPromptChange.java
index e9819d58f95..4cbc4301993 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/ArtifactPromptChange.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/ArtifactPromptChange.java
@@ -14,7 +14,7 @@
package org.eclipse.osee.framework.ui.skynet.artifact;
import java.util.Collection;
-import org.eclipse.osee.framework.core.data.AttributeTypeToken;
+import org.eclipse.osee.framework.core.data.AttributeTypeGeneric;
import org.eclipse.osee.framework.logging.OseeLevel;
import org.eclipse.osee.framework.logging.OseeLog;
import org.eclipse.osee.framework.skynet.core.AccessPolicy;
@@ -48,11 +48,11 @@ public final class ArtifactPromptChange {
return ArtifactPromptChange.prompt;
}
- public static boolean promptChangeAttribute(AttributeTypeToken attributeType, final Collection<? extends Artifact> artifacts, boolean persist) {
+ public static boolean promptChangeAttribute(AttributeTypeGeneric<?> attributeType, final Collection<? extends Artifact> artifacts, boolean persist) {
return promptChangeAttribute(attributeType, artifacts, persist, true);
}
- public static boolean promptChangeAttribute(AttributeTypeToken attributeType, final Collection<? extends Artifact> artifacts, boolean persist, boolean multiLine) {
+ public static boolean promptChangeAttribute(AttributeTypeGeneric<?> attributeType, final Collection<? extends Artifact> artifacts, boolean persist, boolean multiLine) {
boolean result = false;
ArtifactPrompt prompt = getArtifactPrompt();
if (prompt != null) {
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/massEditor/MassXViewer.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/massEditor/MassXViewer.java
index c29727740a4..7d7772b5884 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/massEditor/MassXViewer.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/massEditor/MassXViewer.java
@@ -29,6 +29,7 @@ import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.nebula.widgets.xviewer.XViewer;
import org.eclipse.nebula.widgets.xviewer.core.model.XViewerColumn;
import org.eclipse.osee.framework.access.AccessControlManager;
+import org.eclipse.osee.framework.core.data.AttributeTypeGeneric;
import org.eclipse.osee.framework.core.data.AttributeTypeToken;
import org.eclipse.osee.framework.core.enums.PermissionEnum;
import org.eclipse.osee.framework.core.enums.PresentationType;
@@ -110,12 +111,12 @@ public class MassXViewer extends XViewer implements IMassViewerEventHandler {
}
try {
if (AttributeTypeManager.typeExists(colName)) {
- AttributeTypeToken attributeType = AttributeTypeManager.getType(colName);
Set<Artifact> artifacts = new HashSet<>();
for (TreeItem item : treeItems) {
artifacts.add((Artifact) item.getData());
}
- if (ArtifactPromptChange.promptChangeAttribute(attributeType, artifacts, false)) {
+ if (ArtifactPromptChange.promptChangeAttribute(AttributeTypeManager.getAttributeType(colName), artifacts,
+ false)) {
refresh();
editor.onDirtied();
}
@@ -150,7 +151,8 @@ public class MassXViewer extends XViewer implements IMassViewerEventHandler {
}
try {
if (AttributeTypeManager.typeExists(colName)) {
- AttributeTypeToken attributeType = null;
+ AttributeTypeGeneric<?> attributeType = null;
+
try {
attributeType = AttributeTypeManager.getType(colName);
} catch (OseeTypeDoesNotExist ex) {
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/prompt/IPromptFactory.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/prompt/IPromptFactory.java
index fa1a8200661..87f5d131411 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/prompt/IPromptFactory.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/prompt/IPromptFactory.java
@@ -14,7 +14,7 @@
package org.eclipse.osee.framework.ui.skynet.artifact.prompt;
import java.util.Collection;
-import org.eclipse.osee.framework.core.data.AttributeTypeToken;
+import org.eclipse.osee.framework.core.data.AttributeTypeGeneric;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
/**
@@ -22,5 +22,5 @@ import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
*/
public interface IPromptFactory {
- IHandlePromptChange createPrompt(AttributeTypeToken attributeType, String displayName, Collection<? extends Artifact> artifacts, boolean persist, boolean multiLine);
+ IHandlePromptChange createPrompt(AttributeTypeGeneric<?> attributeType, String displayName, Collection<? extends Artifact> artifacts, boolean persist, boolean multiLine);
}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/prompt/PromptFactory.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/prompt/PromptFactory.java
index a55c2b535fe..c0b7d1d555f 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/prompt/PromptFactory.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/prompt/PromptFactory.java
@@ -15,7 +15,7 @@ package org.eclipse.osee.framework.ui.skynet.artifact.prompt;
import java.text.NumberFormat;
import java.util.Collection;
-import org.eclipse.osee.framework.core.data.AttributeTypeToken;
+import org.eclipse.osee.framework.core.data.AttributeTypeGeneric;
import org.eclipse.osee.framework.jdk.core.type.OseeStateException;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
@@ -25,7 +25,7 @@ import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
public final class PromptFactory implements IPromptFactory {
@Override
- public IHandlePromptChange createPrompt(AttributeTypeToken attributeType, String displayName, Collection<? extends Artifact> artifacts, boolean persist, boolean multiLine) {
+ public IHandlePromptChange createPrompt(AttributeTypeGeneric<?> attributeType, String displayName, Collection<? extends Artifact> artifacts, boolean persist, boolean multiLine) {
IHandlePromptChange promptChange;
if (attributeType.isDate()) {
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/prompt/StringHandlePromptChange.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/prompt/StringHandlePromptChange.java
index b590fc619ca..6dd96d77c15 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/prompt/StringHandlePromptChange.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/prompt/StringHandlePromptChange.java
@@ -17,6 +17,7 @@ import java.text.NumberFormat;
import java.text.ParseException;
import java.util.Collection;
import org.eclipse.jface.window.Window;
+import org.eclipse.osee.framework.core.data.AttributeTypeGeneric;
import org.eclipse.osee.framework.core.data.AttributeTypeId;
import org.eclipse.osee.framework.core.data.AttributeTypeToken;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
@@ -30,13 +31,13 @@ import org.eclipse.osee.framework.ui.skynet.widgets.dialog.EntryDialog;
*/
public class StringHandlePromptChange implements IHandlePromptChange {
private final EntryDialog entryDialog;
- private final AttributeTypeToken attributeType;
+ private final AttributeTypeGeneric<?> attributeType;
private final boolean persist;
private final boolean multiLine;
private final Collection<? extends Artifact> artifacts;
private final NumberFormat format;
- public StringHandlePromptChange(AttributeTypeToken attributeType, boolean persist, String displayName, Collection<? extends Artifact> artifacts, NumberFormat format, boolean multiLine) {
+ public StringHandlePromptChange(AttributeTypeGeneric<?> attributeType, boolean persist, String displayName, Collection<? extends Artifact> artifacts, NumberFormat format, boolean multiLine) {
this.attributeType = attributeType;
this.persist = persist;
this.artifacts = artifacts;
@@ -72,7 +73,7 @@ public class StringHandlePromptChange implements IHandlePromptChange {
}
}
- private static void updateSmaAttributes(final Collection<? extends Artifact> artifacts, AttributeTypeToken attributeType, NumberFormat format, EntryDialog entryDialog) {
+ private static void updateSmaAttributes(final Collection<? extends Artifact> artifacts, AttributeTypeGeneric<?> attributeType, NumberFormat format, EntryDialog entryDialog) {
for (Artifact artifact : artifacts) {
String value = entryDialog.getEntry();
String safeValue = getSafeValue(value, format, attributeType);

Back to the top