Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrescobar2011-02-22 16:57:46 -0500
committerRyan D. Brooks2011-02-22 16:57:46 -0500
commit39b40b9429d4ea96dd43d363c231f034c1c5f225 (patch)
treeaf4b13adb0606cd35ef672baafb5e1768a759685 /plugins/org.eclipse.osee.framework.core.dsl.ui.integration
parentb95a49e1a006cac894b18a4d38afb73ee7d30a4e (diff)
downloadorg.eclipse.osee-39b40b9429d4ea96dd43d363c231f034c1c5f225.tar.gz
org.eclipse.osee-39b40b9429d4ea96dd43d363c231f034c1c5f225.tar.xz
org.eclipse.osee-39b40b9429d4ea96dd43d363c231f034c1c5f225.zip
feature[ats_YGHW1]: Integrate artifact matcher
Diffstat (limited to 'plugins/org.eclipse.osee.framework.core.dsl.ui.integration')
-rw-r--r--plugins/org.eclipse.osee.framework.core.dsl.ui.integration/src/org/eclipse/osee/framework/core/dsl/ui/integration/internal/ArtifactDataAccessor.java79
1 files changed, 61 insertions, 18 deletions
diff --git a/plugins/org.eclipse.osee.framework.core.dsl.ui.integration/src/org/eclipse/osee/framework/core/dsl/ui/integration/internal/ArtifactDataAccessor.java b/plugins/org.eclipse.osee.framework.core.dsl.ui.integration/src/org/eclipse/osee/framework/core/dsl/ui/integration/internal/ArtifactDataAccessor.java
index 69c7afa6d5..5d6ae1c27c 100644
--- a/plugins/org.eclipse.osee.framework.core.dsl.ui.integration/src/org/eclipse/osee/framework/core/dsl/ui/integration/internal/ArtifactDataAccessor.java
+++ b/plugins/org.eclipse.osee.framework.core.dsl.ui.integration/src/org/eclipse/osee/framework/core/dsl/ui/integration/internal/ArtifactDataAccessor.java
@@ -14,6 +14,9 @@ import java.util.Collection;
import java.util.HashSet;
import java.util.logging.Level;
import org.eclipse.osee.framework.core.data.IAttributeType;
+import org.eclipse.osee.framework.core.data.IOseeBranch;
+import org.eclipse.osee.framework.core.data.Identity;
+import org.eclipse.osee.framework.core.data.Named;
import org.eclipse.osee.framework.core.dsl.integration.ArtifactDataProvider;
import org.eclipse.osee.framework.core.exception.OseeCoreException;
import org.eclipse.osee.framework.core.model.Branch;
@@ -38,58 +41,58 @@ public final class ArtifactDataAccessor implements ArtifactDataProvider {
}
@Override
- public ArtifactData asCastedObject(Object object) throws OseeCoreException {
- ArtifactData wrapper = null;
+ public ArtifactProxy asCastedObject(Object object) throws OseeCoreException {
+ XArtifactProxy proxy = null;
if (object instanceof Artifact) {
final Artifact artifact = (Artifact) object;
- wrapper = new ArtifactWrapper(artifact);
+ proxy = new XArtifactProxy(artifact);
} else if (object instanceof Branch) {
Branch branch = (Branch) object;
final Artifact artifact = OseeSystemArtifacts.getDefaultHierarchyRootArtifact(branch);
- wrapper = new ArtifactWrapper(artifact);
+ proxy = new XArtifactProxy(artifact);
}
- return wrapper;
+ return proxy;
}
- private final class ArtifactWrapper implements ArtifactData {
- private final Artifact artifact;
+ private final class XArtifactProxy implements ArtifactProxy {
+ private final Artifact self;
- public ArtifactWrapper(Artifact artifact) {
- this.artifact = artifact;
+ public XArtifactProxy(Artifact self) {
+ this.self = self;
}
@Override
public String getGuid() {
- return artifact.getGuid();
+ return self.getGuid();
}
@Override
public ArtifactType getArtifactType() {
- return artifact.getArtifactType();
+ return self.getArtifactType();
}
@Override
public boolean isAttributeTypeValid(IAttributeType attributeType) throws OseeCoreException {
- return artifact.isAttributeTypeValid(attributeType);
+ return self.isAttributeTypeValid(attributeType);
}
@Override
public Collection<RelationType> getValidRelationTypes() throws OseeCoreException {
- return artifact.getValidRelationTypes();
+ return self.getValidRelationTypes();
}
@Override
public IBasicArtifact<?> getObject() {
- return artifact;
+ return self;
}
@Override
- public Collection<String> getHierarchy() {
- Collection<String> hierarchy = new HashSet<String>();
+ public Collection<ArtifactProxy> getHierarchy() {
+ Collection<ArtifactProxy> hierarchy = new HashSet<ArtifactProxy>();
try {
- Artifact artifactPtr = artifact;
+ Artifact artifactPtr = self;
while (artifactPtr != null) {
- hierarchy.add(artifactPtr.getGuid());
+ hierarchy.add(new XArtifactProxy(artifactPtr));
artifactPtr = artifactPtr.getParent();
}
} catch (OseeCoreException ex) {
@@ -97,5 +100,45 @@ public final class ArtifactDataAccessor implements ArtifactDataProvider {
}
return hierarchy;
}
+
+ @Override
+ public boolean matches(Identity... identities) {
+ return self.matches(identities);
+ }
+
+ @Override
+ public String getUnqualifiedName() {
+ return self.getUnqualifiedName();
+ }
+
+ @Override
+ public int compareTo(Named other) {
+ return self.compareTo(other);
+ }
+
+ @Override
+ public IOseeBranch getBranch() {
+ return self.getBranch();
+ }
+
+ @Override
+ public String getName() {
+ return self.getName();
+ }
+
+ @Override
+ public int hashCode() {
+ return self.hashCode();
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ return self.equals(obj);
+ }
+
+ @Override
+ public String toString() {
+ return self.toString();
+ }
}
} \ No newline at end of file

Back to the top