Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRyan D. Brooks2016-02-04 22:07:07 +0000
committerRyan D. Brooks2016-02-04 22:07:07 +0000
commit557079ac9aee8e8a41ab7ebce05c6142d64dafb9 (patch)
treea5ba9cc7c98a0804884686c1aa8d84abc0c64b63 /plugins/org.eclipse.osee.framework.core.dsl.ui.integration/src/org
parent0d22cf094b4cb632a9b65a205e6c1f2b253fe61f (diff)
downloadorg.eclipse.osee-557079ac9aee8e8a41ab7ebce05c6142d64dafb9.tar.gz
org.eclipse.osee-557079ac9aee8e8a41ab7ebce05c6142d64dafb9.tar.xz
org.eclipse.osee-557079ac9aee8e8a41ab7ebce05c6142d64dafb9.zip
refactor: Use BranchId were appropriate
Diffstat (limited to 'plugins/org.eclipse.osee.framework.core.dsl.ui.integration/src/org')
-rw-r--r--plugins/org.eclipse.osee.framework.core.dsl.ui.integration/src/org/eclipse/osee/framework/core/dsl/ui/integration/AbstractDslRenderer.java4
-rw-r--r--plugins/org.eclipse.osee.framework.core.dsl.ui.integration/src/org/eclipse/osee/framework/core/dsl/ui/integration/internal/ArtifactDataProviderImpl.java13
-rw-r--r--plugins/org.eclipse.osee.framework.core.dsl.ui.integration/src/org/eclipse/osee/framework/core/dsl/ui/integration/internal/OseeDslArtifactUpdateOperation.java8
-rw-r--r--plugins/org.eclipse.osee.framework.core.dsl.ui.integration/src/org/eclipse/osee/framework/core/dsl/ui/integration/internal/OseeDslRenderer.java8
4 files changed, 19 insertions, 14 deletions
diff --git a/plugins/org.eclipse.osee.framework.core.dsl.ui.integration/src/org/eclipse/osee/framework/core/dsl/ui/integration/AbstractDslRenderer.java b/plugins/org.eclipse.osee.framework.core.dsl.ui.integration/src/org/eclipse/osee/framework/core/dsl/ui/integration/AbstractDslRenderer.java
index efad5ed922b..af888edcbf4 100644
--- a/plugins/org.eclipse.osee.framework.core.dsl.ui.integration/src/org/eclipse/osee/framework/core/dsl/ui/integration/AbstractDslRenderer.java
+++ b/plugins/org.eclipse.osee.framework.core.dsl.ui.integration/src/org/eclipse/osee/framework/core/dsl/ui/integration/AbstractDslRenderer.java
@@ -21,7 +21,7 @@ import java.util.List;
import org.eclipse.core.resources.IFile;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.osee.framework.core.data.IArtifactType;
-import org.eclipse.osee.framework.core.data.IOseeBranch;
+import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.dsl.ui.integration.internal.DslUiIntegrationConstants;
import org.eclipse.osee.framework.core.operation.IOperation;
import org.eclipse.osee.framework.jdk.core.type.OseeCoreException;
@@ -88,7 +88,7 @@ public abstract class AbstractDslRenderer extends FileSystemRenderer {
* Provides the update operation for the renderer.
*/
@Override
- protected abstract IOperation getUpdateOperation(File file, List<Artifact> artifacts, IOseeBranch branch, PresentationType presentationType);
+ protected abstract IOperation getUpdateOperation(File file, List<Artifact> artifacts, BranchId branch, PresentationType presentationType);
/**
* Provides the minimum match ranking for this renderer.
diff --git a/plugins/org.eclipse.osee.framework.core.dsl.ui.integration/src/org/eclipse/osee/framework/core/dsl/ui/integration/internal/ArtifactDataProviderImpl.java b/plugins/org.eclipse.osee.framework.core.dsl.ui.integration/src/org/eclipse/osee/framework/core/dsl/ui/integration/internal/ArtifactDataProviderImpl.java
index b0b999d5267..4e2f2550a8e 100644
--- a/plugins/org.eclipse.osee.framework.core.dsl.ui.integration/src/org/eclipse/osee/framework/core/dsl/ui/integration/internal/ArtifactDataProviderImpl.java
+++ b/plugins/org.eclipse.osee.framework.core.dsl.ui.integration/src/org/eclipse/osee/framework/core/dsl/ui/integration/internal/ArtifactDataProviderImpl.java
@@ -14,10 +14,10 @@ import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
import java.util.logging.Level;
+import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.data.IAttributeType;
import org.eclipse.osee.framework.core.data.IOseeBranch;
import org.eclipse.osee.framework.core.dsl.integration.ArtifactDataProvider;
-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;
@@ -46,8 +46,8 @@ public final class ArtifactDataProviderImpl implements ArtifactDataProvider {
if (object instanceof Artifact) {
final Artifact artifact = (Artifact) object;
proxy = new XArtifactProxy(artifact);
- } else if (object instanceof IOseeBranch) {
- IOseeBranch branch = (IOseeBranch) object;
+ } else if (object instanceof BranchId) {
+ BranchId branch = (BranchId) object;
final Artifact artifact = OseeSystemArtifacts.getDefaultHierarchyRootArtifact(branch);
proxy = new XArtifactProxy(artifact);
}
@@ -111,11 +111,16 @@ public final class ArtifactDataProviderImpl implements ArtifactDataProvider {
}
@Override
- public IOseeBranch getBranch() {
+ public BranchId getBranch() {
return self.getBranch();
}
@Override
+ public IOseeBranch getBranchToken() {
+ return self.getBranchToken();
+ }
+
+ @Override
public String getName() {
return self.getName();
}
diff --git a/plugins/org.eclipse.osee.framework.core.dsl.ui.integration/src/org/eclipse/osee/framework/core/dsl/ui/integration/internal/OseeDslArtifactUpdateOperation.java b/plugins/org.eclipse.osee.framework.core.dsl.ui.integration/src/org/eclipse/osee/framework/core/dsl/ui/integration/internal/OseeDslArtifactUpdateOperation.java
index 580c71097e0..5374a058590 100644
--- a/plugins/org.eclipse.osee.framework.core.dsl.ui.integration/src/org/eclipse/osee/framework/core/dsl/ui/integration/internal/OseeDslArtifactUpdateOperation.java
+++ b/plugins/org.eclipse.osee.framework.core.dsl.ui.integration/src/org/eclipse/osee/framework/core/dsl/ui/integration/internal/OseeDslArtifactUpdateOperation.java
@@ -16,7 +16,7 @@ import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.osee.framework.core.data.IOseeBranch;
+import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.data.TokenFactory;
import org.eclipse.osee.framework.core.dsl.integration.util.OseeDslSegmentParser;
import org.eclipse.osee.framework.core.dsl.integration.util.OseeDslSegmentParser.OseeDslSegment;
@@ -54,7 +54,7 @@ public class OseeDslArtifactUpdateOperation extends AbstractOperation {
double workPercentage = 0.80 * 1.0 / segments.size();
int workAmount = calculateWork(workPercentage);
- Map<IOseeBranch, SkynetTransaction> transactionMap = new HashMap<>();
+ Map<BranchId, SkynetTransaction> transactionMap = new HashMap<>();
for (OseeDslSegment segment : segments) {
int startAt = segment.start();
int endAt = segment.end();
@@ -75,8 +75,8 @@ public class OseeDslArtifactUpdateOperation extends AbstractOperation {
return Lib.fileToString(file);
}
- protected void addChanges(Map<IOseeBranch, SkynetTransaction> transactionMap, long branchId, String artifactGuid, String data) throws OseeCoreException {
- IOseeBranch branch = TokenFactory.createBranch(branchId);
+ protected void addChanges(Map<BranchId, SkynetTransaction> transactionMap, long branchId, String artifactGuid, String data) throws OseeCoreException {
+ BranchId branch = TokenFactory.createBranch(branchId);
SkynetTransaction transaction = transactionMap.get(branch);
if (transaction == null) {
transaction = TransactionManager.createTransaction(branch, "OseeDslArtifactUpdate");
diff --git a/plugins/org.eclipse.osee.framework.core.dsl.ui.integration/src/org/eclipse/osee/framework/core/dsl/ui/integration/internal/OseeDslRenderer.java b/plugins/org.eclipse.osee.framework.core.dsl.ui.integration/src/org/eclipse/osee/framework/core/dsl/ui/integration/internal/OseeDslRenderer.java
index d85388b0685..d440c5355a1 100644
--- a/plugins/org.eclipse.osee.framework.core.dsl.ui.integration/src/org/eclipse/osee/framework/core/dsl/ui/integration/internal/OseeDslRenderer.java
+++ b/plugins/org.eclipse.osee.framework.core.dsl.ui.integration/src/org/eclipse/osee/framework/core/dsl/ui/integration/internal/OseeDslRenderer.java
@@ -15,8 +15,8 @@ import java.io.File;
import java.io.InputStream;
import java.io.UnsupportedEncodingException;
import java.util.List;
+import org.eclipse.osee.framework.core.data.BranchId;
import org.eclipse.osee.framework.core.data.IArtifactType;
-import org.eclipse.osee.framework.core.data.IOseeBranch;
import org.eclipse.osee.framework.core.dsl.integration.util.OseeDslSegmentParser;
import org.eclipse.osee.framework.core.dsl.ui.integration.AbstractDslRenderer;
import org.eclipse.osee.framework.core.enums.CoreArtifactTypes;
@@ -61,11 +61,11 @@ public final class OseeDslRenderer extends AbstractDslRenderer {
data = artifact.getSoleAttributeValueAsString(CoreAttributeTypes.UriGeneralStringData, "");
} else {
StringBuilder builder = new StringBuilder();
- builder.append(parser.getStartTag(artifact));
+ builder.append(parser.getStartTag(artifact, artifact.getBranchToken()));
builder.append("\n");
builder.append(artifact.getSoleAttributeValueAsString(CoreAttributeTypes.GeneralStringData, ""));
builder.append("\n");
- builder.append(parser.getEndTag(artifact));
+ builder.append(parser.getEndTag(artifact, artifact.getBranchToken()));
data = builder.toString();
}
@@ -77,7 +77,7 @@ public final class OseeDslRenderer extends AbstractDslRenderer {
}
@Override
- protected IOperation getUpdateOperation(File file, List<Artifact> artifacts, IOseeBranch branch, PresentationType presentationType) {
+ protected IOperation getUpdateOperation(File file, List<Artifact> artifacts, BranchId branch, PresentationType presentationType) {
IOperation op;
Artifact artifact = artifacts.iterator().next();
if (artifact.isOfType(CoreArtifactTypes.OseeTypeDefinition)) {

Back to the top