Commit 3214afe8 authored by Chen Wenwen's avatar Chen Wenwen
Browse files

now with Code Specification and Mode Automaton in report

refs 290
parent 74ccd488
......@@ -75,6 +75,7 @@ public class ExportImagesAction extends EObjectActionBase<EObject> {
private void exportImages(IImageContainer element) {
for(ImageItem imageItem : element.getImages()) {
try {
copyFile(getImageFile(imageItem), new File(imageFolder, imageItem.getPath()));
} catch(IOException e) {
e.printStackTrace();
......
......@@ -49,7 +49,7 @@ import org.fortiss.tooling.kernel.ui.service.IModelEditorBindingService;
* @author kisslinger
* @author $Author$
* @version $Rev$
* @ConQAT.Rating YELLOW Hash: DA83B80EFA65F11B9BB97E1D0EE32313
* @ConQAT.Rating YELLOW Hash: A5C14674D90033453A61FC393CC140C6
*/
public class ExportSpecificationImagesAction extends EObjectActionBase<EObject> {
/** folder which should contain the images in the end */
......@@ -96,9 +96,7 @@ public class ExportSpecificationImagesAction extends EObjectActionBase<EObject>
}
// export formal specifications
EList<FormalSpecification> formalSpecs =
pickInstanceOf(FormalSpecification.class, req.getContainedElementsList());
for(FormalSpecification formalSpec : formalSpecs) {
for(FormalSpecification formalSpec : req.getFormalSpecifications()) {
handleExportComponent(formalSpec.getTopComponent());
}
......@@ -114,9 +112,11 @@ public class ExportSpecificationImagesAction extends EObjectActionBase<EObject>
if(hasStateAutomaton(component)) {
handleExportState(getStateAutomaton(component).getRootState());
} else if(getModeAutomaton(component) != null) {
}
if(getModeAutomaton(component) != null) {
handleExportMode(getModeAutomaton(component).getRootMode());
} else if((!component.getSubComponents().isEmpty()) ||
}
if((!component.getSubComponents().isEmpty()) ||
!(component.getContainer() instanceof Component)) {
// the component view must be exported if the component contains sub-components or if it
// is the top-component
......
......@@ -40,7 +40,7 @@ import com4j.Variant;
* @author mou
* @author $Author$
* @version $Rev$
* @ConQAT.Rating GREEN Hash: 108FEA61E5570F9D916ECC0A683528E2
* @ConQAT.Rating YELLOW Hash: FFF61993A57A4345B41EE434EFC2A0A6
*/
public class ExportReportCommand implements Callable<Object> {
......@@ -69,6 +69,7 @@ public class ExportReportCommand implements Callable<Object> {
public Object call() throws Exception {
String templateURI = getResourceURI(PLUGIN_ID, template);
String output = execute(templateURI, getContextFor(modelElement));
PrintWriter htmOutput = new PrintWriter(htmFile);
htmOutput.print(output);
htmOutput.close();
......
......@@ -62,7 +62,7 @@ import org.fortiss.tooling.kernel.utils.EcoreUtils;
* @author mou
* @author $Author$
* @version $Rev$
* @ConQAT.Rating YELLOW Hash: 0385CA172E7ABF89F78199D7130EE142
* @ConQAT.Rating YELLOW Hash: 18E25AE4D80B3F5F48941CE17A64AC87
*/
public class ContextFactory {
......@@ -157,13 +157,13 @@ public class ContextFactory {
ctx.defineContextList("formalspecs_short");
ctx.defineContextList("formalspecs");
for(FormalSpecification formalSpec : EcoreUtils.pickInstanceOf(FormalSpecification.class,
r.getContainedElementsList())) {
for(FormalSpecification formalSpec : r.getFormalSpecifications()) {
EvaluationContext nestctx = new EvaluationContext();
nestctx.set("name", formalSpec.getName());
ctx.addContext("formalspecs_short", nestctx);
handleTopComponent(formalSpec.getTopComponent(), formalSpec.getName(), ctx,
"formalspecs");
}
ctx.set("comments", r.getComment());
......@@ -227,11 +227,11 @@ public class ContextFactory {
private static void handleTopComponent(Component topComponent, String nameToUse,
EvaluationContext ctx, String listName) {
ctx.addContext(listName, getPictureContextFor(topComponent, nameToUse));
for(Component subComponent : EcoreUtils.pickInstanceOf(Component.class,
topComponent.getContainedElementsList())) {
handleComponent(subComponent, ctx, listName);
}
}
/**
......@@ -248,15 +248,9 @@ public class ContextFactory {
.getRootState().getContainedElementsList())) {
handleState(subState, ctx, listName);
}
} else if(getModeAutomaton(component) != null) {
ModeAutomaton modeAutomaton = getModeAutomaton(component);
ctx.addContext(listName,
getPictureContextFor(modeAutomaton.getRootMode(), component.getName()));
for(Mode subMode : EcoreUtils.pickInstanceOf(Mode.class, modeAutomaton.getRootMode()
.getContainedElementsList())) {
handleMode(subMode, ctx, listName);
}
} else if(getCodeSpecification(component) != null) {
}
if(getCodeSpecification(component) != null) {
EvaluationContext nestctx = new EvaluationContext();
nestctx.set("name", component.getName());
nestctx.set("has_text", true);
......@@ -264,7 +258,19 @@ public class ContextFactory {
nestctx.set("text",
formatStatements((getCodeSpecification(component).getBody()).toString()));
ctx.addContext(listName, nestctx);
} else if((!component.getSubComponents().isEmpty()) ||
}
if(getModeAutomaton(component) != null) {
ModeAutomaton modeAutomaton = getModeAutomaton(component);
ctx.addContext(listName,
getPictureContextFor(modeAutomaton.getRootMode(), component.getName()));
for(Mode subMode : EcoreUtils.pickInstanceOf(Mode.class, modeAutomaton.getRootMode()
.getContainedElementsList())) {
handleMode(subMode, ctx, listName);
}
}
if((!component.getSubComponents().isEmpty()) ||
!(component.getContainer() instanceof Component)) {
ctx.addContext(listName, getPictureContextFor(component));
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment