E4/Bespin

From Eclipsepedia

< E4
Jump to: navigation, search
A screenshot of a text editor running in Mozilla Firefox with the help of Mozilla Bespin.

The e4 Bespin server is an experimental implementation of Bespin's client-server API.

Contents

Getting the Eclipse code

  1. Start with a recent Eclipse build and an empty workspace. We recommend Eclipse SDK 3.5 M4.
  2. Select File > Import... and select CVS > Projects from CVS, click Next.
  3. Copy the CVS repository location and paste it into the "Host" field to populate the wizard page: :pserver:anonymous@dev.eclipse.org:/cvsroot/eclipse
  4. You should see "Host: dev.eclipse.org, Repository path: /cvsroot/eclipse, User: anonymous, Connection type: pserver".
  5. Click Next and select the second option Use an existing module.
  6. Drill down as follows: e4 > org.eclipse.e4.server > bundles and select org.eclipse.e4.server.bespin. Click Finish.

Getting the Mozilla code

  1. Using a web browser, go to http://hg.mozilla.org/labs. The recommended version is 0.3; to get it click on "Bespin" under the "Name" link, scroll to the bottom of the page, and under "Tags", click on the "files" link for version 0.3. On the next page, click on the zip or gz link on the second line. This should download an archive with the Bespin source code version 0.3. (As of this writing, the version at the tip no longer contains the Eclipse project metadata files that 0.3 had, and requires you to add the dojo toolkit.)
  2. In Eclipse, select File > Import..., pick General > Existing Projects into Workspace, click Next, select the archive file option, click Browse... and select the archive file you just downloaded. Click Open in the file chooser dialog, then check bespin to be imported, and click Finish.

If you have "no project found" message, unzip downloaded file in your eclipse workspace folder. In Eclipse, file -> new -> project -> plug-in project -> copy and paste the name of downloaded folder- click next and click finish

  1. As a result, you should have a project called bespin in your workspace, containing folders like backend, docs, frontend, etc. and a few files. (Note: If you are adventurous, you could instead install Mercurial and check out the project directly from the Mozilla repository.)

if you have do new -> plug-in project, you must go to Running the server

  1. Right-click on the bespin project and select PDE Tools > Convert Projects to Plug-in Projects.... Confirm the wizard dialog that opens by clicking Finish. This will generate a plug-in manifest file META-INF/MANIFEST.MF.

Running the server

  1. Select Run > Run Configurations... and double-click on OSGi Framework to create a new OSGi launch configuration. Click Deselect All and then check:
    • bespin
    • org.eclipse.e4.server.bespin
    • org.eclipse.equinox.http.jetty
  2. Click on Add Required Bundles.
  3. Optionally, add -Dorg.eclipse.equinox.http.jetty.http.port=8080 as a VM argument on the Arguments tab to change the port on which the server will run.
  4. Click the Run button.
  5. Using Firefox 3, open http://localhost or http://localhost:8080 depending on the port your server runs on.
  6. Click Register and fill in name and password. These are only stored locally.

Running Eclipse-specific Commands

  1. In Eclipse, Open dashboard.html in a text editor (Ctrl+Shift+R, enter dashboard.html, click on the triangle next to Open and select Text Editor). The file is located in bepsin/frontend in case you need to navigate to the file and Open With->Text Editor
  2. Insert the following line after the line that references js/commandline/commands.js:
<script type="text/javascript" src="/eclipse/commands/eclipsecommands.js"></script>
  1. Do the same for editor.html.
  2. Edit dashboardcommands.js and add 'cvsco', 'newproject' to the list of commands available in the dashboard. The file is located in bespin/frontend/js/commandline.
  3. Make sure to reload the Bespin page in your web browser, press Ctrl+J to activate the command line, and enter help to see the list of available commands.

You can now create a new project from the dashboard using the newproject command, or check out an existing project available through anonymous CVS using the cvsco command. When in the editor, you can use the problems command to display the list of warnings or errors for the current file.

Note that the Java syntax highlighting shown in the screenshot above was produced by copying Mozilla's javascript.js file and adjusting it for Java, by replacing the list of keywords with one for the Java language, and changing the registration so that it applies to *.java files.