01: /*
02: * $Author$
03: * $Id$
04: * This is free software, as software should be; you can redistribute
05: * it and/or modify it under the terms of the GNU Lesser General Public
06: * License as published by the Free Software Foundation; either
07: * version 2.1 of the License, or (at your option) any later version.
08:
09: * See LICENSE.txt for the full license covering this software/program/code.
10: */
11:
12: package isql.commands;
13:
14: import isql.Command;
15: import util.PerlWrapper;
16: import isql.*;
17: import util.*;
18: import javax.swing.JTextArea;
19: import javax.swing.table.TableModel;
20: import java.awt.Font;
21: import java.util.*;
22:
23: /**
24: * The command object associated with the refresh command, used to
25: * refresh table information (in case schema has changed).
26: * @author rahul kumar <rahul_kumar@yahoo.com>
27: * @see XXX
28: */
29:
30: public class RefreshCommand implements Command {
31:
32: /** ctor/constructor.
33: */
34: public RefreshCommand() {
35: }
36:
37: public String[] getCommandList() {
38: return commands;
39: }
40:
41: public void execute(SQLForm form, String command, String SQLString) {
42: _form = form;
43: SQLTabbedPane tp = _form.tp;
44: SQLJDBC myjdbc = _form.myjdbc;
45:
46: if (SQLString.indexOf("tables") != -1) {
47: _form.setErrorArea("\nDatabase is: "
48: + myjdbc.refreshDatabase());
49: _form.fillTableList();
50: _form.setTabTable();
51: }
52:
53: }
54:
55: public String getUsage(String s) {
56: return usage;
57: }
58:
59: String commands[] = { "refresh" };
60: SQLForm _form;
61:
62: final String usage = "refresh tables";
63:
64: ////// START INSTANCE VARIABLES //////
65:
66: ////// START CONSTANTS AND CLASS LEVEL VARIABLES //////
67: static final String P = "RefreshCommand"; // used in exception strings
68:
69: } // end of class
|