Mercurial > dive4elements > river
changeset 1419:3f15d9c22d53
Display only information in CapabilitiesPanel that really exist.
flys-client/trunk@3327 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Mon, 28 Nov 2011 16:40:03 +0000 |
parents | 750a53950e9f |
children | c8481debff70 5fab0fe3c445 |
files | flys-client/ChangeLog flys-client/src/main/java/de/intevation/flys/client/client/ui/map/CapabilitiesPanel.java |
diffstat | 2 files changed, 40 insertions(+), 12 deletions(-) [+] |
line wrap: on
line diff
--- a/flys-client/ChangeLog Mon Nov 28 16:27:36 2011 +0000 +++ b/flys-client/ChangeLog Mon Nov 28 16:40:03 2011 +0000 @@ -1,3 +1,8 @@ +2011-11-28 Ingo Weinzierl <ingo@intevation.de> + + * src/main/java/de/intevation/flys/client/client/ui/map/CapabilitiesPanel.java: + Display only information that really exist. + 2011-11-28 Ingo Weinzierl <ingo@intevation.de> * src/main/java/de/intevation/flys/client/shared/model/WMSLayer.java: Added
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/map/CapabilitiesPanel.java Mon Nov 28 16:27:36 2011 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/map/CapabilitiesPanel.java Mon Nov 28 16:40:03 2011 +0000 @@ -49,19 +49,42 @@ grid.setText(3, 0, MSG.capabilitiesFees() + ":"); grid.setText(3, 1, capabilites.getFees()); + int row = 4; + ContactInformation ci = capabilites.getContactInformation(); - grid.setText(4, 0, MSG.capabilitiesContactInformation() + ":"); - grid.setText(4, 1, ci.getPerson()); - grid.setText(5, 0, ""); - grid.setText(5, 1, ci.getOrganization()); - grid.setText(6, 0, ""); - grid.setText(6, 1, ci.getAddress()); - grid.setText(7, 0, ""); - grid.setText(7, 1, ci.getPostcode() + " " + ci.getCity()); - grid.setText(8, 0, ""); - grid.setText(8, 1, MSG.capabilitiesEmail() + ": " + ci.getEmail()); - grid.setText(9, 0, ""); - grid.setText(9, 1, MSG.capabilitiesPhone() + ": " + ci.getPhone()); + + grid.setText(row, 0, MSG.capabilitiesContactInformation() + ":"); + + String person = ci.getPerson(); + if (person != null && person.length() > 0) { + grid.setText(row++, 1, person); + } + + String organization = ci.getOrganization(); + if (organization != null && organization.length() > 0) { + grid.setText(row++, 1, organization); + } + + String address = ci.getAddress(); + if (address != null && address.length() > 0) { + grid.setText(row++, 1, address); + } + + String pc = ci.getPostcode(); + String c = ci.getCity(); + if ((pc != null && pc.length() > 0) || (c != null && c.length() > 0)) { + grid.setText(row++, 1, pc + " " + c); + } + + String email = ci.getEmail(); + if (email != null && email.length() > 0) { + grid.setText(row++, 1, MSG.capabilitiesEmail() + ": " + email); + } + + String phone = ci.getPhone(); + if (phone != null && phone.length() > 0) { + grid.setText(row++, 1, MSG.capabilitiesPhone() + ": " + phone); + } Label title = new Label(MSG.capabilitiesHint()); title.setHeight(25);