Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Williams2018-01-09 16:01:38 -0500
committerEric Williams2018-01-09 16:07:20 -0500
commitdbf306e169f35af8aa89ffba3749d703dd45a450 (patch)
treec0ee4d7f8310ba78e2e2c20f6fbb53aaff7a838b
parent458bdeadd04cc1a45cff6a7f661fe5d0279fb6fb (diff)
downloadeclipse.platform.swt-dbf306e169f35af8aa89ffba3749d703dd45a450.tar.gz
eclipse.platform.swt-dbf306e169f35af8aa89ffba3749d703dd45a450.tar.xz
eclipse.platform.swt-dbf306e169f35af8aa89ffba3749d703dd45a450.zip
Bug 519295: [GTK3] Invisible settings button in validation preferences
Bug snippet to reproduce the issue. Change-Id: Ida0ebe281bc2fa7e6b73d6a63ff78f38b34412a8 Signed-off-by: Eric Williams <ericwill@redhat.com>
-rw-r--r--tests/org.eclipse.swt.tests.gtk/Bug Snippets/org/eclipse/swt/tests/gtk/snippets/Bug519295_TableMultipleColumns.java74
1 files changed, 74 insertions, 0 deletions
diff --git a/tests/org.eclipse.swt.tests.gtk/Bug Snippets/org/eclipse/swt/tests/gtk/snippets/Bug519295_TableMultipleColumns.java b/tests/org.eclipse.swt.tests.gtk/Bug Snippets/org/eclipse/swt/tests/gtk/snippets/Bug519295_TableMultipleColumns.java
new file mode 100644
index 0000000000..1623da11c5
--- /dev/null
+++ b/tests/org.eclipse.swt.tests.gtk/Bug Snippets/org/eclipse/swt/tests/gtk/snippets/Bug519295_TableMultipleColumns.java
@@ -0,0 +1,74 @@
+package org.eclipse.swt.tests.gtk.snippets;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableColumn;
+import org.eclipse.swt.widgets.TableItem;
+
+/*
+ * Title: Bug 519295: [GTK3] Invisible settings button in validation preferences
+ * How to run: launch snippet and observe TableItem columns
+ * Bug description: Image only appears in one column
+ * Expected results: Images should appear at least once in all columns
+ * GTK Version(s): GTK3
+ */
+public class Bug519295_TableMultipleColumns {
+ public static void main(String[] args) {
+ Display display = Display.getDefault();
+ Shell shell = new Shell(display);
+ shell.setLayout(new FillLayout());
+
+ Table tree = new Table(shell, SWT.NONE);
+ tree.setHeaderVisible(true);
+
+ TableColumn column1 = new TableColumn(tree, SWT.LEFT);
+ column1.setText("Column 1");
+ column1.setWidth(50);
+ TableColumn column2 = new TableColumn(tree, SWT.LEFT);
+ column2.setText("Column 2");
+ column2.setWidth(50);
+ TableColumn column3 = new TableColumn(tree, SWT.LEFT);
+ column3.setText("Column 3");
+ column3.setWidth(50);
+
+ int W = 100, H = 100;
+ final Image xImage = new Image(display, W, H);
+ GC gc = new GC(xImage);
+ gc.setForeground(display.getSystemColor(SWT.COLOR_RED));
+ gc.drawLine(0, 0, W - 1, H - 1);
+ gc.drawLine(0, H - 1, W - 1, 0);
+ gc.drawOval(1, 1, W - 2, H - 2);
+ gc.dispose();
+
+ int Wz = 40, Hz = 40;
+ final Image zImage = new Image(display, Wz, Hz);
+ GC gcz = new GC(zImage);
+ gcz.setForeground(display.getSystemColor(SWT.COLOR_RED));
+ gcz.drawLine(0, 0, Wz - 1, Hz - 1);
+ gcz.drawLine(0, Hz - 1, Wz - 1, 0);
+ gcz.drawOval(1, 1, Wz - 2, Hz - 2);
+ gcz.dispose();
+
+ for (int i = 0; i < 12; i++) {
+ if (i != 3 && i != 6) {
+ TableItem item = new TableItem(tree, SWT.NONE);
+ item.setImage(i, xImage);
+ item.setText(i, "Test");
+ }
+ }
+
+ shell.pack();
+ shell.open();
+
+ while (!shell.isDisposed()) {
+ if (!display.readAndDispatch())
+ display.sleep();
+ }
+ }
+
+}

Back to the top