E4/Running the demos

From Eclipsepedia

< E4
Revision as of 14:56, 1 December 2008 by Gheorghe.ca.ibm.com (Talk | contribs)

Jump to: navigation, search

Contents

e4 Photo Demo

To run the e4 photo demo (a RCP style example app), you can follow these steps:

  1. see Project Set Files for info on how to get the files for org.eclipse.e4.ui.releng
  2. import the PSF files 'e4.ui.psf' and 'e4.ui.examples.psf'.
  3. Open the Run Configurations dialog (Ctrl+3 MRC), expand 'Eclipse Application', select 'e4 photo demo', and click Run.
  4. The demo app should open, looking empty. Click on "Create Album".
  5. Check the outer Eclipse's Console view, it should have printed a location on disk where it created the album. (It created a project in an Eclipse workspace.) Copy sample photos from your workspace (under demos/sampleData/photos in the old location, HEAD/e4-incubator/demos) into the album directory. You can do this while the demo application is running, it will pick up the changes in its "Library" view.


Project Set Files

You can get the latest versions of the project set files from the appropriate team releng project under 'e4/releng' :pserver:anonymous@dev.eclipse.org:/cvsroot/eclipse

  1. Start with Eclipse 3.5 and an empty workspace.
  2. Open the CVS Repositories view (Ctrl+3 CVSR).
  3. Right-click in the view and select New > Repository Location.
  4. Copy the following string and paste it into the 'Host' field: :pserver:anonymous@dev.eclipse.org:/cvsroot/eclipse .
  5. (Optional: Adjust user name, password and connection method if you are a committer.)
  6. Expand the repository, then HEAD, e4, releng
  7. Right-click on the appropriate releng project, like 'org.eclipse.e4.ui.releng', and select 'Check Out'.
  8. In the Package Explorer, expand the releng project and select the file PSF file, like 'e4.ui.psf'.
  9. Select 'Import Project Set' from the context menu on the the psf file
  10. A dialog will open asking you to create repository locations. Select each location and click 'Create', providing username 'anonymous' unless you are a committer. Click OK.

SWT for Flex

The SWT port for Flex consists of the Adobe Flex environment (the ActionScript compiler), the Flex tools plugins (which provides the tools needed to compile and launch Java code in a Flash player) and the Eclipse target environment (the running plugins, the SWT port itself and example code). NOTE: That the both the tools and the port are in the pre-alpha stage. You are living on the bleeding edge. Good luck!

The Eclipse target environment provides support for compiling, launching and debugging java applications in flash player.

Setup Flex environment:

  1. Download and install the Adobe Open Source Flex SDK (available from http://opensource.adobe.com). NOTE: The path where you install the Flex SDK must contain no spaces. This is due to a bug in FCSH.
  2. Verify that your Flex install works by opening a command prompt, changing to the Flex SDK bin directory, typing "mxmlc" and hitting Enter. If you get a message like the following, you will need to add a JAVA_HOME environment variable that points to the home dir or edit the bin/jvm.config file in the Flex SDK.
  Error: could not find JRE
  Error: could not find Java 2 Runtime Environment.

Setup the Flex tools:

  1. Download a new build of Eclipse 3.5 (latest milestone build is fine).
  2. Update your eclipse.ini file and add another line at the end, -Dflex.sdk=<your path to the installed sdk>
  3. Create a new Eclipse Workspace. NOTE: The path were you create the workspace must contain no spaces. This is due to a bug in FCSH.
  4. Download the Flex tools by going to the e4 build site (http://build.eclipse.org/eclipse/e4/build/e4/downloads/drops/4.0.0/), clicking on the latest build, clicking on the folder with that build version and copying the link location of the Update link. (Note: at some point the site for downloads will be changed to http://download.eclipse.org/e4/downloads/. These instructions will be updated at that point.)
  5. Back in your Eclipse workspace, select Help>Install New Software...
  6. Click on the Add Site... button and paste in the Update link you copied from the build page. Click OK.
  7. Under the Uncategorized section, select the ActionScript Developer Tools plugin and click Next (twice), accept the license and click Install.
  8. When prompted to restart, click on Yes.
  9. Create a workspace variable in Linked Resources preference page ('Preferences' -> 'Workspace' -> 'Linked Resources'). The variable should be called WORKSPACE and point to the root of your Eclipse workspace.

Setup the Eclipse target environment


  1. Turn off auto build ('Project' -> 'Build Automatically')
  2. Connect to dev.eclipse.org:/cvsroot/eclipse and browse to the e4 project. Check out the org.eclipse.e4.swt.releng project into your workspace.
  3. Select the "e4.swt.as.demo.psf", right click and select Import Project Set... (If prompted for username:password, you should use anonymous:anonymous).
  4. Add a new ActionScript VM. ('Window' -> 'Preferences' -> 'Java>Installed JREs').
    1. Click Add...
    2. Select ActionScript VM, click next.
    3. Click Directory... and browse to either your Firefox or IE install directory.
    4. Click OK.
    5. Click Finish
  5. Change the .classpath_flex to .classpath for the following projects. (Note that in order to see the classpath files, you have to either do this in the Navigator view or turn off the resources filter in the Packages Explorer by clicking on the drop down arrow menu in the top right hand corner of the package explorer, selecting Filters and unchecking *.resources).
    1. org.eclipse.swt
    2. org.eclipse.swt.e4.jcl
    3. org.eclipse.swt.examples
  1. Refresh the org.eclipse.swt project to pick up the linked resources.
  2. Turn on Build Automatically (You can watch the build progress in the ActionScript Build Console, available from the Console view)
  3. You can run any of the demos from org.eclipse.swt.e4.examples by clicking on them and Selecting "Run As>ActionScript Application". Note that for the Flickr example, you must select static linking in the launch configuration dialog.

Setup a sample SWT ActionScript project from scratch

 Note that this assumes you have gone through the steps above.
  1. Create a Java Project.
  2. Add the ActionScript nature to the project "Select Project>Popup Menu>Action Script Tools>Toogle Nature".
  3. Add the org.eclipse.swt project to the Java Build Path projects tab.
  4. Change the execution environment of the project JRE container to J2AS-1.5
  5. Add this class, save and Run as ActionScript Application
public class Main {
	public static void main(String[] args) {
		Display display = new Display();
		Shell shell = new Shell(display);
		shell.setLayout(new GridLayout(1, false));
 
		Button b = new Button(shell, SWT.PUSH);
		b.setText("Push");
 
		shell.pack();
		shell.open();
	}
}

SWT for Dojo

Common setup between the two SWT demos:

  1. Create new Eclipse Workspace.
  2. see Project Set Files for info on how to get the files for org.eclipse.e4.swt.releng
  3. Import the 'e4.swt.as.psf' file into your workspace. (Just click "OK" when it asks for "compatible locations".)
  4. Change "Preferences -> Java -> Compiler -> Building -> Build path problems -> Circular dependencies" to Warning.

Steps specific to Dojo:

  1. Copy .classpath_dojo to .classpath in both the org.eclipse.swt and org.eclispse.swt.e4 projects. (Note that in order to see the classpath files, you have to either do this in the Navigator view or turn off the resources filter in the Packages Explorer by clicking on the drop down arrow menu in the top right hand corner of the package explorer, selecting Filters and unchecking *.resources).
  2. Download the Google Web Toolkit for Linux (use version 1.4.62 for now). Note it is important to get the Linux download regardless of the OS you are running on.
  3. Download the Dojo Toolkit (use version 1.1.1).
  4. Create a Java Project, call it "DojoResources".
  5. Create 2 subfolders, named "public" and "gwt". In the "public" subfolder, create another folder named "dojo".
  6. Extract the Dojo download and import the folders into the "dojo" folder. Your directory structure should look like this:
public
--dojo
	-- dijit
	-- dojo
	-- dojoX
	-- util
  1. Extract the GWT download and import "gwt-dev-linux.jar" and "gwt-user.jar" into the "gwt" folder. Your directory structure should look like this:
gwt
-- gwt-dev-linux.jar
-- gwt-user.jar
  1. Copy the dojoLib.gwt.xml file from org.eclipse.swt.e4\Eclipse SWT PI\dojo\build to the root of the DojoResources project.
  2. To build the example, run the script org.eclipse.swt.e4.examples\dojo\build.xml. To run the script, right click and select Run As>Ant Build... Click on the JRE tab and select "Run in the same JRE as the workspace".
  3. Copy the index.html file from /org.eclipse.swt.e4/Eclipse SWT PI/dojo/build/ to the generated controlexample folder (org.eclipse.swt.e4.examples/dojo/bin/www/controlexample).
  4. Replace the following line in the index.html file :
<!-- <script src="NAME_OF_GWT_XML_FILE.nocache.js" language="javascript"></script> -->

with this:

<script src="controlexample.nocache.js" language="javascript"></script>
  1. Open the index.html file in a browser (embeded or system one).

Scriptable Workbench

*** Due to project refactoring (moving from the incubator to a fully fledged project), these instructions are out of date and the demos are broken. We are working to fix this situation. Please stay tuned.

Common setup between the two Platform UI demos:

  1. Download 3.4.
  2. Install XULRunner 1.8.1.3 as described in the SWT FAQ.
  3. Create a new workspace. This is important - the demo will not run with the SWT projects from above.
  4. Download the "Mozilla XPCom for Java" feature from this update site: http://releases.mozilla.org/pub/mozilla.org/xulrunner/releases/1.8.1.3/contrib/eclipse/
  5. Import the ui-e4Set.psf file.

Running the "Scriptable Workbench" demo:

  1. Run an inner Eclipse.
  2. Open the "Workbench Model" view by using the Quick Access (CTRL+3) and entering "Workbench Model"

Note that this is experimental code, and many things in the inner Eclipse don't work. Try and play around by changing and running the Javascript code in the right pane of the Model View.

Eclipse Web Client

*** Due to project refactoring (moving from the incubator to a fully fledged project), these instructions are out of date and the demos are broken. We are working to fix this situation. Please stay tuned.

Common setup between the two Platform UI demos:

  1. Download 3.4.
  2. Install XULRunner 1.8.1.3 as described in the SWT FAQ.
  3. Create a new workspace. This is important - the demo will not run with the SWT projects from above.
  4. Download the "Mozilla XPCom for Java" feature from this update site: http://releases.mozilla.org/pub/mozilla.org/xulrunner/releases/1.8.1.3/contrib/eclipse/
  5. Import the ui-e4Set.psf file.

Running the "Eclipse Web Client" demo:

  1. Run an inner Eclipse.
  2. Create a new project (for example, the RCP Mail project)
  3. In Firefox 2, go to about:config and change the value of network.http.max-persistent-connections-per-server to 4 (default is 2).
  4. Start Firefox 2 and point it at http://localhost:8000/e4/files/workbench.html.

Note that the demo only runs in Firefox.