Tweaking the Menu Bar of JavaFX 8 Applications on OS X

JavaFX provides a simple means to create platform independent applications with a graphical UI. This platform independence, however, usually comes at a price. As the compiled code is supposed to run on all supported operating systems, JavaFX does not support all unique operating system specific UI elements. This is usually not a big problem, but it can be rather annoying in certain cases.

On OS X, the application’s menu bar is usually detached from the application’s main window and shown at the very top of the desktop instead. In contrast to the regular menu of a JavaFX application, this menu bar always contains the Apple menu and something that is called application menu. This application menu is created for every application regardless of whether it uses an own menu bar or not and contains items to show, hide and quit the application. Native Mac OS applications also use the application menu for example for preferences, the about menu and other application related menu items. Unfortunately, JavaFX does not provide any means to access this menu let alone adding new custom items to it. This can be particularly annoying when menu items are labeled “Java” or contain the entire package name of your main class.

In this blog post, I describe how to access the application menu using Cocoa native bindings from Eclipse SWT to modify default application menu items and adding new custom items. With the resulting code, JavaFX applications are able to use the default Mac OS menu bar just like any native application.

(read more…)

Jan Gassen

OSGi declarative services and the event bus – Eclipse RCP Cookbook

OSGi services are used to provide functionality via separate bundles. They are also used to decouple functionality, so it is possible to exchange the implementation at runtime. With the introduction of OSGi declarative services and Eclipse 4 it became more popular to use OSGi services in Eclipse RCP applications.

The communication system in Eclipse 4 is the global event bus. It supports communication between application components and is also used for decoupling, since bundles only need to know the event bus for communication, not the bundles they need to communicate with.

This recipe shows how to use the event bus in an Eclipse 4 based application, how to create a simple service using OSGi declarative services, and how to communicate via event bus in an OSGi service. For this, a part will be added to the application that shows log messages which are sent via event bus.

(read more…)

Dirk Fauth

Generated Jenkins Jobs and automatic Branch Merging for Feature Branches

In my current project we are using feature branches to keep the master-branch clean and stable. Development, peer code reviews and also the first pre-integration acceptance tests by the product owner team takes place in the feature branches.

Many projects are using a set of jenkins-jobs to execute builds, run tests and provide code-metrics. Most of these projects are only running these jobs for the master-branch.

Our goal was to reduce the integration risk at the end of a feature branch`s lifecycle. The same Jenkins-Jobs as used for the master-branch should be used for all feature branches. Developers for example should fix their test-problems and ui-test-failures as long as they are working in the branch. As a nice side-effect, the product owner team will have an overview with all branches and their current state. They will not start any acceptance test, until the feature-branch-jobs are green.

(read more…)

Daniel Reuter