KickJava   Java API By Example, From Geeks To Geeks.

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


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.components.UnknownDC;
12 import org.oddjob.designer.model.DesignerModel;
13 import org.oddjob.monitor.Standards;
14
15
16 public class ViewXMLAction extends AbstractAction JavaDoc {
17     private final DesignerModel model;
18     
19     public ViewXMLAction(DesignerModel model) {
20         this.model = model;
21         putValue(Action.NAME, "View XML");
22         putValue(Action.MNEMONIC_KEY, Standards.VIEW_XML_MNEMONIC_KEY);
23         putValue(Action.ACCELERATOR_KEY, Standards.VIEW_XML_ACCELERATOR_KEY);
24     }
25     
26     /* (non-Javadoc)
27      * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
28      */

29     public void actionPerformed(ActionEvent JavaDoc e) {
30         UnknownDC unknown = new UnknownDC();
31         unknown.name("As XML");
32         unknown.unknown(model.getCurrentXML());
33
34         model.replaceSelected(unknown);
35     }
36 }
Popular Tags