Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorEric Williams2017-06-22 19:00:07 +0000
committerEric Williams2017-06-23 16:54:30 +0000
commitd5321fd38953825aea717f890cdc0af010c4ace8 (patch)
tree06f1366af31d293ccb563ae65fd6f760af9cf8f6 /tests
parent6a0d96f4ad875d95bb8371f665998f8c5198d2f5 (diff)
downloadeclipse.platform.swt-d5321fd38953825aea717f890cdc0af010c4ace8.tar.gz
eclipse.platform.swt-d5321fd38953825aea717f890cdc0af010c4ace8.tar.xz
eclipse.platform.swt-d5321fd38953825aea717f890cdc0af010c4ace8.zip
Bug 518657: [GTK] Add bug snippets to GTK only tests project
Add bug snippets folder and README + sample bug snippet. Change-Id: Id3f799a070b40f8fab8a1b7ddefe554091906f63 Signed-off-by: Eric Williams <ericwill@redhat.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/org.eclipse.swt.tests.gtk/.classpath1
-rw-r--r--tests/org.eclipse.swt.tests.gtk/Bug Snippets/org/eclipse/swt/tests/gtk/snippets/Bug166720_TableEditorFlicker.java55
-rw-r--r--tests/org.eclipse.swt.tests.gtk/Bug Snippets/org/eclipse/swt/tests/gtk/snippets/README20
3 files changed, 76 insertions, 0 deletions
diff --git a/tests/org.eclipse.swt.tests.gtk/.classpath b/tests/org.eclipse.swt.tests.gtk/.classpath
index 2d54539e87..590b9f8ceb 100644
--- a/tests/org.eclipse.swt.tests.gtk/.classpath
+++ b/tests/org.eclipse.swt.tests.gtk/.classpath
@@ -3,5 +3,6 @@
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="JUnit Tests"/>
+ <classpathentry kind="src" path="Bug Snippets"/>
<classpathentry kind="output" path="bin"/>
</classpath>
diff --git a/tests/org.eclipse.swt.tests.gtk/Bug Snippets/org/eclipse/swt/tests/gtk/snippets/Bug166720_TableEditorFlicker.java b/tests/org.eclipse.swt.tests.gtk/Bug Snippets/org/eclipse/swt/tests/gtk/snippets/Bug166720_TableEditorFlicker.java
new file mode 100644
index 0000000000..1557d6d4e5
--- /dev/null
+++ b/tests/org.eclipse.swt.tests.gtk/Bug Snippets/org/eclipse/swt/tests/gtk/snippets/Bug166720_TableEditorFlicker.java
@@ -0,0 +1,55 @@
+package org.eclipse.swt.tests.gtk.snippets;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.TableEditor;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+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;
+import org.eclipse.swt.widgets.Text;
+
+/*
+ * Title: Bug 166720 - [TableEditor] flickers quite a bit when scrolling - Linux GTK
+ * How to run: launch snippet and scroll TableEditor.
+ * Bug description: TableEditor flickers when scrolling.
+ * Expected results: TableEditor should scroll smoothly.
+ * GTK Version(s): GTK2.x
+ */
+
+public class Bug166720_TableEditorFlicker {
+ public static void main(String[] args) {
+ Display display = new Display ();
+ Shell shell = new Shell (display);
+ shell.setLayout (new GridLayout ());
+ Table table = new Table (shell, SWT.BORDER | SWT.MULTI);
+ GridData gd = new GridData(GridData.FILL_BOTH);
+ gd.heightHint = 200;
+ gd.widthHint = 200;
+ table.setLayoutData(gd);
+
+ TableColumn column = new TableColumn(table, SWT.NONE);
+ column.setWidth (100);
+ for (int i=0; i<100; i++) {
+ new TableItem (table, SWT.NONE);
+ }
+ TableItem [] items = table.getItems ();
+ for (int i=0; i<items.length; i++) {
+ TableEditor editor = new TableEditor (table);
+ editor = new TableEditor (table);
+ Text text = new Text (table, SWT.NONE);
+ text.setText("Text" + i);
+ editor.grabHorizontal = true;
+ editor.setEditor(text, items[i], 0);
+ editor = new TableEditor (table);
+ }
+ shell.pack ();
+ shell.open ();
+ while (!shell.isDisposed ()) {
+ if (!display.readAndDispatch ()) display.sleep ();
+ }
+ display.dispose ();
+ }
+} \ No newline at end of file
diff --git a/tests/org.eclipse.swt.tests.gtk/Bug Snippets/org/eclipse/swt/tests/gtk/snippets/README b/tests/org.eclipse.swt.tests.gtk/Bug Snippets/org/eclipse/swt/tests/gtk/snippets/README
new file mode 100644
index 0000000000..30130af85f
--- /dev/null
+++ b/tests/org.eclipse.swt.tests.gtk/Bug Snippets/org/eclipse/swt/tests/gtk/snippets/README
@@ -0,0 +1,20 @@
+Place here all snippets that correspond to specific bugs. Naming format is Eclipse Bugzilla number + name, if applicable.
+
+For example: Bug486334_TableTest.java
+Non-bug specific snippets: TreeTest.java
+
+Please make snippets as clear as possible. At the very least, include a comment above the class definition
+that explains how the snippet works, what it does, and what the expected result is. For example:
+
+/*
+ * Title: Bug 166720 - [TableEditor] flickers quite a bit when scrolling - Linux GTK
+ * How to run: launch snippet and scroll TableEditor.
+ * Bug description: TableEditor flickers when scrolling.
+ * Expected results: TableEditor should scroll smoothly.
+ * GTK version(s): GTK2.x
+ */
+
+ Alternatively: code instructions into the snippet itself, so that users can simply run the snippet
+ and visually look at the instructions.
+
+ These snippets can also be used as references in code. For example "// See Gtk test Bug486334_TableTest.java" \ No newline at end of file

Back to the top