Eclipse Newsletter - Eclipse Builds

May 26, 2015 02:23 PM

In this issue of the newsletter, we will look at how Maven, Tycho, and Gradle can be used from inside Eclipse.

May 26, 2015 02:23 PM

EMF Dos and Don’ts #11

by Maximilian Koegel and Jonas Helming at May 26, 2015 11:47 AM

EMF is a very powerful framework and with power comes…responsibility. You can achieve great things with minimum  effort using EMF, but if something goes wrong, you may also spend hours trying to figure out why. This blog post is part of a series on things you should do and things you should not do when using EMF. You can use the link to the series pilot to navigate to the start and the link below to navigate to the next blog once it is published.

EMF Dos #11: Carefully use EcoreUtil.delete()

This static helper methods is used in many projects, but often causes trouble. Before we talk about potential issues with this method, let us have a look at the JavaDoc to understand, what it is supposed to do:

“Deletes the object from its containing resource and/or its containing object as well as from any other feature that references it within the enclosing resource set, resource, or root object.”

As described before, EMF model instances are typically structured in a tree (containment tree), the root node of this tree is typically a Resource. Removing an EObject from this tree will de-facto delete it. As an example, it will not be serialized anymore. In the following example a call of EcoreUtil.delete() on EObject C will remove the containment reference from A to C. As there is no incoming reference to C anymore, the EObject is deleted.

image02

This sounds simple, but the second part of the description is the critical point. In the following example, C has two incoming references, the containment from A and a cross-reference from B. When deleting C, this cross-reference must also be deleted to keep a consistent model. Otherwise B would hold a dangling reference to an EObject, which is not part of the containment tree and which would not be serialized itself.

image00

For this reason, EcoreUtil.delete() takes care about removing incoming cross-references, too. While this is principally a good thing, it can cause two issues: Cross-References to Children

1. Cross-References to Children

EcoreUtil.delete() will only remove cross-references to the EObject you called the method on, but not its children. In the following example, deleting EObject C will still create a dangling reference from B to D (marked in blue). Only the red references are removed in this case.

image01

For that reason, there is a second method with a boolean parameter: EcoreUtil.delete(EObject toBeDeleted, boolean recursive), which will recursively visit all children of an EObject and remove incoming cross-references on them as well. While this keeps a consistent model, it can exaggerate the next issue.

2. Performance

To understand the potential performance problem of EcoreUtil.delete(), one has to understand how incoming cross-references pointing to the EObject to be deleted are identified. As the cross-references can be uni-directional, there is no efficient way to identify all other EObjects in a model instance, which hold a reference to the EObject to be deleted. That is the reason why all EObjects in the enclosing root EObjects, Resource or even Resource Set are visited and checked, regardless of whether they hold a cross-reference to the object to be deleted. If a cross-reference is found, it is removed. Therefore, the run-time of EcoreUtil.delete() is O(n), while n is the number of EObjects in a model instance. Even worse, this is only the case, if the model is already completely loaded in memory. If parts of the model are not yet loaded, the performance can be much worse, as those parts then need to be loaded during the delete operation. If you only deal with small models, this might never be a problem in your project, but models tend to grow over time.

There are two solutions for this issue. First, uni-directional references should be avoided completely, all references are bi-directional. In this case, you can implement a very efficient delete, as the cross-references can be removed from the side of the tree, which gets deleted (consider sub elements, too!). Second, the creation of a “cross-reference maps” in an additional data structure, which can help to find cross-references more efficiently. The cross-reference adapter, provided by EMF, helps to implement this, as it supports to be notified whenever a cross-references is added or removed. Model repositories such as CDO or EMFStore typically already implement a more efficient delete function like this. In both cases, using bi-directional references only and using cross-reference maps or a repository, you must not use EcoreUtil.delete.

By the way, the Delete Command, offered by the EMF framework shows the same behavior, meaning it searches recursively for cross-references and removes them.


TwitterGoogle+LinkedInFacebook

1 Comment. Tagged with eclipse, emf, eclipse, emf


by Maximilian Koegel and Jonas Helming at May 26, 2015 11:47 AM

EMF-IncQuery: Query Explorer support for EMF Facet Model Browser

by harmathd at May 26, 2015 11:04 AM

The EMF Facet project provides a convenient editor for EMF models called the EMF Facet Model Browser which is a great replacement for the Sample Reflective Ecore Model Editor.

To use it, install the EMF Facet SDK as described here, and open your model with the EMF Facet Model Browser. It provides grouping model elements by type, grouping attribute and reference values by relation, text search and so on. The only downside is that it only works for models which have their metamodel registered, therefore if you are developing a metamodel, you have to launch a runtime Eclipse instance to be able to edit instance models of your metamodel with the Model Browser.

Starting from EMF-IncQuery 1.0M3, you can also load models from this advanced editor to EMF-IncQuery's Query Explorer view for your convenience! The Show location context menu command also works, but only partially: because the EMF Facet Model Browser can only select one element, it selects only the first element of the match.


by harmathd at May 26, 2015 11:04 AM

openHAB 1.7 and 2.0 alpha 2 Release

by Kai Kreuzer (noreply@blogger.com) at May 26, 2015 08:41 AM

The openHAB community is growing rapidly and so does the rate of contributions - it is therefore definitely time for a new release!
We have reached a new all-time record with a total of 160 add-ons (of which 23 are new bindings and 9 new actions) for openHAB 1.7 - you can find the full list of new features and enhancements in the release notes!
Nest Protect
As usual, I would like to highlight a few: First of all, there is support for Nest now - not only for the thermostats, but also for Nest Protect, the smoke detector. So finally Nest can claim that it "works with openHAB" ;-) Being an open and independent platform, when mentioning Nest, there should also be Ecobee - and indeed we have a new binding for this as well.
Another highlight is the Logitech Harmony Hub integration, which is a very popular device to control all of your entertainment racks. The binding supports bi-directional communication with the hub, i.e. it can send commands as well as being informed about actions on the hub, e.g. triggered through a Harmony remote control. Other new entertainment-related bindings are for example the ones for Denon receivers and for Plex. If you own a pool or an alarm system, you might be as well interested in the Autelis and the Satel bindings.



Besides the new bindings, there is another new feature that is targeting the developer-type of users: Besides the Xtext-based rules, it is now possible to write rules in any JSR223-compliant scripting language, like e.g. Jython. This is a really cool feature for people who prefer other languages and didn't get along with the default rule scripting syntax.

openHAB 2.0 alpha 2

So what about openHAB 2 then? Despite the fact that it is still called an alpha release, it has made a huge step forward: Most bugs of the first alpha release have been fixed, so that the runtime is pretty stable meanwhile and already used by a few users in production. One important step was the continued work on the 1.x compatibility layer - more than 30 add-ons of openHAB 1.x have already been reported to work smoothly on the openHAB 2 runtime. Although this is a good number, it still means that less than 20% has been tested so far. So with the alpha 2 release, I would like to encourage all users to test their 1.x add-ons on openHAB 2 - once we have reached 80%, we are ready to go for a first beta.
Auto-discovered devices
Besides backward compatibility, the real highlights of openHAB 2 are of course the new bindings that are already implemented against the Eclipse SmartHome APIs. This is where most efforts took place over the past months; as a result, we have by now almost 20 "new" bindings - besides the intial ones like for Philips Hue, LIFX, Belkin WeMo or Sonos, there is now support for AVM Fritz AHA devices, IPP-printers, eQ-3's MAX! system and more. The great thing about all these new bindings is their ease of setup: All you have to do is to launch the openHAB runtime and available devices are found automatically and ready to be used with a simple click.
Charging a Tesla through openHAB
There is of course one exception to the rule - the new Tesla binding cannot discover your Tesla automatically :-). But besides this limitation, this binding is my personal highlight - it cannot only do the obvious things like reporting the odometer, the location and the battery charging level; no, you can now also honk the horn, adjust the sunroof and activate valet mode on your car - isn't that cool? I am just slightly disappointed that I do not have any testing hardware myself at home... As charging is an important aspect of EVs, the Tesla binding is accompanied by a binding for Keba charging stations.

If you want to have a glance at openHAB 2 yourself, simply download the demo package, which comes with a few useful add-ons so that you should have an easy start.

Mobile Apps

Light and Dark Theme on Android app
I should not forget to mention that with this new release there are also updated versions of the openHAB native apps in the AppStore (review pending) and the PlayStore - these updates also bring many fixes and are compatible with openHAB 2 already. The Android app has been updated to Material design with a choice of a light and a dark theme. Furthermore, it supports already the new discovery and inbox mechanisms of openHAB 2 - more features will follow soon!


by Kai Kreuzer (noreply@blogger.com) at May 26, 2015 08:41 AM

Screenshot of the Week: Missing JRE

by waynebeaton at May 25, 2015 03:29 PM

One of the more frustrating things about Eclipse–at least for some users–is that Eclipse doesn’t come with a Java Runtime Environment (JRE). Since Eclipse is itself a Java application, it needs a JRE to run. The intellectual property rules at Eclipse prevent us from including a JRE with the downloads, so you have to go and install one yourself.

If you try to run Eclipse without having first installed a JRE, you’ll see a message like this:

JRE Needed

The new installer provides a little more help. If you try to launch the installer without having first installed a JRE, you’ll see something like this:

JRE Needed with help

If you click “Yes”, a dialog box will open inviting to you locate a JRE (this would be the right option to use if you know that you have a JRE installed, but it isn’t on the class path).

If you click “No”, your browser will open with some handy links to help you install a JRE:

JRE Links

The list includes both JRE and Java Development Kit (JDK) links. If you’re using Eclipse to do Java development and just want things to work “out of the box”, install a JDK. More advanced users can configure JDKs in the preferences.



by waynebeaton at May 25, 2015 03:29 PM

“Eclipse Rich Client Platform” book – Revised third edition available based on Eclipse 4.4

by Lars Vogel at May 22, 2015 12:04 PM

I’m happy to announce that the revisted third edition of the Eclipse RCP book is available. It has been updated to Eclipse 4.4 and contains lots of small corrections and clarifications. The update resulted in approx. 100 more pages.

Eclipse Rich Client Platform


by Lars Vogel at May 22, 2015 12:04 PM

Unit Testing with scripts in EASE

by Christian Pontesegger (noreply@blogger.com) at May 22, 2015 08:41 AM


In the company I work for we do lots of regression testing, mostly for interface testing of hardware devices. Therefore we needed a unit testbench similar to JUnit without the complexity of writing java code for our tests. So we implemented a simple Unit test framework for EASE.

Source code for this tutorial is available in the EASE scripts repository.

Step 1: Create a simple test script

Create a new Project in your workspace named JavaScript Unit Testing Tutorial. Create a new file Tests/Simple/01 Valid tests.js
// starts a simple test
startTest("empty", "an empty test case");
// ends a test
endTest();

// start another test
startTest("no test code", "a test containing no assertions");
print("Hi from valid test");
endTest();

// third test
startTest("valid assertions", "a test containing valid assertions");
// check
assertTrue(true);
endTest();

// code outside of a testcase
print('"' + getTestFile() + '" completed');
You might ask where these test functions come from as we do not load any modules. The unit test framework comes with a module called Unittest. It is hidden by default but will be loaded automatically when we execute EASE UnitTests. To unhide go to the Preferences/Scripting/Modules (Note: this is not necessary to use the module, it will only display it in UI components).

If you are familiar with unit testing in general you also know assertions and according methods like assertTrue(). In general these methods perform a check for validity. In case an expected result does not match with a current result, an error is generated for the containing test case.

So test cases are encapsulated between a startTest() and an endTest(). It is recommended to not use assertions outside test cases, yet not mandatory.

Step 2: Create and execute a test suite

To execute test files, we need to create a Test Suite, that sets up a test environment for us. Create a new Scripting/Script Testsuite named Testsuite.suite.  The editor will allow you to select test files you want to execute. Therefore we look for script files in the same project where the suite is located.

Select our previously created test file and hit the Run Test Suite button in the top right corner.



 A new view is opened that displays unit test results.



The top tree view reflects the file structure of our test files and displays decorators indicating the test execution result. If you select a test file, detailed results are displayed in the bottom section.

Step 3: Test errors

Create a new file Tests/Simple/02 Test errors.js.
// test containing assertions that fail
startTest("invalid assertions", "a test containing invalid assertions");
assertTrue(true);
assertTrue(false);
assertFalse(true);
assertFalse(false);
endTest();

// manually create a failure
startTest("failure", "test throwing a failure");
failure("test broken, stop execution here");

// an exception would also create a failure
throw new java.lang.Exception("code exception");
endTest();

startTest("never to be reached");
// not being reached as the failure above terminates test file execution
endTest();
Save the test, add it to your suite and run the suite right away. When an assertion fails, error markers are generated on your script files on the according code location. You will also see the most critical assertion reflected in the Script Unit Test view. Double clicking on errors will open the source editor on the corresponding location.



Similar to JUnit there exist two different types of things that can go wrong: errors and failures. Errors are assertions that do not meet their criteria. They are recoverable, meaning script execution of the test file continues.

Failures on the other hand are not recoverable, so script execution of that test file is terminated immediately.

Step 4: Test Suite configuration

Typically tests need to be adapted to a certain environment. In general you do not want test engineers to modify your script code. So the test suite supports setting of Variables that are automatically available in all test files. The Setup section allows to execute arbitrary code on the Test Suite start, Test File start, startTest() call and also for the corresponding teardown sections. As you may provide multiple suite files within a project, these secions are a good place to adapt tests according to your environment.

Optional: Test automation

Often tests need to be executed automatically, eg for a nightly test run. The Unittest module allows to run a testsuite from a script. Together with the headless application from EASE you can run a suite from the commandline and create a report (we currently support the JUnit xml format that can be picked up from Hudson/Jenkins).

Optional: Additional assertions

If you want to provide your own assertion methods, simply create your own module and let your wrapped method return an IAssertion. If you call your method from within a test script it will automatically validate your assertion method.

So why do I want to write scripted tests?

In the company I work for we use these kind of tests for interface verification of hardware devices. Therefore we provide our own modules that allow us to send stimuli and validate expected responses. We also use it in combination with analog measurement devices to verify that certain hardware parameters are within valid ranges.

Currently Script Unit Testing is supported for the Rhino script engine only.

by Christian Pontesegger (noreply@blogger.com) at May 22, 2015 08:41 AM

My favourite free Mac OSX apps

by David Bosschaert (noreply@blogger.com) at May 21, 2015 01:11 PM

I have been a Windows guy for many, many years, starting with Windows 2.x in the late 1980's all the way up to Windows 7. Then, about 4 years ago I gave up. Not because Windows was so bad (I actually quite liked Windows 7) but because at the time I could not find any decent laptop for it! So I got a Mac in 2011. And, over the years I got to like it, especially the hardware. I was always a big fan of opensource and freeware/shareware which was always widely available for Windows. Over the past years a collected some good legal free software for the Mac and I thought I'd share with everyone what I like. The interesting bit here is that most of this stuff is not actually distributed via the Apple Appstore...

Here's my list in no particular order, starting with a bundle of freely available utilities...

Handbrake



Great video converter tool. Convert any videos that you might have into any other format. BTW if you're looking for good settings that give you videos that play/stream on most devices and are relatively modest in size, I use the following settings (everything not mentioned is left at default):
  • Format: MP4, Web Optimized
  • Picture: Size: source = destination, Cropping: automatic, Anamorphic: none, Filters: all off
  • Video: Codec: H.264, FPS: Same as source-variable, Quality: RF 22, Use Advanced Options
  • Audio: AAC Stereo, Samplerate auto, Bitrate 128
  • Advanced: Reference Frames: 6, CABAC Entropy Encoding: yes, 8x8 transform: yes, Weighted P-Frames: yes, Subpixel ME & Mode: 2  SATD qpel, Trellis: off, No DCT Decimation: off.
Download from http://handbrake.fr.

VLC

The video player that plays everything. If you install the right drivers it can even play Blu Ray discs, something the native DVD player on OSX cannot do. Download from http://www.videolan.org/vlc.

Kodi


Previously called XBMC. Another media player. This one is really good for streaming over the network and has tons of plugins. You can also create a catalog that runs on a central server and stream that to all the devices in your house, for example. I wrote some details on how I use my Raspberry PI as such a media server here: http://coderthoughts.blogspot.com/2014/01/how-i-learned-to-stop-worrying-about.html. Download from http://kodi.tv.

BetterTouchTool

This tool has a lot of features for the touchpad, but the main reason why I use it is not on the touchpad. I don't like the click feature of the touchpad, the fact that you have to press the touchpad itself. I prefer pressing a button to act as a mouseclick. On my UK keyboard there is a key that I never use, just above the TAB key there is a key with the § sign. The above screenshot shows how I used the BetterTouchTool to remap that key to be the mouseclick. I still use the trackpad to position my mouse, but no need to press it down, I do that with my other hand by pressing that mapped key. Download from here: http://blog.boastr.net
BetterTouchTool also has Windows 7-like window snapping functionality, which is really handy too. Although I personally use Breeze for that, which has more features in this area. It's not a free tool so it doesn't belong in this list, but its very cheap so worth checking out :)

Flycut

This is a very handy little tool, that simply extends the clipboard with a history of up to 25 entries. Instead of cmd-V, use shift-cmd-V to cycle through all your past clipboard contents. Extremely useful. This one is free on the apple appstore: https://itunes.apple.com/ie/app/flycut-clipboard-manager/id442160987?mt=12.

Zipeg

This is a free WinZip-like tool for the Mac. It doesn't have as many features as WinZip, but I tend to find it very good for quickly peeking in a .zip or .jar file. And the program icon is just really cute! Download from: http://www.zipeg.com.

MacVim

I'm a VIM guy and this Mac version is really good! Download from https://code.google.com/p/macvim.

KeePassX

I'm relatively new to password management software but the recent vulnerabilities and attacks made me move to it. I'm a bit weary of storing my passwords in a cloud-based solution. I'd rather have a local file that's properly encrypted, so that it doesn't matter who actually sees that raw file. I also want something that automatically works with web browsers so that passwords are automatically entered. KeePass is a great Windows-based app that does all that. There's an Android version (KeePassDroid) that even works on my BlackBerry Z10. And there are Chrome (chromeIPass) and Firefox (PassIFox) integrations with the KeePass HTTP server that seamlessly enter your passwords in the appropriate websites if you approve this action.
There are a number of opensource projects to get this working on the Mac too. However, they seem to be in various stages of incompleteness. There is the KeePassX project, but it doesn't have support for the HTTP server (yet) that you need to integrate with the browser. There is a new project called MacPass which is another KeePass clone, but it also doesn't support the HTTP server (yet). Some people use Mono to run the Windows KeePass on OSX, but I found that not very satisfying and at some point it just started crashing continuously. In the end I found Keith Bennett's fork of KeePassX 2.0Alpha5 that has HTTP server support. The UI is a bit buggy, but it's the best I could find in the opensource arena for password management on OSX, so this is what I'm using right now. Looking forward to having a more stable version of KeePass on the Mac with HTTP server support.

PDF Split and Merge

I love PDFs :) (hey I work for Adobe). And there are tons of tools available for creating PDFs both from Adobe and from other vendors. PDFSam is a really nice little tool that helps you work with PDFs once they are created. Rearrange pages, split chapters off, merge multiple PDFs together, that kind of thing. I find myself using this tool pretty often. You can get it from here: http://www.pdfsam.org.

OSX Screen Saver runner

Ok, should maybe not be in this list, because it's not freeware or opensource, as it's shipped as part of OSX itself but it's free in that everyone who has OSX already has it, but you may not be aware of its existence. This is just a really simple way to lock your screen, if you need to walk away from your computer, for example. You simply find it on your local disk at /System/Library/Frameworks/ScreenSaver.framework/Versions/A/Resources/ScreenSaverEngine.app
and I normally have it locked to my dock, so I can just click it to lock my screen.

Applications

There are also a few larger applications where I think there are some great opensource products available that I use on a daily basis.

Openoffice / Libreoffice

Personally I prefer this office suite to the commercial ones available. Great features, great usability and it works on all the platforms that I use outside of OSX, including Linux. Download from https://www.openoffice.org.

Thunderbird and Firefox


These two need no further introduction. Just an excellent webbrowser and a great email client. Get them at https://www.mozilla.org.

Eclipse

Still the best IDE around for Java and other programming languages. Available from http://www.eclipse.org.

That's it - these are my favourite opensource / freeware / shareware apps that I use all the time. Enjoy :)

by David Bosschaert (noreply@blogger.com) at May 21, 2015 01:11 PM

Code editors in general with JavaFX

by Tom Schindl at May 20, 2015 11:17 AM

Yesterday I did a short demo on how one can build code editors with JavaFX while the talk was at Xtextcon most information apply to any code editor you may want to develop with the runtime components developed as part of e(fx)clipse.

I’ve uploaded the slides to slideshare

The important point is that all this is plain Java! No OSGi involved so eg the Java-Sample I showed looks like this:

public class SampleJavaCode extends Application {
  private final static String[] LEGAL_CONTENT_TYPES = new String[] { 
    IJavaPartitions.JAVA_DOC,
    IJavaPartitions.JAVA_MULTI_LINE_COMMENT, 
    IJavaPartitions.JAVA_SINGLE_LINE_COMMENT,
    IJavaPartitions.JAVA_STRING, IJavaPartitions.JAVA_CHARACTER };

  private int count = 0;

  @Override
  public void start(Stage primaryStage) throws Exception {
    BorderPane container = new BorderPane();
    Document document = new Document();
    document.set(
      Util.getFileContent(getClass().getClassLoader().getResource("Sample_big.txt").toURI()));

    JavaSourceConfiguration configuration = new JavaSourceConfiguration();

    SourceViewer viewer = new SourceViewer();

    FastPartitioner partitioner = new FastPartitioner(new FastJavaPartitionScanner(), LEGAL_CONTENT_TYPES);
    document.setDocumentPartitioner(configuration.getConfiguredDocumentPartitioning(viewer), partitioner);
    partitioner.connect(document);

    viewer.configure(configuration);
    viewer.setDocument(document);
    container.setCenter(viewer.getTextWidget());

    Scene s = new Scene(container);
    s.getStylesheets().add(getClass().getResource("dark.css").toExternalForm());
    primaryStage.setScene(s);
    primaryStage.show();
  }

  public static void main(String[] args) {
    Application.launch(args);
  }
}

and looks like this:

bright.css:
blog_screen1

dark.css:
blog_screen2

All sources for the stuff I presented are available in the e(fx)clipse git repository – watch out for projects starting with “org.eclipse.fx.xtext”.



by Tom Schindl at May 20, 2015 11:17 AM

My Journey to Mars, Eclipse Mars

by Doug Schaefer at May 18, 2015 06:05 PM

Wow, Eclipse Mars is almost finished and it’s been very busy for me and those I’ve been working with. We have a lot of exciting new features coming and I can’t wait to get them into the community’s hands and see where they take them.

I’m going to write more over the next few weeks on each of these, but I thought I’d give an overview of what you can expect for Mars. They all stem from a common theme, make Eclipse easier to use and lower the barrier to entry for new users, especially those writing C and C++ as a hobby, the new breed of hobbyist computer engineers using $10 computers to build amazing electronics projects. New users mean a growing and vibrant community.

Here are the highlights.

Serial Port Library

CDT has a pretty interesting native library that provides interfaces to native tools that the Java run-time doesn’t. This includes a Process subclass called Spawner that can send Unix signals, a Pseudo TTY interface (PTY) that can be used to set up terminal like interfaces to processes, and access to the Windows Registry.

One thing that is really common with these new $10 computers, especially the microcontrollers like Arduino is that you need to connect to them with a serial port to see what’s going on. For whatever reason, the serial port libraries out in the open were all GPL/LGPL and the main one, rxtx, has disappeared. Serial port programming isn’t rocket science, so I wrote my own library and added it to the CDT native feature. My first use is with the Arduino CDT covered below.

Remote Target Management

As I was building the LaunchBar (coming up next), I needed a way for the user to select which system to launch on. I made one that was pretty simple that adapted the targets such as those we were using for QNX and BlackBerry. I then started adding features, like a View to interact with the targets and then thought about a services architecture that would add command shells, remote launching, remote file access, i.e., a full blown target management system.

Well, that reminded me of Greg Watson (from PTP fame)’s talk from a few years ago about the fact we have too many target management systems, and none of them do everything we need. So he started one that does. I decided instead of writing my own, I’d add my vision to Greg’s and come up with an uber flexible, services oriented target management system. The beauty is that it’s easy to adapt to any existing TM system. And we’ll continue to build out features and make it a suitable replacement for RSE in upcoming releases.

Screen Shot 2015-05-18 at 1.56.06 PM

The LaunchBar

The LaunchBar has been the focus of my team at QNX’s efforts to fix up one of the biggest usability issues we see with Eclipse, the whole mechanism to launch the applications you’re building with the IDE. There’s been some work to improve that over the years, such as the launch shortcuts, but frankly, other IDEs do a much better job at this.

We felt it was important for the user to know exactly what was going to happen when they hit the run button. And that’s accomplished by showing the current selection, i.e. What you’re going to launch, Where you’re going to launch it to, and How you’re going to launch it. How is simply the launch modes we’ve had in the past but make more accessible. The Where relates to my work with the Remote TM system. In this day with embedded targets and cloud servers, we’re often building software that’s going to run somewhere else than our desktops.

The most important aspect what helping the user define What they’re going to launch. And really, my objective here was to make it so that the user never needs to go the the launch configuration dialog for the most common cases. To help with that, we have an automated system the populates potential What’s. By default, launch configurations are a What, obviously, and that makes the launch bar usable with existing launch configurations. But the system is flexible, and What’s can be anything, for example, Arduino projects.

Screen Shot 2015-05-18 at 2.00.03 PM

Arduino C++ IDE

My first foray into the hobbyist computer engineer world was with Arduino. I bought an Arduino Uno and built a little system with a sensor and a wifi shield that was a kind of Internet of Thing. But after years of using professional IDEs, the last many being Eclipse, I wasn’t very excited about the standard Arduino IDE. Also, Arduino programming is done through this language called Wiring which, come on!, it’s so close to C++, why not teach hobbyists those last two or three concepts and “Program Your Arduino in C++ Like a Pro”.

And, hey, I know this great C++ IDE they can use. So, and this is the self serving part, I set out to build an integration for the Arduino toolchain for CDT. And it turned out pretty nice and I enjoy using it for my Arduino projects. And as a bonus, I get to use the same IDE, hell, same workspace, to program the server side of my Internet of Thing project. For me, that has always been the promise of Eclipse: One IDE to rule them all!

I have the plug-ins in CDT and they’ll be coming out in Mars. It’s really only a preview at the moment and you’ll need to have the standard Arduino IDE installed for it to work. As I was wrapping up the Mars work, Arduino released their 1.6 version and with it and pretty nifty library and BSP management system with an open data format. I plan on adding support for that system to the Arduino CDT plug-ins as well and that should eliminate the need to install the Arduino IDE if you so desire.

The Journey Continues

As I mentioned, I’ll write a lot more about these features in the upcoming weeks. It’s going to be hard to try them without a little documentation and that will come here on my blog for now until things mature. There’s a lot more ahead as I get feedback from the community and people try to use these things in different configurations. I already have great feedback from the Red Hat JBoss guys who are trying to use the LaunchBar for WTP that’s resulted in a pretty big last minute change. But this stuff is only successful if people use it and contribute back so I’m more than willing to listen.

Also my journey into the computer engineer hobbyist world continues beyond Arduino. I have a Raspberry Pi B and I have been able to build an ARMv6 hardware float toolchain for it. We’ll likely make this the first official embedded target support provided by the CDT as an example for the embedded vendors to follow. We should have done that a long time ago.

I’ve also just purchased a couple of ESP8266 chips. They’re little microcontrollers inside a wifi chip with a healthy number of GPIO pins, all for $10 or less. The Chinese company that makes them has put out a pretty good SDK and the toolchain is again standard GCC. I need a CDT integration for these too :).

I mentioned in my note about EclipseCon that I think this is probably the most exciting time to be in the Eclipse community since they early days. So many new features and great work being done by a diverse team of really smart people has breathed some much needed new life into our favourite IDE.


by Doug Schaefer at May 18, 2015 06:05 PM

Eclipse DemoCamp “Mars” Vienna

by Florian Pirchner at May 18, 2015 10:32 AM

Lunifera GmbH and IoT-Vienna are organizing the Eclipse-DemoCampMars” on 19.6 2015.

With this event, we want to bring people and companies together to share their knowledge, experience with and about Eclipse. This meeting includes six Talks and a quick intro on the Eclipse Foundation’s role by Benjamin Cabé.

Speakers

  • Tom Schindl: Something cool TBD
  • Werner Keil: Energie Sparen präzise Messwerte bei SmartHome und SmartGrid
  • Philip Langer: EMF Compare
  • Benjamin Cabé: IoT Talk
  • Florian Pirchner: OSGi-IoT-Vaadin

We also provide catering, drinks, beer and cakes as usual.

For details please visit http://edcvienna.org/#home

Hope to see you at the DemoCamp “Mars” Vienna…

Best,
the DemoCamp organizers



by Florian Pirchner at May 18, 2015 10:32 AM

Shared blog for EclipseSource Munich

by Jonas Helming at May 18, 2015 10:29 AM

As Maximilian already announced on his Blog: To make it simpler for you to follow our blog posts from EclipseSource Munich we will now use a joint blog for all topics related to our work in Munich. This means there will be less posts that appear on my blog since I will post many things on the new Blog. All posts on the new blog are announced on the Twitter Account and Google+ page, see details below:

New Blog: http://eclipsesource.com/blogs/author/helmingkoegel

Twitter: https://twitter.com/EclipseSourceM

Google+: https://plus.google.com/105940428433807258305/posts

See you on the new blog!


TwitterGoogle+LinkedInFacebook

Leave a Comment


by Jonas Helming at May 18, 2015 10:29 AM

EMF Forms: Beyond SWT

by Maximilian Koegel and Jonas Helming at May 18, 2015 09:33 AM

EMF Forms makes it really simple to create forms to edit your data based on an EMF model. We have recently released EMF Forms 1.5.0. To get started with EMF Forms please refer to our tutorial.

Besides saving a lot of effort when comparing to manual UI development, EMF Forms provides an additional benefit for free: UI technology independance. EMF Forms uses a technology independent language to describe the UI (View model). This model is interpreted by a rendering component to create a UI during runtime. By enhancing or replacing the existing renderer, the UI can be adapted to project specific needs. The default renderer are written in SWT, however, it is fairly simple, to develop a renderer in another UI technology and thereby migrate all existing form-based UIs.

For 1.5.x, we have spent efforts to make the implementation of new renderers as simple as possible and we are happy that the number of supported UI technologies is growing.

Since the last release cycle (1.5.x), there is even an external contribution to EMF Forms providing a Vaadin rendering component that translates a View model to a form-based UI in Vaadin. This new renderer is also under active development

Additionally, we are working on a web renderer based on AngularJS. Please refer here for a complete list of available technologies and how to use them. The link also contains a new tutorial for how to use the available renderers.

If you miss a supported technology or if you are interested in one of the renderers under development, please contact us.

 

 image03  image05  image00
JavaFX

Android (using Tabris)

 image04  image01
 image05

Browser (using RAP)

Browser (using AngularJS) Browser (using Vaadin)


TwitterGoogle+LinkedInFacebook

Leave a Comment. Tagged with eclipse, emf, emfcp, emfforms, eclipse, emf, emfcp, emfforms


by Maximilian Koegel and Jonas Helming at May 18, 2015 09:33 AM

EclipseCon France - Early registration deadline

May 17, 2015 02:23 PM

The early registration deadline is May 26. Register now!

May 17, 2015 02:23 PM

Great Fix Winners, Round Three

May 17, 2015 02:22 PM

Here are the final winners for the Great Fix. Thank you to everyone who contributed!

May 17, 2015 02:22 PM

Honored to become Eclipse PDE committer

by Lars Vogel at May 13, 2015 12:11 PM

I’m happy to announce that I was elected as PDE committer. This made the integration of the new png icons in PDE much easier. I plan to work on the PDE templates and improve the PDE tooling for the IDE and PDE extensions in the Eclipse Neon release.


by Lars Vogel at May 13, 2015 12:11 PM

Unravelling the container within the container within the container…

by Melanie Bats at May 13, 2015 07:12 AM

Last time in the Sirius blog post series, you learned how to create an artificial container, today we will see how to create an infinite hierarchy of containers.

As an example we will represent the different dream levels featured in Inception :

We need to model dream levels and that levels can refer to other sub levels :

We develop a first Flat representation to show all the levels at the same stage :

A Flat diagram is created and a Level container is defined to represent all the levels defined in the model :

Thanks to this representation we see all the different dreams but it is not possible to understand how they are interlinked.

Next step we create a SubLevel diagram to represent the first three dream levels :

A first container Level represents the reality, then we represent the second dream level thanks to the SubLevel container and finally the third level with another container named SubSubLevel.

For each container we retrieve the child level thanks to the levels feature defined in the metamodel. For each level container we define a new style.

The following SubLevel diagram results:

Defining for each level a new mapping and a new style is really painful and it determines the number of levels you can create. Fortunately, Sirius can help us to define an infinite hierarchy of elements.

Reuse mappings

We create a new Inception diagram as we did before, we define again a Level container to represent the initial level and then a SubLevel mapping models the second level.

At this point we are able to represent only the first two levels. To get an infinite hierarchy of levels, we need to set in the Import tab, the Reused Container Mappings field and select the SubLevel mapping. This means that the SubLevel mapping could define as descendant other SubLevel mappings. Here we reuse a mapping defined elsewhere in the VSM using the Reused Mappings property in the Import category. The effect at runtime is the same as if you had created an equivalent mapping inside the parent mapping.

We create a new Inception diagram and…It’s working like a dream! We see all the levels hierarchy.

Pay attention, as this method uses recursion, if you set the semantic candidates expression to eAllContents a stack overflow exception will occur.

Last point, using this method we need to define the style for the first level and then we set the same style values to the sublevel mapping in order that all the levels appears with the same look.

With Sirius you can define the level style just once.

Import mappings

A last Inception2 diagram is defined, with a Level2 mapping which is an exact copy of the previous Level mapping. We define also a style for this mapping.
Then instead of creating a New Diagram Element as we did in the previous diagram definition, this time we create a New Import Element.

The Semantic Candidates Expression is set to feature:levels

And in the Import tab, we set the Imported Mapping to Level2. This means that this new mapping reuses the style defined by the imported mapping.

The mapping imports are used to specialize an already defined mapping. In our example we override the Semantic Candidates Expression.
To get an infinite hierarchy of levels, we set again the Reused Container Mapping field to SubLevel2.

Then in this diagram definition the level style is defined just once:

If we create an Inception2 diagram we obtain exactly the same result as before :

With Sirius, make your dreaming designer come true!

The sample code from this example is available on github: https://github.com/mbats/sirius-blog/tree/master/reimport

 


by Melanie Bats at May 13, 2015 07:12 AM

Running Eclipse Mosquitto on Snappy Ubuntu Core

by Benjamin Cabé at May 11, 2015 10:34 PM

I’ve recently been playing around with Snappy Ubuntu Core, and I thought it would be a nice exercise to try and package Mosquitto as a so-called “Snap”.

This blog post will give you a quick introduction to Snappy, and what it means to have a technology like Mosquitto available as a snap package.

Snappy Ubuntu Core

snappy

Ubuntu Core is a minimal Ubuntu distribution, that doesn’t come with the classical, APT-based, package manager.
Ubuntu Core is targeting cloud & IoT environments, therefore it is using an approach where the applications or services that one installs in a given distro, are self-contained “snaps”, that are completely isolated from the rest of the environment. If a snap depends on a shared library, this library will be bundled with the snap. If a snap needs to be granted rights beyond the scope of their default sandboxed container, it will be specified in the snap metadata. And so on.

Why does it matter for the Internet of Things?

Being able to transactionally update a system definitely makes sense for cloud environments, but it is also key for Internet of Things solutions. Even more so if you take into account how easy it is to fire up a new EC2 machine for a system you just crashed, vs. actually going on the field to troubleshoot an IoT gateway that went off the network after a failed update…

Furthermore, IoT gateways today are operating a very limited set of services, since there’s no clean and safe way to really turn them into extensible platforms, where any partner involved in developing a given solution would be able to run its own bits, in dedicated sandboxes. Application frameworks like Kura certainly enable such things at the application level, but we need solutions like Ubuntu Core for anything closer to the system.

Mosquitto on Snappy Ubuntu Core

If you have ever played with MQTT, there’s a good chance that you have used Eclipse Mosquitto as your broker. It is a very customizable, feature-packed, broker that has recently added support for MQTT over WebSockets. Mosquitto is available in source form, but it is also distributed in binary form and as a ready-to-use package in many Linux distros.

The Mosquitto Snappy package contains a WebSockets-ready version of Mosquitto 1.4.2 that can run on x64 or ARM architectures. Therefore, you are literally 2 minutes away from having an up-and-running Mosquitto broker on Microsoft Azure, Amazon EC2, or Google Compute Engine. Since Ubuntu Core is also available for the Raspberry Pi and the BeagleBone Black, you can install Mosquitto on those platform as well.

If you want to try it yourself on EC2, for example, you can follow this tutorial to bootstrap your Ubuntu Core image. Once you have a shell access to your Core server, simply run sudo snappy install mosquitto.kartben, and Mosquitto will be automatically downloaded from the Ubuntu Software Store, and installed. WebSockets are enabled on port 8080 and as a matter of fact, I have also packaged a few extra resources with the broker to help you get started: if you open http://{myubuntucoreIP}:8080 in your browser, you will be granted with a web page that helps making sure you use the right connection settings, and also with a live visualization of your topics’ activity.

screenshot


by Benjamin Cabé at May 11, 2015 10:34 PM

Using JYZ3D (and JOGL) in Eclipse RCP

by Maarten Meijer (noreply@blogger.com) at May 11, 2015 10:18 PM

As part of evaluating several 3D charting packages for use in Eclipse RCP Applications I needed to get JYZ3D (http://www.jyz3d.org) working on OSX.

Jzy3d is an open source java library that allows to easily draw 3d scientific data: surfaces, scatter plots, bar charts, and lot of other 3d primitives. The API provides support for rich interactive charts, with colorbars, tooltips and overlays. Axis and chart layout can be fully customized and enhanced. Relying on JOGL 2, you can easily deploy native OpenGL charts on Windows, Unix, MacOs (...) and integrate into Swing, AWT, or SWT. Various contributions have also made Jzy3d available for other languages/platforms such as Scala, Groovy, and Matlab.

JYZ3D is described as suitable for RCP but it requires some setup. I describe the process below in order to help others get results quicker.

First attempt

Using libraries in RCP requires packaging them in bundles and adding an OSGi MANIFEST so that they can be properly located as dependencies. As JYZ3D requires JOGL (http://jogamp.org/jogl/www/) I looked for ways to install JOGL easily on RCP, by converting it to a bundle. I found the tutorial by Wade Walker from 2010 that can easily be adapted to the latest version of JOGL meaning 2.3.1.

The first attempt resulted in a Exception: java.lang.UnsatisfiedLinkError: Can't load library: /System/Library/Frameworks/gluegen-rt.Framework/gluegen-rt

UnsatisfiedLinkError

As JOGL uses some interesting class loader tricks, the main library requires an Activator to insert some extra logic on start up using JarUtil.setResolver().

The resulting Activator.java is as follows:


package jogamp.osgi;

import java.io.IOException;
import java.net.URL;

import jogamp.nativewindow.Debug;

import org.eclipse.core.runtime.FileLocator;
import org.eclipse.swt.awt.SWT_AWT;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;

import com.jogamp.common.util.JarUtil;

/**
* The activator class controls the plug-in life cycle
*/
public class Activator extends AbstractUIPlugin {

// The shared instance
private static Activator plugin;

/**
* Returns the shared instance
*
* @return the shared instance
*/
public static Activator getDefault() {
return plugin;
}

/**
* The constructor
*/
public Activator() {
}
@Override
public void start(BundleContext context) throws Exception {
super.start(context);
JarUtil.setResolver(new JarUtil.Resolver() {
@Override
public URL resolve(URL url) {
try {
// System.out.println("before resolution: " + url.toString());
URL after = FileLocator.resolve(url);
// System.out.println("after resolution: " + after.toString());
return (after);
} catch (IOException ioexception) {
return (url);
}
}
});
plugin = this;
}

@Override
public void stop(BundleContext context) throws Exception {
plugin = null;
super.stop(context);
}

}

There was a change in the native code library naming conventions from Java 6 to Java 7 so you must unpack the *macosx-universal jars (jogl and gluegen), duplicate al *.jnilib files to *.dylib files and repack into the jars.

Once you have done this you can run Wade Walker's example view code.

JOGL Demo Wade WalkerI then downloaded jars for JZY3D 0.9.1 from Maven and created a bundle using Create Bundle from jar.

The result was a lot of errors about package javax.media.opengl not being found. JXY3D relies on a much older version of JOGL and despite it being a 2.x.x. version there is definitely a compatibility break here. So much for the adoption of proper semantic versioning.

Second attempt

I downloaded the source for JXY3D from GitHub from https://github.com/jzy3d/jzy3d-api importing them as Maven projects (important step) and built the jars as Maven projects.

These depend on a newer version of JOGL (2.1.5-01) but having learned my lesson about version compatibility I created new JOGL Library plugin using the jars for version 2.1.5-01. I downloaded these from Maven Central. Again fix the native library naming issue for macosx-universal versions.

The mechanism for finding the natives changes between JOGL versions, so here the solution is to put all native jars into the same bundle as the main library. Again add the above bundle activator, and, as this is a bundle with native jars in the root, add the bin/ folder with the Activator to the class path.

classpath

The final error purely on OSX was org.eclipse.swt.SWTError: Not implemented java.lang.ClassNotFoundException: apple.awt.CEmbeddedFrame>This can be solved using the magic found on stackoverflow: SWT_AWT.embeddedFrameClass = "sun.lwawt.macosx.CViewEmbeddedFrame";

The final Activator.java is as follows:


package jogamp.osgi;

import java.io.IOException;
import java.net.URL;

import jogamp.nativewindow.Debug;

import org.eclipse.core.runtime.FileLocator;
import org.eclipse.swt.awt.SWT_AWT;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;

import com.jogamp.common.util.JarUtil;

/**
* The activator class controls the plug-in life cycle
*/
public class Activator extends AbstractUIPlugin {

// The shared instance
private static Activator plugin;

/**
* Returns the shared instance
*
* @return the shared instance
*/
public static Activator getDefault() {
return plugin;
}

/**
* The constructor
*/
public Activator() {
}
@Override
public void start(BundleContext context) throws Exception {
super.start(context);
if ("Mac OS X".equals(System.getProperty("os.name"))) {
System.out.println("Set SWT_AWT.embeddedFrameClass");
SWT_AWT.embeddedFrameClass = "sun.lwawt.macosx.CViewEmbeddedFrame";
}
JarUtil.setResolver(new JarUtil.Resolver() {
@Override
public URL resolve(URL url) {
try {
// System.out.println("before resolution: " + url.toString());
URL after = FileLocator.resolve(url);
// System.out.println("after resolution: " + after.toString());
return (after);
} catch (IOException ioexception) {
return (url);
}
}
});
plugin = this;
}

@Override
public void stop(BundleContext context) throws Exception {
plugin = null;
super.stop(context);
}

}

And then I can also run the example code for JYZ3D.

JYZ3D demo

Lessons

  • Don't assume that everybody uses semantic versioning.
  • Be grateful for the people who take the time to answer questions on StackOverflow.

by Maarten Meijer (noreply@blogger.com) at May 11, 2015 10:18 PM

Welcome Dirk Fauth as a new eclipse.platform.ui Committer

by Lars Vogel at May 11, 2015 07:07 PM

I would like to welcome Dirk Fauth as new platform.ui committer. Dirk is the project lead of NatTable project and a very active contributor to several Eclipse projects. Dirk recently also won the Greatfix price and has indicated that he plans actively review contributions from the community via Gerrit.

Welcome Dirk!

See the message on the platform.ui mailing list.


by Lars Vogel at May 11, 2015 07:07 PM