01: /*
02: * Gruntspud
03: *
04: * Copyright (C) 2002 Brett Smith.
05: *
06: * Written by: Brett Smith <t_magicthize@users.sourceforge.net>
07: *
08: * This program is free software; you can redistribute it and/or
09: * modify it under the terms of the GNU Library General Public License
10: * as published by the Free Software Foundation; either version 2 of
11: * the License, or (at your option) any later version.
12: * This program is distributed in the hope that it will be useful,
13: * but WITHOUT ANY WARRANTY; without even the implied warranty of
14: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15: * GNU Library General Public License for more details.
16: *
17: * You should have received a copy of the GNU Library General Public
18: * License along with this program; if not, write to the Free Software
19: * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20: */
21:
22: package gruntspud.ui.preferences;
23:
24: import gruntspud.Constants;
25: import gruntspud.GruntspudContext;
26: import gruntspud.ui.UIUtil;
27:
28: import java.awt.BorderLayout;
29: import java.awt.GridLayout;
30:
31: import javax.swing.JPanel;
32:
33: /**
34: * UI component for editing of display options
35: *
36: * @author magicthize
37: */
38: public class FilterOptionsTab extends AbstractOptionsTab {
39:
40: private FilterPane filterPane;
41:
42: /**
43: * Constructor for the DisplayOptionsTab object
44: */
45: public FilterOptionsTab() {
46: super ("Filter", UIUtil
47: .getCachedIcon(Constants.ICON_TOOL_FILTER));
48: }
49:
50: /**
51: * DOCUMENT ME!
52: *
53: * @param context DOCUMENT ME!
54: */
55: public void init(GruntspudContext context) {
56: super .init(context);
57:
58: setTabToolTipText("Define your own named filters.");
59: setTabMnemonic('f');
60: setTabLargeIcon(UIUtil
61: .getCachedIcon(Constants.ICON_TOOL_LARGE_FILTER));
62: setTabContext("General");
63:
64: JPanel e = new JPanel(new BorderLayout());
65: filterPane = new FilterPane(context);
66: e.add(filterPane);
67: setLayout(new GridLayout(1, 1));
68: add(e, BorderLayout.CENTER);
69: }
70:
71: public void tabSelected() {
72:
73: }
74:
75: /**
76: * Validate the options
77: *
78: * @return <code>true</code> if the options were ok
79: */
80: public boolean validateTab() {
81: return true;
82: }
83:
84: /**
85: * Apply the options
86: */
87: public void applyTab() {
88: filterPane.apply();
89: }
90: }
|