01: package com.opensymphony.workflow.designer.spi;
02:
03: import java.awt.Component;
04: import java.util.Map;
05:
06: import com.opensymphony.workflow.loader.ConfigFunctionDescriptor;
07: import com.opensymphony.workflow.designer.dialogs.DialogUtils;
08:
09: /**
10: * User: Hani Suleiman
11: * Date: Jan 6, 2004
12: * Time: 1:23:42 PM
13: */
14: public class BshFunctionPlugin implements FunctionPlugin {
15: private ConfigFunctionDescriptor function;
16:
17: public void setFunction(ConfigFunctionDescriptor descriptor) {
18: this .function = descriptor;
19: }
20:
21: public ConfigFunctionDescriptor getFunction() {
22: return function;
23: }
24:
25: public boolean editFunction(Map args, Component parent) {
26: String text = DialogUtils.getTextDialog((String) function
27: .getArgs().get("script"), parent);
28: if (text != null) {
29: function.getArgs().put("script", text);
30: return true;
31: }
32: return false;
33: }
34: }
|