Mercurial > dive4elements > river
view flys-client/src/main/java/de/intevation/flys/client/client/ui/map/CapabilitiesPanel.java @ 4215:c179cd02177d
Logout the current user
Add code to the logout button to remove the current user from the session and to
redirect the browser window to the login page.
Part of flys/issue916 (Logout: "Abmelden" Knopf mit Funktion belegen)
author | Björn Ricks <bjoern.ricks@intevation.de> |
---|---|
date | Tue, 23 Oct 2012 09:59:16 +0200 |
parents | 3f15d9c22d53 |
children |
line wrap: on
line source
package de.intevation.flys.client.client.ui.map; import com.google.gwt.core.client.GWT; import com.google.gwt.user.client.ui.Grid; import com.smartgwt.client.types.Overflow; import com.smartgwt.client.widgets.Label; import com.smartgwt.client.widgets.layout.HLayout; import com.smartgwt.client.widgets.layout.Layout; import com.smartgwt.client.widgets.layout.VLayout; import de.intevation.flys.client.shared.model.Capabilities; import de.intevation.flys.client.shared.model.ContactInformation; import de.intevation.flys.client.client.FLYSConstants; public class CapabilitiesPanel extends VLayout { protected FLYSConstants MSG = GWT.create(FLYSConstants.class); protected Capabilities capabilites; public CapabilitiesPanel(Capabilities capabilites) { super(); this.capabilites = capabilites; initLayout(); } protected void initLayout() { setMargin(5); setOverflow(Overflow.AUTO); initContent(); } protected void initContent() { Grid grid = new Grid(10, 2); grid.setCellPadding(10); grid.setText(0, 0, MSG.capabilitiesTitle() + ":"); grid.setText(0, 1, capabilites.getTitle()); grid.setText(1, 0, MSG.capabilitiesURL() + ":"); grid.setText(1, 1, capabilites.getOnlineResource()); grid.setText(2, 0, MSG.capabilitiesAccessConstraints() + ":"); grid.setText(2, 1, capabilites.getAccessConstraints()); grid.setText(3, 0, MSG.capabilitiesFees() + ":"); grid.setText(3, 1, capabilites.getFees()); int row = 4; ContactInformation ci = capabilites.getContactInformation(); 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); title.setStyleName("capabilities-info-title"); addMember(title); addMember(grid); } protected Layout createRow(Label title, Label content) { title.setWidth(100); HLayout layout = new HLayout(); layout.addMember(title); layout.addMember(content); return layout; } } // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :