Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrescobar2011-03-09 13:35:13 -0500
committerRyan D. Brooks2011-03-09 13:35:13 -0500
commit15273bf7a2bdd8242c9ea3f55958ad4f7d0ebcf6 (patch)
tree46b314a5851d119aa101603b7a34f3580ad7c82d /plugins
parentacee510219269f7bca1d33ab1e02bfa53c45a4cc (diff)
downloadorg.eclipse.osee-15273bf7a2bdd8242c9ea3f55958ad4f7d0ebcf6.tar.gz
org.eclipse.osee-15273bf7a2bdd8242c9ea3f55958ad4f7d0ebcf6.tar.xz
org.eclipse.osee-15273bf7a2bdd8242c9ea3f55958ad4f7d0ebcf6.zip
refactor: Change ArtifactImageProvider to use IArtifact
Diffstat (limited to 'plugins')
-rw-r--r--plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/AtsArtifactImageProvider.java22
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/ArtifactImageProvider.java4
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/FrameworkArtifactImageProvider.java12
3 files changed, 21 insertions, 17 deletions
diff --git a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/AtsArtifactImageProvider.java b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/AtsArtifactImageProvider.java
index 51f1cde7e34..d4b66073a9c 100644
--- a/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/AtsArtifactImageProvider.java
+++ b/plugins/org.eclipse.osee.ats/src/org/eclipse/osee/ats/AtsArtifactImageProvider.java
@@ -20,6 +20,7 @@ import org.eclipse.osee.framework.core.data.IArtifactType;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
import org.eclipse.osee.framework.skynet.core.UserManager;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.types.IArtifact;
import org.eclipse.osee.framework.ui.skynet.ArtifactImageManager;
import org.eclipse.osee.framework.ui.skynet.ArtifactImageProvider;
import org.eclipse.osee.framework.ui.skynet.FrameworkImage;
@@ -53,17 +54,18 @@ public class AtsArtifactImageProvider extends ArtifactImageProvider {
}
@Override
- public String setupImage(Artifact artifact) throws OseeCoreException {
- if (artifact.isOfType(AtsArtifactTypes.Version)) {
- if (artifact.getSoleAttributeValue(AtsAttributeTypes.NextVersion, false)) {
- return ArtifactImageManager.setupImage(artifact, AtsImage.NEXT, Location.BOT_RIGHT);
+ public String setupImage(IArtifact artifact) throws OseeCoreException {
+ Artifact aArtifact = artifact.getFullArtifact();
+ if (aArtifact.isOfType(AtsArtifactTypes.Version)) {
+ if (aArtifact.getSoleAttributeValue(AtsAttributeTypes.NextVersion, false)) {
+ return ArtifactImageManager.setupImage(aArtifact, AtsImage.NEXT, Location.BOT_RIGHT);
}
- if (artifact.getSoleAttributeValue(AtsAttributeTypes.Released, false)) {
- return ArtifactImageManager.setupImage(artifact, AtsImage.RELEASED, Location.TOP_RIGHT);
+ if (aArtifact.getSoleAttributeValue(AtsAttributeTypes.Released, false)) {
+ return ArtifactImageManager.setupImage(aArtifact, AtsImage.RELEASED, Location.TOP_RIGHT);
}
- if (artifact.getSoleAttributeValue(AtsAttributeTypes.VersionLocked, false) && !artifact.getSoleAttributeValue(
+ if (aArtifact.getSoleAttributeValue(AtsAttributeTypes.VersionLocked, false) && !aArtifact.getSoleAttributeValue(
AtsAttributeTypes.Released, false)) {
- return ArtifactImageManager.setupImage(artifact, AtsImage.VERSION_LOCKED, Location.BOT_RIGHT);
+ return ArtifactImageManager.setupImage(aArtifact, AtsImage.VERSION_LOCKED, Location.BOT_RIGHT);
}
}
@@ -71,11 +73,11 @@ public class AtsArtifactImageProvider extends ArtifactImageProvider {
AbstractWorkflowArtifact stateMachine = (AbstractWorkflowArtifact) artifact;
if (SubscribeManager.isSubscribed(stateMachine, UserManager.getUser())) {
// was 8,6
- return ArtifactImageManager.setupImage(artifact, AtsImage.SUBSCRIBED_OVERLAY, Location.BOT_RIGHT);
+ return ArtifactImageManager.setupImage(aArtifact, AtsImage.SUBSCRIBED_OVERLAY, Location.BOT_RIGHT);
}
if (FavoritesManager.isFavorite(stateMachine, UserManager.getUser())) {
// was 7,0
- return ArtifactImageManager.setupImage(artifact, AtsImage.FAVORITE_OVERLAY, Location.TOP_RIGHT);
+ return ArtifactImageManager.setupImage(aArtifact, AtsImage.FAVORITE_OVERLAY, Location.TOP_RIGHT);
}
}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/ArtifactImageProvider.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/ArtifactImageProvider.java
index d34ccebfc2e..182e0275c0e 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/ArtifactImageProvider.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/ArtifactImageProvider.java
@@ -12,7 +12,7 @@ package org.eclipse.osee.framework.ui.skynet;
import org.eclipse.osee.framework.core.data.IArtifactType;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
-import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.types.IArtifact;
/**
* This class allows plugins to provide the base images for artifact types by registering via ImageManger.registerImage.
@@ -29,7 +29,7 @@ public abstract class ArtifactImageProvider {
* super.setupImage()
*/
@SuppressWarnings("unused")
- public String setupImage(Artifact artifact) throws OseeCoreException {
+ public String setupImage(IArtifact artifact) throws OseeCoreException {
return ArtifactImageManager.setupImageNoProviders(artifact);
}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/FrameworkArtifactImageProvider.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/FrameworkArtifactImageProvider.java
index dc0e2b57a7a..09f39ef7142 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/FrameworkArtifactImageProvider.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/FrameworkArtifactImageProvider.java
@@ -15,6 +15,7 @@ import org.eclipse.osee.framework.core.exception.OseeCoreException;
import org.eclipse.osee.framework.skynet.core.User;
import org.eclipse.osee.framework.skynet.core.UserManager;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+import org.eclipse.osee.framework.skynet.core.types.IArtifact;
import org.eclipse.osee.framework.ui.plugin.PluginUiImage;
import org.eclipse.osee.framework.ui.swt.ImageManager;
@@ -41,14 +42,15 @@ public class FrameworkArtifactImageProvider extends ArtifactImageProvider {
}
@Override
- public String setupImage(Artifact artifact) throws OseeCoreException {
- if (artifact.isDeleted()) {
+ public String setupImage(IArtifact artifact) throws OseeCoreException {
+ Artifact aArtifact = artifact.getFullArtifact();
+ if (aArtifact.isDeleted()) {
return null;
- } else if (((User) artifact).isSystemUser()) {
+ } else if (((User) aArtifact).isSystemUser()) {
return ImageManager.setupImage(FrameworkImage.USER_GREY);
- } else if (!((User) artifact).isActive()) {
+ } else if (!((User) aArtifact).isActive()) {
return ImageManager.setupImage(FrameworkImage.USER_YELLOW);
- } else if (((User) artifact).equals(UserManager.getUser())) {
+ } else if (((User) aArtifact).equals(UserManager.getUser())) {
return ImageManager.setupImage(FrameworkImage.USER_RED);
}

Back to the top