01: package net.sourceforge.squirrel_sql.plugins.graph;
02:
03: import net.sourceforge.squirrel_sql.fw.util.StringManager;
04: import net.sourceforge.squirrel_sql.fw.util.StringManagerFactory;
05:
06: import javax.swing.*;
07: import java.awt.*;
08:
09: public class GraphSelectionDialog extends JDialog {
10: private static final StringManager s_stringMgr = StringManagerFactory
11: .getStringManager(GraphSelectionDialog.class);
12:
13: JList lstControllers;
14: JButton btnCreateNewGraph;
15: JButton btnOK;
16: JButton btnCancel;
17:
18: public GraphSelectionDialog(JFrame parent) {
19: super (parent, true);
20: // i18n[graph.selGraph=Select graph]
21: setTitle(s_stringMgr.getString("graph.selGraph"));
22:
23: getContentPane().setLayout(new GridBagLayout());
24:
25: GridBagConstraints gbc;
26:
27: gbc = new GridBagConstraints(0, 0, 1, 1, 0, 0,
28: GridBagConstraints.NORTHWEST, GridBagConstraints.NONE,
29: new Insets(5, 5, 5, 5), 0, 0);
30: // i18n[graph.selGraphToAdd=Select the graph to add the selected tables to]
31: getContentPane()
32: .add(
33: new JLabel(s_stringMgr
34: .getString("graph.selGraphToAdd")), gbc);
35:
36: lstControllers = new JList();
37: lstControllers
38: .setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
39: gbc = new GridBagConstraints(0, 1, 1, 1, 1, 1,
40: GridBagConstraints.NORTHWEST, GridBagConstraints.BOTH,
41: new Insets(0, 5, 5, 5), 0, 0);
42: getContentPane().add(new JScrollPane(lstControllers), gbc);
43:
44: gbc = new GridBagConstraints(0, 2, 1, 1, 1, 0,
45: GridBagConstraints.NORTHWEST,
46: GridBagConstraints.HORIZONTAL, new Insets(0, 5, 5, 5),
47: 0, 0);
48: getContentPane().add(createButtonPanel(), gbc);
49:
50: setSize(400, 300);
51: }
52:
53: private JPanel createButtonPanel() {
54: JPanel ret = new JPanel(new GridBagLayout());
55:
56: GridBagConstraints gbc;
57:
58: gbc = new GridBagConstraints(0, 0, 1, 1, 0, 0,
59: GridBagConstraints.WEST, GridBagConstraints.NONE,
60: new Insets(0, 5, 5, 5), 0, 0);
61: // i18n[graph.btnOk=OK]
62: btnOK = new JButton(s_stringMgr.getString("graph.btnOk"));
63: ret.add(btnOK, gbc);
64: getRootPane().setDefaultButton(btnOK);
65:
66: gbc = new GridBagConstraints(1, 0, 1, 1, 0, 0,
67: GridBagConstraints.WEST, GridBagConstraints.NONE,
68: new Insets(0, 5, 5, 5), 0, 0);
69: // i18n[graph.btnCreateNewGraph=Create new graph]
70: btnCreateNewGraph = new JButton(s_stringMgr
71: .getString("graph.btnCreateNewGraph"));
72: ret.add(btnCreateNewGraph, gbc);
73:
74: gbc = new GridBagConstraints(2, 0, 1, 1, 0, 0,
75: GridBagConstraints.EAST, GridBagConstraints.NONE,
76: new Insets(0, 5, 5, 5), 0, 0);
77: // i18n[graph.btnCancel=Cancel]
78: btnCancel = new JButton(s_stringMgr
79: .getString("graph.btnCancel"));
80: ret.add(btnCancel, gbc);
81:
82: return ret;
83: }
84: }
|