1 9 10 package org.enhydra.jawe.actions; 11 12 import java.awt.Window ; 13 import java.awt.event.ActionEvent ; 14 import org.enhydra.jawe.AbstractGraph; 15 import org.enhydra.jawe.JaWE; 16 import org.enhydra.jawe.PackageEditor; 17 import org.enhydra.jawe.PackageGraph; 18 import org.enhydra.jawe.ProcessEditor; 19 import org.enhydra.jawe.xml.elements.WorkflowProcess; 20 21 24 public class MakeCopyOfProcess extends ActionBase { 25 26 public MakeCopyOfProcess (PackageEditor pe) { 27 super(pe); 28 } 29 30 public void actionPerformed(ActionEvent e) { 31 PackageGraph graph=(PackageGraph)editor.getGraph(); 32 Object cell=graph.getSelectionCell(); 33 if(!graph.isCellEditable(cell)) return; 34 Window parentW=graph.getEditor().getWindow(); 35 if (cell instanceof org.enhydra.jawe.graph.Process) { 36 org.enhydra.jawe.graph.Process wf=(org.enhydra.jawe.graph.Process)cell; 37 WorkflowProcess wp=(WorkflowProcess)wf.getPropertyObject(); 38 39 ProcessEditor pe=(ProcessEditor)((PackageEditor)editor).getProcessObject(wp).getImplementationEditor(); 40 Save.updateExtendedAttributesForWorkflowProcess(wp,pe); 41 org.enhydra.jawe.xml.elements.WorkflowProcesses wps= 42 (org.enhydra.jawe.xml.elements.WorkflowProcesses) 43 JaWE.getInstance().getRealXMLPackage().get("WorkflowProcesses"); 44 org.enhydra.jawe.xml.elements.WorkflowProcess wpCopy= 45 wps.createCopyOfWorkflowProcess(wp,true); 46 47 if (wpCopy==null) return; 49 50 graph.createWorkflowObject(editor.getWindow(),wpCopy); 51 52 if (wpCopy==null) return; 53 wps.decrementID(); 54 graph.repaint(); 55 } 56 } 57 58 } 59 | Popular Tags |