KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sslexplorer > navigation > forms > ProfileSelectionForm


1 /*
2  * SSL-Explorer
3  *
4  * Copyright (C) 2003-2006 3SP LTD. All Rights Reserved
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * as published by the Free Software Foundation; either version 2 of
9  * the License, or (at your option) any later version.
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
16  * License along with this program; if not, write to the Free Software
17  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18  */

19             
20 package com.sslexplorer.navigation.forms;
21
22 import java.util.List JavaDoc;
23
24 import org.apache.commons.logging.Log;
25 import org.apache.commons.logging.LogFactory;
26 import org.apache.struts.action.ActionMapping;
27
28 import com.sslexplorer.core.forms.CoreForm;
29
30 /**
31  * For used by 'selectPropertyProfile' that allows the user to select his
32  * current property profile. The user may also choose to make the profile they
33  * select their default the next time they logon.
34  *
35  * @author Brett Smith <brett@3sp.com>
36  */

37
38 public class ProfileSelectionForm extends CoreForm {
39
40     static Log log = LogFactory.getLog(ProfileSelectionForm.class);
41
42     // Private instance variables
43
private List JavaDoc propertyProfiles;
44     private int selectedPropertyProfile;
45     private boolean makeDefault;
46
47     /**
48      * Get the list of {@link com.sslexplorer.properties.PropertyProfile} objects
49      * that are available for selection. I.e. those that the current user
50      * is allowed to use.
51      *
52      * @return list of available property profiles
53      */

54     public List JavaDoc getPropertyProfiles() {
55         return propertyProfiles;
56     }
57
58     /**
59      * Set the list of {@link com.sslexplorer.properties.PropertyProfile} objects
60      * that are available for selection. I.e. those that the current user
61      * is allowed to use.
62      *
63      * @param propertyProfiles list of property profiles
64      */

65     public void setPropertyProfiles(List JavaDoc propertyProfiles) {
66         this.propertyProfiles = propertyProfiles;
67     }
68
69     /**
70      * Set the ID of the selected profile
71      *
72      * @param selectedPropertyProfile selected profile
73      */

74     public void setSelectedPropertyProfile(int selectedPropertyProfile) {
75         this.selectedPropertyProfile = selectedPropertyProfile;
76     }
77
78     /**
79      * Get the ID of the selected profile
80      *
81      * @return ID of selected profile
82      */

83     public int getSelectedPropertyProfile() {
84         return selectedPropertyProfile;
85     }
86
87     /**
88      * Get whether this profile should be made the default for the user
89      *
90      * @return <code>true</code> if the profile should be made the default
91      */

92     public boolean getMakeDefault() {
93         return makeDefault;
94     }
95
96     /**
97      * Set wthher this profile should be made the default for this user.
98      *
99      * @param makeDefault <code>true</code> to make the profile default for the user
100      */

101     public void setMakeDefault(boolean makeDefault) {
102         this.makeDefault = makeDefault;
103     }
104
105     /* (non-Javadoc)
106      * @see org.apache.struts.action.ActionForm#reset(org.apache.struts.action.ActionMapping, javax.servlet.http.HttpServletRequest)
107      */

108     public void reset(ActionMapping mapping, javax.servlet.http.HttpServletRequest JavaDoc request) {
109         propertyProfiles = null;
110         selectedPropertyProfile = 0;
111     }
112 }
Popular Tags