Mercurial > dive4elements > river
comparison flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/FloodplainChoice.java @ 2579:2867ae59e216
#566 Improved german translation.
flys-artifacts/trunk@4117 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Mon, 05 Mar 2012 10:53:42 +0000 |
parents | eccf966fb677 |
children |
comparison
equal
deleted
inserted
replaced
2578:e3fd2d2fab6d | 2579:2867ae59e216 |
---|---|
1 package de.intevation.flys.artifacts.states; | 1 package de.intevation.flys.artifacts.states; |
2 | 2 |
3 import org.w3c.dom.Element; | 3 import org.w3c.dom.Element; |
4 | |
5 import org.apache.log4j.Logger; | |
4 | 6 |
5 import de.intevation.artifacts.Artifact; | 7 import de.intevation.artifacts.Artifact; |
6 import de.intevation.artifacts.CallContext; | 8 import de.intevation.artifacts.CallContext; |
7 import de.intevation.artifacts.CallMeta; | 9 import de.intevation.artifacts.CallMeta; |
8 | 10 |
16 /** | 18 /** |
17 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> | 19 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> |
18 */ | 20 */ |
19 public class FloodplainChoice extends DefaultState { | 21 public class FloodplainChoice extends DefaultState { |
20 | 22 |
21 public static final String OPTION = "floodplain.option"; | 23 public static final String OPTION = "floodplain.option"; |
24 public static final String ACTIVE = "floodplain.active"; | |
25 public static final String INACTIVE = "floodplain.inactive"; | |
26 | |
27 private static final Logger logger = | |
28 Logger.getLogger(FloodplainChoice.class); | |
22 | 29 |
23 | 30 |
24 @Override | 31 @Override |
25 protected String getUIProvider() { | 32 protected String getUIProvider() { |
26 return "boolean_panel"; | 33 return "boolean_panel"; |
42 | 49 |
43 return new Element[] { option }; | 50 return new Element[] { option }; |
44 } | 51 } |
45 | 52 |
46 | 53 |
54 @Override | |
55 protected String getLabelFor( | |
56 CallContext cc, | |
57 String name, | |
58 String value, | |
59 String type | |
60 ) { | |
61 logger.debug("GET LABEL FOR '" + name + "' / '" + value + "'"); | |
62 if (value != null && value.equals("true")) { | |
63 return Resources.getMsg(cc.getMeta(), ACTIVE, ACTIVE); | |
64 } | |
65 else { | |
66 return Resources.getMsg(cc.getMeta(), INACTIVE, INACTIVE); | |
67 } | |
68 } | |
69 | |
70 | |
47 protected Element createItem(XMLUtils.ElementCreator cr, Object obj) { | 71 protected Element createItem(XMLUtils.ElementCreator cr, Object obj) { |
48 Element item = ProtocolUtils.createArtNode(cr, "item", null, null); | 72 Element item = ProtocolUtils.createArtNode(cr, "item", null, null); |
49 Element label = ProtocolUtils.createArtNode(cr, "label", null, null); | 73 Element label = ProtocolUtils.createArtNode(cr, "label", null, null); |
50 Element value = ProtocolUtils.createArtNode(cr, "value", null, null); | 74 Element value = ProtocolUtils.createArtNode(cr, "value", null, null); |
51 | 75 |