Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Kurtakov2014-02-19 16:37:23 -0500
committerGerrit Code Review @ Eclipse.org2014-02-23 14:34:52 -0500
commit9d8ba9b754e947de2519828fd0bf98edd8cc73c8 (patch)
tree483593e3cf041f4dcbb9ee3dd57ab038e5bd873f /examples/org.eclipse.swt.examples.views
parentb647d62c5bdcee9c1d9104cd6245d80b8fca31e7 (diff)
downloadeclipse.platform.swt-9d8ba9b754e947de2519828fd0bf98edd8cc73c8.tar.gz
eclipse.platform.swt-9d8ba9b754e947de2519828fd0bf98edd8cc73c8.tar.xz
eclipse.platform.swt-9d8ba9b754e947de2519828fd0bf98edd8cc73c8.zip
Bug 428514 - Merge the examples project that contain only views.
A single views bundle is enough. Change-Id: I4ef7f8446ef611a072584269aef5afd4cd5ac5c0 Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
Diffstat (limited to 'examples/org.eclipse.swt.examples.views')
-rw-r--r--examples/org.eclipse.swt.examples.views/.classpath7
-rw-r--r--examples/org.eclipse.swt.examples.views/.project28
-rw-r--r--examples/org.eclipse.swt.examples.views/.settings/org.eclipse.jdt.core.prefs11
-rw-r--r--examples/org.eclipse.swt.examples.views/META-INF/MANIFEST.MF12
-rw-r--r--examples/org.eclipse.swt.examples.views/about.html28
-rw-r--r--examples/org.eclipse.swt.examples.views/build.properties21
-rw-r--r--examples/org.eclipse.swt.examples.views/doc-html/swt_browser_ex.html33
-rw-r--r--examples/org.eclipse.swt.examples.views/doc-html/swt_controls_ex.html34
-rw-r--r--examples/org.eclipse.swt.examples.views/doc-html/swt_customcontrols_ex.html34
-rw-r--r--examples/org.eclipse.swt.examples.views/doc-html/swt_layout_ex.html36
-rw-r--r--examples/org.eclipse.swt.examples.views/doc-html/swt_paint_ex.html39
-rw-r--r--examples/org.eclipse.swt.examples.views/icons/browser_example.gifbin0 -> 380 bytes
-rw-r--r--examples/org.eclipse.swt.examples.views/icons/controls_example.gifbin0 -> 111 bytes
-rw-r--r--examples/org.eclipse.swt.examples.views/icons/layouts_example.gifbin0 -> 217 bytes
-rw-r--r--examples/org.eclipse.swt.examples.views/icons/paint_example.gifbin0 -> 217 bytes
-rw-r--r--examples/org.eclipse.swt.examples.views/plugin.properties81
-rw-r--r--examples/org.eclipse.swt.examples.views/plugin.xml101
-rw-r--r--examples/org.eclipse.swt.examples.views/pom.xml24
-rw-r--r--examples/org.eclipse.swt.examples.views/src/org/eclipse/swt/examples/browserexample/BrowserView.java56
-rw-r--r--examples/org.eclipse.swt.examples.views/src/org/eclipse/swt/examples/controls/ControlView.java58
-rw-r--r--examples/org.eclipse.swt.examples.views/src/org/eclipse/swt/examples/controls/CustomControlView.java36
-rw-r--r--examples/org.eclipse.swt.examples.views/src/org/eclipse/swt/examples/layouts/LayoutView.java58
-rw-r--r--examples/org.eclipse.swt.examples.views/src/org/eclipse/swt/examples/paint/PaintView.java123
23 files changed, 820 insertions, 0 deletions
diff --git a/examples/org.eclipse.swt.examples.views/.classpath b/examples/org.eclipse.swt.examples.views/.classpath
new file mode 100644
index 0000000000..64c5e31b7a
--- /dev/null
+++ b/examples/org.eclipse.swt.examples.views/.classpath
@@ -0,0 +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/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/examples/org.eclipse.swt.examples.views/.project b/examples/org.eclipse.swt.examples.views/.project
new file mode 100644
index 0000000000..928a0d97a9
--- /dev/null
+++ b/examples/org.eclipse.swt.examples.views/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.swt.examples.views</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ </natures>
+</projectDescription>
diff --git a/examples/org.eclipse.swt.examples.views/.settings/org.eclipse.jdt.core.prefs b/examples/org.eclipse.swt.examples.views/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000000..416f4fb696
--- /dev/null
+++ b/examples/org.eclipse.swt.examples.views/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,11 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
diff --git a/examples/org.eclipse.swt.examples.views/META-INF/MANIFEST.MF b/examples/org.eclipse.swt.examples.views/META-INF/MANIFEST.MF
new file mode 100644
index 0000000000..57805ee132
--- /dev/null
+++ b/examples/org.eclipse.swt.examples.views/META-INF/MANIFEST.MF
@@ -0,0 +1,12 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %plugin.SWTPaintExample.name
+Bundle-SymbolicName: org.eclipse.swt.examples.views;singleton:=true
+Bundle-Version: 3.103.0.qualifier
+Bundle-Vendor: %providerName
+Bundle-Localization: plugin
+Require-Bundle: org.eclipse.core.runtime,
+ org.eclipse.ui,
+ org.eclipse.swt.examples
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
diff --git a/examples/org.eclipse.swt.examples.views/about.html b/examples/org.eclipse.swt.examples.views/about.html
new file mode 100644
index 0000000000..460233046e
--- /dev/null
+++ b/examples/org.eclipse.swt.examples.views/about.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
+<title>About</title>
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+
+<p>June 2, 2006</p>
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
+at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
+being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
+apply to your use of any object code in the Content. Check the Redistributor's license that was
+provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at <a href="http://www.eclipse.org">http://www.eclipse.org</a>.</p>
+
+</body>
+</html> \ No newline at end of file
diff --git a/examples/org.eclipse.swt.examples.views/build.properties b/examples/org.eclipse.swt.examples.views/build.properties
new file mode 100644
index 0000000000..df814256df
--- /dev/null
+++ b/examples/org.eclipse.swt.examples.views/build.properties
@@ -0,0 +1,21 @@
+###############################################################################
+# Copyright (c) 2000, 2003 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
+###############################################################################
+bin.includes = doc-html/,\
+ icons/,\
+ plugin.properties,\
+ plugin.xml,\
+ about.html,\
+ .,\
+ META-INF/
+
+src.includes = about.html
+
+source.. = src/
diff --git a/examples/org.eclipse.swt.examples.views/doc-html/swt_browser_ex.html b/examples/org.eclipse.swt.examples.views/doc-html/swt_browser_ex.html
new file mode 100644
index 0000000000..d51de532a0
--- /dev/null
+++ b/examples/org.eclipse.swt.examples.views/doc-html/swt_browser_ex.html
@@ -0,0 +1,33 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<html>
+<head>
+<meta name="copyright" content="Copyright (c) IBM Corporation and others 2000, 2013. This page is made available under license. For full details see the LEGAL in the documentation book that contains this page." >
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <link rel="stylesheet" href="../../../book.css" charset="ISO-8859-1" type="text/css">
+ <title>SWT - Controls Overview</title>
+</head>
+<body>
+
+<h2>SWT example - Browser</h2>
+
+<p>
+The Browser Example is a simple demonstration of the SWT Browser widget.
+It consists of a composite containing a Browser widget to render HTML and some
+additional widgets to implement actions commonly found on browsers (toolbar
+with back, forward, refresh and stop buttons, status bar etc.).
+</p>
+
+<h3>Running the example</h3>
+<p>
+Follow the <a href="../../org.eclipse.swt.examples/doc-html/swt_manual_setup.html">SWT standalone examples setup</a>
+instructions to install and run the example from your workspace.
+</p>
+<p>
+The "Main" class is <code>org.eclipse.swt.examples.browserexample.BrowserExample</code>.
+</p>
+<p>
+This example can also be run using the <a href="../../org.eclipse.swt.examples.launcher/doc-html/swt_launcher_ex.html">Example Launcher</a>.
+Select the <strong>Browser</strong> item from the <strong>Workbench Views</strong> category and click <strong>Run</strong>.
+</p>
+</body>
+</html>
diff --git a/examples/org.eclipse.swt.examples.views/doc-html/swt_controls_ex.html b/examples/org.eclipse.swt.examples.views/doc-html/swt_controls_ex.html
new file mode 100644
index 0000000000..b548225c1a
--- /dev/null
+++ b/examples/org.eclipse.swt.examples.views/doc-html/swt_controls_ex.html
@@ -0,0 +1,34 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<html>
+<head>
+<meta name="copyright" content="Copyright (c) IBM Corporation and others 2000, 2013. This page is made available under license. For full details see the LEGAL in the documentation book that contains this page." >
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <link rel="stylesheet" href="../../../book.css" charset="ISO-8859-1" type="text/css">
+ <title>SWT - Controls Overview</title>
+</head>
+<body>
+
+<h2>SWT example - Controls</h2>
+
+<p>
+The Controls Example is a simple demonstration of common SWT controls.
+It consists of a tab folder where each tab in the folder allows the user
+to interact with a different control.
+The user can change styles and settings and view how this affects each control.
+</p>
+
+<h3>Running the example</h3>
+<p>
+Follow the <a href="../../org.eclipse.swt.examples/doc-html/swt_manual_setup.html">SWT standalone examples setup</a>
+instructions to install and run the example from your workspace.
+</p>
+<p>
+The "Main" class is <code>org.eclipse.swt.examples.controlexample.ControlExample</code>.
+</p>
+<p>
+This example can also be run using the <a href="../../org.eclipse.swt.examples.launcher/doc-html/swt_launcher_ex.html">Example Launcher</a>.
+Select the <strong>Controls</strong> item from the <strong>Workbench Views</strong> category and click <strong>Run</strong>.
+</p>
+
+</body>
+</html>
diff --git a/examples/org.eclipse.swt.examples.views/doc-html/swt_customcontrols_ex.html b/examples/org.eclipse.swt.examples.views/doc-html/swt_customcontrols_ex.html
new file mode 100644
index 0000000000..a053e81f40
--- /dev/null
+++ b/examples/org.eclipse.swt.examples.views/doc-html/swt_customcontrols_ex.html
@@ -0,0 +1,34 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<html>
+<head>
+<meta name="copyright" content="Copyright (c) IBM Corporation and others 2000, 2013. This page is made available under license. For full details see the LEGAL in the documentation book that contains this page." >
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <link rel="stylesheet" href="../../../book.css" charset="ISO-8859-1" type="text/css">
+ <title>SWT - Controls Overview</title>
+</head>
+<body>
+
+<h2>SWT example - Custom Controls</h2>
+
+<p>
+The Custom Controls example is a simple demonstration of emulated SWT controls.
+It consists of a tab folder where each tab in the folder allows the user
+to interact with a different emulated control.
+The user can change styles and settings and view how this affects each control.
+</p>
+
+<h3>Running the example</h3>
+<p>
+Follow the <a href="../../org.eclipse.swt.examples/doc-html/swt_manual_setup.html">SWT standalone examples setup</a>
+instructions to install and run the example from your workspace.
+</p>
+<p>
+The "Main" class is <code>org.eclipse.swt.examples.controlexample.CustomControlExample</code>.
+</p>
+<p>
+This example can also be run using the <a href="../../org.eclipse.swt.examples.launcher/doc-html/swt_launcher_ex.html">Example Launcher</a>.
+Select the <strong>Custom Controls</strong> item from the <strong>Workbench Views</strong> category and click <strong>Run</strong>.
+</p>
+
+</body>
+</html>
diff --git a/examples/org.eclipse.swt.examples.views/doc-html/swt_layout_ex.html b/examples/org.eclipse.swt.examples.views/doc-html/swt_layout_ex.html
new file mode 100644
index 0000000000..5d6539295f
--- /dev/null
+++ b/examples/org.eclipse.swt.examples.views/doc-html/swt_layout_ex.html
@@ -0,0 +1,36 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<html>
+<head>
+<meta name="copyright" content="Copyright (c) IBM Corporation and others 2000, 2013. This page is made available under license. For full details see the LEGAL in the documentation book that contains this page." >
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <link rel="stylesheet" href="../../../book.css" charset="ISO-8859-1" type="text/css">
+ <title>SWT - Layout Example</title>
+</head>
+<body>
+
+<h2>SWT example - Layouts</h2>
+
+<p>
+This example is a simple demonstration of common SWT layouts.
+It consists of a tab folder where each tab in the folder allows the
+user to interact with a different SWT layout.
+The user can insert widgets into a layout and set the values of the layout data
+using a property sheet. When the user has a suitable arrangement, the underlying
+code can be generated by clicking on the <strong>Code</strong> button.
+</p>
+
+<h3>Running the example</h3>
+<p>
+Follow the <a href="../../org.eclipse.swt.examples/doc-html/swt_manual_setup.html">SWT standalone examples setup</a>
+instructions to install and run the example from your workspace.
+</p>
+<p>
+The "Main" class is <code>org.eclipse.swt.examples.layoutexample.LayoutExample</code>.
+</p>
+<p>
+This example can also be run using the <a href="../../org.eclipse.swt.examples.launcher/doc-html/swt_launcher_ex.html">Example Launcher</a>.
+Select the <strong>Layouts</strong> item from the <strong>Workbench Views</strong> category and click <strong>Run</strong>.
+</p>
+
+</body>
+</html> \ No newline at end of file
diff --git a/examples/org.eclipse.swt.examples.views/doc-html/swt_paint_ex.html b/examples/org.eclipse.swt.examples.views/doc-html/swt_paint_ex.html
new file mode 100644
index 0000000000..5c7ec77ab3
--- /dev/null
+++ b/examples/org.eclipse.swt.examples.views/doc-html/swt_paint_ex.html
@@ -0,0 +1,39 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<html>
+<head>
+<meta name="copyright" content="Copyright (c) IBM Corporation and others 2000, 2013. This page is made available under license. For full details see the LEGAL in the documentation book that contains this page." >
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <link rel="stylesheet" href="../../../book.css" charset="ISO-8859-1" type="text/css">
+ <title>SWT - Paint Tool</title>
+</head>
+<body>
+
+<h2>SWT example - Paint Tool</h2>
+
+<p>
+This example demonstrates the use of SWT graphics operations in the form of a
+rudimentary bitmap painting program. The Paint Tool implementation also
+demonstrates a mechanism for managing timed GUI operations in the background
+that are triggered by user input.
+</p>
+<p>
+Select a tool with which to draw in the drawing area. There are a number of tools
+to choose from on the toolbar. To change the color selection, click on a color in the
+palette below the drawing area; left-click to set the foreground color, right-click to set the
+background color.
+</p>
+
+<h3>Running the example</h3>
+
+<p>
+From Eclipse's <strong>Window</strong> menu select <strong>Show View</strong> &gt; <strong>Other</strong>.
+In the <strong>Show View</strong> dialog, expand <strong>SWT Examples</strong> and select
+the view named <strong>Paint</strong>. A view containing the paint program will appear.
+</p>
+<p>
+This example can also be run using the <a href="../../org.eclipse.swt.examples.launcher/doc-html/swt_launcher_ex.html">Example Launcher</a>.
+Select the <strong>Paint</strong> item from the <strong>Workbench Views</strong> category and click <strong>Run</strong>.
+</p>
+
+</body>
+</html>
diff --git a/examples/org.eclipse.swt.examples.views/icons/browser_example.gif b/examples/org.eclipse.swt.examples.views/icons/browser_example.gif
new file mode 100644
index 0000000000..895e22110d
--- /dev/null
+++ b/examples/org.eclipse.swt.examples.views/icons/browser_example.gif
Binary files differ
diff --git a/examples/org.eclipse.swt.examples.views/icons/controls_example.gif b/examples/org.eclipse.swt.examples.views/icons/controls_example.gif
new file mode 100644
index 0000000000..cbdee97066
--- /dev/null
+++ b/examples/org.eclipse.swt.examples.views/icons/controls_example.gif
Binary files differ
diff --git a/examples/org.eclipse.swt.examples.views/icons/layouts_example.gif b/examples/org.eclipse.swt.examples.views/icons/layouts_example.gif
new file mode 100644
index 0000000000..d945dde53b
--- /dev/null
+++ b/examples/org.eclipse.swt.examples.views/icons/layouts_example.gif
Binary files differ
diff --git a/examples/org.eclipse.swt.examples.views/icons/paint_example.gif b/examples/org.eclipse.swt.examples.views/icons/paint_example.gif
new file mode 100644
index 0000000000..d945dde53b
--- /dev/null
+++ b/examples/org.eclipse.swt.examples.views/icons/paint_example.gif
Binary files differ
diff --git a/examples/org.eclipse.swt.examples.views/plugin.properties b/examples/org.eclipse.swt.examples.views/plugin.properties
new file mode 100644
index 0000000000..b0b5b1ab69
--- /dev/null
+++ b/examples/org.eclipse.swt.examples.views/plugin.properties
@@ -0,0 +1,81 @@
+###############################################################################
+# Copyright (c) 2000, 2005 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
+###############################################################################
+providerName = Eclipse.org
+plugin.SWTPaintExample.name = SWT Views Example Plugin
+category.SWTExamples.name = SWT Examples
+view.PaintExample.name = Paint
+
+launchcategory.SWTViewExamples.name = Workbench Views
+launchcategory.SWTViewExamples.description = \
+ A collection of Standard Widget Toolkit examples that run as Views inside the Workbench. \
+ These examples will create a new View in the current Perspective.
+
+launchitem.PaintExample.name = Paint
+launchitem.PaintExample.description = \
+ This example demonstrates the use of SWT graphics operations in the form of a \
+ rudimentary bitmap painting program. The Airbrush Tool implementation also \
+ demonstrates a mechanism for managing timed GUI operations in the background \
+ that are triggered by user input.\n\n\
+ Select a tool with which to draw in the drawing area. There are a number of tools \
+ to choose from on the toolbar. To change the color selection, click on a color in the \
+ palette below the drawing area: left-click for the foreground color, right-click for the \
+ background color.\n\n\
+ Uses SWT's GC and FontDialog, and JFace's InputDialog and action set support.
+view.LayoutExample.name = SWT Layouts
+
+launchcategory.SWTViewExamples.name = Workbench Views
+launchcategory.SWTViewExamples.description = \
+ A collection of Standard Widget Toolkit examples that run as Views inside the Workbench. \
+ These examples will create a new View in the current Perspective.
+
+launchitem.LayoutExample.name = Layouts
+launchitem.LayoutExample.description = \
+ This example is a simple demonstration of common SWT layouts. \n\n\
+ It consists of a tab folder where each tab allows the \
+ user to interact with a different SWT layout.\
+ The user can insert widgets into a layout and set the values of the layout data \
+ using a property sheet. When the user has a suitable arrangement, code can be \
+ generated by clicking on the Code button.
+
+view.ControlsExample.name = SWT Controls
+view.CustomControlsExample.name = SWT Custom Controls
+
+launchcategory.SWTViewExamples.name = Workbench Views
+launchcategory.SWTViewExamples.description = \
+ A collection of Standard Widget Toolkit examples that run as Views inside the Workbench. \
+ These examples will create a new View in the current Perspective.
+
+launchitem.ControlsExample.name = Controls
+launchitem.ControlsExample.description = \
+ This example is a simple demonstration of native SWT controls.\n\n\
+ It consists of a tab folder where each tab allows the user \
+ to interact with a different SWT control. \
+ The user can change styles and settings and view how this affects the control.
+
+launchitem.CustomControlsExample.name = Custom Controls
+launchitem.CustomControlsExample.description = \
+ This example is a simple demonstration of custom SWT controls.\n\n\
+ It consists of a tab folder where each tab allows the user \
+ to interact with a different SWT custom control. \
+ The user can change styles and settings and view how this affects the control.
+
+view.BrowserExample.name = Web Browser
+
+launchcategory.SWTViewExamples.name = Workbench Views
+launchcategory.SWTViewExamples.description = \
+ A collection of Standard Widget Toolkit examples that run as Views inside the Workbench. \
+ These examples will create a new View in the current Perspective.
+
+launchitem.BrowserExample.name = Web Browser
+launchitem.BrowserExample.description = \
+ This example demonstrates how to integrate a Web Browser with the SWT Browser widget.\n\n\
+ It consists of a composite containing a Browser widget to render HTML. \
+ Additional widgets allow the user to perform typical browser actions (for example, navigate to a particular URL, go back, forward, refresh and stop).
diff --git a/examples/org.eclipse.swt.examples.views/plugin.xml b/examples/org.eclipse.swt.examples.views/plugin.xml
new file mode 100644
index 0000000000..4c9ffb0cf1
--- /dev/null
+++ b/examples/org.eclipse.swt.examples.views/plugin.xml
@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.0"?>
+<plugin>
+ <extension
+ point="org.eclipse.ui.views">
+ <view
+ name="%view.PaintExample.name"
+ icon="icons/paint_example.gif"
+ category="org.eclipse.swt.examples.category"
+ class="org.eclipse.swt.examples.paint.PaintView"
+ id="org.eclipse.swt.examples.paint.view">
+ </view>
+ <view
+ name="%view.LayoutExample.name"
+ icon="icons/layouts_example.gif"
+ category="org.eclipse.swt.examples.category"
+ class="org.eclipse.swt.examples.layouts.LayoutView"
+ id="org.eclipse.swt.examples.layouts.view">
+ </view>
+ <view
+ name="%view.ControlsExample.name"
+ icon="icons/controls_example.gif"
+ category="org.eclipse.swt.examples.category"
+ class="org.eclipse.swt.examples.controls.ControlView"
+ id="org.eclipse.swt.examples.controls.view">
+ </view>
+ <view
+ name="%view.CustomControlsExample.name"
+ icon="icons/controls_example.gif"
+ category="org.eclipse.swt.examples.category"
+ class="org.eclipse.swt.examples.controls.CustomControlView"
+ id="org.eclipse.swt.examples.customcontrols.view">
+ </view>
+ <view
+ name="%view.BrowserExample.name"
+ icon="icons/browser_example.gif"
+ category="org.eclipse.swt.examples.category"
+ class="org.eclipse.swt.examples.browserexample.BrowserView"
+ id="org.eclipse.swt.examples.browserexample.view">
+ </view>
+ </extension>
+ <extension
+ point="org.eclipse.swt.examples.launcher.launchItems">
+ <category
+ name="%launchcategory.SWTViewExamples.name"
+ description="%launchcategory.SWTViewExamples.description"
+ id="org.eclipse.swt.examples.launchViewCategory">
+ </category>
+ <item
+ name="%launchitem.PaintExample.name"
+ icon="icons/paint_example.gif"
+ description="%launchitem.PaintExample.description"
+ category="org.eclipse.swt.examples.launchViewCategory"
+ id="org.eclipse.swt.examples.paint.viewlauncher">
+ <view
+ viewId="org.eclipse.swt.examples.paint.view">
+ </view>
+ </item>
+ <item
+ name="%launchitem.LayoutExample.name"
+ icon="icons/layouts_example.gif"
+ description="%launchitem.LayoutExample.description"
+ category="org.eclipse.swt.examples.launchViewCategory"
+ id="org.eclipse.swt.examples.layouts.viewlauncher">
+ <view
+ viewId="org.eclipse.swt.examples.layouts.view">
+ </view>
+ </item>
+ <item
+ name="%launchitem.ControlsExample.name"
+ icon="icons/controls_example.gif"
+ description="%launchitem.ControlsExample.description"
+ category="org.eclipse.swt.examples.launchViewCategory"
+ id="org.eclipse.swt.examples.controls.viewlauncher">
+ <view
+ viewId="org.eclipse.swt.examples.controls.view">
+ </view>
+ </item>
+ <item
+ name="%launchitem.CustomControlsExample.name"
+ icon="icons/controls_example.gif"
+ description="%launchitem.CustomControlsExample.description"
+ category="org.eclipse.swt.examples.launchViewCategory"
+ id="org.eclipse.swt.examples.customcontrols.viewlauncher">
+ <view
+ viewId="org.eclipse.swt.examples.customcontrols.view">
+ </view>
+ </item>
+ <item
+ name="%launchitem.BrowserExample.name"
+ icon="icons/browser_example.gif"
+ category="org.eclipse.swt.examples.launchViewCategory"
+ description="%launchitem.BrowserExample.description"
+ id="org.eclipse.swt.examples.browserexample.viewlauncher">
+ <view
+ viewId="org.eclipse.swt.examples.browserexample.view">
+ </view>
+ </item>
+ </extension>
+
+</plugin>
diff --git a/examples/org.eclipse.swt.examples.views/pom.xml b/examples/org.eclipse.swt.examples.views/pom.xml
new file mode 100644
index 0000000000..86f65a9a5e
--- /dev/null
+++ b/examples/org.eclipse.swt.examples.views/pom.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (c) 2012, 2013 Eclipse Foundation and others.
+ All rights reserved. This program and the accompanying materials
+ are made available under the terms of the Eclipse Distribution License v1.0
+ which accompanies this distribution, and is available at
+ http://www.eclipse.org/org/documents/edl-v10.php
+
+ Contributors:
+ Igor Fedorenko - initial implementation
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <artifactId>eclipse.platform.swt</artifactId>
+ <groupId>eclipse.platform.swt</groupId>
+ <version>4.4.0-SNAPSHOT</version>
+ <relativePath>../../</relativePath>
+ </parent>
+ <groupId>org.eclipse.swt</groupId>
+ <artifactId>org.eclipse.swt.examples.views</artifactId>
+ <version>3.103.0-SNAPSHOT</version>
+ <packaging>eclipse-plugin</packaging>
+</project>
diff --git a/examples/org.eclipse.swt.examples.views/src/org/eclipse/swt/examples/browserexample/BrowserView.java b/examples/org.eclipse.swt.examples.views/src/org/eclipse/swt/examples/browserexample/BrowserView.java
new file mode 100644
index 0000000000..cb034e6cb5
--- /dev/null
+++ b/examples/org.eclipse.swt.examples.views/src/org/eclipse/swt/examples/browserexample/BrowserView.java
@@ -0,0 +1,56 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2004 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.examples.browserexample;
+
+import org.eclipse.swt.widgets.*;
+import org.eclipse.ui.part.*;
+
+/**
+ * <code>BrowserView</code> is a simple demonstration
+ * of the SWT Browser widget. It consists of a workbench
+ * view and tab folder where each tab in the folder allows the
+ * user to interact with a control.
+ *
+ * @see ViewPart
+ */
+public class BrowserView extends ViewPart {
+ BrowserExample instance = null;
+
+ /**
+ * Create the example
+ *
+ * @see ViewPart#createPartControl
+ */
+ @Override
+ public void createPartControl(Composite frame) {
+ instance = new BrowserExample(frame, true);
+ }
+
+ /**
+ * Called when we must grab focus.
+ *
+ * @see org.eclipse.ui.part.ViewPart#setFocus
+ */
+ @Override
+ public void setFocus() {
+ instance.focus();
+ }
+
+ /**
+ * Called when the View is to be disposed
+ */
+ @Override
+ public void dispose() {
+ instance.dispose();
+ instance = null;
+ super.dispose();
+ }
+}
diff --git a/examples/org.eclipse.swt.examples.views/src/org/eclipse/swt/examples/controls/ControlView.java b/examples/org.eclipse.swt.examples.views/src/org/eclipse/swt/examples/controls/ControlView.java
new file mode 100644
index 0000000000..8ac034b003
--- /dev/null
+++ b/examples/org.eclipse.swt.examples.views/src/org/eclipse/swt/examples/controls/ControlView.java
@@ -0,0 +1,58 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2003 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.examples.controls;
+
+
+import org.eclipse.swt.examples.controlexample.*;
+import org.eclipse.swt.widgets.*;
+import org.eclipse.ui.part.*;
+
+/**
+ * <code>Controls</code> is a simple demonstration
+ * of the native controls defined by SWT. It consists of a workbench
+ * view and tab folder where each tab in the folder allows the
+ * user to interact with a control.
+ *
+ * @see ViewPart
+ */
+public class ControlView extends ViewPart {
+ ControlExample instance = null;
+
+ /**
+ * Create the example
+ *
+ * @see ViewPart#createPartControl
+ */
+ @Override
+ public void createPartControl(Composite frame) {
+ instance = new ControlExample(frame);
+ }
+
+ /**
+ * Called when we must grab focus.
+ *
+ * @see org.eclipse.ui.part.ViewPart#setFocus
+ */
+ @Override
+ public void setFocus() {
+ instance.setFocus();
+ }
+
+ /**
+ * Called when the View is to be disposed
+ */
+ @Override
+ public void dispose() {
+ instance.dispose();
+ instance = null;
+ super.dispose();
+ }
+}
diff --git a/examples/org.eclipse.swt.examples.views/src/org/eclipse/swt/examples/controls/CustomControlView.java b/examples/org.eclipse.swt.examples.views/src/org/eclipse/swt/examples/controls/CustomControlView.java
new file mode 100644
index 0000000000..4fb2fedc6a
--- /dev/null
+++ b/examples/org.eclipse.swt.examples.views/src/org/eclipse/swt/examples/controls/CustomControlView.java
@@ -0,0 +1,36 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2003 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.examples.controls;
+
+
+import org.eclipse.swt.examples.controlexample.*;
+import org.eclipse.swt.widgets.*;
+
+/**
+ * <code>CustomControls</code> is a simple demonstration
+ * of the custom controls defined by SWT. It consists of a workbench
+ * view and tab folder where each tab in the folder allows the
+ * user to interact with a control.
+ *
+ * @see ViewPart
+ */
+public class CustomControlView extends ControlView {
+
+ /**
+ * Create the example
+ *
+ * @see ViewPart#createPartControl
+ */
+ @Override
+ public void createPartControl(Composite frame) {
+ instance = new CustomControlExample(frame);
+ }
+}
diff --git a/examples/org.eclipse.swt.examples.views/src/org/eclipse/swt/examples/layouts/LayoutView.java b/examples/org.eclipse.swt.examples.views/src/org/eclipse/swt/examples/layouts/LayoutView.java
new file mode 100644
index 0000000000..e0781134e7
--- /dev/null
+++ b/examples/org.eclipse.swt.examples.views/src/org/eclipse/swt/examples/layouts/LayoutView.java
@@ -0,0 +1,58 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2003 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.examples.layouts;
+
+
+import org.eclipse.swt.examples.layoutexample.*;
+import org.eclipse.swt.widgets.*;
+import org.eclipse.ui.part.*;
+
+/**
+ * <code>Layouts</code> is a simple demonstration
+ * of the layouts defined by SWT. It consists of a workbench
+ * view and tab folder where each tab in the folder allows the
+ * user to interact with a layout.
+ *
+ * @see ViewPart
+ */
+public class LayoutView extends ViewPart {
+ LayoutExample instance = null;
+
+ /**
+ * Create the example
+ *
+ * @see ViewPart#createPartControl
+ */
+ @Override
+ public void createPartControl(Composite frame) {
+ instance = new LayoutExample(frame);
+ }
+
+ /**
+ * Called when we must grab focus.
+ *
+ * @see org.eclipse.ui.part.ViewPart#setFocus
+ */
+ @Override
+ public void setFocus() {
+ instance.setFocus();
+ }
+
+ /**
+ * Called when the View is to be disposed
+ */
+ @Override
+ public void dispose() {
+ instance.dispose();
+ instance = null;
+ super.dispose();
+ }
+}
diff --git a/examples/org.eclipse.swt.examples.views/src/org/eclipse/swt/examples/paint/PaintView.java b/examples/org.eclipse.swt.examples.views/src/org/eclipse/swt/examples/paint/PaintView.java
new file mode 100644
index 0000000000..7d7bd08ad3
--- /dev/null
+++ b/examples/org.eclipse.swt.examples.views/src/org/eclipse/swt/examples/paint/PaintView.java
@@ -0,0 +1,123 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2005 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.examples.paint;
+
+
+import org.eclipse.jface.action.*;
+import org.eclipse.jface.resource.*;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.*;
+import org.eclipse.ui.*;
+import org.eclipse.ui.part.*;
+
+/**
+ * The view for the paint application.
+ * All rendering happens inside the area created by createPartControl().
+ *
+ * @see ViewPart
+ */
+public class PaintView extends ViewPart {
+ PaintExample instance = null;
+
+ /**
+ * Constructs a Paint view.
+ */
+ public PaintView() {
+ }
+
+ /**
+ * Creates the example.
+ *
+ * @see ViewPart#createPartControl
+ */
+ @Override
+ public void createPartControl(Composite parent) {
+ instance = new PaintExample(parent);
+ instance.createGUI(parent);
+
+ /*** Add toolbar contributions ***/
+ final IActionBars actionBars = getViewSite().getActionBars();
+ IToolBarManager toolbarManager = actionBars.getToolBarManager();
+ Tool tools[] = PaintExample.tools;
+ String group = tools[0].group;
+ toolbarManager.add(new GroupMarker(group));
+ for (int i = 0; i < tools.length; i++) {
+ Tool tool = tools[i];
+ if (!tool.group.equals(group)) {
+ toolbarManager.add(new Separator());
+ toolbarManager.add(new GroupMarker(tool.group));
+ }
+ group = tool.group;
+ PaintAction action = new PaintAction(tool);
+ toolbarManager.appendToGroup(group, action);
+ if (i == PaintExample.Default_tool || i == PaintExample.Default_fill || i == PaintExample.Default_linestyle) {
+ action.setChecked(true);
+ }
+ }
+ actionBars.updateActionBars();
+
+ instance.setDefaults();
+ }
+
+ /**
+ * Called when the View is to be disposed
+ */
+ @Override
+ public void dispose() {
+ instance.dispose();
+ instance = null;
+ super.dispose();
+ }
+
+ /**
+ * Returns the Display.
+ *
+ * @return the display we're using
+ */
+ public Display getDisplay() {
+ return instance.getDisplay();
+ }
+
+ /**
+ * Called when we must grab focus.
+ *
+ * @see org.eclipse.ui.part.ViewPart#setFocus
+ */
+ @Override
+ public void setFocus() {
+ instance.setFocus();
+ }
+
+ /**
+ * Action set glue.
+ */
+ class PaintAction extends Action {
+ private int style;
+ private Runnable action;
+ public PaintAction(Tool tool) {
+ super();
+ String id = tool.group + '.' + tool.name;
+ setId(id);
+ style = tool.type == SWT.RADIO ? IAction.AS_RADIO_BUTTON : IAction.AS_PUSH_BUTTON;
+ action = tool.action;
+ setText(PaintExample.getResourceString(id + ".label"));
+ setToolTipText(PaintExample.getResourceString(id + ".tooltip"));
+ setDescription(PaintExample.getResourceString(id + ".description"));
+ setImageDescriptor(ImageDescriptor.createFromFile(
+ PaintExample.class,
+ PaintExample.getResourceString(id + ".image")));
+ }
+ @Override
+ public int getStyle() { return style; }
+ @Override
+ public void run() { action.run(); }
+ }
+} \ No newline at end of file

Back to the top