Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMorgan E. Cook2017-07-10 12:50:30 -0400
committerMorgan Cook2017-08-28 18:26:53 -0400
commit5860f777f7ec60180398af98903b9be8241b5e58 (patch)
treee460034bba85f04305fa57cad22a77dfa23027f9
parent9c2f6c4236a100e7f860c321906aa496619a3e1b (diff)
downloadorg.eclipse.osee-5860f777f7ec60180398af98903b9be8241b5e58.tar.gz
org.eclipse.osee-5860f777f7ec60180398af98903b9be8241b5e58.tar.xz
org.eclipse.osee-5860f777f7ec60180398af98903b9be8241b5e58.zip
refactor: Remove renderer dependency on AttributeElement
Signed-off-by: Morgan E. Cook <morgan.e.cook@boeing.com> Change-Id: I1fe0be0eb06ce4add33a437f7fffe83b91c6bc5c Signed-off-by: Morgan E. Cook <morgan.e.cook@boeing.com>
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/DefaultArtifactRenderer.java9
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/IRenderer.java3
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/RendererManager.java11
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/WordTemplateRenderer.java10
-rw-r--r--plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/word/WordTemplateProcessor.java8
5 files changed, 19 insertions, 22 deletions
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/DefaultArtifactRenderer.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/DefaultArtifactRenderer.java
index c4ef18c9a9..8d9ede9ba0 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/DefaultArtifactRenderer.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/DefaultArtifactRenderer.java
@@ -52,7 +52,6 @@ import org.eclipse.osee.framework.ui.skynet.internal.Activator;
import org.eclipse.osee.framework.ui.skynet.internal.ServiceUtil;
import org.eclipse.osee.framework.ui.skynet.render.compare.DefaultArtifactCompare;
import org.eclipse.osee.framework.ui.skynet.render.compare.IComparator;
-import org.eclipse.osee.framework.ui.skynet.render.word.AttributeElement;
import org.eclipse.osee.framework.ui.skynet.render.word.Producer;
import org.eclipse.osee.framework.ui.skynet.render.word.WordMLProducer;
import org.eclipse.osee.framework.ui.skynet.skywalker.SkyWalkerView;
@@ -147,11 +146,9 @@ public class DefaultArtifactRenderer implements IRenderer {
}
@Override
- public void renderAttribute(AttributeTypeToken attributeType, Artifact artifact, PresentationType presentationType, Producer producer, AttributeElement attributeElement, String footer) throws OseeCoreException {
+ public void renderAttribute(AttributeTypeToken attributeType, Artifact artifact, PresentationType presentationType, Producer producer, String format, String label, String footer) throws OseeCoreException {
WordMLProducer wordMl = (WordMLProducer) producer;
- String format = attributeElement.getFormatPre();
boolean allAttrs = (boolean) rendererOptions.get(RendererOption.ALL_ATTRIBUTES);
-
wordMl.startParagraph();
if (allAttrs) {
@@ -162,7 +159,7 @@ public class DefaultArtifactRenderer implements IRenderer {
}
} else {
// assumption: the label is of the form <w:r><w:t> text </w:t></w:r>
- wordMl.addWordMl(attributeElement.getLabel());
+ wordMl.addWordMl(label);
}
if (attributeType.equals(CoreAttributeTypes.RelationOrder)) {
@@ -171,7 +168,7 @@ public class DefaultArtifactRenderer implements IRenderer {
wordMl.addWordMl(data);
} else {
String valueList = artifact.getAttributesToString(attributeType);
- if (attributeElement.getFormatPre().contains(">x<")) {
+ if (format.contains(">x<")) {
wordMl.addWordMl(format.replace(">x<", ">" + Xml.escape(valueList).toString() + "<"));
} else {
wordMl.addTextInsideParagraph(valueList);
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/IRenderer.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/IRenderer.java
index 3d24904cc9..2e481061d3 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/IRenderer.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/IRenderer.java
@@ -21,7 +21,6 @@ import org.eclipse.osee.framework.core.util.RendererOption;
import org.eclipse.osee.framework.skynet.core.artifact.Artifact;
import org.eclipse.osee.framework.ui.skynet.MenuCmdDef;
import org.eclipse.osee.framework.ui.skynet.render.compare.IComparator;
-import org.eclipse.osee.framework.ui.skynet.render.word.AttributeElement;
import org.eclipse.osee.framework.ui.skynet.render.word.Producer;
/**
@@ -41,7 +40,7 @@ public interface IRenderer {
public void addMenuCommandDefinitions(ArrayList<MenuCmdDef> commands, Artifact artifact);
- public void renderAttribute(AttributeTypeToken attributeType, Artifact artifact, PresentationType presentationType, Producer producer, AttributeElement attributeElement, String footer);
+ public void renderAttribute(AttributeTypeToken attributeType, Artifact artifact, PresentationType presentationType, Producer producer, String format, String label, String footer);
public String renderAttributeAsString(AttributeTypeId attributeType, Artifact artifact, PresentationType presentationType, String defaultValue);
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/RendererManager.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/RendererManager.java
index 740e944e97..bf3faea0ba 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/RendererManager.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/RendererManager.java
@@ -41,7 +41,6 @@ import org.eclipse.osee.framework.ui.skynet.internal.Activator;
import org.eclipse.osee.framework.ui.skynet.render.compare.CompareDataCollector;
import org.eclipse.osee.framework.ui.skynet.render.compare.IComparator;
import org.eclipse.osee.framework.ui.skynet.render.compare.NoOpCompareDataCollector;
-import org.eclipse.osee.framework.ui.skynet.render.word.AttributeElement;
import org.eclipse.osee.framework.ui.skynet.render.word.Producer;
/**
@@ -135,9 +134,9 @@ public final class RendererManager {
return bestRendererPrototype;
}
- public static void renderAttribute(AttributeTypeToken attributeType, PresentationType presentationType, Artifact artifact, Producer producer, AttributeElement attributeElement, String footer, Map<RendererOption, Object> rendererOptions) throws OseeCoreException {
+ public static void renderAttribute(AttributeTypeToken attributeType, PresentationType presentationType, Artifact artifact, Producer producer, String format, String label, String footer, Map<RendererOption, Object> rendererOptions) throws OseeCoreException {
getBestRenderer(PRODUCE_ATTRIBUTE, artifact, rendererOptions).renderAttribute(attributeType, artifact,
- presentationType, producer, attributeElement, footer);
+ presentationType, producer, format, label, footer);
}
public static Collection<AttributeTypeToken> getAttributeTypeOrderList(Artifact artifact) throws OseeCoreException {
@@ -211,7 +210,8 @@ public final class RendererManager {
}
public static String open(Artifact artifact, PresentationType presentationType, IProgressMonitor monitor) throws OseeCoreException {
- return open(Collections.singletonList(artifact), presentationType, monitor, new HashMap<RendererOption, Object>());
+ return open(Collections.singletonList(artifact), presentationType, monitor,
+ new HashMap<RendererOption, Object>());
}
public static String open(Artifact artifact, PresentationType presentationType) throws OseeCoreException {
@@ -246,7 +246,8 @@ public final class RendererManager {
}
public static void diffInJobWithPreferedRenderer(Collection<ArtifactDelta> artifactDeltas, String pathPrefix, IRenderer preferedRenderer) {
- diffInJobWithPreferedRenderer(artifactDeltas, pathPrefix, preferedRenderer, new HashMap<RendererOption, Object>());
+ diffInJobWithPreferedRenderer(artifactDeltas, pathPrefix, preferedRenderer,
+ new HashMap<RendererOption, Object>());
}
public static void diffInJobWithPreferedRenderer(Collection<ArtifactDelta> artifactDeltas, String pathPrefix, IRenderer preferedRenderer, Map<RendererOption, Object> rendererOptions) {
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/WordTemplateRenderer.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/WordTemplateRenderer.java
index f78542c1cd..f577d4cdfc 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/WordTemplateRenderer.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/WordTemplateRenderer.java
@@ -60,7 +60,6 @@ import org.eclipse.osee.framework.skynet.core.word.WordUtil;
import org.eclipse.osee.framework.ui.skynet.MenuCmdDef;
import org.eclipse.osee.framework.ui.skynet.render.compare.IComparator;
import org.eclipse.osee.framework.ui.skynet.render.compare.WordTemplateCompare;
-import org.eclipse.osee.framework.ui.skynet.render.word.AttributeElement;
import org.eclipse.osee.framework.ui.skynet.render.word.Producer;
import org.eclipse.osee.framework.ui.skynet.render.word.WordMLProducer;
import org.eclipse.osee.framework.ui.skynet.render.word.WordTemplateProcessor;
@@ -164,15 +163,15 @@ public class WordTemplateRenderer extends WordRenderer {
}
@Override
- public void renderAttribute(AttributeTypeToken attributeType, Artifact artifact, PresentationType presentationType, Producer producer, AttributeElement attributeElement, String footer) throws OseeCoreException {
+ public void renderAttribute(AttributeTypeToken attributeType, Artifact artifact, PresentationType presentationType, Producer producer, String format, String label, String footer) throws OseeCoreException {
WordMLProducer wordMl = (WordMLProducer) producer;
if (attributeType.equals(CoreAttributeTypes.WordTemplateContent)) {
String data = null;
LinkType linkType = (LinkType) getRendererOptionValue(RendererOption.LINK_TYPE);
- if (attributeElement.getLabel().length() > 0) {
- wordMl.addParagraph(attributeElement.getLabel());
+ if (label.length() > 0) {
+ wordMl.addParagraph(label);
}
TransactionId txId = null;
@@ -219,7 +218,7 @@ public class WordTemplateRenderer extends WordRenderer {
}
wordMl.resetListValue();
} else {
- super.renderAttribute(attributeType, artifact, PresentationType.SPECIALIZED_EDIT, wordMl, attributeElement,
+ super.renderAttribute(attributeType, artifact, PresentationType.SPECIALIZED_EDIT, wordMl, format, label,
footer);
}
}
@@ -302,6 +301,7 @@ public class WordTemplateRenderer extends WordRenderer {
}
templateContent = WordUtil.removeGUIDFromTemplate(templateContent);
+
return templateProcessor.applyTemplate(artifacts, templateContent, templateOptions, templateStyles, null, null,
(String) getRendererOptionValue(RendererOption.OUTLINE_TYPE), presentationType);
}
diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/word/WordTemplateProcessor.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/word/WordTemplateProcessor.java
index 74991c66bc..478253cb87 100644
--- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/word/WordTemplateProcessor.java
+++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/render/word/WordTemplateProcessor.java
@@ -776,12 +776,12 @@ public class WordTemplateProcessor {
if (!(publishInLine && artifact.isAttributeTypeValid(WordTemplateContent)) || attributeType.equals(
WordTemplateContent)) {
- RendererManager.renderAttribute(attributeType, presentationType, artifact, wordMl, attributeElement, footer,
- renderer.getRendererOptions());
+ RendererManager.renderAttribute(attributeType, presentationType, artifact, wordMl,
+ attributeElement.getFormat(), attributeElement.getLabel(), footer, renderer.getRendererOptions());
}
} else if (attributeType.equals(WordTemplateContent)) {
- RendererManager.renderAttribute(attributeType, presentationType, artifact, wordMl, attributeElement, footer,
- renderer.getRendererOptions());
+ RendererManager.renderAttribute(attributeType, presentationType, artifact, wordMl,
+ attributeElement.getFormat(), attributeElement.getLabel(), footer, renderer.getRendererOptions());
}
}

Back to the top