From 1aec8f7fde4bc9ecc972fab6079a3b93d2a702cb Mon Sep 17 00:00:00 2001
From: Peter Hormanns <peter.hormanns@hostsharing.net>
Date: Wed, 25 May 2011 18:16:58 +0200
Subject: [PATCH] Spaltenbreiten verbessert durch setExpandRatio

---
 hsarweb/src/de/hsadmin/web/UnixUserModule.java               |    1 +
 hsarweb/src/de/hsadmin/web/config/PropertyConfig.java        |   10 ++++++++++
 hsarweb/WebContent/VAADIN/themes/hs/layout/footer.html       |    2 +-
 hsarweb/src/de/hsadmin/web/vaadin/TableComponentFactory.java |    3 ++-
 hsarweb/src/de/hsadmin/web/EMailAddressModule.java           |    1 +
 hsarweb/src/de/hsadmin/web/QueueTaskModule.java              |    4 +++-
 hsarweb/src/de/hsadmin/web/EMailAliasModule.java             |    1 +
 7 files changed, 19 insertions(+), 3 deletions(-)

diff --git a/hsarweb/WebContent/VAADIN/themes/hs/layout/footer.html b/hsarweb/WebContent/VAADIN/themes/hs/layout/footer.html
index 31dc7b7..becaf72 100644
--- a/hsarweb/WebContent/VAADIN/themes/hs/layout/footer.html
+++ b/hsarweb/WebContent/VAADIN/themes/hs/layout/footer.html
@@ -1,4 +1,4 @@
 <div style="width:100%; background-color:white;">
 	<div  style="margin:0px; padding:0px; vertical-align:top; float:left; ">(c) Hostsharing eG, <a href="https://www.hostsharing.net/impressum">Impressum</a></div>
-	<div  style="margin:0px; padding:0px; vertical-align:top; text-align:right; ">hsarweb (Vers. 2.0a, 23.05.2011)</div>
+	<div  style="margin:0px; padding:0px; vertical-align:top; text-align:right; ">hsarweb (Vers. 2.0b, 25.05.2011)</div>
 </div>
\ No newline at end of file
diff --git a/hsarweb/src/de/hsadmin/web/EMailAddressModule.java b/hsarweb/src/de/hsadmin/web/EMailAddressModule.java
index dc3d4e3..8bdc8d5 100644
--- a/hsarweb/src/de/hsadmin/web/EMailAddressModule.java
+++ b/hsarweb/src/de/hsadmin/web/EMailAddressModule.java
@@ -54,6 +54,7 @@
 		});
 		domainProp.setWriteOnce(true);
 		PropertyConfig targetProp = new PropertyConfig(moduleConfig, "target", String.class, new EMailTargetPropertyFieldFactory(this));
+		targetProp.setExpandRatio(0.8f);
 		targetProp.setDefaultValue(new PropertyDefaultValue() {
 			@Override
 			public String getDefaultValue() {
diff --git a/hsarweb/src/de/hsadmin/web/EMailAliasModule.java b/hsarweb/src/de/hsadmin/web/EMailAliasModule.java
index ff6f04e..21769e4 100644
--- a/hsarweb/src/de/hsadmin/web/EMailAliasModule.java
+++ b/hsarweb/src/de/hsadmin/web/EMailAliasModule.java
@@ -38,6 +38,7 @@
 		});
 		nameProp.setWriteOnce(true);
 		PropertyConfig targetProp = new PropertyConfig(moduleConfig, "target", String.class, new EMailTargetPropertyFieldFactory(this));
+		targetProp.setExpandRatio(0.8f);
 		targetProp.setDefaultValue(new PropertyDefaultValue() {
 			@Override
 			public String getDefaultValue() {
diff --git a/hsarweb/src/de/hsadmin/web/QueueTaskModule.java b/hsarweb/src/de/hsadmin/web/QueueTaskModule.java
index 8bca559..2ce7402 100644
--- a/hsarweb/src/de/hsadmin/web/QueueTaskModule.java
+++ b/hsarweb/src/de/hsadmin/web/QueueTaskModule.java
@@ -17,7 +17,9 @@
 	protected void initModule() {
 		moduleConfig = new ModuleConfig("q", getApplication().getLocale());
 		moduleConfig.addProperty(new PropertyConfig(moduleConfig, "id", Long.class, PropertyTableColumn.INTERNAL_KEY));
-		moduleConfig.addProperty(new PropertyConfig(moduleConfig, "title", String.class));
+		PropertyConfig titleProp = new PropertyConfig(moduleConfig, "title", String.class);
+		titleProp.setExpandRatio(0.7f);
+		moduleConfig.addProperty(titleProp);
 		moduleConfig.addProperty(new PropertyConfig(moduleConfig, "status", String.class));
 		moduleConfig.addProperty(new PropertyConfig(moduleConfig, "started", Date.class, new DatePropertyFieldFactory()));
 		moduleConfig.addProperty(new PropertyConfig(moduleConfig, "finished", Date.class, new DatePropertyFieldFactory()));
diff --git a/hsarweb/src/de/hsadmin/web/UnixUserModule.java b/hsarweb/src/de/hsadmin/web/UnixUserModule.java
index 4198990..dc7f2ee 100644
--- a/hsarweb/src/de/hsadmin/web/UnixUserModule.java
+++ b/hsarweb/src/de/hsadmin/web/UnixUserModule.java
@@ -68,6 +68,7 @@
 		});
 		PropertyConfig passwordProp = new PropertyConfig(moduleConfig, "password", String.class, PropertyTableColumn.NONE, new PasswordPropertyFieldFactory(this));
 		PropertyConfig commentProp = new PropertyConfig(moduleConfig, "comment", String.class);
+		commentProp.setExpandRatio(0.7f);
 		PropertyConfig shellProp = new PropertyConfig(moduleConfig, "shell", String.class, new SelectPropertyFieldFactory());
 		shellProp.setDefaultValue(new PropertyDefaultValue() {
 			@Override
diff --git a/hsarweb/src/de/hsadmin/web/config/PropertyConfig.java b/hsarweb/src/de/hsadmin/web/config/PropertyConfig.java
index cfbead6..cfe95e9 100644
--- a/hsarweb/src/de/hsadmin/web/config/PropertyConfig.java
+++ b/hsarweb/src/de/hsadmin/web/config/PropertyConfig.java
@@ -18,6 +18,7 @@
 	private PropertyDefaultValue defaultValue;
 	private PropertySelectValues selectValues;
 	private boolean showInForm = true;
+	private float expandRatio;
 	
 	public PropertyConfig(ModuleConfig moduleConfig, String id, Class<?> clasz) {
 		this.moduleConfig = moduleConfig;
@@ -27,6 +28,7 @@
 		this.setPropFieldFactory(new DefaultPropertyFieldFactory());
 		this.defaultValue = null;
 		this.selectValues = null;
+		this.setExpandRatio(0.5f);
 	}
 
 	public PropertyConfig(ModuleConfig moduleConfig, String id, Class<?> clasz, PropertyFieldFactory fieldFactory) {
@@ -137,5 +139,13 @@
 	public void setShowInForm(boolean show) {
 		showInForm = show;
 	}
+
+	public float getExpandRatio() {
+		return expandRatio;
+	}
+
+	public void setExpandRatio(float expandRatio) {
+		this.expandRatio = expandRatio;
+	}
 	
 }
diff --git a/hsarweb/src/de/hsadmin/web/vaadin/TableComponentFactory.java b/hsarweb/src/de/hsadmin/web/vaadin/TableComponentFactory.java
index 9b46fe0..a44bc90 100644
--- a/hsarweb/src/de/hsadmin/web/vaadin/TableComponentFactory.java
+++ b/hsarweb/src/de/hsadmin/web/vaadin/TableComponentFactory.java
@@ -71,11 +71,12 @@
 			table.setSelectable(false);
 			table.setImmediate(true);
 			table.setColumnCollapsingAllowed(true);
-			table.setColumnReorderingAllowed(true);
+			table.setColumnReorderingAllowed(false);
 			for (PropertyConfig prop : config.getPropertyList()) {
 				PropertyTableColumn propTableColumn = prop.getPropTableColumn();
 				if (propTableColumn != PropertyTableColumn.NONE) {
 					table.addContainerProperty(prop.getId(), prop.getType(), prop.getDefaultValue());
+					table.setColumnExpandRatio(prop.getId(), prop.getExpandRatio());
 					table.setColumnHeader(prop.getId(), prop.getLabel());
 					if (propTableColumn == PropertyTableColumn.HIDDEN) { 
 						table.setColumnCollapsed(prop.getId(), true);

--
Gitblit v1.9.3