diff options
author | Ryan D. Brooks | 2016-12-10 23:22:28 +0000 |
---|---|---|
committer | David W. Miller | 2016-12-10 23:22:28 +0000 |
commit | 494ea6a387bc2487e5d88532bffc7edf43a49a60 (patch) | |
tree | 253734452d7cbee518220a37472ea697fffec322 | |
parent | 0d60e5f99ea3733fde09c7cf6fa1febc3e089d14 (diff) | |
download | org.eclipse.osee-494ea6a387bc2487e5d88532bffc7edf43a49a60.tar.gz org.eclipse.osee-494ea6a387bc2487e5d88532bffc7edf43a49a60.tar.xz org.eclipse.osee-494ea6a387bc2487e5d88532bffc7edf43a49a60.zip |
refactor: Remove IAttributeType usage from ArtifactPromptChange
Change-Id: Id2b18cfb00eb6e62782f8eb7b4d5bf801608b28e
19 files changed, 87 insertions, 87 deletions
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/PromptChangeUtil.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/PromptChangeUtil.java index 68bf9f09319..312118f532b 100644 --- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/PromptChangeUtil.java +++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/util/PromptChangeUtil.java @@ -14,7 +14,7 @@ import java.util.Arrays; import java.util.Collection; import org.eclipse.osee.ats.core.client.workflow.AbstractWorkflowArtifact; import org.eclipse.osee.ats.internal.Activator; -import org.eclipse.osee.framework.core.data.IAttributeType; +import org.eclipse.osee.framework.core.data.AttributeTypeToken; import org.eclipse.osee.framework.logging.OseeLevel; import org.eclipse.osee.framework.logging.OseeLog; import org.eclipse.osee.framework.ui.skynet.artifact.ArtifactPromptChange; @@ -28,11 +28,11 @@ public final class PromptChangeUtil { // Utility class } - public static boolean promptChangeAttribute(final Collection<? extends AbstractWorkflowArtifact> awas, IAttributeType attributeType, boolean persist, boolean multiLine) { + public static boolean promptChangeAttribute(final Collection<? extends AbstractWorkflowArtifact> awas, AttributeTypeToken attributeType, boolean persist, boolean multiLine) { return ArtifactPromptChange.promptChangeAttribute(attributeType, awas, persist, multiLine); } - public static boolean promptChangeAttribute(AbstractWorkflowArtifact sma, IAttributeType attributeType, final boolean persist, boolean multiLine) { + public static boolean promptChangeAttribute(AbstractWorkflowArtifact sma, AttributeTypeToken attributeType, final boolean persist, boolean multiLine) { try { return ArtifactPromptChange.promptChangeAttribute(attributeType, Arrays.asList(sma), persist, multiLine); } catch (Exception ex) { diff --git a/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/access/AccessDataQuery.java b/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/access/AccessDataQuery.java index e26d058f7c7..476f2120a05 100644 --- a/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/access/AccessDataQuery.java +++ b/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/access/AccessDataQuery.java @@ -12,9 +12,9 @@ package org.eclipse.osee.framework.core.model.access; import java.util.Collection; import org.eclipse.osee.framework.core.data.ArtifactToken; +import org.eclipse.osee.framework.core.data.AttributeTypeId; import org.eclipse.osee.framework.core.data.BranchId; import org.eclipse.osee.framework.core.data.IArtifactType; -import org.eclipse.osee.framework.core.data.IAttributeType; import org.eclipse.osee.framework.core.data.RelationTypeSide; import org.eclipse.osee.framework.core.enums.PermissionEnum; import org.eclipse.osee.framework.jdk.core.type.OseeCoreException; @@ -107,7 +107,7 @@ public class AccessDataQuery { } } - public void attributeTypeMatches(PermissionEnum permissionToMatch, ArtifactToken artifact, final IAttributeType attributeType, PermissionStatus permissionStatus) throws OseeCoreException { + public void attributeTypeMatches(PermissionEnum permissionToMatch, ArtifactToken artifact, final AttributeTypeId attributeType, PermissionStatus permissionStatus) throws OseeCoreException { artifactMatches(permissionToMatch, artifact, permissionStatus); if (permissionStatus.matched()) { Collection<AccessDetail<?>> branchAccessDetails = accessData.getAccess(artifact.getBranch()); diff --git a/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/type/ArtifactType.java b/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/type/ArtifactType.java index 3388246fecd..9c18c98e5ee 100644 --- a/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/type/ArtifactType.java +++ b/plugins/org.eclipse.osee.framework.core.model/src/org/eclipse/osee/framework/core/model/type/ArtifactType.java @@ -17,6 +17,7 @@ import java.util.HashSet; import java.util.Map; import java.util.Set; import org.eclipse.osee.framework.core.data.ArtifactTypeId; +import org.eclipse.osee.framework.core.data.AttributeTypeId; import org.eclipse.osee.framework.core.data.BranchId; import org.eclipse.osee.framework.core.data.IArtifactType; import org.eclipse.osee.framework.core.data.IAttributeType; @@ -110,7 +111,7 @@ public class ArtifactType extends AbstractOseeIdType implements IArtifactType { ((ArtifactTypeAttributesField) field).set(attributeTypes); } - public boolean isValidAttributeType(IAttributeType attributeType, Branch branch) throws OseeCoreException { + public boolean isValidAttributeType(AttributeTypeId attributeType, Branch branch) throws OseeCoreException { Collection<IAttributeType> attributes = getAttributeTypes(branch); return attributes.contains(attributeType); } diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/AccessPolicy.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/AccessPolicy.java index 47fb7a5fa3f..14cdef1e3c6 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/AccessPolicy.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/AccessPolicy.java @@ -13,9 +13,9 @@ package org.eclipse.osee.framework.skynet.core; import java.util.Collection; import java.util.logging.Level; import org.eclipse.osee.framework.core.data.ArtifactToken; +import org.eclipse.osee.framework.core.data.AttributeTypeId; import org.eclipse.osee.framework.core.data.BranchId; import org.eclipse.osee.framework.core.data.IArtifactType; -import org.eclipse.osee.framework.core.data.IAttributeType; import org.eclipse.osee.framework.core.data.RelationTypeSide; import org.eclipse.osee.framework.core.enums.PermissionEnum; import org.eclipse.osee.framework.core.model.access.PermissionStatus; @@ -30,7 +30,7 @@ public interface AccessPolicy { PermissionStatus hasBranchPermission(BranchId branch, PermissionEnum permission, Level level) throws OseeCoreException; - PermissionStatus hasAttributeTypePermission(Collection<? extends ArtifactToken> artifacts, IAttributeType attributeType, PermissionEnum permission, Level level) throws OseeCoreException; + PermissionStatus hasAttributeTypePermission(Collection<? extends ArtifactToken> artifacts, AttributeTypeId attributeType, PermissionEnum permission, Level level) throws OseeCoreException; PermissionStatus hasArtifactTypePermission(BranchId branch, Collection<? extends IArtifactType> artifactTypes, PermissionEnum permission, Level level) throws OseeCoreException; diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/Artifact.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/Artifact.java index 3c585ec1c94..249879de5f3 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/Artifact.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/Artifact.java @@ -452,7 +452,7 @@ public class Artifact extends FullyNamedIdentity<String> implements IArtifact, A * applications. Use addAttribute() instead */ @SuppressWarnings("unchecked") - private <T> Attribute<T> createAttribute(IAttributeType attributeType) throws OseeCoreException { + private <T> Attribute<T> createAttribute(AttributeTypeId attributeType) throws OseeCoreException { Class<? extends Attribute<T>> attributeClass = (Class<? extends Attribute<T>>) AttributeTypeManager.getAttributeBaseClass(attributeType); Attribute<T> attribute = null; @@ -467,10 +467,9 @@ public class Artifact extends FullyNamedIdentity<String> implements IArtifact, A return attribute; } - private <T> Attribute<T> initializeAttribute(IAttributeType attributeType, ModificationType modificationType, boolean markDirty, boolean setDefaultValue) throws OseeCoreException { + private <T> Attribute<T> initializeAttribute(AttributeTypeId attributeType, ModificationType modificationType, boolean markDirty, boolean setDefaultValue) throws OseeCoreException { Attribute<T> attribute = createAttribute(attributeType); - attribute.internalInitialize(attributeType, this, modificationType, ApplicabilityId.BASE, markDirty, - setDefaultValue); + attribute.internalInitialize(attributeType, this, modificationType, ApplicabilityId.BASE, markDirty, setDefaultValue); return attribute; } @@ -479,14 +478,14 @@ public class Artifact extends FullyNamedIdentity<String> implements IArtifact, A markDirty, data); } - public final <T> Attribute<T> internalInitializeAttribute(IAttributeType attributeType, AttributeId attributeId, int gammaId, ModificationType modificationType, ApplicabilityId applicabilityId, boolean markDirty, Object... data) { + public final <T> Attribute<T> internalInitializeAttribute(AttributeTypeId attributeType, AttributeId attributeId, int gammaId, ModificationType modificationType, ApplicabilityId applicabilityId, boolean markDirty, Object... data) { Attribute<T> attribute = createAttribute(attributeType); attribute.internalInitialize(attributeType, this, modificationType, applicabilityId, attributeId, gammaId, markDirty, false); attribute.getAttributeDataProvider().loadData(data); return attribute; } - public final boolean isAttributeTypeValid(IAttributeType attributeType) throws OseeCoreException { + public final boolean isAttributeTypeValid(AttributeTypeId attributeType) throws OseeCoreException { if (attributeType.equals(CoreAttributeTypes.Name)) { return true; } @@ -615,7 +614,7 @@ public class Artifact extends FullyNamedIdentity<String> implements IArtifact, A return soleAttributes.iterator().next(); } - private <T> Attribute<T> getOrCreateSoleAttribute(IAttributeType attributeType) throws OseeCoreException { + private <T> Attribute<T> getOrCreateSoleAttribute(AttributeTypeId attributeType) throws OseeCoreException { if (!isAttributeTypeValid(attributeType)) { throw new OseeArgumentException("The attribute type %s is not valid for artifacts of type [%s]", attributeType, getArtifactTypeName()); @@ -631,7 +630,7 @@ public class Artifact extends FullyNamedIdentity<String> implements IArtifact, A * Return he existing attribute value or the default value from a newly initialized attribute if none previously * existed */ - public final <T> T getOrInitializeSoleAttributeValue(IAttributeType attributeType) throws OseeCoreException { + public final <T> T getOrInitializeSoleAttributeValue(AttributeTypeId attributeType) throws OseeCoreException { Attribute<T> attribute = getOrCreateSoleAttribute(attributeType); return attribute.getValue(); } @@ -642,7 +641,7 @@ public class Artifact extends FullyNamedIdentity<String> implements IArtifact, A * <br> * Used for quick access to attribute value that should only have 0 or 1 instances of the attribute. */ - public final <T> T getSoleAttributeValue(IAttributeType attributeType) throws OseeCoreException { + public final <T> T getSoleAttributeValue(AttributeTypeId attributeType) throws OseeCoreException { List<Attribute<T>> soleAttributes = getAttributes(attributeType); if (soleAttributes.isEmpty()) { if (!isAttributeTypeValid(attributeType)) { @@ -765,15 +764,15 @@ public class Artifact extends FullyNamedIdentity<String> implements IArtifact, A * Used on attribute types with no more than one instance. If the attribute exists, it's value is changed, otherwise * a new attribute is added and its value set. */ - public final <T> void setSoleAttributeValue(IAttributeType attributeType, T value) throws OseeCoreException { + public final <T> void setSoleAttributeValue(AttributeTypeId attributeType, T value) throws OseeCoreException { getOrCreateSoleAttribute(attributeType).setValue(value); } - public final <T> void setSoleAttributeFromString(IAttributeType attributeType, String value) throws OseeCoreException { + public final <T> void setSoleAttributeFromString(AttributeTypeId attributeType, String value) throws OseeCoreException { getOrCreateSoleAttribute(attributeType).setFromString(value); } - public final void setSoleAttributeFromStream(IAttributeType attributeType, InputStream stream) throws OseeCoreException { + public final void setSoleAttributeFromStream(AttributeTypeId attributeType, InputStream stream) throws OseeCoreException { getOrCreateSoleAttribute(attributeType).setValueFromInputStream(stream); } @@ -819,7 +818,7 @@ public class Artifact extends FullyNamedIdentity<String> implements IArtifact, A * Will add the single string value if it does not already exist. Will also cleanup if more than one exists with same * value. Will not touch any other values. */ - public void setSingletonAttributeValue(IAttributeType attributeType, String value) throws OseeCoreException { + public void setSingletonAttributeValue(AttributeTypeId attributeType, String value) throws OseeCoreException { List<Attribute<String>> attributes = getAttributes(CoreAttributeTypes.StaticId, value); if (attributes.isEmpty()) { addAttribute(attributeType, value); @@ -846,7 +845,7 @@ public class Artifact extends FullyNamedIdentity<String> implements IArtifact, A * attributes will be changed to match or if need be new attributes will be added to stored these values. Finally any * excess attributes will be deleted. */ - public final void setAttributeValues(IAttributeType attributeType, Collection<String> newValues) throws OseeCoreException { + public final void setAttributeValues(AttributeTypeId attributeType, Collection<String> newValues) throws OseeCoreException { ensureAttributesLoaded(); // ensure new values are unique HashSet<String> uniqueNewValues = new HashSet<>(newValues); @@ -884,7 +883,7 @@ public class Artifact extends FullyNamedIdentity<String> implements IArtifact, A } } - public final <T> void setAttributeFromValues(IAttributeType attributeType, Collection<T> values) throws OseeCoreException { + public final <T> void setAttributeFromValues(AttributeTypeId attributeType, Collection<T> values) throws OseeCoreException { ensureAttributesLoaded(); Set<T> uniqueItems = Collections.toSet(values); @@ -922,7 +921,7 @@ public class Artifact extends FullyNamedIdentity<String> implements IArtifact, A } } - public final void setBinaryAttributeFromValues(IAttributeType attributeType, Collection<InputStream> values) throws OseeCoreException { + public final void setBinaryAttributeFromValues(AttributeTypeId attributeType, Collection<InputStream> values) throws OseeCoreException { ensureAttributesLoaded(); List<Attribute<Object>> remainingAttributes = getAttributes(attributeType); @@ -945,7 +944,7 @@ public class Artifact extends FullyNamedIdentity<String> implements IArtifact, A /** * adds a new attribute of the type named attributeTypeName and assigns it the given value */ - public final <T> void addAttribute(IAttributeType attributeType, T value) throws OseeCoreException { + public final <T> void addAttribute(AttributeTypeId attributeType, T value) throws OseeCoreException { initializeAttribute(attributeType, ModificationType.NEW, true, false).setValue(value); } @@ -953,7 +952,7 @@ public class Artifact extends FullyNamedIdentity<String> implements IArtifact, A * adds a new attribute of the type named attributeTypeName. The attribute is set to the default value for its type, * if any. */ - public final void addAttribute(IAttributeType attributeType) throws OseeCoreException { + public final void addAttribute(AttributeTypeId attributeType) throws OseeCoreException { initializeAttribute(attributeType, ModificationType.NEW, true, true); } @@ -968,7 +967,7 @@ public class Artifact extends FullyNamedIdentity<String> implements IArtifact, A /** * adds a new attribute of the type named attributeTypeName and assigns it the given value */ - public final void addAttributeFromString(IAttributeType attributeType, String value) throws OseeCoreException { + public final void addAttributeFromString(AttributeTypeId attributeType, String value) throws OseeCoreException { initializeAttribute(attributeType, ModificationType.NEW, true, false).setFromString(value); } @@ -976,7 +975,7 @@ public class Artifact extends FullyNamedIdentity<String> implements IArtifact, A * we do not what duplicated enumerated values so this method silently returns if the specified attribute type is * enumerated and value is already present */ - private final <T> void setOrAddAttribute(IAttributeType attributeType, T value) throws OseeCoreException { + private final <T> void setOrAddAttribute(AttributeTypeId attributeType, T value) throws OseeCoreException { List<Attribute<Object>> attributes = getAttributes(attributeType); for (Attribute<?> canidateAttribute : attributes) { if (canidateAttribute.getValue().equals(value)) { @@ -1602,11 +1601,11 @@ public class Artifact extends FullyNamedIdentity<String> implements IArtifact, A return false; } - public final int getRemainingAttributeCount(IAttributeType attributeType) throws OseeCoreException { + public final int getRemainingAttributeCount(AttributeTypeId attributeType) throws OseeCoreException { return AttributeTypeManager.getMaxOccurrences(attributeType) - getAttributeCount(attributeType); } - public final int getAttributeCount(IAttributeType attributeType) throws OseeCoreException { + public final int getAttributeCount(AttributeTypeId attributeType) throws OseeCoreException { ensureAttributesLoaded(); return getAttributes(attributeType).size(); } @@ -1696,7 +1695,7 @@ public class Artifact extends FullyNamedIdentity<String> implements IArtifact, A if (modType == ModificationType.DELETED) { return; } - for (IAttributeType attributeType : getAttributeTypes()) { + for (AttributeTypeId attributeType : getAttributeTypes()) { int missingCount = AttributeTypeManager.getMinOccurrences(attributeType) - getAttributeCount(attributeType); for (int i = 0; i < missingCount; i++) { initializeAttribute(attributeType, ModificationType.NEW, isNewArtifact, true); diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/Attribute.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/Attribute.java index cacd24b1016..526e7e51eb5 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/Attribute.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/artifact/Attribute.java @@ -19,6 +19,7 @@ import java.util.logging.Level; import org.eclipse.core.runtime.IStatus; import org.eclipse.osee.framework.core.data.ApplicabilityId; import org.eclipse.osee.framework.core.data.AttributeId; +import org.eclipse.osee.framework.core.data.AttributeTypeId; import org.eclipse.osee.framework.core.data.IAttributeType; import org.eclipse.osee.framework.core.enums.CoreAttributeTypes; import org.eclipse.osee.framework.core.enums.ModificationType; @@ -45,7 +46,7 @@ public abstract class Attribute<T> implements Comparable<Attribute<T>>, Attribut private boolean dirty; private ModificationType modificationType; private boolean useBackingData; - private IAttributeType attributeTypeToken; + private AttributeTypeId attributeTypeToken; private ApplicabilityId applicabilityId; void internalInitialize(IAttributeType attributeType, Artifact artifact, ModificationType modificationType, ApplicabilityId applicabilityId, boolean markDirty, boolean setDefaultValue) throws OseeCoreException { @@ -100,7 +101,7 @@ public abstract class Attribute<T> implements Comparable<Attribute<T>>, Attribut return attributeChange; } - public void internalInitialize(IAttributeType attributeType, Artifact artifact, ModificationType modificationType, ApplicabilityId applicabilityId, AttributeId attributeId, int gammaId, boolean markDirty, boolean setDefaultValue) throws OseeCoreException { + public void internalInitialize(AttributeTypeId attributeType, Artifact artifact, ModificationType modificationType, ApplicabilityId applicabilityId,AttributeId attributeId, int gammaId, boolean markDirty, boolean setDefaultValue) throws OseeCoreException { internalInitialize(attributeType, artifact, modificationType, applicabilityId, markDirty, setDefaultValue); this.attrId = attributeId; this.gammaId = gammaId; @@ -227,10 +228,10 @@ public abstract class Attribute<T> implements Comparable<Attribute<T>>, Attribut * @return attributeType Attribute Type Information */ public AttributeType getAttributeType() { - return AttributeTypeManager.getType(getAttributeTypeToken()); + return AttributeTypeManager.getType(attributeTypeToken); } - public IAttributeType getAttributeTypeToken() { + public AttributeTypeId getAttributeTypeToken() { return attributeTypeToken; } diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/attribute/AttributeTypeManager.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/attribute/AttributeTypeManager.java index 896c5bad98a..93b9e59dd9c 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/attribute/AttributeTypeManager.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/attribute/AttributeTypeManager.java @@ -16,6 +16,7 @@ import java.util.HashMap; import java.util.HashSet; import java.util.Map; import java.util.Set; +import org.eclipse.osee.framework.core.data.AttributeTypeId; import org.eclipse.osee.framework.core.data.BranchId; import org.eclipse.osee.framework.core.data.IAttributeType; import org.eclipse.osee.framework.core.exception.OseeTypeDoesNotExist; @@ -107,7 +108,7 @@ public class AttributeTypeManager { return attributeType; } - public static AttributeType getType(IAttributeType type) throws OseeCoreException { + public static AttributeType getType(AttributeTypeId type) throws OseeCoreException { return getTypeByGuid(type.getId()); } @@ -126,11 +127,11 @@ public class AttributeTypeManager { return attributeType.getOseeEnumType().valuesAsOrderedStringSet(); } - public static Set<String> getEnumerationValues(IAttributeType attributeType) throws OseeCoreException { + public static Set<String> getEnumerationValues(AttributeTypeId attributeType) throws OseeCoreException { return getEnumerationValues(getType(attributeType)); } - public static Map<String, String> getEnumerationValueDescriptions(IAttributeType attributeType) throws OseeCoreException { + public static Map<String, String> getEnumerationValueDescriptions(AttributeTypeId attributeType) throws OseeCoreException { Map<String, String> values = new HashMap<>(); for (OseeEnumEntry entry : AttributeTypeManager.getType(attributeType).getOseeEnumType().values()) { values.put(entry.getName(), entry.getDescription()); @@ -138,11 +139,11 @@ public class AttributeTypeManager { return values; } - public static int getMinOccurrences(IAttributeType attributeType) throws OseeCoreException { + public static int getMinOccurrences(AttributeTypeId attributeType) throws OseeCoreException { return getType(attributeType).getMinOccurrences(); } - public static int getMaxOccurrences(IAttributeType attributeType) throws OseeCoreException { + public static int getMaxOccurrences(AttributeTypeId attributeType) throws OseeCoreException { return getType(attributeType).getMaxOccurrences(); } @@ -153,11 +154,11 @@ public class AttributeTypeManager { } @SuppressWarnings("rawtypes") - public static boolean isBaseTypeCompatible(Class<? extends Attribute> baseType, IAttributeType attributeType) throws OseeCoreException { + public static boolean isBaseTypeCompatible(Class<? extends Attribute> baseType, AttributeTypeId attributeType) throws OseeCoreException { return baseType.isAssignableFrom(getAttributeBaseClass(attributeType)); } - public static Class<? extends Attribute<?>> getAttributeBaseClass(IAttributeType attributeType) throws OseeCoreException { + public static Class<? extends Attribute<?>> getAttributeBaseClass(AttributeTypeId attributeType) throws OseeCoreException { return AttributeExtensionManager.getAttributeClassFor(getType(attributeType).getBaseAttributeTypeId()); } @@ -165,7 +166,7 @@ public class AttributeTypeManager { return AttributeExtensionManager.getAttributeProviderClassFor(attributeType.getAttributeProviderId()); } - public static boolean checkIfRemovalAllowed(IAttributeType attributeType, Collection<? extends Artifact> artifacts) { + public static boolean checkIfRemovalAllowed(AttributeTypeId attributeType, Collection<? extends Artifact> artifacts) { boolean removalAllowed = false; if (getType(attributeType).getMinOccurrences() == 0) { removalAllowed = true; diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/internal/AccessPolicyImpl.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/internal/AccessPolicyImpl.java index 3cfdb5ad179..686633f2229 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/internal/AccessPolicyImpl.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/internal/AccessPolicyImpl.java @@ -15,9 +15,9 @@ import java.util.Collection; import java.util.logging.Level; import org.eclipse.osee.framework.core.client.OseeClientProperties; import org.eclipse.osee.framework.core.data.ArtifactToken; +import org.eclipse.osee.framework.core.data.AttributeTypeId; import org.eclipse.osee.framework.core.data.BranchId; import org.eclipse.osee.framework.core.data.IArtifactType; -import org.eclipse.osee.framework.core.data.IAttributeType; import org.eclipse.osee.framework.core.data.RelationTypeSide; import org.eclipse.osee.framework.core.enums.PermissionEnum; import org.eclipse.osee.framework.core.enums.RelationSide; @@ -106,7 +106,7 @@ public class AccessPolicyImpl implements AccessPolicy { * others will write to the log. */ @Override - public PermissionStatus hasAttributeTypePermission(Collection<? extends ArtifactToken> artifacts, IAttributeType attributeType, PermissionEnum permission, Level level) throws OseeCoreException { + public PermissionStatus hasAttributeTypePermission(Collection<? extends ArtifactToken> artifacts, AttributeTypeId attributeType, PermissionEnum permission, Level level) throws OseeCoreException { User currentUser = getCurrentUser(); AccessDataQuery query = getAccessService().getAccessData(currentUser, artifacts); 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 75bae345798..8b5b2c96b93 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 @@ -11,16 +11,17 @@ package org.eclipse.osee.framework.ui.skynet.artifact; +import static org.eclipse.osee.framework.core.enums.CoreAttributeTypes.Annotation; +import static org.eclipse.osee.framework.core.enums.CoreAttributeTypes.Name; import java.util.ArrayList; import java.util.Collection; import java.util.List; import java.util.logging.Level; import org.eclipse.osee.framework.core.data.ArtifactToken; +import org.eclipse.osee.framework.core.data.AttributeTypeId; import org.eclipse.osee.framework.core.data.BranchId; import org.eclipse.osee.framework.core.data.IArtifactType; -import org.eclipse.osee.framework.core.data.IAttributeType; import org.eclipse.osee.framework.core.data.RelationTypeSide; -import org.eclipse.osee.framework.core.enums.CoreAttributeTypes; import org.eclipse.osee.framework.core.enums.PermissionEnum; import org.eclipse.osee.framework.core.model.access.PermissionStatus; import org.eclipse.osee.framework.jdk.core.type.OseeCoreException; @@ -37,7 +38,6 @@ import org.junit.Test; * @author Jeff C. Phillips */ public class ArtifactPromptChangeTest { - private static IAttributeType TEST_ATTRIBUTE_TYPE = CoreAttributeTypes.Name; @Test public void test() throws OseeCoreException { @@ -46,13 +46,12 @@ public class ArtifactPromptChangeTest { MockPromptFactory MockPromptFactory = new MockPromptFactory(); AccessPolicy policyHandler = new MockAccessPolicyHandler(); - MockPromptFactory.createPrompt(CoreAttributeTypes.Annotation, "", artifacts, persist, false); + MockPromptFactory.createPrompt(Annotation, "", artifacts, persist, false); ArtifactPrompt artifactPromptChange = new ArtifactPrompt(MockPromptFactory, policyHandler); - Assert.assertFalse( - artifactPromptChange.promptChangeAttribute(CoreAttributeTypes.Annotation, artifacts, persist, false)); - Assert.assertTrue(artifactPromptChange.promptChangeAttribute(TEST_ATTRIBUTE_TYPE, artifacts, persist, false)); + Assert.assertFalse(artifactPromptChange.promptChangeAttribute(Annotation, artifacts, persist, false)); + Assert.assertTrue(artifactPromptChange.promptChangeAttribute(Name, artifacts, persist, false)); } private static class MockAccessPolicyHandler implements AccessPolicy { @@ -73,7 +72,7 @@ public class ArtifactPromptChangeTest { } @Override - public PermissionStatus hasAttributeTypePermission(Collection<? extends ArtifactToken> artifacts, IAttributeType attributeType, PermissionEnum permission, Level level) { + public PermissionStatus hasAttributeTypePermission(Collection<? extends ArtifactToken> artifacts, AttributeTypeId attributeType, PermissionEnum permission, Level level) { return new PermissionStatus(); } @@ -96,15 +95,15 @@ public class ArtifactPromptChangeTest { private static class MockPromptFactory implements IPromptFactory { @Override - public IHandlePromptChange createPrompt(IAttributeType attributeType, String displayName, Collection<? extends Artifact> artifacts, boolean persist, boolean multiLine) throws OseeCoreException { + public IHandlePromptChange createPrompt(AttributeTypeId attributeType, String displayName, Collection<? extends Artifact> artifacts, boolean persist, boolean multiLine) throws OseeCoreException { return new TestPromptChange(attributeType, persist); } } private static class TestPromptChange implements IHandlePromptChange { - private final IAttributeType attributeType; + private final AttributeTypeId attributeType; private final boolean persist; - public TestPromptChange(IAttributeType attributeType, boolean persist) { + public TestPromptChange(AttributeTypeId attributeType, boolean persist) { super(); this.attributeType = attributeType; this.persist = persist; @@ -117,7 +116,7 @@ public class ArtifactPromptChangeTest { @Override public boolean store() throws OseeCoreException { - return persist && attributeType.equals(TEST_ATTRIBUTE_TYPE); + return persist && attributeType.equals(Name); } } } 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 e2e6b11c6d1..520273d5d09 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 @@ -12,7 +12,7 @@ package org.eclipse.osee.framework.ui.skynet.artifact; import java.util.Collection; -import org.eclipse.osee.framework.core.data.IAttributeType; +import org.eclipse.osee.framework.core.data.AttributeTypeToken; import org.eclipse.osee.framework.core.enums.PermissionEnum; import org.eclipse.osee.framework.jdk.core.type.OseeCoreException; import org.eclipse.osee.framework.logging.OseeLevel; @@ -35,7 +35,7 @@ public final class ArtifactPrompt { this.policyHandler = policyHandler; } - public boolean promptChangeAttribute(IAttributeType attributeType, final Collection<? extends Artifact> artifacts, boolean persist, boolean multiLine) throws OseeCoreException { + public boolean promptChangeAttribute(AttributeTypeToken attributeType, final Collection<? extends Artifact> artifacts, boolean persist, boolean multiLine) throws OseeCoreException { boolean toReturn = false; boolean hasPermission = policyHandler.hasAttributeTypePermission(artifacts, attributeType, PermissionEnum.WRITE, OseeLevel.SEVERE_POPUP).matched(); 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 841ee2abdc8..3565feb14c3 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 @@ -12,7 +12,7 @@ package org.eclipse.osee.framework.ui.skynet.artifact; import java.util.Collection; -import org.eclipse.osee.framework.core.data.IAttributeType; +import org.eclipse.osee.framework.core.data.AttributeTypeToken; import org.eclipse.osee.framework.logging.OseeLevel; import org.eclipse.osee.framework.logging.OseeLog; import org.eclipse.osee.framework.skynet.core.AccessPolicy; @@ -46,11 +46,11 @@ public final class ArtifactPromptChange { return ArtifactPromptChange.prompt; } - public static boolean promptChangeAttribute(IAttributeType attributeType, final Collection<? extends Artifact> artifacts, boolean persist) { + public static boolean promptChangeAttribute(AttributeTypeToken attributeType, final Collection<? extends Artifact> artifacts, boolean persist) { return promptChangeAttribute(attributeType, artifacts, persist, true); } - public static boolean promptChangeAttribute(IAttributeType attributeType, final Collection<? extends Artifact> artifacts, boolean persist, boolean multiLine) { + public static boolean promptChangeAttribute(AttributeTypeToken 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/EnumSelectionDialog.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/EnumSelectionDialog.java index 86898bccb7b..10bd3be5f3c 100644 --- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/EnumSelectionDialog.java +++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/EnumSelectionDialog.java @@ -13,7 +13,7 @@ package org.eclipse.osee.framework.ui.skynet.artifact; import java.util.Collection; import java.util.HashSet; import java.util.Set; -import org.eclipse.osee.framework.core.data.IAttributeType; +import org.eclipse.osee.framework.core.data.AttributeTypeId; import org.eclipse.osee.framework.jdk.core.type.OseeCoreException; import org.eclipse.osee.framework.skynet.core.artifact.Artifact; import org.eclipse.osee.framework.skynet.core.attribute.AttributeTypeManager; @@ -50,7 +50,7 @@ public class EnumSelectionDialog extends FilteredCheckboxTreeDialog { }; private Selection selected = Selection.AddSelection; - public EnumSelectionDialog(IAttributeType attributeType, Collection<? extends Artifact> artifacts) { + public EnumSelectionDialog(AttributeTypeId attributeType, Collection<? extends Artifact> artifacts) { super("Select Options" + (isSingletonAttribute(attributeType) ? " - (Singleton)" : ""), "Select option(s) to add, delete or replace.", new ArrayTreeContentProvider(), new StringLabelProvider(), new StringViewerSorter()); @@ -70,7 +70,7 @@ public class EnumSelectionDialog extends FilteredCheckboxTreeDialog { setInput(options); } - private static boolean isSingletonAttribute(IAttributeType attributeType) { + private static boolean isSingletonAttribute(AttributeTypeId attributeType) { return AttributeTypeManager.getMaxOccurrences(attributeType) == 1; } diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/EnumSingletonSelectionDialog.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/EnumSingletonSelectionDialog.java index 9d5a6708c20..c9c5d7b19e2 100644 --- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/EnumSingletonSelectionDialog.java +++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/EnumSingletonSelectionDialog.java @@ -14,7 +14,7 @@ import java.util.Collection; import java.util.HashSet; import java.util.Set; import org.eclipse.jface.viewers.ArrayContentProvider; -import org.eclipse.osee.framework.core.data.IAttributeType; +import org.eclipse.osee.framework.core.data.AttributeTypeId; import org.eclipse.osee.framework.jdk.core.type.OseeCoreException; import org.eclipse.osee.framework.skynet.core.artifact.Artifact; import org.eclipse.osee.framework.skynet.core.attribute.AttributeTypeManager; @@ -38,7 +38,7 @@ public class EnumSingletonSelectionDialog extends ListDialog { private boolean isRemoveAllAllowed = true; private boolean removeAllSelected = false; - public EnumSingletonSelectionDialog(IAttributeType attributeType, Collection<? extends Artifact> artifacts) { + public EnumSingletonSelectionDialog(AttributeTypeId attributeType, Collection<? extends Artifact> artifacts) { super(Displays.getActiveShell()); Set<String> options; try { diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/prompt/BooleanHandlePromptChange.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/prompt/BooleanHandlePromptChange.java index 6d7813edd29..a294d7e93d0 100644 --- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/prompt/BooleanHandlePromptChange.java +++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/prompt/BooleanHandlePromptChange.java @@ -15,7 +15,7 @@ import java.util.Collection; import org.eclipse.jface.dialogs.MessageDialog; import org.eclipse.jface.dialogs.MessageDialogWithToggle; import org.eclipse.jface.window.Window; -import org.eclipse.osee.framework.core.data.IAttributeType; +import org.eclipse.osee.framework.core.data.AttributeTypeId; import org.eclipse.osee.framework.jdk.core.type.OseeCoreException; import org.eclipse.osee.framework.logging.OseeLevel; import org.eclipse.osee.framework.logging.OseeLog; @@ -31,10 +31,10 @@ import org.eclipse.osee.framework.ui.swt.Displays; public class BooleanHandlePromptChange implements IHandlePromptChange { private final MessageDialogWithToggle dialog; private final Collection<? extends Artifact> artifacts; - private final IAttributeType attributeType; + private final AttributeTypeId attributeType; private final boolean persist; - public BooleanHandlePromptChange(Collection<? extends Artifact> artifacts, IAttributeType attributeType, String displayName, boolean persist, String toggleMessage) { + public BooleanHandlePromptChange(Collection<? extends Artifact> artifacts, AttributeTypeId attributeType, String displayName, boolean persist, String toggleMessage) { super(); this.artifacts = artifacts; this.attributeType = attributeType; diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/prompt/DateHandlePromptChange.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/prompt/DateHandlePromptChange.java index 70fbe1adc59..47d448faedb 100644 --- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/prompt/DateHandlePromptChange.java +++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/prompt/DateHandlePromptChange.java @@ -13,7 +13,7 @@ package org.eclipse.osee.framework.ui.skynet.artifact.prompt; import java.util.Collection; import java.util.Date; import org.eclipse.jface.window.Window; -import org.eclipse.osee.framework.core.data.IAttributeType; +import org.eclipse.osee.framework.core.data.AttributeTypeId; import org.eclipse.osee.framework.jdk.core.type.OseeCoreException; import org.eclipse.osee.framework.logging.OseeLevel; import org.eclipse.osee.framework.logging.OseeLog; @@ -28,10 +28,10 @@ import org.eclipse.osee.framework.ui.skynet.widgets.dialog.DateSelectionDialog; public class DateHandlePromptChange implements IHandlePromptChange { private final DateSelectionDialog diag; private final Collection<? extends Artifact> artifacts; - private final IAttributeType attributeType; + private final AttributeTypeId attributeType; private final boolean persist; - public DateHandlePromptChange(Collection<? extends Artifact> artifacts, IAttributeType attributeType, String displayName, boolean persist) { + public DateHandlePromptChange(Collection<? extends Artifact> artifacts, AttributeTypeId attributeType, String displayName, boolean persist) { super(); this.artifacts = artifacts; this.attributeType = attributeType; diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/prompt/EnumeratedHandlePromptChange.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/prompt/EnumeratedHandlePromptChange.java index e598acae18f..fb10eb46e6e 100644 --- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/prompt/EnumeratedHandlePromptChange.java +++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/artifact/prompt/EnumeratedHandlePromptChange.java @@ -16,7 +16,7 @@ import java.util.List; import java.util.Set; import java.util.logging.Level; import org.eclipse.jface.window.Window; -import org.eclipse.osee.framework.core.data.IAttributeType; +import org.eclipse.osee.framework.core.data.AttributeTypeId; import org.eclipse.osee.framework.jdk.core.type.OseeCoreException; import org.eclipse.osee.framework.jdk.core.util.Strings; import org.eclipse.osee.framework.logging.OseeLog; @@ -37,11 +37,11 @@ public class EnumeratedHandlePromptChange implements IHandlePromptChange { private EnumSelectionDialog dialog = null; private EnumSingletonSelectionDialog singletonDialog = null; private final Collection<? extends Artifact> artifacts; - private final IAttributeType attributeType; + private final AttributeTypeId attributeType; private final boolean persist; private boolean isSingletonAttribute = false; - public EnumeratedHandlePromptChange(Collection<? extends Artifact> artifacts, IAttributeType attributeType, String displayName, boolean persist) { + public EnumeratedHandlePromptChange(Collection<? extends Artifact> artifacts, AttributeTypeId attributeType, String displayName, boolean persist) { super(); this.artifacts = artifacts; this.attributeType = attributeType; 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 2c9f06b2c1c..afe6ce54823 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 @@ -11,7 +11,7 @@ package org.eclipse.osee.framework.ui.skynet.artifact.prompt; import java.util.Collection; -import org.eclipse.osee.framework.core.data.IAttributeType; +import org.eclipse.osee.framework.core.data.AttributeTypeId; import org.eclipse.osee.framework.jdk.core.type.OseeCoreException; import org.eclipse.osee.framework.skynet.core.artifact.Artifact; @@ -20,5 +20,5 @@ import org.eclipse.osee.framework.skynet.core.artifact.Artifact; */ public interface IPromptFactory { - IHandlePromptChange createPrompt(IAttributeType attributeType, String displayName, Collection<? extends Artifact> artifacts, boolean persist, boolean multiLine) throws OseeCoreException; + IHandlePromptChange createPrompt(AttributeTypeId attributeType, String displayName, Collection<? extends Artifact> artifacts, boolean persist, boolean multiLine) throws OseeCoreException; } 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 c85da381250..6730044c173 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 @@ -12,7 +12,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.IAttributeType; +import org.eclipse.osee.framework.core.data.AttributeTypeId; import org.eclipse.osee.framework.jdk.core.type.OseeCoreException; import org.eclipse.osee.framework.jdk.core.type.OseeStateException; import org.eclipse.osee.framework.skynet.core.artifact.Artifact; @@ -31,7 +31,7 @@ import org.eclipse.osee.framework.skynet.core.attribute.StringAttribute; public final class PromptFactory implements IPromptFactory { @Override - public IHandlePromptChange createPrompt(IAttributeType attributeType, String displayName, Collection<? extends Artifact> artifacts, boolean persist, boolean multiLine) throws OseeCoreException { + public IHandlePromptChange createPrompt(AttributeTypeId attributeType, String displayName, Collection<? extends Artifact> artifacts, boolean persist, boolean multiLine) throws OseeCoreException { IHandlePromptChange promptChange; if (AttributeTypeManager.isBaseTypeCompatible(DateAttribute.class, attributeType)) { 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 77c45702563..7176e75b0d6 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 @@ -14,7 +14,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.IAttributeType; +import org.eclipse.osee.framework.core.data.AttributeTypeId; import org.eclipse.osee.framework.jdk.core.type.OseeCoreException; import org.eclipse.osee.framework.jdk.core.util.Strings; import org.eclipse.osee.framework.skynet.core.artifact.Artifact; @@ -29,14 +29,13 @@ import org.eclipse.osee.framework.ui.skynet.widgets.dialog.EntryDialog; */ public class StringHandlePromptChange implements IHandlePromptChange { private final EntryDialog entryDialog; - private final IAttributeType attributeType; + private final AttributeTypeId attributeType; private final boolean persist; private final boolean multiLine; private final Collection<? extends Artifact> artifacts; private final NumberFormat format; - public StringHandlePromptChange(IAttributeType attributeType, boolean persist, String displayName, Collection<? extends Artifact> artifacts, NumberFormat format, boolean multiLine) { - super(); + public StringHandlePromptChange(AttributeTypeId attributeType, boolean persist, String displayName, Collection<? extends Artifact> artifacts, NumberFormat format, boolean multiLine) { this.attributeType = attributeType; this.persist = persist; this.artifacts = artifacts; @@ -62,7 +61,7 @@ public class StringHandlePromptChange implements IHandlePromptChange { return true; } - private static void setInitialText(Collection<? extends Artifact> artifacts, EntryDialog entryDialog, NumberFormat format, IAttributeType attributeType) throws OseeCoreException { + private static void setInitialText(Collection<? extends Artifact> artifacts, EntryDialog entryDialog, NumberFormat format, AttributeTypeId attributeType) throws OseeCoreException { if (artifacts.size() == 1) { Object smaObj = artifacts.iterator().next().getSoleAttributeValue(attributeType, ""); String initialText = smaObj.equals("") ? "" : formatObject(smaObj, format); @@ -72,7 +71,7 @@ public class StringHandlePromptChange implements IHandlePromptChange { } } - private static void updateSmaAttributes(final Collection<? extends Artifact> artifacts, IAttributeType attributeType, NumberFormat format, EntryDialog entryDialog) throws OseeCoreException { + private static void updateSmaAttributes(final Collection<? extends Artifact> artifacts, AttributeTypeId attributeType, NumberFormat format, EntryDialog entryDialog) throws OseeCoreException { for (Artifact artifact : artifacts) { String value = entryDialog.getEntry(); String safeValue = getSafeValue(value, format, attributeType); @@ -84,7 +83,7 @@ public class StringHandlePromptChange implements IHandlePromptChange { } } - private static String getSafeValue(String value, NumberFormat format, IAttributeType attributeType) throws OseeCoreException { + private static String getSafeValue(String value, NumberFormat format, AttributeTypeId attributeType) throws OseeCoreException { String toReturn = value; if (format != null) { try { |