How to view the source code of the SWT example (Eclipse)?

I just downloaded SWT examples from the Eclipse website, but I have a problem: I canโ€™t view the source code. I can run the Control Example application (which I need), but if I create a project with .jar enabled, I just see empty packages in them. What am I doing wrong? Is there any way to see these .java files?

I am developing an RCP application for Eclipse and these examples may help me.

+4
source share
3 answers

Ok, I archived .jar-s in my file system, and now I see the sources. :)

So, if someone is facing this problem, you just need to unzip the .jar files located in the plugins directory.

+1
source

Download the sample archive from the eclipse download site (e.g. org.eclipse.sdk.examples-3.7.zip ).

Locate the plugins\org.eclipse.swt.examples.source_3.7.0.v3735b.jar file in the archive (or another suitable jar file) in the archive and extract the contents (the jar are simply renamed to zip files) into some existing Eclipse project or create new (e.g. SWTExamples). In the src folder you can find all the sources of examples. To run the test case, run the project with the main class org.eclipse.swt.examples.controlexample.ControlExample .

In the org.eclipse.swt.examples.controlexample package you can find the sources you are looking for.

IMHO control examples have quite complicated source code, but you can find what you need.

+3
source

As indicated on the SWT example page:

If you downloaded them and ran them in Eclipse, the sources can be found at eclipse/plugins/org.eclipse.swt.examples.[exampleName].source_[version].jar

If you downloaded .jar directly, you have instructions on the examples page (http://www.eclipse.org/swt/examples.php) on how to install them in eclipse, which should load the .jar's source.

+2
source

All Articles