forked from eclipse-platform/www.eclipse.org-swt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexamples.php
123 lines (108 loc) · 6.4 KB
/
examples.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
<?php require_once($_SERVER['DOCUMENT_ROOT'] . "/eclipse.org-common/system/app.class.php"); require_once($_SERVER['DOCUMENT_ROOT'] . "/eclipse.org-common/system/nav.class.php"); require_once($_SERVER['DOCUMENT_ROOT'] . "/eclipse.org-common/system/menu.class.php"); $App = new App(); $Nav = new Nav(); $Menu = new Menu(); include($App->getProjectCommon());
$pageTitle = "SWT Examples";
ob_start();
?>
<div id="midcolumn">
<h1>SWT Examples</h1>
<div class="homeitem">
<h2>SWT Examples</h2>
<p>SWT Examples are useful little programs that are written in SWT.
These are typically much larger and more comprehensive than SWT <a href="snippets/">Snippets</a>.
</p>
<p>The following SWT Examples can be downloaded from the Eclipse download page:
<img src="images/controlexample.png" width="400" height="275" align="right" alt="ControlExample on Vista">
</p>
<ul>
<li>ControlExample</li>
<li>CustomControlExample</li>
<li>AddressBook</li>
<li>BrowserExample</li>
<li>ClipboardExample</li>
<li>DNDExample (Drag and Drop)</li>
<li>FileViewer</li>
<li>GraphicsExample</li>
<li>HelloWorld [1-5]</li>
<li>HoverHelp</li>
<li>ImageAnalyzer</li>
<li>JavaViewer</li>
<li>LayoutExample</li>
<li>PaintExample</li>
<li>TextEditor</li>
<li>OLEExample (win32 only, OLE)</li>
<li>OleWebBrowser (win32 only, OLE)</li>
</ul>
<p>ControlExample, CustomControlExample, LayoutExample, and PaintExample are also available as Eclipse plugins,
and the following examples are <em>only</em> available as Eclipse plugins:
</p>
<ul>
<li>BrowserDemo in the org.eclipse.swt.examples.browser.demos project</li>
<li>WebBrowser in the org.eclipse.swt.examples.browser project</li>
</ul>
<p>There are several ways to download and run the SWT examples:</p>
<ul>
<li><a href="#insideEclipse">Run inside Eclipse, either in an example view or from the SWT Example Launcher view.</a></li>
<li><a href="#standaloneInsideEclipse">Launch as standalone applications from within Eclipse.</a></li>
<li><a href="#standaloneOutsideEclipse">Run as standalone applications outside of Eclipse.</a></li>
</ul>
</div>
<div class="homeitem">
<h2><a href="#insideEclipse" name="insideEclipse"></a>Running the SWT Examples inside Eclipse</h2>
<ol>
<li>To get the examples, go to the Eclipse downloads page at <a href="https://download.eclipse.org/eclipse/downloads">
https://download.eclipse.org/eclipse/downloads</a>.</li>
<li>Click on the Eclipse build that you would like examples for
(i.e. the Eclipse build that you are running; typically the latest Stable Build).</li>
<li>Scroll down until you see "Eclipse p2 Repository", use the update site provided under "To update your build to use this specific build, you can use the software repository at" to install using "Install New Sotware..." under Help menu.</li>
<li>After installing the examples, you can find their source in <code>eclipse/plugins/org.eclipse.swt.examples.<exampleName>.source_<version>.jar</code>.
<li>To run the plug-in SWT examples, restart Eclipse, go to <i>Window > Show View... > Other...</i> and expand "SWT Examples".</li>
</ol>
<p>Alternatively, you can use these (more detailed) steps from the Eclipse ISV doc to download, install, and run
the Eclipse SWT Examples:</p>
<ol>
<li><a href = "https://help.eclipse.org/topic/org.eclipse.platform.doc.isv/samples/samples.html">
Installing the examples</a></li>
<li><a href = "https://help.eclipse.org/topic/org.eclipse.platform.doc.isv/samples/org.eclipse.swt.examples.launcher/doc-html/swt_launcher_ex.html">
Running the SWT examples as views or with the SWT Example Launcher</a></li>
<li><a href = "https://help.eclipse.org/topic/org.eclipse.platform.doc.isv/samples/org.eclipse.swt.examples/doc-html/swt_manual_setup.html">
Running the SWT standalone examples</a></li>
<li><a href = "https://help.eclipse.org/topic/org.eclipse.platform.doc.isv/samples/org.eclipse.swt.examples/doc-html/swt_manual_setup.html#ExamplesOverview">
SWT Examples Overview</a></li>
</ol>
</div>
<div class="homeitem">
<h2><a href="#standaloneInsideEclipse" name="standaloneInsideEclipse"></a>Launching standalone SWT Examples inside Eclipse</h2>
<ol>
<li><a href="eclipse.php">Load SWT into your workspace.</a></li>
<li><a href="#insideEclipse">Load the SWT examples into your workspace by one of the methods listed above</a>.</li>
<li>Run a standalone example by selecting the main class (e.g. org.eclipse.swt.examples.controlexample.ControlExample) and selecting
<br><em>Run > Run As > Java Application</em> (Note: prior to Eclipse 3.3 use
<em>Run > Run As > SWT Application</em>).</li>
</ol>
</div>
<div class="homeitem">
<h2><a href="#standaloneOutsideEclipse" name="standaloneOutsideEclipse"></a>Running standalone SWT Examples outside of Eclipse</h2>
<p>(NOTE: these instructions will only work for Eclipse 3.3 and newer) To run the ControlExample or CustomControlExample standalone:</p>
<ol>
<li>Go to the Eclipse downloads page at <a href="https://download.eclipse.org/eclipse/downloads/">
https://download.eclipse.org/eclipse/downloads/</a>.</li>
<li>Click on the Eclipse build that you would like examples for
(i.e. the Eclipse/SWT build that you are running; typically the latest Stable Build).</li>
<li>Scroll down until you see "Eclipse p2 Repository", go to link provided under "To update your build to use this specific build, you can use the software repository at".</li>
<li>Go to plugins folder, find file <code>org.eclipse.swt.examples_<version>.jar</code>, and download it.</li>
<li>Extract <code>org.eclipse.swt.examples_<version>.jar</code> to a folder.</li>
<li>Open a DOS window (on Windows) or a terminal window (on Mac or Linux) and navigate to this directory.</li>
<li>To run the example, type the following line with the appropriate paths substituted:<br>
<code><pathToYourJRE>\bin\java -classpath <pathOfYourPlatformSWTjar>;.\swtexamples.jar org.eclipse.swt.examples.controlexample.ControlExample</code>
<p>This is the ControlExample. There is a tab for each control, and you can
change the various styles, etc, to see what changes in the controls. To run
the CustomControlExample simply use the class name CustomControlExample
instead of ControlExample in step 6.</p>
</li>
</ol>
</div>
</div>
<?php
$html = ob_get_clean();
# Generate the web page
$App->generatePage($theme, $Menu, $Nav, $pageAuthor, $pageKeywords, $pageTitle, $html);
?>