Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrescobar2010-08-10 14:04:10 -0400
committerrescobar2010-08-10 14:04:10 -0400
commit8f1681aebc30bba15844097722d5a0c3ebc6a0fc (patch)
tree440e39696973e5b24af8cc22750d5edce6f2605b /plugins/org.eclipse.osee.framework.core.dsl.ui.integration
parentc954f5019e576553b7f289bf530861bc7bb778dc (diff)
downloadorg.eclipse.osee-8f1681aebc30bba15844097722d5a0c3ebc6a0fc.tar.gz
org.eclipse.osee-8f1681aebc30bba15844097722d5a0c3ebc6a0fc.tar.xz
org.eclipse.osee-8f1681aebc30bba15844097722d5a0c3ebc6a0fc.zip
"Team Workflow" - YGHW1 - "Block changes to requirements unless done under an appropriate action."
Diffstat (limited to 'plugins/org.eclipse.osee.framework.core.dsl.ui.integration')
-rw-r--r--plugins/org.eclipse.osee.framework.core.dsl.ui.integration/META-INF/MANIFEST.MF2
-rw-r--r--plugins/org.eclipse.osee.framework.core.dsl.ui.integration/src/org/eclipse/osee/framework/core/dsl/ui/integration/internal/ArtifactDataAccessor.java156
2 files changed, 87 insertions, 71 deletions
diff --git a/plugins/org.eclipse.osee.framework.core.dsl.ui.integration/META-INF/MANIFEST.MF b/plugins/org.eclipse.osee.framework.core.dsl.ui.integration/META-INF/MANIFEST.MF
index e7dc3b9a51..4bf7758787 100644
--- a/plugins/org.eclipse.osee.framework.core.dsl.ui.integration/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.osee.framework.core.dsl.ui.integration/META-INF/MANIFEST.MF
@@ -36,7 +36,9 @@ Import-Package: org.eclipse.compare,
org.eclipse.osee.framework.jdk.core.util.xml,
org.eclipse.osee.framework.logging,
org.eclipse.osee.framework.plugin.core.util,
+ org.eclipse.osee.framework.skynet.core,
org.eclipse.osee.framework.skynet.core.artifact,
+ org.eclipse.osee.framework.skynet.core.artifact.search,
org.eclipse.osee.framework.skynet.core.attribute,
org.eclipse.osee.framework.skynet.core.importing,
org.eclipse.osee.framework.ui.plugin,
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 e1cb3b6880..150441fcd0 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
@@ -8,75 +8,89 @@
* Contributors:
* Boeing - initial API and implementation
*******************************************************************************/
-package org.eclipse.osee.framework.core.dsl.ui.integration.internal;
-
-import java.util.Collection;
-import java.util.HashSet;
-import org.eclipse.osee.framework.core.data.IAttributeType;
-import org.eclipse.osee.framework.core.dsl.integration.ArtifactDataProvider;
-import org.eclipse.osee.framework.core.exception.OseeCoreException;
-import org.eclipse.osee.framework.core.model.IBasicArtifact;
-import org.eclipse.osee.framework.core.model.type.ArtifactType;
-import org.eclipse.osee.framework.core.model.type.RelationType;
-import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
-
-public final class ArtifactDataAccessor implements ArtifactDataProvider {
-
- @Override
- public boolean isApplicable(Object object) {
- return asCastedObject(object) != null;
- }
-
- @Override
- public ArtifactData asCastedObject(Object object) {
- ArtifactData wrapper = null;
- if (object instanceof Artifact) {
- final Artifact artifact = (Artifact) object;
- wrapper = new ArtifactWrapper(artifact);
- }
- return wrapper;
- }
-
- private final class ArtifactWrapper implements ArtifactData {
- private final Artifact artifact;
-
- public ArtifactWrapper(Artifact artifact) {
- this.artifact = artifact;
- }
-
- @Override
- public String getGuid() {
- return artifact.getGuid();
- }
-
- @Override
- public ArtifactType getArtifactType() {
- return artifact.getArtifactType();
- }
-
- @Override
- public boolean isAttributeTypeValid(IAttributeType attributeType) throws OseeCoreException {
- return artifact.isAttributeTypeValid(attributeType);
- }
-
- @Override
- public Collection<RelationType> getValidRelationTypes() throws OseeCoreException {
- return artifact.getValidRelationTypes();
- }
-
- @Override
- public IBasicArtifact<?> getObject() {
- return artifact;
- }
-
- @Override
- public Collection<String> getHierarchy() {
- Collection<String> hierarchy = new HashSet<String>();
- Artifact artifactPtr = artifact;
- while (artifactPtr != null) {
- hierarchy.add(artifactPtr.getGuid());
- }
- return hierarchy;
- }
- }
+package org.eclipse.osee.framework.core.dsl.ui.integration.internal;
+
+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.dsl.integration.ArtifactDataProvider;
+import org.eclipse.osee.framework.core.exception.OseeCoreException;
+import org.eclipse.osee.framework.core.model.Branch;
+import org.eclipse.osee.framework.core.model.IBasicArtifact;
+import org.eclipse.osee.framework.core.model.type.ArtifactType;
+import org.eclipse.osee.framework.core.model.type.RelationType;
+import org.eclipse.osee.framework.logging.OseeLog;
+import org.eclipse.osee.framework.skynet.core.OseeSystemArtifacts;
+import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
+
+public final class ArtifactDataAccessor implements ArtifactDataProvider {
+
+ @Override
+ public boolean isApplicable(Object object) {
+ boolean result = false;
+ try {
+ result = asCastedObject(object) != null;
+ } catch (OseeCoreException ex) {
+ OseeLog.log(Activator.class, Level.SEVERE, ex);
+ }
+ return result;
+ }
+
+ @Override
+ public ArtifactData asCastedObject(Object object) throws OseeCoreException {
+ ArtifactData wrapper = null;
+ if (object instanceof Artifact) {
+ final Artifact artifact = (Artifact) object;
+ wrapper = new ArtifactWrapper(artifact);
+ } else if (object instanceof Branch) {
+ Branch branch = (Branch) object;
+ final Artifact artifact = OseeSystemArtifacts.getDefaultHierarchyRootArtifact(branch);
+ wrapper = new ArtifactWrapper(artifact);
+ }
+ return wrapper;
+ }
+
+ private final class ArtifactWrapper implements ArtifactData {
+ private final Artifact artifact;
+
+ public ArtifactWrapper(Artifact artifact) {
+ this.artifact = artifact;
+ }
+
+ @Override
+ public String getGuid() {
+ return artifact.getGuid();
+ }
+
+ @Override
+ public ArtifactType getArtifactType() {
+ return artifact.getArtifactType();
+ }
+
+ @Override
+ public boolean isAttributeTypeValid(IAttributeType attributeType) throws OseeCoreException {
+ return artifact.isAttributeTypeValid(attributeType);
+ }
+
+ @Override
+ public Collection<RelationType> getValidRelationTypes() throws OseeCoreException {
+ return artifact.getValidRelationTypes();
+ }
+
+ @Override
+ public IBasicArtifact<?> getObject() {
+ return artifact;
+ }
+
+ @Override
+ public Collection<String> getHierarchy() {
+ Collection<String> hierarchy = new HashSet<String>();
+ Artifact artifactPtr = artifact;
+ while (artifactPtr != null) {
+ hierarchy.add(artifactPtr.getGuid());
+ }
+ return hierarchy;
+ }
+ }
} \ No newline at end of file

Back to the top