From 78f70feab79472e42c560f3a19a8abed5b6d831a Mon Sep 17 00:00:00 2001
From: Peter Hormanns < <peter.hormanns@jalin.de>
Date: Fri, 02 Nov 2012 15:42:49 +0100
Subject: [PATCH] new logout button

---
 hsarweb/src/de/hsadmin/web/AbstractModule.java |   21 ++++++++++++++++++++-
 hsarweb/src/texts/main.properties              |    1 +
 hsarweb/src/texts/main_de.properties           |    1 +
 3 files changed, 22 insertions(+), 1 deletions(-)

diff --git a/hsarweb/src/de/hsadmin/web/AbstractModule.java b/hsarweb/src/de/hsadmin/web/AbstractModule.java
index 83c4962..8726124 100644
--- a/hsarweb/src/de/hsadmin/web/AbstractModule.java
+++ b/hsarweb/src/de/hsadmin/web/AbstractModule.java
@@ -6,10 +6,12 @@
 
 import com.vaadin.data.Property;
 import com.vaadin.data.Property.ValueChangeEvent;
+import com.vaadin.terminal.ExternalResource;
 import com.vaadin.terminal.Sizeable;
 import com.vaadin.terminal.ThemeResource;
 import com.vaadin.ui.Button;
 import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.Button.ClickListener;
 import com.vaadin.ui.Component;
 import com.vaadin.ui.Form;
 import com.vaadin.ui.HorizontalLayout;
@@ -55,7 +57,6 @@
 		if (this instanceof SearchAble || this instanceof InsertAble ||
 				!("USER".equals(application.getLoginUserRole()) || "NONE".equals(application.getLoginUserRole()))) {
 			HorizontalLayout toolbar = new HorizontalLayout();
-			createRunAsSelect(toolbar);
 			if (this instanceof InsertAble) {
 				Button btNew = new Button(moduleConfig.getLabel("new"));
 				ThemeResource icon = new ThemeResource("../runo/icons/16/document-add.png");
@@ -108,6 +109,24 @@
 				});
 				toolbar.addComponent(btNew);
 			}
+			toolbar.setWidth("100%");
+			Label space = new Label("  ");
+			space.setWidth("100%");
+			toolbar.addComponent(space);
+			toolbar.setExpandRatio(space, 1.0f);
+			createRunAsSelect(toolbar);
+			Button btLogout = new Button(localeConfig.getText("logout"));
+			btLogout.addListener(new ClickListener() {
+				private static final long serialVersionUID = 1L;
+				@Override
+				public void buttonClick(ClickEvent event) {
+					ExternalResource logoutLink = new ExternalResource("logout");
+					application.getMainWindow().open(logoutLink);
+				}
+			});
+			toolbar.addComponent(btLogout);
+			ThemeResource icon = new ThemeResource("../runo/icons/16/cancel.png");
+			btLogout.setIcon(icon);
 			layout.addComponent(toolbar);
 		}
 		layout.addComponent(component);
diff --git a/hsarweb/src/texts/main.properties b/hsarweb/src/texts/main.properties
index c393470..e73a51d 100644
--- a/hsarweb/src/texts/main.properties
+++ b/hsarweb/src/texts/main.properties
@@ -6,6 +6,7 @@
 abort=abort
 new=new
 runas=<strong>select</strong><br />change user perspective
+logout=logout
 modules.NONE=de.hsadmin.web.HomeModule
 modules.USER=de.hsadmin.web.HomeModule
 modules.DOM_ADMIN=de.hsadmin.web.DomainReadonlyModule,de.hsadmin.web.EMailAddressModule,de.hsadmin.web.HomeModule
diff --git a/hsarweb/src/texts/main_de.properties b/hsarweb/src/texts/main_de.properties
index a1cff87..190998b 100644
--- a/hsarweb/src/texts/main_de.properties
+++ b/hsarweb/src/texts/main_de.properties
@@ -6,3 +6,4 @@
 abort=abbrechen
 new=Eintrag anlegen
 runas=<strong>Auswahl/Eingabe:</strong><br />zur Ansicht eines anderen<br />Benutzers wechseln
+logout=abmelden

--
Gitblit v1.9.0-SNAPSHOT