comparison flys-client/src/main/java/de/intevation/flys/client/server/ThemeListingServiceImpl.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 e75b15818435
children 37dce0f2f63b
comparison
equal deleted inserted replaced
2907:3521f330f57c 2908:cd068ff7966d
88 XPathConstants.NODESET, 88 XPathConstants.NODESET,
89 null); 89 null);
90 90
91 for (int j = 0; j < theTheme.getLength(); j++) { 91 for (int j = 0; j < theTheme.getLength(); j++) {
92 Element elem = (Element) theTheme.item(j); 92 Element elem = (Element) theTheme.item(j);
93 theStyles.put(groupName, getStyle(elem)); 93 theStyles.put(groupName, StyleHelper.getStyle(elem));
94 } 94 }
95 } 95 }
96 96
97 return theStyles; 97 return theStyles;
98 } 98 }
100 logger.error(ce, ce); 100 logger.error(ce, ce);
101 } 101 }
102 102
103 throw new ServerException(ERROR_NO_GROUPS_FOUND); 103 throw new ServerException(ERROR_NO_GROUPS_FOUND);
104 } 104 }
105
106
107 protected Style getStyle (Element element) {
108 if (!element.getTagName().equals("theme")) {
109 return null;
110 }
111
112 NodeList list = element.getElementsByTagName("field");
113 Style style = new Style();
114
115 style.setName (element.getAttribute("name"));
116 style.setFacet (element.getAttribute("facet"));
117
118 try {
119 int ndx = Integer.parseInt(element.getAttribute("index"));
120 style.setIndex (ndx);
121 }
122 catch(NumberFormatException nfe) {
123 return null;
124 }
125
126 for(int i = 0; i < list.getLength(); i++) {
127 Element e = (Element) list.item(i);
128 StyleSetting set = new StyleSetting (
129 e.getAttribute("name"),
130 e.getAttribute("default"),
131 e.getAttribute("display"),
132 e.getAttribute("hints"),
133 e.getAttribute("type"));
134 style.appendStyleSetting(set);
135 }
136 return style;
137 }
138 } 105 }
139 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : 106 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org