1 package com.opensymphony.workflow.designer.actions; 2 3 import java.awt.event.ActionEvent ; 4 import javax.swing.*; 5 import javax.swing.undo.CannotUndoException ; 6 7 import com.opensymphony.workflow.designer.WorkflowDesigner; 8 import com.opensymphony.workflow.designer.WorkflowGraph; 9 10 15 16 public class EditUndo extends AbstractAction 17 { 18 public EditUndo() 19 { 20 setEnabled(false); 21 } 22 23 public void actionPerformed(ActionEvent e) 24 { 25 try 26 { 27 WorkflowGraph graph = WorkflowDesigner.INSTANCE.getCurrentGraph(); 28 graph.getUndoManager().undo(graph.getGraphLayoutCache()); 29 graph.getUndoManager().updateHistoryButtons(); 30 } 31 catch(CannotUndoException ex) 32 { 33 System.out.println("Unable to undo: " + ex); 34 ex.printStackTrace(); 35 } 36 } 37 38 } 39 | Popular Tags |