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.components.UnknownDC; 12 import org.oddjob.designer.model.DesignerModel; 13 import org.oddjob.monitor.Standards; 14 15 16 public class ViewXMLAction extends AbstractAction { 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 29 public void actionPerformed(ActionEvent 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 |