Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLina Kemmel2015-05-13 16:26:24 +0000
committerLina Kemmel2015-05-13 16:35:26 +0000
commit28eae5a124e699ec7aa8293ac7fa643d7d4191ce (patch)
tree99dd9f53d8b5440e4202e8ec5d1ec463ebbff193 /examples
parent4b4619a6b5b2cd61a37c980601ead9593d587b9d (diff)
downloadeclipse.platform.swt-28eae5a124e699ec7aa8293ac7fa643d7d4191ce.tar.gz
eclipse.platform.swt-28eae5a124e699ec7aa8293ac7fa643d7d4191ce.tar.xz
eclipse.platform.swt-28eae5a124e699ec7aa8293ac7fa643d7d4191ce.zip
Misc changes
Diffstat (limited to 'examples')
-rw-r--r--examples/org.eclipse.swt.snippets/.classpath14
-rw-r--r--examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet900.java46
2 files changed, 53 insertions, 7 deletions
diff --git a/examples/org.eclipse.swt.snippets/.classpath b/examples/org.eclipse.swt.snippets/.classpath
index ad32c83a78..f797f60925 100644
--- a/examples/org.eclipse.swt.snippets/.classpath
+++ b/examples/org.eclipse.swt.snippets/.classpath
@@ -1,7 +1,7 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry excluding="org/eclipse/swt/snippets/Snippet341.java|org/eclipse/swt/snippets/Snippet321.java|org/eclipse/swt/snippets/Snippet323.java|org/eclipse/swt/snippets/Snippet329.java|org/eclipse/swt/snippets/Snippet306.java|org/eclipse/swt/snippets/Snippet267.java|org/eclipse/swt/snippets/Snippet277.java|org/eclipse/swt/snippets/Snippet158.java|org/eclipse/swt/snippets/Snippet174.java|org/eclipse/swt/snippets/Snippet195.java|org/eclipse/swt/snippets/Snippet209.java" kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet900.java b/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet900.java
new file mode 100644
index 0000000000..aadfb24067
--- /dev/null
+++ b/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet900.java
@@ -0,0 +1,46 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2015 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;
+
+/*
+ * SegmentListener example snippet: create tool bar (wrap on resize)
+ *
+ * For a list of all SWT example snippets see
+ * http://www.eclipse.org/swt/snippets/
+ */
+import org.eclipse.swt.*;
+import org.eclipse.swt.widgets.*;
+
+public class Snippet900 {
+
+public static void main (String [] args) {
+ Display display = new Display ();
+ final Shell shell = new Shell (display);
+ final Button button = new Button(shell, SWT.PUSH);
+ button.setText("def");
+
+ button.addListener(SWT.Segments, new Listener() {
+
+ @Override
+ public void handleEvent(Event event) {
+ button.setText("abc");
+ }
+
+ });
+ button.pack();
+ button.setLocation(10, 180);
+ shell.open ();
+ while (!shell.isDisposed ()) {
+ if (!display.readAndDispatch ()) display.sleep ();
+ }
+ display.dispose ();
+}
+}

Back to the top