Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorXi Yan2018-09-04 15:39:01 +0000
committerXi Yan2018-09-04 15:57:01 +0000
commit4637faea28199f85d42a4ca237ad145cd1f2d386 (patch)
treef1bf608407e67242259162ca629223437b02df9d /tests
parent36bd428f1c9a3c2dfa7b0d8eab63495b292687e1 (diff)
downloadeclipse.platform.swt-4637faea28199f85d42a4ca237ad145cd1f2d386.tar.gz
eclipse.platform.swt-4637faea28199f85d42a4ca237ad145cd1f2d386.tar.xz
eclipse.platform.swt-4637faea28199f85d42a4ca237ad145cd1f2d386.zip
Bug 538579 - DateTime SWT.DATE and SWT.Time styles do not allow to set
value SWT.DATE & SWT.TIME need handle to be registered in widgetTable in order to function correctly. Added additional checks to register/deregister handle. Tested with attached snippet, no additional test breaks in AllNonBrowserTests. Change-Id: I928aa7122abba427af29242504c3a5feeacf141b Signed-off-by: Xi Yan <xixiyan@redhat.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug538579_DateTimeSetValue.java47
1 files changed, 47 insertions, 0 deletions
diff --git a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug538579_DateTimeSetValue.java b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug538579_DateTimeSetValue.java
new file mode 100644
index 0000000000..b1e625db81
--- /dev/null
+++ b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug538579_DateTimeSetValue.java
@@ -0,0 +1,47 @@
+/*******************************************************************************
+ * Copyright (c) 2018 Red Hat and others.
+ *
+ * This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * Red Hat - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.swt.tests.gtk.snippets;
+
+
+import static org.eclipse.swt.events.SelectionListener.widgetSelectedAdapter;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.RowLayout;
+import org.eclipse.swt.widgets.DateTime;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Shell;
+
+public class Bug538579_DateTimeSetValue {
+
+public static void main (String [] args) {
+ Display display = new Display ();
+ Shell shell = new Shell (display);
+ shell.setLayout (new RowLayout ());
+
+ DateTime date = new DateTime (shell, SWT.DATE);
+ date.addSelectionListener (
+ widgetSelectedAdapter(e -> System.out.println ("Date changed")));
+
+ DateTime time = new DateTime (shell, SWT.TIME);
+ time.addSelectionListener (widgetSelectedAdapter(e -> System.out.println ("time changed")));
+
+ shell.pack ();
+ shell.open ();
+ while (!shell.isDisposed ()) {
+ if (!display.readAndDispatch ()) display.sleep ();
+ }
+ display.dispose ();
+}
+} \ No newline at end of file

Back to the top