Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSravan Kumar Lakkimsetti2015-01-23 13:19:08 +0000
committerSravan Kumar Lakkimsetti2015-01-27 13:12:32 +0000
commited91a2ed2a7203dc96f4e0033beb8076468b927d (patch)
treea7821efe4c75f404be18563b2fafa75860ff09d0
parent67dd38fff1b2fe7a7314d55e407ce5dc0df31bf4 (diff)
downloadeclipse.platform.swt-ed91a2ed2a7203dc96f4e0033beb8076468b927d.tar.gz
eclipse.platform.swt-ed91a2ed2a7203dc96f4e0033beb8076468b927d.tar.xz
eclipse.platform.swt-ed91a2ed2a7203dc96f4e0033beb8076468b927d.zip
Bug 424173 - table.showItem doesn't reveal the item on linuxI20150127-0900
Change-Id: I49f61cb3267fcd6ff34cfe67d7958bc1d23befb1 Signed-off-by: Sravan Kumar Lakkimsetti <sravankumarl@in.ibm.com>
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Composite.java17
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Shell.java14
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java19
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java17
4 files changed, 62 insertions, 5 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Composite.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Composite.java
index aeb8429725..202a502bce 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Composite.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Composite.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2012 IBM Corporation and others.
+ * Copyright (c) 2000, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -1662,4 +1662,19 @@ void updateLayout (boolean all) {
}
}
}
+
+public void setVisible (boolean visible) {
+ super.setVisible (visible);
+
+ /*
+ * Workaround for the Bug 424173 making the child elements visible so that
+ * the child elements can perform pending actions
+ */
+ Control [] list = getChildren ();
+ for (Control i: list) {
+ if ((i instanceof Table) || (i instanceof Tree)) {
+ i.setVisible (visible);
+ }
+ }
+}
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Shell.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Shell.java
index 412bade70e..9563effa57 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Shell.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Shell.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2014 IBM Corporation and others.
+ * Copyright (c) 2000, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -2308,6 +2308,18 @@ public void setVisible (boolean visible) {
OS.gtk_widget_hide (shellHandle);
sendEvent (SWT.Hide);
}
+
+ /*
+ * Workaround for the Bug 424173 making the child elements visible so that
+ * the child elements can perform pending actions
+ */
+ Control [] list = getChildren ();
+
+ for (Control i: list) {
+ if (i instanceof Composite) {
+ i.setVisible (visible);
+ }
+ }
}
@Override
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java
index c1c5a3259d..f3c6bf2d24 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2014 IBM Corporation and others.
+ * Copyright (c) 2000, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -97,7 +97,8 @@ public class Table extends Composite {
int drawState, drawFlags;
GdkColor drawForeground;
boolean ownerDraw, ignoreSize, ignoreAccessibility;
-
+ TableItem pendingShowItem = null;
+
static final int CHECKED_COLUMN = 0;
static final int GRAYED_COLUMN = 1;
static final int FOREGROUND_COLUMN = 2;
@@ -3524,6 +3525,16 @@ public void setTopIndex (int index) {
OS.gtk_tree_path_free (path);
}
+@Override
+public void setVisible (boolean visible) {
+ super.setVisible (visible);
+
+ if ((visible) && (pendingShowItem != null)) {
+ showItem (pendingShowItem);
+ pendingShowItem = null;
+ }
+}
+
/**
* Shows the column. If the column is already showing in the receiver,
* this method simply returns. Otherwise, the columns are scrolled until
@@ -3607,6 +3618,10 @@ public void showItem (TableItem item) {
if (item == null) error (SWT.ERROR_NULL_ARGUMENT);
if (item.isDisposed()) error (SWT.ERROR_INVALID_ARGUMENT);
if (item.parent != this) return;
+
+ if (!this.isVisible ()) {
+ pendingShowItem = item;
+ }
showItem (item.handle);
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java
index 3c1d8c5ca8..2b3917deed 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2014 IBM Corporation and others.
+ * Copyright (c) 2000, 2015 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -90,6 +90,7 @@ public class Tree extends Composite {
int drawState, drawFlags;
GdkColor drawForeground;
boolean ownerDraw, ignoreSize, ignoreAccessibility;
+ TreeItem pendingShowItem = null;
static final int ID_COLUMN = 0;
static final int CHECKED_COLUMN = 1;
@@ -3557,6 +3558,11 @@ public void showItem (TreeItem item) {
if (item == null) error (SWT.ERROR_NULL_ARGUMENT);
if (item.isDisposed ()) error(SWT.ERROR_INVALID_ARGUMENT);
if (item.parent != this) return;
+
+ if (!this.isVisible ()) {
+ pendingShowItem = item;
+ }
+
long /*int*/ path = OS.gtk_tree_model_get_path (modelHandle, item.handle);
showItem (path, true);
OS.gtk_tree_path_free (path);
@@ -3613,4 +3619,13 @@ long /*int*/ windowProc (long /*int*/ handle, long /*int*/ arg0, long /*int*/ us
return super.windowProc (handle, arg0, user_data);
}
+@Override
+public void setVisible (boolean visible) {
+ super.setVisible (visible);
+
+ if ((visible) && (pendingShowItem != null)) {
+ showItem (pendingShowItem);
+ pendingShowItem = null;
+ }
+}
}

Back to the top