KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sslexplorer > security > forms > ShowAvailableAccountsForm


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.security.forms;
21
22 import javax.servlet.http.HttpServletRequest JavaDoc;
23 import javax.servlet.http.HttpSession JavaDoc;
24
25 import org.apache.commons.logging.Log;
26 import org.apache.commons.logging.LogFactory;
27 import org.apache.struts.action.ActionMapping;
28
29 import com.sslexplorer.security.User;
30 import com.sslexplorer.security.UserItem;
31 import com.sslexplorer.security.UserItemModel;
32 import com.sslexplorer.table.forms.AbstractPagerForm;
33
34 public class ShowAvailableAccountsForm extends AbstractPagerForm {
35
36     boolean isEditable;
37     boolean errored;
38
39     static Log log = LogFactory.getLog(ShowAvailableAccountsForm.class);
40
41     public ShowAvailableAccountsForm() {
42         super(new UserItemModel());
43     }
44
45     public void initialize(User[] users, User currentUser, HttpSession JavaDoc session) {
46         super.initialize(session, "account");
47         for (int i = 0; users != null && i < users.length; i++) {
48             UserItem item = new UserItem(users[i]);
49             getModel().addItem(item);
50         }
51         getPager().rebuild(getFilterText());
52     }
53
54     public String JavaDoc getEditable() {
55         return String.valueOf(isEditable);
56     }
57
58     public void setEditable(boolean isEditable) {
59         this.isEditable = isEditable;
60     }
61
62     public void setErrored(boolean errored) {
63         this.errored = errored;
64     }
65     
66     public boolean getErrored() {
67         return errored;
68     }
69
70     /* (non-Javadoc)
71      * @see com.sslexplorer.table.forms.AbstractPagerForm#reset(org.apache.struts.action.ActionMapping, javax.servlet.http.HttpServletRequest)
72      */

73     public void reset(ActionMapping mapping, HttpServletRequest JavaDoc request) {
74         super.reset(mapping, request);
75         errored = false;
76     }
77
78 }
Popular Tags