01: /*
02: ** $Id: TabDialogView.java,v 1.4 2000/10/26 08:34:15 mrw Exp $
03: **
04: ** Mike Wilson, July 2000, mrw@whisperingwind.co.uk
05: **
06: ** (C) Copyright 2000, Mike Wilson, Reading, Berkshire, UK
07: **
08: ** This program is free software; you can redistribute it and/or modify
09: ** it under the terms of the GNU General Public License as published by
10: ** the Free Software Foundation; either version 2 of the License, or
11: ** (at your option) any later version.
12: **
13: ** This program is distributed in the hope that it will be useful,
14: ** but WITHOUT ANY WARRANTY; without even the implied warranty of
15: ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16: ** GNU General Public License for more details.
17: **
18: ** You should have received a copy of the GNU Library General
19: ** Public License along with this library; if not, write to the
20: ** Free Software Foundation, Inc., 59 Temple Place - Suite 330,
21: ** Boston, MA 02111-1307 USA.
22: */
23:
24: package uk.co.whisperingwind.framework;
25:
26: import java.awt.Component;
27: import java.awt.Insets;
28: import java.awt.GridBagConstraints;
29: import javax.swing.JTabbedPane;
30: import javax.swing.JFrame;
31:
32: /**
33: ** View which contains a JTabbedPane and a row of buttons at the
34: ** bottom.
35: */
36:
37: public abstract class TabDialogView extends ButtonView {
38: protected JTabbedPane tabbedPane = new JTabbedPane();
39:
40: public TabDialogView(JFrame parent, boolean modal) {
41: super (parent, modal);
42: GridBagConstraints constraints = new GridBagConstraints();
43:
44: constraints.fill = GridBagConstraints.BOTH;
45: constraints.gridx = 0;
46: constraints.gridy = 0;
47: constraints.insets = new Insets(4, 4, 4, 4);
48: constraints.fill = GridBagConstraints.BOTH;
49: constraints.weightx = 1.0;
50: constraints.weighty = 1.0;
51: content.getContentPane().add(tabbedPane, constraints);
52: }
53:
54: /**
55: ** Add a tab to the tab set.
56: **
57: ** @param label the label for the new tab.
58: ** @param Component the component to place in the tab.
59: */
60:
61: public void addTab(String label, Component component) {
62: tabbedPane.add(label, component);
63: }
64: }
|