1 package org.apache.ojb.tools.mapping.reversedb2.actions; 2 import org.apache.ojb.broker.metadata.DescriptorRepository; 3 import org.apache.ojb.tools.mapping.reversedb2.gui.JIFrmOJBRepository; 4 18 19 23 public class ActionNewOJBRepository extends javax.swing.AbstractAction 24 { 25 private javax.swing.JFrame containingFrame; 26 27 public ActionNewOJBRepository(javax.swing.JFrame pcontainingFrame) 28 { 29 this.containingFrame = pcontainingFrame; 30 putValue(NAME, "New OJB Repository"); 31 putValue(MNEMONIC_KEY, new Integer (java.awt.event.KeyEvent.VK_N)); 32 } 33 34 public void actionPerformed (java.awt.event.ActionEvent actionEvent) 35 { 36 javax.swing.SwingUtilities.invokeLater(new Runnable () 37 { 38 public void run() 39 { 40 try 41 { 42 DescriptorRepository repository = new DescriptorRepository(); 44 JIFrmOJBRepository frm = new JIFrmOJBRepository(repository); 45 containingFrame.getContentPane().add(frm); 46 frm.setVisible(true); 47 } 48 catch (Throwable t) 49 { 50 t.printStackTrace(); 51 } 52 } 53 }); 54 } 55 } 56 | Popular Tags |