From 22870cb9ae701690e712fe6e648cdd463cf532cb Mon Sep 17 00:00:00 2001 From: antelder Date: Wed, 10 Aug 2011 08:50:20 +0000 Subject: Add the option to draw the virtual domain composite git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1156073 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/tuscany/sca/diagram/shell/DrawShellCommand.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'collaboration') diff --git a/collaboration/GSoC-2011-Nirmal/CompositeDiagramShellPlugin/src/main/java/org/apache/tuscany/sca/diagram/shell/DrawShellCommand.java b/collaboration/GSoC-2011-Nirmal/CompositeDiagramShellPlugin/src/main/java/org/apache/tuscany/sca/diagram/shell/DrawShellCommand.java index 7124525c92..2be3d1dedb 100644 --- a/collaboration/GSoC-2011-Nirmal/CompositeDiagramShellPlugin/src/main/java/org/apache/tuscany/sca/diagram/shell/DrawShellCommand.java +++ b/collaboration/GSoC-2011-Nirmal/CompositeDiagramShellPlugin/src/main/java/org/apache/tuscany/sca/diagram/shell/DrawShellCommand.java @@ -45,7 +45,7 @@ public class DrawShellCommand implements Command { } public String getShortHelp() { - return "draw "; + return "draw [DOMAIN | ]"; } public String getHelp() { @@ -53,6 +53,7 @@ public class DrawShellCommand implements Command { helpText.append("Draws a picture of the composite.\n"); helpText.append("\n"); helpText.append("Arguments:\n"); + helpText.append(" DOMAIN - When the only argument is DOMAIN display the domain composite, otherwise:\n"); helpText.append(" contributionURI - (required) the URI of the installed contribution\n"); helpText.append(" compositeURL - (required) the URI of a started composite\n"); return helpText.toString(); @@ -60,7 +61,12 @@ public class DrawShellCommand implements Command { public boolean invoke(String[] args) throws Exception { - Composite composite = shell.getNode().getContribution(args[0]).getArtifactModel(args[1]); + Composite composite; + if ("DOMAIN".equals(args[0])) { + composite = shell.getNode().getDomainComposite(); + } else { + composite = shell.getNode().getContribution(args[0]).getArtifactModel(args[1]); + } TuscanyCompositeEntityBuilder eb = new TuscanyCompositeEntityBuilder(composite); CompositeEntity comp = eb.buildCompositeEntity(); DiagramGenerator dg = new DiagramGenerator(comp); -- cgit v1.2.3