Bug 430664 - application editor key/value table columns are too large by
default

Change-Id: I54f724c75c874d5dd9d427bf4830e41e29c64c78
Signed-off-by: Steven Spungin <steven@spungin.tv>
diff --git a/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/component/ControlFactory.java b/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/component/ControlFactory.java
index 969e181..9c73ca4 100644
--- a/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/component/ControlFactory.java
+++ b/bundles/org.eclipse.e4.tools.emf.ui/src/org/eclipse/e4/tools/emf/ui/internal/common/component/ControlFactory.java
@@ -8,7 +8,7 @@
  * Contributors:
  *     Tom Schindl <tom.schindl@bestsolution.at> - initial API and implementation
  *     Dirk Fauth <dirk.fauth@googlemail.com> - Bug 426986
- *     Steven Spungin <steven@spungin.tv> - Bug 430660
+ *     Steven Spungin <steven@spungin.tv> - Bug 430660, 430664
  ******************************************************************************/
 package org.eclipse.e4.tools.emf.ui.internal.common.component;
 
@@ -99,6 +99,7 @@
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Control;
 import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.TableColumn;
 import org.eclipse.swt.widgets.Text;
 
 public class ControlFactory {
@@ -340,6 +341,15 @@
 								editor.getEditingDomain().getCommandStack().execute(cmd);
 								super.okPressed();
 							}
+
+							// pack the first column
+							if (tableviewer.getTable().getColumns().length > 0) {
+								TableColumn tableColumn = tableviewer.getTable().getColumns()[0];
+								tableColumn.pack();
+								if (tableColumn.getWidth() < 20) {
+									tableColumn.setWidth(20);
+								}
+							}
 						}
 					}
 				};
@@ -903,4 +913,4 @@
 			}
 		});
 	}
-}
\ No newline at end of file
+}