JetBrains Lockin: We Told You So

by Mike Milinkovich at September 04, 2015 03:02 PM

The news this morning that JetBrains is switching to a subscription-only model is a perfect example of why and how trusting a proprietary tools vendor leaves you and your business exposed to the whims of their profit margins. Make no mistake: this is motivated by what’s good for their business, not what is good for the developer community. Even if JetBrains backpedals on this decision, it is a lesson worth learning.

Eclipse is the only truly community-based tooling platform. We are 100% open source from top to bottom. There is no “Community Edition”. It’s all open source. We are not beholden to any vendor’s agenda.

We are well aware that IntelliJ is a great product. We are also aware that Eclipse has not been moving forward as quickly as we would have liked this last few years. But we are actively working to change things, and you — the developer community — can help. First of all, the Eclipse platform is now a truly open and community-driven project. Your time and code contributions will be welcomed. Also, we recently announced that 100% of all personal donations will be directed to funding Eclipse enhancements. So you can help in your personal capacity by donating even a fraction of JetBrain’s subscription fees to Eclipse. Just as importantly, we will take directed corporate donations to fund Eclipse enhancements as well. Is there a couple of missing features that is slowing down your company’s use of Eclipse? We can fix those for a fraction of what JetBrains wants to extract from your employer.

Eclipse is a true free and open source software community, focused on the needs of developers everywhere. Let’s use this opportunity to re-invest in it so that it is the tool that you want to use every day. For free. Now and forever.


Filed under: Foundation

by Mike Milinkovich at September 04, 2015 03:02 PM

e(fx)clipse 2.1.0 released

by Tom Schindl at September 04, 2015 12:16 PM

I’m happy to announce that e(fx)clipse 2.1.0 has been released today and it has a heap of new features and bugfixes (in total 49 tickets have been resolved).

The project

Starting with this release I’d like to publicly document the amount of time we spend on the project. For this 2.1.0 we spend ~150 work hours and another ~60 private hours. So if you appreciate all this we certainly welcome all donations.

In the next release cycle we’ll also setup bug bounties for often requested features like Min/Max support or detach through DnD. In case you miss something don’t be shy get in touch with us.

Where do you get it

  • Tooling:
  • Runtime:
  • Core libraries published on maven central

    As many of our components don’t require to run in an OSGi-Environment and can be used in any application we started to publish them on maven-central.

    • Eclipse Platform
      • com.ibm.icu.base
      • org.eclipse.e4.core.di.annotations
      • org.eclipse.equinox.common
      • org.eclipse.jdt.annotation
    • e(fx)clipse
      • org.eclipse.text
      • org.eclipse.fx.core
      • org.eclipse.fx.ui.panes
      • org.eclipse.fx.ui.animation
      • org.eclipse.fx.ui.controls
      • org.eclipse.fx.core.di
      • org.eclipse.fx.text
      • org.eclipse.fx.text.ui
      • org.eclipse.fx.code.editor
      • org.eclipse.fx.code.editor.fx

    Smart Code editing

    If you follow this blog regularly it should not be a surprise that one of the main working areas has been to extract components from our research projects and make them available as loosely coupled components allowing one to implement code editors in a very simple way (nothing is bound to OSGi and e4!).

    simply-code

    We ship lexical highlighters you can use in your own applications for the following languages by default:

    • go
    • dart
    • groovy
    • java
    • js
    • kotlin
    • php
    • python
    • rust
    • swift
    • xml

    In case you are interested in using the APIs there’s a series of blogs who introduce the APIs and the tooling who makes it very easy for you to develop an editor for your favorite language or DSL:

    and more blogs on this topic will follow soon. Finally it is important to understand that all the code editing APIs are declared as provisional because we need to get feedback from adopters and maybe adjust them here and there.

    New APIs

    There’s a bunch of new APIs available and I won’t describe all of them but the most interesting are:

    @Preference / Value

    While there’s a preference annotation in the e4 platform we ship our own one because the current implementation available from the platform is not working the way we expect you to develop components (hint: we expect you to write components without any dependency on OSGi and eclipse platform APIs).

    Usage is straight forward:

    import org.eclipse.fx.core.preferences.Preference;
    import org.eclipse.fx.core.preferences.Value;
     
    class MyComponent {
      @Inject
      @Preference(key="myStringPrefValue")
      Value<String> sValue;
     
      @Inject
      @Preference(key="myIntegerPrefValue")
      Value<Integer> iValue;
    }
    

    And because the the annotation can make use of the adapter services who are part of the core platform you can exchange Value through javafx.beans.property.Property<T>. Read more at the wiki.

    EventBus

    A similar problem you face with publishing preferences or context values is to publish informations on the IEventBroker who has a compile time dependency on the OSGi-Event-Interface.

    Starting with 2.1.0 we provide our own simple EventBus-API you can use instead of the IEventBroker when publishing events. In an e4 application we simply wrap the IEventBroker and none OSGi users we provide a default implementation org.eclipse.fx.core.event.SimpleEventBus.

    Usage is straight forward

    import static org.eclipse.fx.core.event.EventBus.data;
    
    class MyComponent {
      private final EventBus bus;
    
      @Inject
      public MyComponent(EventBus bus) {
        this.bus = bus;
        this.bus.subscribe( "my/app/config/changed", 
          e -> { handleConfigChange(e.getData()) } );
        // or for the cool kids
        this.bus.subscribe( "my/app/config/changed", 
          data(this::handleConfigChange) );
      }
    
      public void publishSelection(Person p) {
        bus.publish("my/app/person/changed", p, true);
      }
    
      public void handleConfigChange(Config c) {
        // ...
      }
    
    }
    

    Adornment Graphics Node

    While a similar API has been / is available as part of the e(fx)clipse e4 APIs we introduce in 2.1.0 a very similar on as part of our controls component so it can be used by none OSGi applications as well.

    For those who ask themselves what adornments are good for the following screenshot of the dart code editor might help

    adornment

    The graphics shown in next to the bottom entry is not a single image but made up from

    • methpub_obj
    • property

    Usage is straight forward:

    Image b = new Image(getClass().getResource("methpub_obj.png").toExternalForm());
    Image p = new Image(getClass().getResource("property.png").toExternalForm());
    
    AdornedGraphicNode node = new AdornedGraphicNode( b, 
      Adornment.create(Location.LEFT_TOP, p) );
    


by Tom Schindl at September 04, 2015 12:16 PM

Create your Project Import Set up at the EclipseCon Europe Hackathon

by waynebeaton at September 04, 2015 03:40 AM

Eclipse Mars has this great new feature that you may have missed: the Oomph Project Importer will configure your Eclipse workspace with everything you need to hit the ground running quickly.

Oomph Project Importer

You can open this by selecting the Projects into Workspace importer via the File > Import… menu. The importer will guide you through the process of cloning Git/Gerrit repositories, constructing build targets, pulling tasks into Mylyn, and adding required plug-ins. In short, it will build a complete ready-to-get-started-coding environment with minimal effort in a matter of minutes.

Creating and maintaining an Oomph set up is critical if you want to lower the entry barriers for your potential contributors. You can also create set ups for your internal projects: get new employees up and running quickly!

But how to do create a set up for your project?

Step one: register for EclipseCon Europe

Step two: attend Eike Stepper and Ed Merk’s, Oomph: Eclipse the Way You Want It tutorial on Tuesday morning.

Step three: drop by the Hackathon area during designated office hours and get help to build your set up directly from the masters themselves.

If you want to learn more about Oomph and project set ups, there’s lot of useful information in the Eclipsepedia wiki.



by waynebeaton at September 04, 2015 03:40 AM

Exposing an OSGi Service as a REST Service

by Scott Lewis (noreply@blogger.com) at September 03, 2015 09:42 PM

In a previous tutorial I showed how to use ECF Remote Services and Jax-RS client technology to import and consume/use a REST service.

In more recent companion tutorial, I show how to use ECF Remote Services and Jax-RS server technology to export an OSGi service as a REST service.

Together, these tutorials show the use of ECF Remote Services and Jax-RS standards to easily but flexibly create, export, import, understand, and consume REST-based services.


by Scott Lewis (noreply@blogger.com) at September 03, 2015 09:42 PM

FYI: #MesosCon Europe 2015

by Chris Aniszczyk at September 03, 2015 09:09 PM

A couple of weeks ago I had the pleasure of attending MesosCon 2015 in Seattle co-located with LinuxCon. I had the honor of being on the Program Committee this year and helped draft the program with a great group of folks. It’s really amazing to see how far things have come since we helped open source Mesos… it was great to see companies like Apple, Verizon, Bloomberg, Paypal, Intel, Cisco, Twitter, AT&T and many other adopters running Mesos with serious production workloads! I was also really proud of us having a diversity scholarship as part of the conference, that worked out really well and we will do it more in the future.

Anyways, if you couldn’t make it, the good news is that all of the sessions were recorded and are available on YouTube now:

Furthermore, if Seattle was a bit too far away, we are hosting MesosCon Europe in Dublin in about a month. The program isn’t live yet as we are in the community review phase for proposals so if you would like to participate in the program selection, please get your votes in!

I look forward to seeing everyone in Dublin and chatting with people over some frosty beverages!


by Chris Aniszczyk at September 03, 2015 09:09 PM

New Eclipse Open Source Project Targets Automotive Industry in Collaboration with EU Research Project

September 03, 2015 01:17 PM

The Eclipse Foundation announces the creation of a new open source project, called APP4MC.

September 03, 2015 01:17 PM

Installing Jenkins Server on Google Cloud Platform

by Roy Ganor (noreply@blogger.com) at September 03, 2015 12:18 PM

The goal of this short post is to show how to spin a Jenkins server on Google Cloud Platform.

Create a new instance

This is a simple one. Browse to your Google Cloud console https://console.developers.google.com and create a new instance. Make sure you:

  1. Select a small (or greater) instance type. 
  2. Select Debian as your OS. 
  3. If you have a network rule that enables TCP 8080 then use it. Otherwise, you can configure this later on to your default rule.

Install Jenkins

To use the Debian package repository of Jenkins, first add the key to your system:
wget -q -O - http://pkg.jenkins-ci.org/debian/jenkins-ci.org.key | sudo apt-key add -
Then add the following entry in your /etc/apt/sources.list:
deb http://pkg.jenkins-ci.org/debian binary/
Update your local package index, then finally install Jenkins:
sudo apt-get update
sudo apt-get install openjdk-7-jre
sudo update-java-alternatives --set java-1.7.0-openjdk-amd64
sudo apt-get install jenkins

Configure the default network rule

In Google Cloud Console go to your project and select Compute Engine | Networks | Firewall rules. Create a new rule. Include tcp:80,8080 to your "Allowed Protocols or Ports"

That's it! Browse to your instance external IP and concatenate :8080.



 


by Roy Ganor (noreply@blogger.com) at September 03, 2015 12:18 PM

NoClassDefFoundError-s in Eclipse Modeling Framework (EMF) *Package$Literals & Xtext tests

by Michael Vorburger (noreply@blogger.com) at September 01, 2015 04:27 PM

I've been going mad over strange EMF related build failures in ESON that occurred on only some machines, and as I've finally understood & fixed the root cause of this... fun (!) mess, thought about writing this up to document the finding, in case this may be useful for anyone else in the future hitting NoClassDefFoundError-s in EMF *Package$Literals in connection with Xtext tests using @RunWith(XtextRunner.class) with @InjectWith(*InjectorProvider.class).

The problem would manifest itself like this: When running current ESON Git master head (rev. ced8ef72cb16e850915d7d14c6a98bfc523a072c), then on some machines all was well, with "Tests run: 118, Failures: 0, Errors: 0, Skipped: 6", wonderful, but on at least one there were "Tests run: 118, Failures: 23, Errors: 57, Skipped: 6"...

Root cause for all failures were loads of java.lang.NoClassDefFoundError: Could not initialize class testmodel.TestmodelPackage$Literals at testmodel.impl. TestModelImpl.eStaticClass(TestModelImpl.java:169).

BTW: There are other cases of NoClassDefFoundError-s in *Package$Literals with causes unrelated to the specific problem here; e.g. old bug 161747 or bug 328555, as well as  e.g. this forum post, but those are unrelated to Xtext test initialization problems.

Adding Java Exception Breakpoints for NoClassDefFoundError, and more importantly java.lang.ExceptionInInitializerError which is the root cause of the NoClassDefFoundError root cause of test failures, unfortunately doesn't help - looks like JDT cannot trap them, probably because those are raised from inside JVM native.(Just FTR: This stackoverflow post has a fancy -javaagent based idea, if ever you REALLY have to know what caused the ExceptionInInitializerError... I haven't tried it.)

Normal breakpoints in ExceptionInInitializerError & NoClassDefFoundError constructors do get hit, and together with breakpoints in testmodel.impl.Testmodel*PackageImpl.init() and initializePackageContents() did shed some limited light.. ultimately I figured that this had something to do with the EMF registry getting reset by the XtextRunner, and was related to test order execution.

Using Tycho’s surefire runOrder helped as a first workaround to make this consistent and predictable… and with <runOrder>alphabetical instead of the default <runOrder>filesystem (thus the difference between machines…) it would always work. This made me realize that something was wrong in a “late” test, perhaps my org.eclipse.emf.eson.xcore.tests.XcoreTest, screwing up the EMF registry. (Also, using <runOrder>reversealphabetical made the error reproducible on all machines where the build previously worked, so this was clearly it.)
PS: The use of “static” fields initialized as EMF does is not a great design pattern, but EMF has been around for “a while”, and how that was originally implemented is not going to change anymore.

by Michael Vorburger (noreply@blogger.com) at September 01, 2015 04:27 PM

Gendoc 0.5.1 available

by Tristan FAURE (noreply@blogger.com) at September 01, 2015 02:54 PM

We are pleased to announce that we have released a new version of Gendoc.

The version 0.5.1 is available on Gendoc website: http://www.eclipse.org/gendoc/downloads/download.php

If you have 0.5.0 version installed you can perform an update of your installation.

This version improves the parsing of tags (whitespace and style problems), the usage of default bundles in fragments and fixes Sonar reported issues, you can find the whole list of fixed bugs here: https://projects.eclipse.org/projects/modeling.gendoc/releases/0.5.1/bugs

The Gendoc team
(original link of this post)

by Tristan FAURE (noreply@blogger.com) at September 01, 2015 02:54 PM

Meet me at EclipseCon Europe 2015 – Session Xtend beyond Java

by ekkescorner at September 01, 2015 07:50 AM

Last conferences I didn’t found the time to attend EclipseCon because of so many projects for BlackBerry10.

This year I’ll be again at EclipseCon Europe in Ludwigsburg

ECE Friends 300x300 Unconference_1

looking forward to meet so many friends again !

I’m also speaking at the conference

ECE Friends 100x100 I'm speaking at_0

Xtend beyond Java: generate cool stuff (C++, Qt) for mobile apps

Room 5, Thursday, 2015-11-05, 14:15
Developing mobile apps for C++ / Qt environments using Eclipse Momentics (based on CDT) there’s much stuff you have to code manually or copy/paste every day. I developed a DSL based on Xtend to make this much easier. This isn’t an app generator – it’s more like generating a workbench where you’ll find all those patterns to work offline (caching to JSON or SQLite), to deal with C++ Pointers for business logic and UI. All the boring stuff will be generated.

Live coding
In this session we’ll start from cratch: design a data model, generate the code and then add some UI logic to get a running app.

Xtend
Then take a look at the templates to see how Xtend can be used to generate C++ instead of Java !

Meet me at EclipseCon !


Filed under: BB10, Blackberry, C++, Cascades, Eclipse, EclipseCon, MDSD, mobile

by ekkescorner at September 01, 2015 07:50 AM

EMF Forms 1.6.0 Feature: Improved Rendering Architecture

by Maximilian Koegel and Jonas Helming at August 31, 2015 11:42 AM

With the Mars Release, we released EMF Forms 1.6.0. EMF Forms makes it really simple to create forms, which edit your data based on an EMF model. To get started with EMF Forms please refer to our tutorial.

One of the major things we worked on for the 1.6 release was a refactoring of the rendering architecture of EMF Forms. The goal was to improve the testability, adaptability and reusability of the EMF Forms renderers. Before we go into details about the changes, let us quickly explain what a renderer is responsible for in EMF Forms and why it is such an important component for the framework.

Instead of manual and tedious UI coding, EMF Forms allows you to describe form-based UIs in simple language, the view model. Because it is focussed on forms, it is much more concise and easier to understand than manually written code, whether the UI technology is SWT, JavaFX or a web framework. A simple view model is shown in the following screenshot. The second screenshot shows how the view model would be rendered in SWT.

image05

image02

Translating the view model to a concrete usable UI is the responsibility of the renderers. Instead of generating code again, as most WYSIWYG-Editors do, EMF Forms interprets the view model at runtime. This allows for a lot of flexibility, e.g. to adapt renderers or even completely replace them without the need to change the view model at all.

To keep the rendering component as flexible as possible, it consists of single renderers, each responsible for a single view model element. As an example, there is a renderer for the element HorizontalLayout, another one for Group. For the control element in the view model, which represents a data field including label shown in the UI, there is a dedicated renderer for each attribute type, e.g. String, Integer or Enum. All renderers are registered in a central registry. When a certain element is rendered, a renderer factory is called to retrieve the correct renderer for an element. You can provide testers along with a renderer, which allows you to return different renderers for the same element based on certain rules, e.g. special renderers for certain domain model attributes.

image04

This architecture of dedicated elements and a factory is very flexible and allows for existing renderers to be replaced or adapted. It has been implemented since the beginning in EMF Forms. However, there are a few details that we improved with the 1.6.0 release.

In the previous release, renderers needed to implement a given interface, which was used to call rendering methods and to fill in required parameters. This does not sound bad on first glance, but this architecture has drawbacks. The set of parameter is fixed for every renderer. While most renderers share a common set of required parameters, there are others, especially custom adaptations, which required some very specific parameters. These might even be objects or services, which are project specific and not part of the framework. With the fixed set of parameters given by the defined interface, it was difficult to retrieve additional ones. Luckily, there is a well-known solution for this issue: dependency injection. It allows you to let the implementation of the renderer define itself, as well as which parameters it requires. EMF Forms will then take care to inject the required objects into the renderer on initialization. Further, renderers typically inherited from certain superclasses to share existing functionality. An example for such a reused feature is the creation of a data binding for a control. For the 1.6 release we have refactored these reusable features into independent services.

The architectural shift to small reusable components, which are wired using dependency injection has been pretty common pattern in recent years. Those components have typically much less dependencies and are therefore easier to test. Additionally, if you want to test renderers, it is easy to mock all external components. More importantly, this approach enables framework users to adapt, extend or exchange the implementation of these services.

image06

As you can see in the diagram, we still use a interface for the renderer to define methods, which are called by the framework, e.g. the render method. This could be removed by defining annotations to mark the respective methods and to call them via dependency injection. Eclipse 4 does that with the behavior annotations, e.g. @Focus or @Execute. However, we currently do not see a major advantage in introducing this into the rendering architecture. The affected methods have had a stable and very minimal parameter set since years, now (typically one or even no parameters). In addition, we sometimes expect pretty specific return values, which cannot be assured during compile time when using dependency injection, which is an advantage for keeping the interface. Finally, renderers are stateful, as they control the current state of the rendered UI. That means, there is currently no real issue with injecting services as fields or in the constructors. We might revise this and even introduce dependency injection for those methods, but the current solution already resolves the problem of differing parameter sets and support completely custom parameters.

We updated our code examples and tutorials to the new rendering architecture, please have a look at this tutorial to learn more about how to implement custom renderers for EMF Forms and how to adapt existing ones.


TwitterGoogle+LinkedInFacebook

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


by Maximilian Koegel and Jonas Helming at August 31, 2015 11:42 AM

Eclipse IDE: Get rid of the "java.awt.List" proposal in "organize imports"

August 31, 2015 07:44 AM

Organize imports does not work for the “List” type out of the box as there is more than one “List” type in Java. Most often, we are only interested in “java.util.List” but not in “java.awt.List”. So, if you too are not programming using the AWT API, you should definitively tell it your Eclipse IDE.

As I always use the “Organize Imports” feature of Eclipse my Eclipse IDE is always configured accordingly (at workspace or at project level).

This usually works well except for the “List” type: Eclipse does not decide for you if you mean “java.util.List” or “java.awt.List”. This is absolutely fair and I am used to fix it with the corresponding quick fix: “Import 'List' (java.util)”

When I work on an Eclipse Scout application, I never need anything from java.awt. Luckily, I recently learned how to teach this to my Eclipse IDE:

In Preferences > Java > Appearance > Type Filters, then add “java.awt*” in the filter list.

With this additional setting, Eclipse is able to pick “java.util.List” as automatic import for List.

I have already adopted this setting in all my workspaces.

You can use this forum thread, to share your feedback.

 

Project Home, Forum, Wiki, Twitter


August 31, 2015 07:44 AM

Vert.x3 real time web apps

by pmlopes at August 31, 2015 12:00 AM

One of the interesting features of Vert.x is the SockJS event bus bridge. This piece of software
allows external applications to communicate with Vert.x event bus using Websockets and if your browser does not
support it then it gracefully degrades to pooling AJAX calls.

WebSockets bring a new level of interaction to the web, they really bring real time to web applications due to the
fact that its communication model is bi-directional in contrast to the traditional HTTP model where a client can
initiate a data request to a server but not the other way around.

In this small post I will demonstrate how you can create a simple collaborative drawing app. The idea is simple, all
users that open the app will be be presented with a empty canvas and what they draw or is drawn on other canvas is
shared in real time on their screen.

For the sake of simplicity and making this post light there is no security involved so, everyone is free to listen to
what is being drawn, however the external application has limited read write access to a single address on Vert.x
event bus, ensuring that other services running on the cluster will not be exposed.

This is what you should expect to see:

screecast

Bootstrap a project

If you followed the previous series on Vert.x development, you saw
that Java and Maven were the main topic, since Vert.x is polyglot I will focus on JavaScript and
NPM as my programming language and package management tool.

With NPM start by creating a package.json, in order to do this we should run:

npm init

This will present a selection of questions and in the end you should have a basic package.json file. This
configuration is very basic so you need to add a dependency to Vert.x so
you can run the application. You can add it to the dependencies property and it should look more or less like this:

{
  "name": "draw",
  "private": true,
  "dependencies": {
  "vertx3-full": "3.0.0-1"
  },
  "scripts": {
  "start": "vertx run server.js"
  },
  "version": "1.0.0",
  "main": "server.js",
  "devDependencies": {},
  "author": "",
  "license": "ISC",
  "description": "A Real Time Drawing App"
}

If you do not know why there is the dependency on vertx3-full or why the added scripts property please check the
older blog post about it.

Project Structure

This post has no preference over project structure, so if you do not agree with the structure used here feel free to
use what you feel best. For this example I will keep it to:

├── package.json
├── server.js
└── webroot
  ├── assets
  │   └── js
  │     ├── script.js
  │     └── vertxbus.js
  └── index.html

3 directories, 5 files

As you can imagine server.js will be our Vert.x application and everything under webroot will be the client
application.

The client application is not really Vert.x specific and could in theory be used by any other framework so I will go
lightly over its code.

Client Application

Our application main entry point is as one can expect index.html. In the index file define the following HTML:


<html>
<head>
  <meta charset="utf-8"/>
  <title>Real time drawing Apptitle>
  
head>

<body>
<canvas id="paper" width="1900" height="1000">
  Your browser needs to support canvas for this to work!
canvas>


<script src="http://code.jquery.com/jquery-1.8.0.min.js">script>
<script src="//cdn.jsdelivr.net/sockjs/0.3.4/sockjs.min.js">script>
<script src='assets/js/vertxbus.js'>script>
<script src="assets/js/script.js">script>

body>
html>

As I previously wrote, the idea is to keep it as simple as possible so it is all about having a canvas element and a
application main script script.js. All the rest are files served by CDNs that provide common web application
libraries such as jQuery, HTML5 shim for older browsers, SockJS client and vertxbus bridge.

The main code is on script.js file:

$(function () {

  // This demo depends on the canvas element
  if (!('getContext' in document.createElement('canvas'))) {
    alert('Sorry, it looks like your browser does not support canvas!');
    return false;
  }

  var doc = $(document),
    canvas = $('#paper'),
    ctx = canvas[0].getContext('2d');

  // Generate an unique ID
  var id = Math.round($.now() * Math.random());

  // A flag for drawing activity
  var drawing = false;

  var clients = {};
  // create a event bus bridge to the server that served this file
  var eb = new vertx.EventBus(
      window.location.protocol + '//' + window.location.hostname + ':' + window.location.port + '/eventbus');

  eb.onopen = function () {
    // listen to draw events
    eb.registerHandler('draw', function (data) {
      // Is the user drawing?
      if (data.drawing && clients[data.id]) {

        // Draw a line on the canvas. clients[data.id] holds
        // the previous position of this user's mouse pointer

        drawLine(clients[data.id].x, clients[data.id].y, data.x, data.y);
      }

      // Saving the current client state
      clients[data.id] = data;
      clients[data.id].updated = $.now();
    });
  };

  var prev = {};

  canvas.on('mousedown', function (e) {
    e.preventDefault();
    drawing = true;
    prev.x = e.pageX;
    prev.y = e.pageY;
  });

  doc.bind('mouseup mouseleave', function () {
    drawing = false;
  });

  var lastEmit = $.now();

  doc.on('mousemove', function (e) {
    if ($.now() - lastEmit > 30) {
      eb.publish('draw', {
        'x': e.pageX,
        'y': e.pageY,
        'drawing': drawing,
        'id': id
      });
      lastEmit = $.now();
    }

    // Draw a line for the current user's movement, as it is
    // not received in the eventbus

    if (drawing) {

      drawLine(prev.x, prev.y, e.pageX, e.pageY);

      prev.x = e.pageX;
      prev.y = e.pageY;
    }
  });

  // Remove inactive clients after 10 seconds of inactivity
  setInterval(function () {

    for (var ident in clients) {
      if (clients.hasOwnProperty(ident)) {
        if ($.now() - clients[ident].updated > 10000) {
          // Last update was more than 10 seconds ago.
          // This user has probably closed the page
          delete clients[ident];
        }
      }
    }

  }, 10000);

  function drawLine(fromx, fromy, tox, toy) {
    ctx.moveTo(fromx, fromy);
    ctx.lineTo(tox, toy);
    ctx.stroke();
  }

});

The most important part in this code is all the code related to eb. The variable eb is our bridge to the event
bus, Start by creating a bridge using the vertx.EventBus object and define where to connect, using the details
of the current window location.

Then add a onopen listener that will subscribe to the address draw on the event bus so it can listen to all
messages regarding drawing and perform the drawing actions. Since listening is not enough I also add a mouse listener
to the document so when it moves it publishes events to the draw address.

Note that I am using publish and not send, the reason should be obvious, I want everyone to know this users mouse
movements, I am not interested on sending the events to just a single user. You can see now that if you want to have
a drawing app in a one on one user basis then instead of publish() you should use send().

Server Application

The server code is quite straight forward, all you need is:

var Router = require("vertx-web-js/router");
var SockJSHandler = require("vertx-web-js/sock_js_handler");
var StaticHandler = require("vertx-web-js/static_handler");

var router = Router.router(vertx);

// Allow outbound traffic to the draw address

var options = {
  "outboundPermitteds" : [{"address" : "draw"}],
  "inboundPermitteds" :  [{"address" : "draw"}]
};

router.route("/eventbus/*").handler(SockJSHandler.create(vertx).bridge(options).handle);

// Serve the static resources
router.route().handler(StaticHandler.create().handle);

vertx.createHttpServer().requestHandler(router.accept).listen(8080);

We start with the usual imports, we import a reference to the Router object and a couple of helper handlers
SockJSHandler and StaticHandler. As their names should tell you one handler will be responsible to handle all
SockJS data and the other all HTTP file serving requests.

We then add then to a router and start a HTTP server that will handle all incoming request using the handler accept
function. Finally we listen on port 8080 and we are ready.

Note that there is a options object where a couple of properties are defined outbound/inbound permitted addresses.
Without this configuration the external application will not be allowed to connect to the vert.x bus, in fact the
default configuration of the SockJSHandler is deny all. So you must specify explicitly which address are allowed to
receive messages from SockJS and which ones are allowed to send/publish to SockJS.

Now you can start your application, don’t forget to install the dependencies for the first time:

npm install

And then run the application:

npm start

If you now open 2 browser windows you will be able to draw nice pictures and see the drawing showing in “real time”
on the other window, if you then draw on the second you should get the mirror effect on the first window.

Have fun!


by pmlopes at August 31, 2015 12:00 AM

Presentation: Jekyll and Hyde with Jubula

by Alexandra Schladebeck, Markus Tiede at August 30, 2015 07:57 PM

This talk will present participants with both aspects of Jubula’s personality: Dr Jekyll: writing tests with the Jubula actions in the ITE; Mr Hyde: writing Jubula tests in Java. We’ll show how the steps to start AUTs, write tests and perform test execution can be done using both aspects of Jubula. The talk will show participants their way around the tool and its features from both perspectives.

By Alexandra Schladebeck, Markus Tiede

by Alexandra Schladebeck, Markus Tiede at August 30, 2015 07:57 PM

Candidate bugs for the EclipseCon Europe 2015 Hackathon

by waynebeaton at August 27, 2015 07:55 PM

Alternate title: What I saw at the EclipseCon Europe Hackathon made my jaw drop!

I’m pretty excited about the hackathon we’re running at EclipseCon Europe.

Hacker's Keyboard

In past hackathons, we’ve let attendees pick the bug that they want to work on. We’re going to encourage this sort of thing this time around, but want also to provide some help for those potential contributors who want to help, but don’t already have an idea.

We need some candidate bug reports.

It occurred to me that we have many open bugs reports annotated with helpwanted, indicating that committers feel that the issue addressed by the report is valid, but that they have no plans to resolve it. Some of these reports, however, are relatively large problems that could day hours, days, and weeks to resolve.

We also have many bug reports annotated with bugday. This keyword was originally used to flag reports that were candidates for a Bug Day event, but has grown to represent issues that committers feel can be addressed by a new contributor with modest effort (e.g. one or two hours).

The bugday bugs seem like a reasonable subset of candidates for the hackathon. As of this moment, there are 54 open bug reports annotated with bugday. That number drops to 40 if you include helpwanted in the search (i.e. there are 40 helpwanted bugday bugs). Both of these numbers are a little large, but are a pretty good starting point. I’m thinking that a list of 20 would be ideal.

I’m hopeful that committers will step up and annotate more bugs. Should an embarrassment of riches result, we’ll have to sort out a reasonable means of whittling this list down to a manageable size (e.g. an age limit).

I’m curious to hear if anybody has thoughts on how we select good candidates.

The EclipseCon Europe 2015 Hackathon runs from noon on Tuesday, November 3rd until the end of the day on Wednesday, November 4th. We’re setting up office hours where you can meet and work with Eclipse committers (more on this later).



by waynebeaton at August 27, 2015 07:55 PM

Eclipse Newsletter - Discover the Eclipse Marketplace

August 27, 2015 03:06 PM

The articles highlight some of the most popular solutions including EclEmma, Spring Tool Suite, JBoss Tools, and PyDev.

August 27, 2015 03:06 PM

Exposing a REST service as an OSGi Service

by Scott Lewis (noreply@blogger.com) at August 27, 2015 02:25 PM


I've produced a tutorial describing an additional use case for Remote Services:  Exposing a Jax REST service as an OSGi Remote Service.

This describes how one can take an existing REST service and expose to consumers as an OSGi Remote Service.





by Scott Lewis (noreply@blogger.com) at August 27, 2015 02:25 PM

Eclipse Scout Day 2015

August 27, 2015 12:03 PM

If you are interested in Eclipse Scout framework or if you are developing Scout applications during your day job, this is the event to attend.

On November 2nd we are organizing the Scout user group meeting as part of the Unconference right before the Eclipsecon Europe. Participation requires registration but the Event is open for anyone interested.

 

 

Dinner at the Rossknecht in Ludwigsburg
Listening to presentation about industrial use case with Scout

At the event, Eclipse Scout committers will demonstrate the current state of the Scout Neon release featuring the new HTML5 UI including full CSS styling as well as the move of Scout to a Java only framework that facilitates the integration of third party Java and Java EE technologies.

To document the event details and build an agenda that does focus on the actual interests of the participants we have created a corresponding wiki page. There is also an online poll to ask you about the topic areas of interest to you and a forum thread for public questions and comment. For anything else that you might want to ask/discuss you can contact us via scout@bsi-software.com.

The Scout user group meeting is not only about learning about the Scout framework, its new features and the change to a Java only framework. At least as interesting are the presentations from Scout adopters that tell their story and share their experiences with using Scout for their specific use case. As soon as the process is hammered out with the Unconference organizers we will update our wiki page and let you know via @EclipseScout and forum.

And last but not least, the Scout user group meeting is fun and provides many networking opportunities with fellow Scout adopters and committers. Don't hesitate and register here for November 2nd.

Looking forward to see you in Ludwigsburg.

 

Project Home, Forum, Wiki, Twitter

 

 

 


August 27, 2015 12:03 PM

Access Dart Analysis Server from Java

by Tom Schindl at August 25, 2015 03:24 PM

In my last few blogs (here, here and here) I started implementing a smart dart editor with syntax highlighting, auto complete, … for google dart.

While the first posts have been dedicated to getting syntax highlighting working we’ll now start with the higher level features you are used to from full blown IDEs.

In this first blog post we’ll look how we can interface with the Dart Analysis Server which is the reason I’ve chose dart as the example language.

The communication with the Dart Analysis is done through the input and output stream. An example will probably help.

Let’s suppose we have a /home/tomschindl/dart-samples/test.dart with the following content:

class Rectangle {
  num left;   
  num top;
  num width; 
  num height;          
  
  num get right             => left + width;
      set right(num value)  => left = value - width;
  num get bottom            => top + height;
      set bottom(num value) => top = value - height;
}

// This is where the app starts executing.
main() {
  var r = new Rectangle();
  r.
}

If you now want to get all auto completetion proposals after r. you issue the following commands/requests to the server:

  • You launch the dart analysis server eg on my workstation it is:
    /Users/tomschindl/Downloads/dart-sdk/bin/dart \
     bin/snapshots/analysis_server.dart.snapshot
  • You inform the server about the root directory:
    { 
      "id" : "default_1", 
      "method" : "analysis.setAnalysisRoots" , 
      "params" :  {
         "included":["/Users/tomschindl/dart-samples/"],
         "excluded":[]
      }
    }
    
  • Which will synchronously return the following result

    {
      "id":"default_1"
    }
    
  • Requesting all auto completetions at offset 367 which is directly after r.

    { 
      "id" : "default_2", 
      "method" : "completion.getSuggestions" , 
      "params" :  {
        "file":"/Users/tomschindl/dart-samples/test.dart",
        "offset":367
      }
    }
    
  • Which will synchronously return the following result
    {
      "id":"default_2",
      "result":{
        "id":"0"
      }
    }
    
  • And asynchronously the following events will occur

    {
      "event":"completion.results",
      "params":{
        "id":"0",
        "replacementOffset":367,
        "replacementLength":0,
        "results":[],
        "isLast":false
      }
    }
    
    {
      "event":"completion.results",
       "params":{
         "id":"0",
         "replacementOffset":367,
         "replacementLength":0,
         "results": [
           {
             "kind":"INVOCATION",
             "relevance":1000,
             "completion":"left",
             "selectionOffset":4,
             "selectionLength":0,
             "isDeprecated":false,
             "isPotential":false,
             "declaringType":"Rectangle",
             "element":{
               "kind":"FIELD",
               "name":"left",
               "location":{
                 "file":"/Users/tomschindl/dart-samples/test.dart",
                 "offset":24,
                 "length":4,
                 "startLine":2,
                 "startColumn":7
               },
               "flags":0,
               "returnType":"num"
             },"returnType":"num"
           },
           {
             "kind":"INVOCATION",
             "relevance":1000,
             "completion":"right",
             "selectionOffset":5,
             "selectionLength":0,
             "isDeprecated":false,
             "isPotential":false,
             "declaringType":"Rectangle",
             "element":{
               "kind":"GETTER",
               "name":"right",
               "location":{
                 "file":"/Users/tomschindl/dart-samples/test.dart",
                 "offset":95,
                 "length":5,
                 "startLine":7,
                 "startColumn":11
               },
               "flags":0,
               "returnType":"num"
             },
             "returnType":"num"
           }
           // Many more
         ],
        "isLast":true
      }
    }
    

I guess you get the idea – not really rocket science but in java we don’t want to deal with this low-level stuff. So as part of the editor work we also developed a Java interface for the Dart Analysis Server available from maven-central.

If we want to issue the same commands as above through the Java-API.

Create a maven-project and make the pom.xml look like this:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>
	<groupId>at.bestsolution</groupId>
	<artifactId>at.bestsolution.dart.server.sample</artifactId>
	<version>0.0.1-SNAPSHOT</version>
	<repositories>
		<repository>
			<id>sonatype-snapshots</id>
			<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
		</repository>
	</repositories>
	<dependencies>
		<dependency>
			<groupId>at.bestsolution.eclipse</groupId>
			<artifactId>org.eclipse.fx.core</artifactId>
			<version>2.1.0-SNAPSHOT</version>
		</dependency>
		<dependency>
			<groupId>at.bestsolution</groupId>
			<artifactId>at.bestsolution.dart.server.api</artifactId>
			<version>1.0.0</version>
		</dependency>
	</dependencies>

	<build>
		<plugins>
			<plugin>
				<artifactId>maven-compiler-plugin</artifactId>
				<configuration>
					<source>1.8</source>
					<target>1.8</target>
				</configuration>
			</plugin>
		</plugins>
	</build>
</project>

And a java class with the following content:

package at.bestsolution.dart.server.sample;

import java.io.IOException;
import java.util.stream.Stream;

import org.eclipse.fx.core.Util;

import at.bestsolution.dart.server.api.DartServer;
import at.bestsolution.dart.server.api.DartServerFactory;
import at.bestsolution.dart.server.api.Registration;
import at.bestsolution.dart.server.api.model.CompletionResultsNotification;
import at.bestsolution.dart.server.api.services.ServiceAnalysis;
import at.bestsolution.dart.server.api.services.ServiceCompletion;

public class DartServerSample {
	public static void main(String[] args) {
		// Get the server factory from the service registry
		DartServerFactory serverFactory = Util.lookupService(DartServerFactory.class);
		// Create a server instance
		DartServer server = serverFactory.getServer("server");

		// Get the analysis and completion service
		ServiceAnalysis analysisService = server.getService(ServiceAnalysis.class);
		ServiceCompletion completionService = server.getService(ServiceCompletion.class);

		// set the root
		analysisService.setAnalysisRoots(new String[] {"/Users/tomschindl/dart-samples/"}, new String[0], null);
		// register for completion notifcations
		Registration proposalRegistration = completionService.results(DartServerSample::handleHandleResults);

		// Request completion at offset 367
		completionService.getSuggestions("/Users/tomschindl/dart-samples/test.dart", 367);

		// Wait for a key press
		try {
			System.in.read();
		} catch (IOException e) {
		}

		// unregister the notification listener
		proposalRegistration.dispose();
		// shutdown the server instance
		server.dispose();
	}

	private static void handleHandleResults(CompletionResultsNotification notification) {
		Stream.of(notification.getResults()).forEach( c -> System.err.println(c.getCompletion()));
	}
}

And then you have to launch the class with

java -Ddart.sdkdir=/Users/tomschindl/Downloads/dart-sdk at.bestsolution.dart.server.sample.DartServerSample

where you replace /Users/tomschindl/Downloads/dart-sdk with the path to your dart-sdk installation.



by Tom Schindl at August 25, 2015 03:24 PM

Gerrit inline editing Feature

August 25, 2015 08:56 AM

Fixing Bug 473139 was the perfect opportunity for me to test the new inline editing feature offered by the Gerrit instance hosted by the Eclipse Foundation.

We have moved our Scout Blog to a new location:
https://www.bsi-software.com/en/scout-blog/

I have opened Bug 473139 to update our RSS Feed URL in the Eclipse planet configuration file.

This was for me a perfect opportunity to test the new inline editing feature of Gerrit. (See Denis Roy email on the “eclipse.org-committers” mailing list: New version of Gerrit deployed)

Here is how I created a new change for my Bug, directly on Gerrit:

1/ Search for the corresponding repository in the projects list.

2/ On the project page, click on the “Create Change”.

3/ In the dialog, select the branch, write the commit comment and click on the “Create” button.

4/ Click on the “Edit” button.

5/ Click on the “Add” button, search for the file and click on the “Open button”.

6/ Edit the File, click on “Save” and on the “Close” button.

7/ Click on the “Done Editing” button.

8/ Click on the “Publish Edit” button.

In my opinion, this is a great feature for small changes…

I like the live edit possibility on GitHub; we now have it also on Gerrit.

Please use this forum thread for your feedback.

Project Home, Forum, Wiki, Twitter


August 25, 2015 08:56 AM