|
|
# How to install and use the AmbientTalk IDE for Eclipse
|
|
|
|
|
|
# Introduction
|
|
|
|
|
|
The AmbientTalk IDE for Eclipse (IdeAT) has been designed to provide a convenient integrated environment in which to build AmbientTalk applications. It extends Eclipse's features to let you quickly create AmbientTalk files and run them. More concretely, the ideAT plugin currently provides:
|
|
|
|
|
|
- Support for Java projects which includes AmbientTalk files.
|
|
|
- An AmbientTalk editor with syntax highlighting, syntax error reporting, brace matching, auto-format, auto-completion of the current identifier and code completion for statements such as if, while, etc.
|
|
|
- Support to run AmbientTalk scripts with interactive console.
|
|
|
- Support to debug distributed AmbientTalk programs ( [see the REME-D page for further info](http://code.google.com/p/ambienttalk/wiki/DebuggingInEclipse)).
|
|
|
|
|
|
Developing AmbientTalk programs in Eclipse with the IdeAT plugin is highly recommended and is the fastest way to get started.
|
|
|
|
|
|
# Requirements
|
|
|
|
|
|
In order to use IdeAT we recommend to use:
|
|
|
- version 1.5 or newer of Java Development Kit.
|
|
|
- versions 3.5 to 4.3 of Eclipse.
|
|
|
|
|
|
# Installation
|
|
|
|
|
|
IdeAT can be directly installed from within Eclipse.
|
|
|
|
|
|
First go to "Help -> Install New Software...->Available Software" and cliclk "Add.." to add a new site.
|
|
|
|
|
|
plugin/availableSoftware.png
|
|
|
|
|
|
Enter a name and the following URL on the "Location" field and click "OK" button.
|
|
|
|
|
|
`http://soft.vub.ac.be/eclipse/update-site/`
|
|
|
|
|
|
plugin/addSite.png
|
|
|
|
|
|
You should then see "IdeAT" offered for installation. Click on the "Next ..." button and follow the instructions from there.
|
|
|
|
|
|
plugin/install.png
|
|
|
|
|
|
# Updates
|
|
|
|
|
|
From time to time, a new revision of the IdeAT becomes available with new features and bugfixes.
|
|
|
When a new version is available (this is usually announced in the AmbientTalk's mailinglist), you should update it using the **Software Updates** feature in Eclipse.
|
|
|
|
|
|
You can check whether an update is available and, if so, install it as follows:
|
|
|
|
|
|
1. Go to "Help-> Check for Updates".
|
|
|
1. If there are updates available, select IdeAT and then click "Next".
|
|
|
1. In the Update Details dialog, click "Next".
|
|
|
1. Read and accept the license agreement and then click Finish. This will download and install the latest version of IdeAT.
|
|
|
1. Restart Eclipse.
|
|
|
|
|
|
|
|
|
# An Example
|
|
|
|
|
|
Here comes a short tutorial how to create a HelloWorld AmbienTalk application with Eclipse. It assumes that you have installed the plugin as described above.
|
|
|
|
|
|
IdeAT does not provide a particular item to create an AmbientTalk project. An AmbientTalk project is any kind of project that contains an AmbientTalk file ( i.e. a file with the .at extension). This means you can create any kind of project and then add AmbientTalk files to it and run them. However, we recommend you to create an AmbientTalk project as a Java project as it will be easier to compile any Java code used by your AmbientTalk application (e.g. GUI classes).
|
|
|
|
|
|
The following figure shows a simple test project which includes three AmbientTalk files: halloWorld.at, concurrentHalloWorld.at and util.at. The Eclipse console shows the result of the execution of the halloWorld.at file.
|
|
|
|
|
|
plugin/halloWorldExample.png
|
|
|
|
|
|
Note that the test project is a Java project but the src folder is empty as this example does not contain any Java code.
|
|
|
|
|
|
For now, to run an AmbientTalk application you can right click an .at file and "Run As.. -> AmbientTalk Application". Next section we will explain how to customize an AmbientTalk run configuration.
|
|
|
|
|
|
The following figure shows the contents of the concurrentHalloWorld.at file. The result of its execution is shown in the Eclipse console.
|
|
|
|
|
|
plugin/concurrentHalloWorldExample.png
|
|
|
|
|
|
This example implements a "hello World" involving two actors. Note that to import futures one can use / which is bound by default to the atlib included with the plugin. In order to refer to other files on the current ambientTalk project, one can use ~. In this example, concurrentHalloWorld.at imports the util.at file which simply defines a sayHallo() method as shown below.
|
|
|
|
|
|
plugin/utilExample.png
|
|
|
|
|
|
You can also evaluate a piece of code on the fly in a running IAT or a new one. To do so, select a the piece of code in the editor, right click and select the "Run Snippet On" option. This option lists all running IATs and a default "New..." option to run the snippet in a newly created IAT. The following picture shows you how to run the util.at code using this feature.
|
|
|
|
|
|
plugin/runSnippetOnExample.png
|
|
|
|
|
|
Note that each Eclipse Console is named with the run configuration name ( set to the at file if the program was run with Run As.. -> AmbientTalk Application") and an iat identifier. In this example, we previously run halloWorld.at and concurrentHalloWorld.at so, two running IAT processes are available apart from the default "New..." option.
|
|
|
|
|
|
The editor also supports auto-completion for AmbientTalk statements by means of CTRL + space and gives suggestions on the current formed word.
|
|
|
|
|
|
# Custom Run Configurations
|
|
|
|
|
|
One can also create a Run configuration for an AmbientTalk program. Select the menu item "Run -> Run Configurations.." then double-click "AmbientTalk Application". You must set the "Program" to an at file. In the screenshoot we set it to halloWorld.at.
|
|
|
|
|
|
plugin/runConfiguration.png
|
|
|
|
|
|
The Arguments tab in "Run configuration.." allows to configure two different kinds of parameters:
|
|
|
1. AmbientTalk VM parameters:
|
|
|
1. AT_HOME variable ( which stores the path to the AmbientTalk? distribution directory).
|
|
|
1. AT_INIT variable (which stores the path of the init.at file).
|
|
|
1. atlib (which stores the path if the atlib directory, used to derive the namespaces to the included libraries).
|
|
|
1. command line parameters to IAT such as -n ([see the command line parameters page for further info](http://code.google.com/p/ambienttalk/wiki/CommandLineParameters)).
|
|
|
1. Java VM arguments passed to the Java VM launching IAT.
|
|
|
|
|
|
plugin/argumentTab.png
|
|
|
|
|
|
ArgumentTab shows the default values set for the IdeAT plugin, which are defined in the Preference Page (as explained later). You can select your custom location for a particular file/folder by clicking in the "Other:" radio button which enables the "File System.." and "Workspace..." buttons. The first one allows you to select a file/directory external to the Eclipse workspace, while the latter allows you to browse for a file/folder in the Eclipse workspace. For example, the screenshot above shows that AT_INIT variable is set to the init.at file from the workspace test-2 project.
|
|
|
|
|
|
The plugin takes the location of atlib and sets automatically the value of AT_LIBPATH passed to IAT by adding every subfolder as an at namespace.
|
|
|
For example, if you select atlib E to /Users/lisa/atlib as shown in the screenshot above, the variable AT_LIBPATH is set by the plugin as follows:
|
|
|
|
|
|
```
|
|
|
-DAT_LIBPATH="at=/Users/lisa/atlib/at:applications=/Users/lisa/atlib/applications:bridges=/Users/lisa/atlib/bridges:frameworks=/Users/lisa/atlib/frameworks:demo=/Users/lisa/atlib/demo:test=/Users/lisa/atlib/test:extensions=/Users/lisa/atlib/extensions"
|
|
|
```
|
|
|
|
|
|
If would like to add a new namespace slot to the default ones, you should set the -DAT_OBJECTPATH variable in the VM command line arguments.
|
|
|
|
|
|
# Preference Page
|
|
|
|
|
|
To customize the ideAT plugin go to Eclipse->Preferences..->IdeAT
|
|
|
|
|
|
plugin/preferencePage.png
|
|
|
|
|
|
One can customize the default location of the AT_HOME and AT_INIT variables, and atlib directory.
|
|
|
Their value can be set to a file/directory external to the Eclipse workspace (by means of the "File System..." button) or a file/folder in the Eclipse workspace (by means of the "Workspace..." button).
|
|
|
|
|
|
Note that changing this values affects **all** run configurations. These values can be overridden in a per run configuration basis as explained above.
|
|
|
|
|
|
The ideAT preferences contains a dedicated page for customizing the editor' syntax highlighting as shown below.
|
|
|
|
|
|
plugin/preferancePageColors.png
|
|
|
|
|
|
Other properties of the editor can be customized using Eclipse's general preferences. For example:
|
|
|
- if you would like to change the font type or size, go to Preferences->General->Appearance->Color and fonts-> Basic an click the "text font" property.
|
|
|
- if you would like to add line numbers to the files, go to Preferences->General->Editors->Text Editors and click on the "Show line numbers" box.
|
|
|
|
|
|
# Feedback
|
|
|
|
|
|
This is first version of the AmbientTalk IDE for Eclipse. Feedback on it is more than welcomed :)
|
|
|
|
|
|
You can send your suggestions and questions to the AmbientTalk mailing-list or report bugs on the Issues section of this website. Please use the "component_ideAT" label for reporting issues.
|
|
|
|
|
|
# Known Issues
|
|
|
|
|
|
- The editor sometimes does not update on the fly multiline comments. Try to position the cursor at the begining of the file and add a space, the editor then should properly update them. Anycase, the comments will be properly greyed out if you save and re open the file.
|
|
|
- Changes on color preferences are currenlty not reflected on opened AmbientTalk files. One needs to close and re open them to see the new colors.
|
|
|
- Auto-completion of identifiers does not include currently identifiers defined in the param list of a closure.
|
|
|
|
|
|
# Wish List
|
|
|
|
|
|
- Auto-completion reusing AT parser so that we can take into account AT scoping rules.
|
|
|
- Completion on jlobby.
|
|
|
- "Refactor" option for AT identifiers.
|
|
|
- Generate getters/setters.
|
|
|
- Outline mode for AT files.
|
|
|
- Open/Closing curly braces.
|
|
|
- Implements java interface support.
|
|
|
|
|
|
|
|
|
|