Mercurial > dive4elements > river
comparison flys-client/src/main/java/de/intevation/flys/client/server/CollectionItemAttributeServiceImpl.java @ 2908:cd068ff7966d
Show only style attributes in StyleEditorWindow that are not 'hidden'.
flys-client/trunk@4685 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Mon, 18 Jun 2012 11:17:29 +0000 |
parents | 4a6814be92ba |
children | 7a94d5e7fc3d |
comparison
equal
deleted
inserted
replaced
2907:3521f330f57c | 2908:cd068ff7966d |
---|---|
135 | 135 |
136 Element e = (Element) themes.item(0); | 136 Element e = (Element) themes.item(0); |
137 NodeList items = e.getElementsByTagName("theme"); | 137 NodeList items = e.getElementsByTagName("theme"); |
138 | 138 |
139 for (int i = 0; i < items.getLength(); i++) { | 139 for (int i = 0; i < items.getLength(); i++) { |
140 Style s = getStyle ((Element) items.item(i)); | 140 Style s = StyleHelper.getStyle ((Element) items.item(i)); |
141 if(s == null) { | 141 if(s == null) { |
142 throw new ServerException(ERROR_NO_STYLES_FOUND); | 142 throw new ServerException(ERROR_NO_STYLES_FOUND); |
143 } | 143 } |
144 else { | 144 else { |
145 cia.appendStyle(s); | 145 cia.appendStyle(s); |
196 themes.appendChild(theme); | 196 themes.appendChild(theme); |
197 } | 197 } |
198 styles.appendChild(action); | 198 styles.appendChild(action); |
199 return styles; | 199 return styles; |
200 } | 200 } |
201 | |
202 | |
203 protected Style getStyle (Element element) { | |
204 | |
205 if (!element.getTagName().equals("theme")) { | |
206 return null; | |
207 } | |
208 | |
209 NodeList list = element.getElementsByTagName("field"); | |
210 Style style = new Style(); | |
211 | |
212 style.setName (element.getAttribute("name")); | |
213 style.setFacet (element.getAttribute("facet")); | |
214 try { | |
215 int ndx = Integer.parseInt(element.getAttribute("index")); | |
216 style.setIndex (ndx); | |
217 } | |
218 catch(NumberFormatException nfe) { | |
219 return null; | |
220 } | |
221 for(int i = 0; i < list.getLength(); i++) { | |
222 Element e = (Element) list.item(i); | |
223 StyleSetting set = new StyleSetting ( | |
224 e.getAttribute("name"), | |
225 e.getAttribute("default"), | |
226 e.getAttribute("display"), | |
227 e.getAttribute("hints"), | |
228 e.getAttribute("type")); | |
229 style.appendStyleSetting(set); | |
230 } | |
231 return style; | |
232 } | |
233 } | 201 } |
234 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : | 202 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |