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.plugin;
23:
24: import gruntspud.Constants;
25: import gruntspud.GruntspudContext;
26: import gruntspud.ui.UIUtil;
27: import gruntspud.ui.preferences.AbstractOptionsTab;
28:
29: import java.awt.BorderLayout;
30:
31: import javax.swing.BorderFactory;
32:
33: import plugspud.PluginManagerPane;
34:
35: /**
36: * Options for plugins
37: *
38: * @author magicthize
39: */
40: public class PluginManagerOptionsTab extends AbstractOptionsTab {
41: private GruntspudContext context;
42: private PluginManagerPane plugins;
43:
44: /**
45: * Constructor for the PluginManagerOptionsTab object
46: */
47: public PluginManagerOptionsTab() {
48: super ("Plugins", UIUtil
49: .getCachedIcon(Constants.ICON_TOOL_PLUGIN));
50: }
51:
52: /**
53: * DOCUMENT ME!
54: *
55: * @param context DOCUMENT ME!
56: */
57: public void init(GruntspudContext context) {
58: super .init(context);
59:
60: setTabToolTipText("Plugins extend the functionality of Gruntspud. You "
61: + "can install and remove plugins from here.");
62: setTabLargeIcon(UIUtil
63: .getCachedIcon(Constants.ICON_TOOL_LARGE_PLUGIN));
64: setTabMnemonic('u');
65: setTabContext("Plugins");
66:
67: plugins = new PluginManagerPane(context.getPluginManager(),
68: context);
69: plugins.setBorder(BorderFactory.createEmptyBorder(2, 2, 6, 6));
70:
71: setLayout(new BorderLayout());
72: add(plugins, BorderLayout.CENTER);
73: }
74:
75: /**
76: * DOCUMENT ME!
77: *
78: * @return DOCUMENT ME!
79: */
80: public boolean validateTab() {
81: return true;
82: }
83:
84: /**
85: * DOCUMENT ME!
86: */
87: public void tabSelected() {
88: }
89:
90: /**
91: * DOCUMENT ME!
92: */
93: public void applyTab() {
94: plugins.cleanUp();
95: }
96: }
|