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: * @author Rahul Kumar $Author: rahul_kumar $
14: * @version $Id: FrameActions.java,v 1.2 2003/12/28 15:02:17 rahul_kumar Exp $
15: */
16: public class FrameActions {
17:
18: SQLForm _form = null;
19:
20: /** constructor passing whatever is needed. Do we need to pass
21: * SQLString or give a method or what.
22: */
23: public FrameActions(SQLForm form) {
24: _form = form;
25: }
26:
27: public Action[] getActions() {
28: return new Action[] { new SetFrameViewAction(_form),
29: new DrawLinksAction(_form) };
30: }
31:
32: public static final String setFrameViewAction = "set-frameview";
33: public static final String closeAllAction = "close-all";
34: public static final String rememberLastAction = "remember-last";
35: public static final String drawLinksAction = "draw-links";
36:
37: public static class SetFrameViewAction extends AbstractAction {
38:
39: public SetFrameViewAction(SQLForm form) {
40: super (setFrameViewAction);
41: this ._form = form;
42: }
43:
44: final SQLForm _form;
45:
46: public void actionPerformed(ActionEvent e) {
47: _form.setAttribute("tableview", "multiple");
48: }
49: }
50:
51: public static class DrawLinksAction extends AbstractAction {
52:
53: public DrawLinksAction(SQLForm form) {
54: super (drawLinksAction);
55: this ._form = form;
56: }
57:
58: final SQLForm _form;
59:
60: public void actionPerformed(ActionEvent e) {
61: InternalWindowPanel iwp = _form.tp.getWindowPanel();
62: iwp.drawStuff();
63: }
64: }
65: } //class
|