From ea4e67ec059da462ee75e110d2e3be443d503576 Mon Sep 17 00:00:00 2001 From: wchen Date: Mon, 4 Jun 2012 08:33:57 +0000 Subject: [PATCH] merge r84583 from trunk to branch 5.1 bug TDI-20349 fixed: Studio hangs or crash with error when expand side bar in tRowGenerator git-svn-id: http://talendforge.org/svn/tos/branches/branch-5_1@84588 f6f1c999-d317-4740-80b0-e6d1abc6f99e --- .../behavior/TableViewerCreatorLayout.java | 41 ++++++++++++++----- 1 file changed, 30 insertions(+), 11 deletions(-) diff --git a/org.talend.common.ui.runtime/src/main/java/org/talend/commons/ui/swt/tableviewer/behavior/TableViewerCreatorLayout.java b/org.talend.common.ui.runtime/src/main/java/org/talend/commons/ui/swt/tableviewer/behavior/TableViewerCreatorLayout.java index e2da001578..fe587a5677 100644 --- a/org.talend.common.ui.runtime/src/main/java/org/talend/commons/ui/swt/tableviewer/behavior/TableViewerCreatorLayout.java +++ b/org.talend.common.ui.runtime/src/main/java/org/talend/commons/ui/swt/tableviewer/behavior/TableViewerCreatorLayout.java @@ -39,8 +39,8 @@ import org.eclipse.swt.widgets.TableColumn; import org.eclipse.swt.widgets.Tree; import org.eclipse.swt.widgets.TreeColumn; import org.talend.commons.ui.runtime.ws.WindowSystem; -import org.talend.commons.ui.swt.tableviewer.TableViewerCreatorNotModifiable; import org.talend.commons.ui.swt.tableviewer.TableViewerCreatorColumnNotModifiable; +import org.talend.commons.ui.swt.tableviewer.TableViewerCreatorNotModifiable; import org.talend.commons.ui.utils.threading.AsynchronousThreading; import org.talend.commons.utils.threading.ExecutionLimiter; @@ -49,10 +49,11 @@ import org.talend.commons.utils.threading.ExecutionLimiter; * * DefaultTableReflectLayout is based on TableLayout class. * - * This supports dynamically resize of columns of table parent composite when you set true continuousLayout. + * This supports dynamically resize of columns of table parent composite when you set true continuousLayout + * . * - * You can now force the layout with the forceLayout method, indeed the current layout method is - * processed by default only once time. + * You can now force the layout with the forceLayout method, indeed the current layout method is processed + * by default only once time. * * $Id: TableViewerCreatorLayout.java 7042 2007-11-15 15:13:48Z smallet $ */ @@ -503,8 +504,8 @@ public class TableViewerCreatorLayout extends Layout { /** * Sets if if layout must be really processed at each call or not. * - * @param continuousLayout true if layout must be really processed at each call, and - * false otherwise + * @param continuousLayout true if layout must be really processed at each call, and false + * otherwise */ public void setContinuousLayout(boolean continuousLayout) { this.continuousLayout = continuousLayout; @@ -583,10 +584,10 @@ public class TableViewerCreatorLayout extends Layout { if (!WindowSystem.isGTK() && !columnsResizingByLayout && (fillHorizontal || continuousLayout)) { // System.out.println("controlResizedExecute"); if (continuousLayout && !fillHorizontal) { - asyncThreadingForManualColumnResizingFalse.interrupt(); - if (!fillHorizontal) { - manualResizing = false; - } + // asyncThreadingForManualColumnResizingFalse.interrupt(); + // if (!fillHorizontal) { + // manualResizing = false; + // } } if (!manualResizing) { manualResizing = true; @@ -648,7 +649,25 @@ public class TableViewerCreatorLayout extends Layout { } } if (continuousLayout && !fillHorizontal) { - asyncThreadingForManualColumnResizingFalse.start(); + // asyncThreadingForManualColumnResizingFalse.start(); + Runnable runable = new Runnable() { + + public void run() { + try { + synchronized (this) { + wait(500); + manualResizing = false; + } + + } catch (InterruptedException e) { + manualResizing = false; + } + + } + + }; + new Thread(runable).start(); + } }