KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > opensymphony > workflow > designer > editor > StepFunctionEditor


1 package com.opensymphony.workflow.designer.editor;
2
3 import com.opensymphony.workflow.designer.StepCell;
4 import com.opensymphony.workflow.designer.ResourceManager;
5 import com.opensymphony.workflow.designer.dialogs.DialogUtils;
6 import com.opensymphony.workflow.loader.AbstractDescriptor;
7 import com.opensymphony.workflow.loader.ActionDescriptor;
8 import com.opensymphony.workflow.loader.ConfigFunctionDescriptor;
9
10 /**
11  * @author baab
12  */

13 public class StepFunctionEditor extends FunctionEditor
14 {
15   public StepFunctionEditor(StepCell cell)
16   {
17     super(cell);
18   }
19
20   private StepCell getCell()
21   {
22     return (StepCell)cell;
23   }
24
25   protected AbstractDescriptor getParent()
26   {
27     //todo need a check here for actions>0 or a more sensible way to get parent
28
return (ActionDescriptor)getCell().getDescriptor().getActions().get(0);
29   }
30
31     protected ConfigFunctionDescriptor getFunction()
32     {
33         ConfigFunctionDescriptor template = (ConfigFunctionDescriptor)DialogUtils.getUserSelection(getModel().getPalette().getPreFunctions(),
34           ResourceManager.getString("function.select.step"),
35           ResourceManager.getString("function.select"), null);
36         if(template!=null)
37           return new ConfigFunctionDescriptor(template);
38         return null;
39     }
40 }
41
Popular Tags