From 2247ae1dc9b3a2fb1be4c35ccd594e2e8bd46965 Mon Sep 17 00:00:00 2001 From: Veronika Irvine Date: Thu, 27 Apr 2006 12:10:41 +0000 Subject: snippet showing text that spans multiple columns --- .../src/org/eclipse/swt/snippets/Snippet240.java | 95 ++++++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100644 examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet240.java (limited to 'examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet240.java') diff --git a/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet240.java b/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet240.java new file mode 100644 index 0000000000..d52cddb0b8 --- /dev/null +++ b/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet240.java @@ -0,0 +1,95 @@ +/******************************************************************************* + * Copyright (c) 2000, 2006 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; + +/* + * Tree snippet: Text that spans multiple columns + * + * For a list of all SWT example snippets see + * http://www.eclipse.org/swt/snippets/ + * + * @since 3.2 + */ + +import org.eclipse.swt.*; +import org.eclipse.swt.graphics.*; +import org.eclipse.swt.layout.*; +import org.eclipse.swt.widgets.*; + +public class Snippet240 { + +public static void main(String [] args) { + final Display display = new Display(); + Shell shell = new Shell (display); + shell.setText("Text spans two columns in a TreeItem"); + shell.setLayout (new FillLayout()); + final Tree tree = new Tree(shell, SWT.MULTI | SWT.FULL_SELECTION); + tree.setHeaderVisible(true); + int columnCount = 4; + for (int i=0; i