KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > jonas > webapp > jonasadmin > deploy > RemoveForm


1 /**
2  * JOnAS: Java(TM) Open Application Server
3  * Copyright (C) 2005 Bull S.A.
4  * Contact: jonas-team@objectweb.org
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
19  * USA
20  *
21  * --------------------------------------------------------------------------
22  * $Id: RemoveForm.java,v 1.2 2005/07/25 21:03:54 pasmith Exp $
23  * --------------------------------------------------------------------------
24  */

25
26 package org.objectweb.jonas.webapp.jonasadmin.deploy;
27
28 import java.util.ArrayList JavaDoc;
29 import java.util.List JavaDoc;
30
31 import javax.servlet.http.HttpServletRequest JavaDoc;
32
33 import org.apache.struts.action.ActionErrors;
34 import org.apache.struts.action.ActionForm;
35 import org.apache.struts.action.ActionMapping;
36
37 /**
38  * Manage the list of modules that can be removed
39  * @author Florent Benoit
40  */

41
42 public class RemoveForm extends ActionForm {
43
44     /**
45      * List of removable modules
46      */

47     private List JavaDoc listRemovable = new ArrayList JavaDoc();
48
49     /**
50      * List of removed modules
51      */

52     private List JavaDoc listRemoved = new ArrayList JavaDoc();
53
54
55     /**
56      * List of modules to remove (select by user, based on removeSelected array)
57      */

58     private List JavaDoc listToBeRemoved = new ArrayList JavaDoc();
59
60
61     /**
62      * Array of user selected elements to be removed
63      */

64     private String JavaDoc[] removeSelected = new String JavaDoc[0];
65
66
67     //private ArrayList listRemove = new ArrayList();
68
private boolean confirm = false;
69
70     /**
71      * Is the current context a domain management action?
72      */

73     private boolean isDomain;
74
75
76 // --------------------------------------------------------- Public Methods
77

78     /**
79      * Reset all properties to their default values.
80      *
81      * @param mapping The mapping used to select this instance
82      * @param request The servlet request we are processing
83      */

84
85     public void reset(ActionMapping mapping, HttpServletRequest JavaDoc request) {
86         removeSelected = new String JavaDoc[0];
87     }
88
89     /**
90      * Validate the properties that have been set from this HTTP request,
91      * and return an <code>ActionErrors</code> object that encapsulates any
92      * validation errors that have been found. If no errors are found, return
93      * <code>null</code> or an <code>ActionErrors</code> object with no
94      * recorded error messages.
95      *
96      * @param mapping The mapping used to select this instance
97      * @param request The servlet request we are processing
98      */

99     public ActionErrors validate(ActionMapping mapping, HttpServletRequest JavaDoc request) {
100         ActionErrors oErrors = new ActionErrors();
101         return oErrors;
102     }
103
104     public List JavaDoc getListRemovable() {
105         return listRemovable;
106     }
107
108     public void setListRemovable(ArrayList JavaDoc listRemovable) {
109         this.listRemovable = listRemovable;
110     }
111
112     public String JavaDoc[] getRemoveSelected() {
113         return removeSelected;
114     }
115
116     public void setRemoveSelected(String JavaDoc[] removeSelected) {
117         this.removeSelected = removeSelected;
118     }
119
120     public boolean isConfirm() {
121         return confirm;
122     }
123
124     public void setConfirm(boolean confirm) {
125         this.confirm = confirm;
126     }
127
128
129     public List JavaDoc getListRemoved() {
130         return listRemoved;
131     }
132
133
134     public void setListRemoved(List JavaDoc listRemoved) {
135         this.listRemoved = listRemoved;
136     }
137
138
139     public List JavaDoc getListToBeRemoved() {
140         return listToBeRemoved;
141     }
142
143
144     public void setListToBeRemoved(List JavaDoc listToBeRemoved) {
145         this.listToBeRemoved = listToBeRemoved;
146     }
147     
148     /**
149      * Return if the action is a domain management operation.
150      * @return if the action is a domain management operation.
151      */

152     public boolean getIsDomain() {
153         return this.isDomain;
154     }
155     
156     /**
157      * Sets if the action is a domain management operation.
158      * @param isDomain if the action is a domain management operation.
159      */

160     public void setIsDomain(boolean isDomain) {
161         this.isDomain = isDomain;
162     }
163
164 }
165
Popular Tags