KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > oddjob > designer > actions > DeleteAction


1 /*
2  * (c) Rob Gordon 2005
3  */

4 package org.oddjob.designer.actions;
5
6 import java.awt.event.ActionEvent JavaDoc;
7
8 import javax.swing.AbstractAction JavaDoc;
9 import javax.swing.Action JavaDoc;
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 JavaDoc {
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 JavaDoc e) {
29         parent.deleteChild(child);
30     }
31 }
Popular Tags