private Component buildJSWMSSelect(String id,
List<String> wmsOutputFormats, List<String> wfsOutputFormats, PreviewLayer layer) {
Fragment f = new Fragment(id, "menuFragment", MapPreviewPage.this);
WebMarkupContainer menu = new WebMarkupContainer("menu");
RepeatingView wmsFormats = new RepeatingView("wmsFormats");
for (int i = 0; i < wmsOutputFormats.size(); i++) {
String wmsOutputFormat = wmsOutputFormats.get(i);
String label = translateFormat("format.wms.", wmsOutputFormat);
// build option with text and value
Label format = new Label(i + "", label);
format.add(new AttributeModifier("value", true, new Model(wmsOutputFormat)));
wmsFormats.add(format);
}
menu.add(wmsFormats);
// the vector ones, it depends, we might have to hide them
boolean vector = layer.groupInfo == null && layer.layerInfo.getType() != LayerInfo.Type.RASTER;
WebMarkupContainer wfsFormatsGroup = new WebMarkupContainer("wfs");
RepeatingView wfsFormats = new RepeatingView("wfsFormats");
if(vector) {
for (int i = 0; i < wfsOutputFormats.size(); i++) {
String wfsOutputFormat = wfsOutputFormats.get(i);
String label = translateFormat("format.wfs.", wfsOutputFormat);
// build option with text and value
Label format = new Label(i + "", label);
format.add(new AttributeModifier("value", true, new Model(wfsOutputFormat)));
wfsFormats.add(format);
}
}
wfsFormatsGroup.add(wfsFormats);
menu.add(wfsFormatsGroup);