Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorncazottes2018-04-08 16:37:58 -0400
committerLeo Ufimtsev2018-04-13 16:09:48 -0400
commit624fe0d237e0e92c9ffdc3054ab74ad1325da881 (patch)
treec27c6841fb31b23bc24f86b4331df82991cc052a /examples
parentf894bab36d1d8d6bf87a55af6e74c42eb00fb145 (diff)
downloadeclipse.platform.swt-624fe0d237e0e92c9ffdc3054ab74ad1325da881.tar.gz
eclipse.platform.swt-624fe0d237e0e92c9ffdc3054ab74ad1325da881.tar.xz
eclipse.platform.swt-624fe0d237e0e92c9ffdc3054ab74ad1325da881.zip
Bug 533124 - Allow multi line text in CTabFolder.I20180413-2000
CTabFolderRenderer with flag that take into account carriage return for multi line. Addition of Snippet371. Addition of Javadoc on CTabItem.setText. Addition of same cross platform behavior relating to the drop-down menu for additional tabs. Change-Id: Ib45891dcc90727830262887745c8ec1ad9be451d Signed-off-by: ncazottes <nicolas@cazottes.net>
Diffstat (limited to 'examples')
-rw-r--r--examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet371.java57
1 files changed, 57 insertions, 0 deletions
diff --git a/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet371.java b/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet371.java
new file mode 100644
index 0000000000..c8756558ea
--- /dev/null
+++ b/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet371.java
@@ -0,0 +1,57 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2017 IBM Corporation 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:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.swt.snippets;
+
+/*
+ * CTabFolder example snippet: demonstration of a multi line CTabFolder
+ *
+ * For a list of all SWT example snippets see
+ * http://www.eclipse.org/swt/snippets/
+ *
+ * @since 4.8
+ */
+import org.eclipse.swt.*;
+import org.eclipse.swt.custom.*;
+import org.eclipse.swt.graphics.*;
+import org.eclipse.swt.layout.*;
+import org.eclipse.swt.widgets.*;
+
+public class Snippet371 {
+
+ public static void main(String[] args) {
+ Display display = new Display();
+ Shell shell = new Shell(display);
+ shell.setLayout(new FillLayout());
+ CTabFolder folder = new CTabFolder(shell, SWT.BORDER);
+
+ CTabItem item1 = new CTabItem(folder, SWT.CLOSE);
+ item1.setText("Item on one line");
+ Text text1 = new Text(folder, SWT.MULTI);
+ text1.setText("Content for Item 1");
+ item1.setControl(text1);
+
+ CTabItem item2 = new CTabItem(folder, SWT.CLOSE);
+ item2.setText("Item on \ntwo lines");
+ Text text2 = new Text(folder, SWT.MULTI);
+ text2.setText("Content for Item 2");
+ item2.setControl(text2);
+
+
+ shell.setSize(new Point(300, 200));
+ shell.open();
+ while (!shell.isDisposed()) {
+ if (!display.readAndDispatch())
+ display.sleep();
+ }
+ display.dispose();
+ }
+}
+

Back to the top