This page will contain articles with description of using eclihx with other eclipse plugins

Development Guide (How to build EclihX from sources)

posted Nov 7, 2011, 3:11 PM by Nikolay Krasko   [ updated Nov 13, 2011, 11:53 AM by Nikolay Krasko ]

There was a tutorial for developers already, but it dates back to 2009 year, was made for Windows at the time when eclihx project used SVN version control system. So today I would like to refresh it and show how you can try yourself as eclihx developer in no more than two hours. Here you will find the all steps for setting up a development environment on Ubuntu 11.10 (the most recent one).

You can run through the tutorial by looking the screenshots in picasa web album Development Guide (How to build EclihX from sources)

Table of Contents
  • Eclipse for RCP and RAP Developers
  • Java 1.6 SDK
  • Mercurial
  • Download EclihX sources
  • Hello world from EclihX
  • Where to go next

Eclipse for RCP and RAP Developers

As you probably know EclihX is in fact a plug-in for eclipse, and the very first thing we need to install is Eclipse, a special version for platform developers. Nothing is intricate here, just visit Eclipse download page, and proceed with Eclipse for RCP and RAP Developers (current version is Eclipse 3.7 Indigo). After downloading is finished, unpack it to the desired folder and be ready to start "eclipse" if you have Java 1.6 installed already. If you don't yet, the next section will guide you through the installation process.

Java 1.6 SDK

If you will try to run eclipse with no Java installed it just won't start with some error. So the next step is to install java. EclihX was developed and tested with JDK 1.6 and all you need is to install Java from Ubuntu Software Center. Just type "java" and click install in the row with "OpenJDK Java 6 Runtime".

Mercurial and Mercurial Eclipse plugin

Next stop is the installation of the Mercurial. When EclihX just started it used Subversion as code version control. But when Google shipped a support of Mercurial, it was decided to migrate to that system in order to provide a more easy way to contribute the project. I'm going to show how to download the sources right into the eclipse workspace.

First you will need "Ubuntu Software Center" again. This time continue with the installation of "scalable distributed version control system" that could be found by typing "mercurial" in the search field (note first m in lower case).

After that we should make an installation of a mercurial plug-in for eclipse itself. The list of steps is:
  • Start eclipse
  • Click Help -> Eclipse Marketplace... in main menu
  • Find the mercurial plug-in. The name is MercurialEclipse (was HgEclipse)
  • Several "Next" and "Ok" clicks in order to accept licence agreement, allow installation software with unsigned content and finaly confirm to restart eclipse.
All the process is showed on screenshots.


Download EclihX sources

Now setting up the environment is finished. The whole procedure doesn't take much time and as you can see doesn't require too much configuration. What we are going to do next is to start using the whole bunch of installed software. 

Now we will download the sources into eclipse workspace. Start your eclipse, open "Plug-in Development" perspective if it's not activated yet, than open Import dialog with right click in "Package Explorer" view or in "File -> Import..." from Eclipse main menu. Find "Clone Existing Mercurial Repository" in Mercurial submenu. In the opened wizard insert "https://code.google.com/p/eclihx" as repository location URL (this link could be found on source page of eclihx project). On the next page select "default" as a revision to clone, and finally on the last page of the wizard do not uncheck anything. Click Finish and you will get all sources downloaded to the local folder and imported to Eclipse workspace.

Again you can control all process with screenshots:

Select Clone from Mecurial sub-menu
Mercurial clone wizardSelect a branch to clone
Projects to clone

Hello world from EclihX

To make the tutorial more fun and add some interactivity, we will start show a message box with "Hello World" when starting EclihX project. 

Navigate to eclihx.ui -> src -> eclihx.ui.internal.ui -> EclihxUIPlugin.java file in Package Explorer view and insert the line:

MessageDialog.openInformation(null, "Test message", "Hello World from Eclihx!");

into the start method after 


"Hello World" example
To launch the project click the right mouse button on eclihx.ui project and navigate to Run As -> Eclipse Application

Launch EclihX from Eclipse

Another instance of eclipse will start with the EclihX plugins included to the environment. After closing welcome screen and activating the EclihX perspective you should be able to see your "Hello World" message.

Hello World message box

Where to go next

Congratulation! You have just finished building EclihX project from sources. Probably you did it, because you are interested in the IDE internals or planning to implement you favorite feature you were always dreamed to see in haXe IDE. I didn't mention anything about Eclipse plug-in development itself, because it's a huge area of knowledge. To dive yourself into this domain I would recommend you to read Platform Plug-in Developer Guide, there you will find a comprehensive information about extending eclipse with your own functionality.

And of course feel free to contact me if you have any questions about extending and patching EclihX.

Will be glad to your feedbacks! :)

Thank you!

Quick Start Tutorial

posted Jan 20, 2011, 3:20 PM by Nikolay Krasko   [ updated Jan 24, 2011, 12:15 AM ]

EclihX Perspective

In order to begin development in haXe you should activate an EclihX perspective. The perspective in eclipse is a way of grouping views, editors and wizards to stay focused on your current task. If you installing EclihX in JDT eclipse installation you will start with Java perspective. See the screenshots below.

Haxe Resource Wizards

After you are in correct perspective "haxe Package Explorer" and "Package Explorer" views will show you haxe resources wizards in context menu:

Haxe Compiler Path

It's very important to configure haxe-compiler as soon as you have turned Eclihx perspective on, because IDE uses it for autocomplete proposals construction. Eclihx will inspect environment variables to try to properly set a default path, but you should also know how to change it if you're working with trunk version of haxe. So you should open "Window->Properties" item of main menu and find "haXe(EclihX)->Compiler" page. Change "haXe compiler" according to your haxe installation.


Now suppose you have successfully created a project with the "haXe Project" wizard, filled it with source files and prepared at least one hxml-file with build configuration. To build the project you should create a run configuration:
  1. Open a "Run Configurations..." dialog ("Run->Run Configurations..." in main menu or "Run As->Run Configurations..." in the context menu of the project in one of the explorers views).
  2. Double click on "haxe application" to create a new configuration.
  3. The new configuration with prefix "New_configuration" should be created. You can rename it for a better  multiple configuration management in the workspace.
  4. Click "Select Project..." button to choose a project to build.
  5. If necessary click "Build file..." to choose a desired hxml-file for launching.
  6. Click "Run" to launch created configuration
  7. You can run created configuration with Ctrl+F11 shortcut or from "Run->Run History->You configuration" in the main menu. 


I have described only most significant functions of eclihx in this tutorial and I'm ready to hear your comments about features you'd like to be described in more detail.

Please see the Donation page to know how you can help the project

1-2 of 2