01: package net.sourceforge.squirrel_sql.plugins.oracle.invalidobjects;
02:
03: /*
04: * Copyright (C) 2003 Jason Height
05: * jmheight@users.sourceforge.net
06: *
07: * This library is free software; you can redistribute it and/or
08: * modify it under the terms of the GNU Lesser General Public
09: * License as published by the Free Software Foundation; either
10: * version 2.1 of the License, or (at your option) any later version.
11: *
12: * This library is distributed in the hope that it will be useful,
13: * but WITHOUT ANY WARRANTY; without even the implied warranty of
14: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15: * Lesser General Public License for more details.
16: *
17: * You should have received a copy of the GNU Lesser General Public
18: * License along with this library; if not, write to the Free Software
19: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20: */
21: import java.awt.event.ActionEvent;
22: import javax.swing.SwingUtilities;
23:
24: import net.sourceforge.squirrel_sql.fw.util.Resources;
25:
26: import net.sourceforge.squirrel_sql.client.IApplication;
27: import net.sourceforge.squirrel_sql.client.action.SquirrelAction;
28:
29: import net.sourceforge.squirrel_sql.client.session.ISession;
30:
31: /**
32: * This <CODE>Action</CODE> displays a new Oracle DBMS Invalid Objects Worksheet.
33: *
34: * @author <A HREF="mailto:jmheight@users.sourceforge.net">Jason Height</A>
35: */
36: public class NewInvalidObjectsWorksheetAction extends SquirrelAction {
37: private Resources _resources;
38:
39: /**
40: * Ctor.
41: *
42: * @param app Application API.
43: *
44: * @throws IllegalArgumentException
45: * Thrown if a <TT>null</TT> <TT>IApplication</TT> passed.
46: */
47: public NewInvalidObjectsWorksheetAction(IApplication app,
48: Resources rsrc) {
49: super (app, rsrc);
50: _resources = rsrc;
51:
52: if (app == null) {
53: throw new IllegalArgumentException(
54: "Null IApplication passed");
55: }
56: }
57:
58: /**
59: * Display the about box.
60: *
61: * @param evt The event being processed.
62: */
63: public void actionPerformed(ActionEvent evt) {
64: ISession activeSession = getApplication().getSessionManager()
65: .getActiveSession();
66: if (activeSession == null)
67: throw new IllegalArgumentException(
68: "This method should not be called with a null activeSession");
69:
70: final InvalidObjectsInternalFrame sif = new InvalidObjectsInternalFrame(
71: activeSession, _resources);
72: getApplication().getMainFrame().addInternalFrame(sif, true,
73: null);
74:
75: // If we don't invokeLater here no Short-Cut-Key is sent
76: // to the internal frame
77: // seen under java version "1.4.1_01" and Linux
78: SwingUtilities.invokeLater(new Runnable() {
79: public void run() {
80: sif.setVisible(true);
81: }
82: });
83: }
84: }
|