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 cache command, used to
25: * cache table information.
26: * @author rahul kumar <rahul_kumar@yahoo.com>
27: * @see XXX
28: */
29:
30: public class CacheCommand implements Command {
31:
32: /** ctor/constructor.
33: */
34: public CacheCommand() {
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: ArrayList v = _form.getColumnList(SQLString.substring(6));
47: if (v.size() > 0) {
48: String tabs[] = new String[v.size()];
49: tp.updateTabTable((String[]) v.toArray(tabs));
50: // do same for sd1
51: _form.sd1.setTabTable(_form.sd.getTabTable());
52: }
53: //tp.appendOutputArea('\n'+ "Cached "+v.size()+" entries.");
54: _form.setErrorArea('\n' + "Cached " + v.size() + " entries.");
55:
56: }
57:
58: public String getUsage(String s) {
59: return usage;
60: }
61:
62: String commands[] = { "reflect" };
63: SQLForm _form;
64:
65: final String usage = "reflect <classname>";
66:
67: ////// START INSTANCE VARIABLES //////
68:
69: ////// START CONSTANTS AND CLASS LEVEL VARIABLES //////
70: static final String P = "CacheCommand"; // used in exception strings
71:
72: } // end of class
|