Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorXi Yan2018-06-06 15:44:50 +0000
committerEric Williams2018-06-07 14:43:47 +0000
commitebf9d7eedcf2e07f6c256751abf964f7e8cbd29e (patch)
treee36b32c28df004ace2d971e4ca005241e51cce55 /tests
parent820c46cbb7018b48aa8791ca34c8025246bda964 (diff)
downloadeclipse.platform.swt-ebf9d7eedcf2e07f6c256751abf964f7e8cbd29e.tar.gz
eclipse.platform.swt-ebf9d7eedcf2e07f6c256751abf964f7e8cbd29e.tar.xz
eclipse.platform.swt-ebf9d7eedcf2e07f6c256751abf964f7e8cbd29e.zip
Bug 396175 - Link widget needs an escape character for < and >
Added escape character for angle bracket in link widget. Change-Id: I44675a5a18c4319421c9b37af16d4d345ec8b55d 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/Bug396175_LinkAngularBracket.java42
1 files changed, 42 insertions, 0 deletions
diff --git a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug396175_LinkAngularBracket.java b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug396175_LinkAngularBracket.java
new file mode 100644
index 0000000000..f28373b9dd
--- /dev/null
+++ b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug396175_LinkAngularBracket.java
@@ -0,0 +1,42 @@
+/*******************************************************************************
+ * Copyright (c) 2018 Red Hat 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.swt.tests.gtk.snippets;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Link;
+import org.eclipse.swt.widgets.Shell;
+
+public class Bug396175_LinkAngularBracket {
+
+ public static void main(String[] args) {
+ Display display = new Display();
+ Shell shell = new Shell(display);
+ shell.setLayout(new GridLayout());
+
+ Link fakeLink = new Link(shell, SWT.BORDER);
+ fakeLink.setText("This is a \\<a href=\"fake\">FAKE\\<LINK\\</a\\>");
+
+ Link realLink = new Link(shell, SWT.BORDER);
+ realLink.setText("This is a <a href=\"real\">REAL\\<LINK</a>");
+
+ shell.pack();
+ shell.open();
+ while (!shell.isDisposed()) {
+ if (!display.readAndDispatch()) {
+ display.sleep();
+ }
+ }
+ display.dispose();
+ }
+
+}

Back to the top