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 modify it under the terms of the GNU Library General Public
09: * License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
10: * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
11: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details.
12: *
13: * You should have received a copy of the GNU Library General Public License along with this program; if not, write to the Free
14: * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
15: */
16:
17: package gruntspud.ui.preferences;
18:
19: import gruntspud.GruntspudContext;
20: import gruntspud.connection.ConnectionProfile;
21:
22: import javax.swing.JPanel;
23:
24: /**
25: * Abstract component that should be implemented by all connection plugins that wish to provide additional options for each
26: * profile.
27: *
28: * @author magicthize
29: */
30: public abstract class AbstractAdditionalOptionsPane extends JPanel {
31: // Private instance variables
32: private GruntspudContext context;
33:
34: /**
35: * Intialise the options pane
36: *
37: * @param context context
38: */
39: public void init(GruntspudContext context) {
40: this .context = context;
41: }
42:
43: /**
44: * Return the context
45: *
46: * @return context
47: */
48: public GruntspudContext getContext() {
49: return context;
50: }
51:
52: /**
53: * Implement to set the connection profile
54: *
55: * @param profile connection profile
56: */
57: public abstract void setProfile(ConnectionProfile profile);
58:
59: /**
60: * Validate the options. Return <code>false</code> if any of the options are incorrect. It is up to the implementation to
61: * show any error messages or warnings.
62: *
63: * @return <code>true</code> if options are ok
64: */
65: public abstract boolean validateOptions();
66:
67: /**
68: * Apply the additional options to the connection profile
69: */
70: public abstract void applyOptions();
71: }
|