KickJava   Java API By Example, From Geeks To Geeks.

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


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

13 public class StepPermissionEditor extends ConditionEditor
14 {
15   public StepPermissionEditor(StepCell cell)
16   {
17     super(cell);
18   }
19
20   protected AbstractDescriptor getParent()
21   {
22     List JavaDoc actions = getCell().getDescriptor().getActions();
23     if(actions.size()>0)
24       return ((ActionDescriptor)actions.get(0)).getRestriction();
25     return null;
26   }
27
28     protected ConfigConditionDescriptor getConfigDescriptor(ConditionDescriptor cond)
29     {
30         return getModel().getPalette().getPermissionCondition(cond.getName());
31     }
32
33     protected ConfigConditionDescriptor getCondition()
34     {
35         PermissionConditionDescriptor template = (PermissionConditionDescriptor)DialogUtils.getUserSelection(getModel().getPalette().getPermissionConditions(),
36           ResourceManager.getString("permission.select.step"),
37           ResourceManager.getString("permission.select"), null);
38         if(template!=null)
39           return new PermissionConditionDescriptor(template);
40         return null;
41     }
42
43   protected StepCell getCell()
44   {
45     return (StepCell)cell;
46   }
47 }
48
Popular Tags