KickJava   Java API By Example, From Geeks To Geeks.

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


1 package com.opensymphony.workflow.designer.editor;
2
3 import com.opensymphony.workflow.designer.ResultEdge;
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.ConfigConditionDescriptor;
8 import com.opensymphony.workflow.loader.ConditionDescriptor;
9
10 /**
11  * @author baab
12  */

13 public class ResultConditionEditor extends ConditionEditor
14 {
15   private ResultEdge edge;
16
17   public ResultConditionEditor(ResultEdge cell)
18   {
19     super(null);
20     edge = cell;
21   }
22
23   protected AbstractDescriptor getParent()
24   {
25     return edge.getDescriptor();
26   }
27
28     protected ConfigConditionDescriptor getConfigDescriptor(ConditionDescriptor cond)
29     {
30         return getModel().getPalette().getResultCondition(cond.getName());
31     }
32
33     protected ConfigConditionDescriptor getCondition()
34     {
35         ConfigConditionDescriptor template = (ConfigConditionDescriptor)DialogUtils.getUserSelection(getModel().getPalette().getResultConditions(),
36           ResourceManager.getString("condition.select.result"),
37           ResourceManager.getString("condition.select"), null);
38         if(template!=null)
39           return new ConfigConditionDescriptor(template);
40         return null;
41     }
42 }
43
Popular Tags