01: package isql;
02:
03: import java.io.*;
04: import java.awt.*;
05: import java.awt.event.ActionEvent;
06: import java.text.*;
07: import javax.swing.*;
08: import javax.swing.KeyStroke;
09: import javax.swing.SwingConstants;
10: import javax.swing.text.*;
11:
12: /**
13: * General database actions, not requiring a table to be selected
14: * @author Rahul Kumar $Author: rahul_kumar $
15: * @version $Id: DBActions.java,v 1.1 2001/12/31 19:51:37 rahul_kumar Exp $
16: */
17: public class DBActions {
18:
19: SQLForm _form = null;
20:
21: /** constructor passing whatever is needed. Do we need to pass
22: * SQLString or give a method or what.
23: */
24: public DBActions(SQLForm form) {
25: _form = form;
26: }
27:
28: public Action[] getActions() {
29: return new Action[] { new DatabaseMetaDataAction(_form),
30: new ResultSetAction(_form), new ViewTypesAction(_form) };
31: }
32:
33: public static final String databaseMetaDataAction = "view-databasemetadata";
34: public static final String resultSetAction = "view-resultset";
35: public static final String viewTypesAction = "view-types";
36:
37: public static class DatabaseMetaDataAction extends AbstractAction {
38:
39: public DatabaseMetaDataAction(SQLForm form) {
40: super (databaseMetaDataAction);
41: this ._form = form;
42: }
43:
44: final SQLForm _form;
45:
46: public void actionPerformed(ActionEvent e) {
47: _form.Run("reflect java.sql.DatabaseMetaData");
48: }
49: }
50:
51: public static class ResultSetAction extends AbstractAction {
52:
53: public ResultSetAction(SQLForm form) {
54: super (resultSetAction);
55: this ._form = form;
56: }
57:
58: final SQLForm _form;
59:
60: public void actionPerformed(ActionEvent e) {
61: _form.Run("reflect java.sql.ResultSet");
62: }
63: }
64:
65: public static class ViewTypesAction extends AbstractAction {
66:
67: public ViewTypesAction(SQLForm form) {
68: super (viewTypesAction);
69: this ._form = form;
70: }
71:
72: final SQLForm _form;
73:
74: public void actionPerformed(ActionEvent e) {
75: _form.Run("reflect java.sql.Types");
76: }
77: }
78: }
|