01: package org.obe.runtime.tool;
02:
03: import org.obe.client.api.repository.NoImplementationToolAgentMetaData;
04: import org.obe.client.api.repository.ToolAgentMetaData;
05: import org.obe.client.api.tool.ToolAgent;
06: import org.obe.client.api.tool.ToolInvocation;
07:
08: import javax.swing.*;
09: import java.io.IOException;
10: import java.io.Writer;
11:
12: /**
13: * A ToolAgent that informs the user of the details of a manual task.
14: *
15: * @author Adrian Price
16: */
17: public final class NoImplementationToolAgent extends AbstractToolAgent {
18: public static final ToolAgent INSTANCE = new NoImplementationToolAgent();
19: public static final ToolAgentMetaData META_DATA = new NoImplementationToolAgentMetaData();
20:
21: private NoImplementationToolAgent() {
22: }
23:
24: protected int _invokeApplication(ToolInvocation ti) {
25: JOptionPane.showMessageDialog(null, new Object[] {
26: ti.workItemName, ti.description }, "Manual Activity",
27: JOptionPane.INFORMATION_MESSAGE);
28: return 0;
29: }
30:
31: public void renderInvocationScript(ToolInvocation ti, Writer writer)
32: throws IOException {
33:
34: writer.write("alert(\"");
35: writer.write("Manual Activity: ");
36: writer.write(ti.workItemName);
37: if (ti.description != null && ti.description.length() > 0) {
38: writer.write("\\n\\n");
39: writer.write(ti.description);
40: }
41: writer.write("\");");
42: }
43: }
|