# HG changeset patch # User Ingo Weinzierl # Date 1322498403 0 # Node ID 3f15d9c22d535d54b4d1179068dd70c8c317209c # Parent 750a53950e9f341442a20e6facbf7d58be75a3ae Display only information in CapabilitiesPanel that really exist. flys-client/trunk@3327 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r 750a53950e9f -r 3f15d9c22d53 flys-client/ChangeLog --- 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 + + * src/main/java/de/intevation/flys/client/client/ui/map/CapabilitiesPanel.java: + Display only information that really exist. + 2011-11-28 Ingo Weinzierl * src/main/java/de/intevation/flys/client/shared/model/WMSLayer.java: Added diff -r 750a53950e9f -r 3f15d9c22d53 flys-client/src/main/java/de/intevation/flys/client/client/ui/map/CapabilitiesPanel.java --- 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);