1 4 package org.oddjob.designer.actions; 5 6 import java.awt.event.ActionEvent ; 7 8 import javax.swing.AbstractAction ; 9 import javax.swing.Action ; 10 11 import org.oddjob.designer.model.DesignComponent; 12 import org.oddjob.designer.model.StructuralDesignComponent; 13 import org.oddjob.monitor.Standards; 14 15 16 public class DeleteAction extends AbstractAction { 17 18 final StructuralDesignComponent parent; 19 final DesignComponent child; 20 21 public DeleteAction(StructuralDesignComponent parent, DesignComponent child) { 22 this.parent = parent; 23 this.child = child; 24 putValue(Action.NAME, "Delete"); 25 putValue(Action.MNEMONIC_KEY, Standards.DELETE_MNEMONIC_KEY); 26 } 27 28 public void actionPerformed(ActionEvent e) { 29 parent.deleteChild(child); 30 } 31 } | Popular Tags |