01: /*
02: * DatabasePropertiesPanel.java
03: *
04: * Copyright (C) 2002, 2003, 2004, 2005, 2006 Takis Diakoumis
05: *
06: * This program is free software; you can redistribute it and/or
07: * modify it under the terms of the GNU General Public License
08: * as published by the Free Software Foundation; either version 2
09: * of the License, or any later version.
10: *
11: * This program is distributed in the hope that it will be useful,
12: * but WITHOUT ANY WARRANTY; without even the implied warranty of
13: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14: * GNU General Public License for more details.
15: *
16: * You should have received a copy of the GNU General Public License
17: * along with this program; if not, write to the Free Software
18: * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19: *
20: */
21:
22: package org.executequery.gui.browser;
23:
24: import java.awt.GridBagConstraints;
25: import java.awt.GridBagLayout;
26: import java.awt.Insets;
27: import java.util.Hashtable;
28: import javax.swing.JScrollPane;
29: import javax.swing.JTable;
30: import org.executequery.gui.DefaultTable;
31: import org.underworldlabs.swing.table.PropertyWrapperModel;
32:
33: /* ----------------------------------------------------------
34: * CVS NOTE: Changes to the CVS repository prior to the
35: * release of version 3.0.0beta1 has meant a
36: * resetting of CVS revision numbers.
37: * ----------------------------------------------------------
38: */
39:
40: /**
41: * Simple panel displaying database meta data properties.
42: *
43: * @author Takis Diakoumis
44: * @version $Revision: 1.5 $
45: * @date $Date: 2006/07/15 13:14:12 $
46: */
47: public class DatabasePropertiesPanel extends ConnectionPropertiesPanel {
48:
49: /** table model */
50: private PropertyWrapperModel model;
51:
52: /** the table */
53: private JTable table;
54:
55: /** Creates a new instance of DatabasePropertiesPanel */
56: public DatabasePropertiesPanel() {
57: super (new GridBagLayout());
58: init();
59: }
60:
61: private void init() {
62: model = new PropertyWrapperModel(
63: PropertyWrapperModel.SORT_BY_KEY);
64: table = new DefaultTable(model);
65: setTableProperties(table);
66:
67: GridBagConstraints gbc = new GridBagConstraints(1, 1, 1, 1,
68: 1.0, 1.0, GridBagConstraints.SOUTHEAST,
69: GridBagConstraints.BOTH, new Insets(5, 5, 5, 5), 0, 0);
70: add(new JScrollPane(table), gbc);
71: }
72:
73: public void setDatabaseProperties(Hashtable properties) {
74: model.setValues(properties, true);
75: }
76:
77: public JTable getTable() {
78: return table;
79: }
80:
81: }
|