I just downloaded the SWT examples from the Eclipse site but I have a problem: I cannot view the source code. I can launch the Control Example application (which I need) but if I create a project with those .jar-s included I just see empty packages in them. What do I do wrong? Is there a way to see those .java files?
I'm developing an RCP application for Eclipse and those examples can help me out.
3.1.Download the SWT library from the Eclipse download page. Navigate to the download page of the latest stable Eclipse release. Scroll down to the SWT binaries and download the correct version for your Java and OS version. Copy the swt.
SWT is an open source widget toolkit for Java designed to provide efficient, portable access to the user-interface facilities of the operating systems on which it is implemented.
Composite is an ancestor of every SWT class to which you can add widgets, including Shell . For that reason, you can think of a Composite as being simply the working area of a Shell , without the styles associated with the aspects of Shell that make windows—the titlebar, control menu, etc.
public Shell(Display display) Constructs a new instance of this class given only the display to create it on. It is created with style SWT.
Download the archive with examples from 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
(or other appropriate jar version) file in the archive and extract the content (jar are just renamed zip files) to some existing Eclipse project or create new one (e.g. SWTExamples). In the src
folder you can find all example's sources. To run control example, run project with main class org.eclipse.swt.examples.controlexample.ControlExample
.
In the package org.eclipse.swt.examples.controlexample
you can find sources for which are you looking for.
IMHO the control examples have quite complicated source code, but there could be found what you need.
As listed on the SWT examples page:
If you have downloaded them and run them inside Eclipse, the sources can be found in eclipse/plugins/org.eclipse.swt.examples.[exampleName].source_[version].jar
If you downloaded the .jar's directly, you have instructions on the examples page (http://www.eclipse.org/swt/examples.php) on how to install them in eclipse, which should download the source .jar's.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With