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 ViewComponentsAction extends AbstractAction { 17 private final DesignerModel model; 18 19 public ViewComponentsAction(DesignerModel model) { 20 this.model = model; 21 putValue(Action.NAME, "View Components"); 22 putValue(Action.MNEMONIC_KEY, Standards.VIEW_COMP_MNEMONIC_KEY); 23 putValue(Action.ACCELERATOR_KEY, Standards.VIEW_COMP_ACCELERATOR_KEY); 24 } 25 26 29 public void actionPerformed(ActionEvent e) { 30 UnknownDC unknown = (UnknownDC) model.getCurrentSelection().getDesignComponent(); 31 String xml = unknown.unknown(); 32 33 model.replaceSelected(xml); 34 35 } 36 } | Popular Tags |