comparison artifacts/src/main/java/org/dive4elements/river/artifacts/states/ComputationRangeState.java @ 9175:34dc0163ad2d

DistancePanel Berechnungsstrecke->Darstellungsbereich Refactoring
author gernotbelger
date Mon, 25 Jun 2018 17:58:11 +0200
parents 8c0d1542c1d8
children baef46792354
comparison
equal deleted inserted replaced
9174:06bb3e94a927 9175:34dc0163ad2d
38 38
39 cr.addAttr(select, "name", data.getName(), true); 39 cr.addAttr(select, "name", data.getName(), true);
40 40
41 final Element label = ProtocolUtils.createArtNode(cr, "label", null, null); 41 final Element label = ProtocolUtils.createArtNode(cr, "label", null, null);
42 42
43 label.setTextContent(Resources.getMsg(context.getMeta(), getID(), getID())); 43 final String msg = getTitle(context);
44
45 label.setTextContent(msg);
44 // VORHER: data.getName(), data.getName())) (entsprach "ld_from", "ld_to" - unterschied zu jetzt: description wird 46 // VORHER: data.getName(), data.getName())) (entsprach "ld_from", "ld_to" - unterschied zu jetzt: description wird
45 // anders gesetzt ("Wahl der Berechnungsstrecke") 47 // anders gesetzt ("Wahl der Berechnungsstrecke")
46 // label bleibt "ld_from", "ld_to"; unklar, wo das gesetzt wird. unklar, warum das Element "label" die Description 48 // label bleibt "ld_from", "ld_to"; unklar, wo das gesetzt wird. unklar, warum das Element "label" die Description
47 // beeinflusst (und scheinbar nicht das Label) 49 // beeinflusst (und scheinbar nicht das Label)
48 50
50 description.setTextContent("TEST"); 52 description.setTextContent("TEST");
51 select.appendChild(description); 53 select.appendChild(description);
52 select.appendChild(label); 54 select.appendChild(label);
53 55
54 return select; 56 return select;
57 }
58
59 // REMARK: allows to overwrite the titel which is shown on the client side.
60 // TODO: instead of a fixed string, we should translate the 'id', but in that case we need to change all old workflows
61 // (reason is, that we have different texts for the title and the 'old' title, which in turn is the translation of
62 // 'description').
63
64 protected String getTitle(final CallContext context) {
65 // REMARK: that is how it should be: return Resources.getMsg(context.getMeta(), getID());
66 return Resources.getMsg(context.getMeta(), "state.title.distance_state");
55 } 67 }
56 68
57 @Override 69 @Override
58 protected Element[] createItems(final XMLUtils.ElementCreator cr, final Artifact artifact, final String name, final CallContext context) { 70 protected Element[] createItems(final XMLUtils.ElementCreator cr, final Artifact artifact, final String name, final CallContext context) {
59 final double[] minmax = getMinMax(artifact); 71 final double[] minmax = getMinMax(artifact);

http://dive4elements.wald.intevation.org