root / trunk / frameworks / _fwAndami / src / com / iver / andami / plugins / config / generate / PopupMenu.java @ 13855
History | View | Annotate | Download (6.55 KB)
1 |
/*
|
---|---|
2 |
* This class was automatically generated with
|
3 |
* <a href="http://www.castor.org">Castor 0.9.5.3</a>, using an XML
|
4 |
* Schema.
|
5 |
* $Id: PopupMenu.java 13855 2007-09-19 15:36:36Z jaume $
|
6 |
*/
|
7 |
|
8 |
package com.iver.andami.plugins.config.generate; |
9 |
|
10 |
//---------------------------------/
|
11 |
//- Imported classes and packages -/
|
12 |
//---------------------------------/
|
13 |
|
14 |
import java.util.Vector; |
15 |
|
16 |
import org.exolab.castor.xml.Marshaller; |
17 |
import org.exolab.castor.xml.Unmarshaller; |
18 |
|
19 |
/**
|
20 |
* Class PopupMenu.
|
21 |
*
|
22 |
* @version $Revision: 13855 $ $Date: 2007-09-19 17:36:36 +0200 (Wed, 19 Sep 2007) $
|
23 |
*/
|
24 |
public class PopupMenu implements java.io.Serializable { |
25 |
|
26 |
|
27 |
//--------------------------/
|
28 |
//- Class/Member Variables -/
|
29 |
//--------------------------/
|
30 |
|
31 |
/**
|
32 |
* Field _name
|
33 |
*/
|
34 |
private java.lang.String _name;
|
35 |
|
36 |
/**
|
37 |
* Field _menuList
|
38 |
*/
|
39 |
private java.util.Vector _menuList;
|
40 |
|
41 |
|
42 |
//----------------/
|
43 |
//- Constructors -/
|
44 |
//----------------/
|
45 |
|
46 |
public PopupMenu() { |
47 |
super();
|
48 |
_menuList = new Vector(); |
49 |
} //-- com.iver.andami.plugins.config.generate.PopupMenu()
|
50 |
|
51 |
|
52 |
//-----------/
|
53 |
//- Methods -/
|
54 |
//-----------/
|
55 |
|
56 |
/**
|
57 |
* Method addMenu
|
58 |
*
|
59 |
* @param vMenu
|
60 |
*/
|
61 |
public void addMenu(com.iver.andami.plugins.config.generate.Menu vMenu) |
62 |
throws java.lang.IndexOutOfBoundsException
|
63 |
{ |
64 |
_menuList.addElement(vMenu); |
65 |
} //-- void addMenu(com.iver.andami.plugins.config.generate.Menu)
|
66 |
|
67 |
/**
|
68 |
* Method addMenu
|
69 |
*
|
70 |
* @param index
|
71 |
* @param vMenu
|
72 |
*/
|
73 |
public void addMenu(int index, com.iver.andami.plugins.config.generate.Menu vMenu) |
74 |
throws java.lang.IndexOutOfBoundsException
|
75 |
{ |
76 |
_menuList.insertElementAt(vMenu, index); |
77 |
} //-- void addMenu(int, com.iver.andami.plugins.config.generate.Menu)
|
78 |
|
79 |
/**
|
80 |
* Method enumerateMenu
|
81 |
*/
|
82 |
public java.util.Enumeration enumerateMenu()
|
83 |
{ |
84 |
return _menuList.elements();
|
85 |
} //-- java.util.Enumeration enumerateMenu()
|
86 |
|
87 |
/**
|
88 |
* Method getMenu
|
89 |
*
|
90 |
* @param index
|
91 |
*/
|
92 |
public com.iver.andami.plugins.config.generate.Menu getMenu(int index) |
93 |
throws java.lang.IndexOutOfBoundsException
|
94 |
{ |
95 |
//-- check bounds for index
|
96 |
if ((index < 0) || (index > _menuList.size())) { |
97 |
throw new IndexOutOfBoundsException(); |
98 |
} |
99 |
|
100 |
return (com.iver.andami.plugins.config.generate.Menu) _menuList.elementAt(index);
|
101 |
} //-- com.iver.andami.plugins.config.generate.Menu getMenu(int)
|
102 |
|
103 |
/**
|
104 |
* Method getMenu
|
105 |
*/
|
106 |
public com.iver.andami.plugins.config.generate.Menu[] getMenu() |
107 |
{ |
108 |
int size = _menuList.size();
|
109 |
com.iver.andami.plugins.config.generate.Menu[] mArray = new com.iver.andami.plugins.config.generate.Menu[size]; |
110 |
for (int index = 0; index < size; index++) { |
111 |
mArray[index] = (com.iver.andami.plugins.config.generate.Menu) _menuList.elementAt(index); |
112 |
} |
113 |
return mArray;
|
114 |
} //-- com.iver.andami.plugins.config.generate.Menu[] getMenu()
|
115 |
|
116 |
/**
|
117 |
* Method getMenuCount
|
118 |
*/
|
119 |
public int getMenuCount() |
120 |
{ |
121 |
return _menuList.size();
|
122 |
} //-- int getMenuCount()
|
123 |
|
124 |
/**
|
125 |
* Returns the value of field 'name'.
|
126 |
*
|
127 |
* @return the value of field 'name'.
|
128 |
*/
|
129 |
public java.lang.String getName()
|
130 |
{ |
131 |
return this._name; |
132 |
} //-- java.lang.String getName()
|
133 |
|
134 |
/**
|
135 |
* Method isValid
|
136 |
*/
|
137 |
public boolean isValid() |
138 |
{ |
139 |
try {
|
140 |
validate(); |
141 |
} |
142 |
catch (org.exolab.castor.xml.ValidationException vex) {
|
143 |
return false; |
144 |
} |
145 |
return true; |
146 |
} //-- boolean isValid()
|
147 |
|
148 |
/**
|
149 |
* Method marshal
|
150 |
*
|
151 |
* @param out
|
152 |
*/
|
153 |
public void marshal(java.io.Writer out) |
154 |
throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
|
155 |
{ |
156 |
|
157 |
Marshaller.marshal(this, out);
|
158 |
} //-- void marshal(java.io.Writer)
|
159 |
|
160 |
/**
|
161 |
* Method marshal
|
162 |
*
|
163 |
* @param handler
|
164 |
*/
|
165 |
public void marshal(org.xml.sax.ContentHandler handler) |
166 |
throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
|
167 |
{ |
168 |
|
169 |
Marshaller.marshal(this, handler);
|
170 |
} //-- void marshal(org.xml.sax.ContentHandler)
|
171 |
|
172 |
/**
|
173 |
* Method removeAllMenu
|
174 |
*/
|
175 |
public void removeAllMenu() |
176 |
{ |
177 |
_menuList.removeAllElements(); |
178 |
} //-- void removeAllMenu()
|
179 |
|
180 |
/**
|
181 |
* Method removeMenu
|
182 |
*
|
183 |
* @param index
|
184 |
*/
|
185 |
public com.iver.andami.plugins.config.generate.Menu removeMenu(int index) |
186 |
{ |
187 |
java.lang.Object obj = _menuList.elementAt(index); |
188 |
_menuList.removeElementAt(index); |
189 |
return (com.iver.andami.plugins.config.generate.Menu) obj;
|
190 |
} //-- com.iver.andami.plugins.config.generate.Menu removeMenu(int)
|
191 |
|
192 |
/**
|
193 |
* Method setMenu
|
194 |
*
|
195 |
* @param index
|
196 |
* @param vMenu
|
197 |
*/
|
198 |
public void setMenu(int index, com.iver.andami.plugins.config.generate.Menu vMenu) |
199 |
throws java.lang.IndexOutOfBoundsException
|
200 |
{ |
201 |
//-- check bounds for index
|
202 |
if ((index < 0) || (index > _menuList.size())) { |
203 |
throw new IndexOutOfBoundsException(); |
204 |
} |
205 |
_menuList.setElementAt(vMenu, index); |
206 |
} //-- void setMenu(int, com.iver.andami.plugins.config.generate.Menu)
|
207 |
|
208 |
/**
|
209 |
* Method setMenu
|
210 |
*
|
211 |
* @param menuArray
|
212 |
*/
|
213 |
public void setMenu(com.iver.andami.plugins.config.generate.Menu[] menuArray) |
214 |
{ |
215 |
//-- copy array
|
216 |
_menuList.removeAllElements(); |
217 |
for (int i = 0; i < menuArray.length; i++) { |
218 |
_menuList.addElement(menuArray[i]); |
219 |
} |
220 |
} //-- void setMenu(com.iver.andami.plugins.config.generate.Menu)
|
221 |
|
222 |
/**
|
223 |
* Sets the value of field 'name'.
|
224 |
*
|
225 |
* @param name the value of field 'name'.
|
226 |
*/
|
227 |
public void setName(java.lang.String name) |
228 |
{ |
229 |
this._name = name;
|
230 |
} //-- void setName(java.lang.String)
|
231 |
|
232 |
/**
|
233 |
* Method unmarshal
|
234 |
*
|
235 |
* @param reader
|
236 |
*/
|
237 |
public static java.lang.Object unmarshal(java.io.Reader reader) |
238 |
throws org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException
|
239 |
{ |
240 |
return (com.iver.andami.plugins.config.generate.PopupMenu) Unmarshaller.unmarshal(com.iver.andami.plugins.config.generate.PopupMenu.class, reader);
|
241 |
} //-- java.lang.Object unmarshal(java.io.Reader)
|
242 |
|
243 |
/**
|
244 |
* Method validate
|
245 |
*/
|
246 |
public void validate() |
247 |
throws org.exolab.castor.xml.ValidationException
|
248 |
{ |
249 |
org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
|
250 |
validator.validate(this);
|
251 |
} //-- void validate()
|
252 |
|
253 |
} |