Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexandr Miloslavskiy2020-10-19 14:47:34 +0000
committerAlexandr Miloslavskiy2020-10-19 14:47:34 +0000
commit917a7ff0321a7b62934b4d3ea634d1c003ec9b90 (patch)
tree490c510ce447c9ceff33a4c3883611e7612cef6a
parent911d3458e5c43f52d475433c1356eb8059d823c5 (diff)
downloadeclipse.platform.swt-917a7ff0321a7b62934b4d3ea634d1c003ec9b90.tar.gz
eclipse.platform.swt-917a7ff0321a7b62934b4d3ea634d1c003ec9b90.tar.xz
eclipse.platform.swt-917a7ff0321a7b62934b4d3ea634d1c003ec9b90.zip
Bug 565526 - test snippet
Change-Id: If1f7c3aef9334c1c93eb6ecb664e4b116285583c Signed-off-by: Alexandr Miloslavskiy <alexandr.miloslavskiy@syntevo.com>
-rw-r--r--tests/org.eclipse.swt.tests.win32/ManualTests/org/eclipse/swt/tests/win32/snippets/Bug565526_SpaceSizes.java59
1 files changed, 59 insertions, 0 deletions
diff --git a/tests/org.eclipse.swt.tests.win32/ManualTests/org/eclipse/swt/tests/win32/snippets/Bug565526_SpaceSizes.java b/tests/org.eclipse.swt.tests.win32/ManualTests/org/eclipse/swt/tests/win32/snippets/Bug565526_SpaceSizes.java
new file mode 100644
index 0000000000..9fa6cfd0c7
--- /dev/null
+++ b/tests/org.eclipse.swt.tests.win32/ManualTests/org/eclipse/swt/tests/win32/snippets/Bug565526_SpaceSizes.java
@@ -0,0 +1,59 @@
+/*******************************************************************************
+ * Copyright (c) 2020 Syntevo 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:
+ * Syntevo - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.swt.tests.win32.snippets;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.StyledText;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.graphics.FontData;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.*;
+
+public class Bug565526_SpaceSizes {
+ public static void main(String[] args) {
+ final Display display = new Display();
+
+ final Shell shell = new Shell(display);
+ shell.setLayout(new GridLayout(1, true));
+
+ final Label hint = new Label(shell, SWT.WRAP);
+ hint.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL));
+ hint.setText("Problem: spaces in row (3) after the \u203b are too narrow");
+
+ StyledText text = new StyledText(shell, 0);
+
+ FontData fontData = text.getFont().getFontData()[0];
+ fontData.setName("Courier new");
+ text.setFont(new Font(display, fontData));
+
+ text.setText(
+ "(1) ...... 012345 ......\n" +
+ "(2) 012345 0\u203b2345 012345\n" +
+ "(3) 012345 0\u203b 012345\n" +
+ "(4) ...... 012345 ......"
+ );
+
+ shell.pack();
+ shell.open();
+
+ while (!shell.isDisposed()) {
+ if (!display.readAndDispatch()) {
+ display.sleep();
+ }
+ }
+
+ display.dispose();
+ }
+}

Back to the top