KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > opensymphony > workflow > designer > proxy > ActionProxy


1 package com.opensymphony.workflow.designer.proxy;
2
3 import com.opensymphony.workflow.loader.ActionDescriptor;
4 import org.jgraph.graph.DefaultGraphCell;
5
6 /**
7  * @author Gulei
8  */

9 public class ActionProxy implements DefaultGraphCell.ValueChangeHandler
10 {
11   private ActionDescriptor action;
12
13   public ActionProxy(ActionDescriptor d)
14   {
15     action = d;
16   }
17
18   public String JavaDoc toString()
19   {
20     return action == null ? "" : action.getName();
21   }
22
23   public Object JavaDoc valueChanged(Object JavaDoc newValue)
24   {
25     if(action==null) return "";
26     String JavaDoc name = action.getName();
27     action.setName(newValue.toString());
28     return name;
29   }
30
31   public Object JavaDoc clone()
32   {
33     System.out.println(getClass() + " WARNING: Unexpected clone called on " + this);
34     return this;
35   }
36
37   public ActionDescriptor getDescriptor()
38   {
39     return action;
40   }
41 }
42
Popular Tags