01: package de.ixdb.squirrel_sql.plugins.cache;
02:
03: import net.sourceforge.squirrel_sql.fw.gui.SortableTable;
04: import net.sourceforge.squirrel_sql.fw.gui.SortableTableModel;
05:
06: import javax.swing.*;
07: import javax.swing.table.DefaultTableModel;
08: import java.awt.*;
09:
10: public class ProcessListPanel extends JPanel {
11: SortableTable tblProcessList;
12: JButton btnRefresh;
13: JButton btnTerminate;
14: JButton btnClose;
15:
16: public ProcessListPanel() {
17: setLayout(new BorderLayout());
18:
19: tblProcessList = new SortableTable(new SortableTableModel(null));
20: tblProcessList
21: .setSelectionMode(ListSelectionModel.SINGLE_INTERVAL_SELECTION);
22: tblProcessList.getTableHeader().setResizingAllowed(true);
23: tblProcessList.getTableHeader().setReorderingAllowed(true);
24: tblProcessList.setAutoCreateColumnsFromModel(false);
25: tblProcessList.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
26:
27: add(new JScrollPane(tblProcessList), BorderLayout.CENTER);
28:
29: JPanel pnlSouth = new JPanel();
30: pnlSouth.setLayout(new GridBagLayout());
31: GridBagConstraints gbc;
32:
33: btnRefresh = new JButton("Refresh list");
34: btnTerminate = new JButton("Terminate selected Process");
35: btnClose = new JButton("Close processes tab");
36:
37: gbc = new GridBagConstraints(0, 0, 1, 1, 0, 0,
38: GridBagConstraints.NORTHWEST, GridBagConstraints.NONE,
39: new Insets(5, 5, 0, 5), 0, 0);
40: pnlSouth.add(btnRefresh, gbc);
41:
42: gbc = new GridBagConstraints(1, 0, 1, 1, 0, 0,
43: GridBagConstraints.NORTHWEST, GridBagConstraints.NONE,
44: new Insets(5, 0, 0, 5), 0, 0);
45: pnlSouth.add(btnTerminate, gbc);
46:
47: gbc = new GridBagConstraints(2, 0, 1, 1, 0, 0,
48: GridBagConstraints.NORTHWEST, GridBagConstraints.NONE,
49: new Insets(5, 0, 0, 5), 0, 0);
50: pnlSouth.add(btnClose, gbc);
51:
52: add(pnlSouth, BorderLayout.SOUTH);
53: }
54:
55: }
|