KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > ojb > tools > mapping > reversedb2 > actions > ActionNewOJBRepository


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 /* Copyright 2002-2005 The Apache Software Foundation
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */

18
19 /**
20  * Opens a new JIFrmOBJRepository in the specified frame.
21  * @author Administrator
22  */

23 public class ActionNewOJBRepository extends javax.swing.AbstractAction JavaDoc
24 {
25     private javax.swing.JFrame JavaDoc containingFrame;
26     /** Creates a new instance of ActionOpenOJBRepository */
27     public ActionNewOJBRepository(javax.swing.JFrame JavaDoc pcontainingFrame)
28     {
29         this.containingFrame = pcontainingFrame;
30         putValue(NAME, "New OJB Repository");
31         putValue(MNEMONIC_KEY, new Integer JavaDoc(java.awt.event.KeyEvent.VK_N));
32     }
33
34     public void actionPerformed (java.awt.event.ActionEvent JavaDoc actionEvent)
35     {
36         javax.swing.SwingUtilities.invokeLater(new Runnable JavaDoc()
37         {
38             public void run()
39             {
40                 try
41                 {
42                     // RepositoryPersistor persistor = new RepositoryPersistor ();
43
DescriptorRepository repository = new DescriptorRepository();
44                     JIFrmOJBRepository frm = new JIFrmOJBRepository(repository);
45                     containingFrame.getContentPane().add(frm);
46                     frm.setVisible(true);
47                 }
48                 catch (Throwable JavaDoc t)
49                 {
50                     t.printStackTrace();
51                 }
52             }
53         });
54     }
55 }
56
Popular Tags