01: /*
02: * Swing Explorer. Tool for developers exploring Java/Swing-based application internals.
03: * Copyright (C) 2008, Maxim Zakharenkov
04: *
05: * This program is free software; you can redistribute it and/or modify
06: * it under the terms of the GNU General Public License as published by
07: * the Free Software Foundation; either version 2 of the License, or
08: * (at your option) any later version.
09: *
10: * This program is distributed in the hope that it will be useful,
11: * but WITHOUT ANY WARRANTY; without even the implied warranty of
12: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13: * GNU General Public License for more details.
14: *
15: * You should have received a copy of the GNU General Public License along
16: * with this program; if not, write to the Free Software Foundation, Inc.,
17: * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18: *
19: * $Header: /cvs/swingexplorer/src/org/swingexplorer/properties/PNLPropertySheet.java,v 1.1 2008/02/13 21:52:12 maxz1 Exp $
20: */
21: package org.swingexplorer.properties;
22:
23: import java.awt.BorderLayout;
24:
25: import javax.swing.JPanel;
26: import javax.swing.JScrollPane;
27: import javax.swing.JTable;
28:
29: /**
30: *
31: * @author Maxim Zakharenkov
32: */
33: public class PNLPropertySheet extends JPanel {
34:
35: MdlProperties mdlProperties;
36: JTable tblProperties;
37: JScrollPane scpTable;
38:
39: public PNLPropertySheet() {
40:
41: tblProperties = new JTable();
42: mdlProperties = new MdlProperties();
43: tblProperties.setModel(mdlProperties);
44:
45: scpTable = new JScrollPane();
46: scpTable.setViewportView(tblProperties);
47:
48: this .setLayout(new BorderLayout());
49: this .add(scpTable, BorderLayout.CENTER);
50: tblProperties.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
51: tblProperties.getColumnModel().getColumn(0).setPreferredWidth(
52: 80);
53: tblProperties.getColumnModel().getColumn(1).setPreferredWidth(
54: 200);
55: }
56:
57: public void setBean(Object _bean) {
58: mdlProperties.setBean(_bean);
59: }
60:
61: public Object getBean() {
62: return mdlProperties.getBean();
63: }
64: }
|