01: /*
02: * ExportExcelCommand.java
03: *
04: * Copyright (C) 2002, 2003, 2004, 2005, 2006 Takis Diakoumis
05: *
06: * This program is free software; you can redistribute it and/or
07: * modify it under the terms of the GNU General Public License
08: * as published by the Free Software Foundation; either version 2
09: * of the License, or any later version.
10: *
11: * This program is distributed in the hope that it will be useful,
12: * but WITHOUT ANY WARRANTY; without even the implied warranty of
13: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14: * GNU General Public License for more details.
15: *
16: * You should have received a copy of the GNU General Public License
17: * along with this program; if not, write to the Free Software
18: * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19: *
20: */
21:
22: package org.executequery.actions.toolscommands;
23:
24: import java.awt.event.ActionEvent;
25:
26: import org.executequery.GUIUtilities;
27: import org.underworldlabs.swing.actions.BaseCommand;
28: import org.executequery.actions.OpenFrameCommand;
29: import org.executequery.gui.BaseDialog;
30: import org.executequery.gui.importexport.ImportExportExcelPanel;
31: import org.executequery.gui.importexport.ImportExportProcess;
32:
33: /* ----------------------------------------------------------
34: * CVS NOTE: Changes to the CVS repository prior to the
35: * release of version 3.0.0beta1 has meant a
36: * resetting of CVS revision numbers.
37: * ----------------------------------------------------------
38: */
39:
40: /** <p>Execution for Export Excel
41: *
42: * @author Takis Diakoumis
43: * @version $Revision: 1.5 $
44: * @date $Date: 2006/06/03 01:24:59 $
45: */
46: public class ExportExcelCommand extends OpenFrameCommand implements
47: BaseCommand {
48:
49: public void execute(ActionEvent e) {
50: if (!isConnected()) {
51: return;
52: }
53:
54: if (isActionableDialogOpen()) {
55: GUIUtilities.acionableDialogToFront();
56: return;
57: }
58:
59: if (!isDialogOpen("Export Excel Spreadsheet")) {
60: GUIUtilities.showWaitCursor();
61: try {
62: BaseDialog dialog = createDialog(
63: "Export Excel Spreadsheet", false, false);
64: ImportExportExcelPanel panel = new ImportExportExcelPanel(
65: dialog, ImportExportProcess.EXPORT);
66: dialog.addDisplayComponent(panel);
67: dialog.display();
68: } finally {
69: GUIUtilities.showNormalCursor();
70: }
71: }
72:
73: }
74:
75: }
|