subshell Blog » Java

Stories, tips and tricks from the team at subshell. A software product developer that is specialized in content management systems.

JFace Tooltips via Information Controls

How to use JFace information controls for custom tooltips

Torsten Witte

2013-05-10 • 05:30 PM

Java, Eclipse

Every Java developer who works with the Eclipse IDE knows the helpful JavaDoc tooltips that appear when the mouse cursor hovers over a method or class name in the source code editor. You can click into the tooltip, then move or resize it or navigate inside the JavaDoc to the documentation of other methods and classes. How can we use this feature in our own Eclipse RCP or JFace application?

Eclipse JavaDoc Tooltips

read more »

Synchronizing multi-threaded resources processing application by locking a set of resources.

Piotr Suszyński

Wed Feb 13 17:25:00 CET 2013 • Wed Feb 13 17:25:00 CET 2013

Java

This is a short, cookbook-recipe-like post about solving a basic synchronization problem, yet that's quite hard to find a solution for it by googling, searching technical forums or stackoverflow.org. The presented solution shows how to lock a set of resources in a way that all of them are locked at once - if this is not possible then no resources are locked and the thread waits for them to become available.

read more »

Extending Jubula for Custom SWT Controls in RCP applications (Updated for Jubula 1.3)

What to do if Jubula can not map the (custom) SWT control you need for your test?

Torsten Witte

2013-02-11 • 11:30 AM

Java, Eclipse

Jubula is a UI testing tool for eclipse rich client applications. For testing you have to map the SWT controls like text fields, labels, tables, trees or buttons of your application under test (AUT) to Jubula components. After that Jubula is able to find the controls and perform actions like clicking the button or entering text into the textfield. In the end verifications can be done on the controls in the test cases, e.g. whether a label displays the expected text or not.

But what to do if Jubula does not draw this funny green border around the control you need in your test, indicating that you can map it when pressing Ctrl+Shift+Q? This is the moment to extend Jubula by yourself. In this article I describe the steps we have done to include our custom control (a SWT canvas) into Jubula tests. We implemented a general solution to support any SWT control in Jubula, so it might help you with your own controls. To sum it up, all you need is a little fragment for your RCP application (the AUT) and a plug-in for the Jubula client.

read more »

Automatic maintenance of Jira project Versions with Maven

The maintenance of project versions in Jira is an unpleasant, recurring and error-prone task. So let's automate it!
Steffen Kuche

Steffen Kuche

Fri May 04 17:00:00 CEST 2012 • Fri May 04 17:00:00 CEST 2012

Java

One must not forget to update the project version in jira after a release. But in this case prospective bug fixes will be marked as fixed in wrong versions, which leads to confusion and irritations in the praxis. And furthermore it is an annoying task which can be automated.

read more »

Using Groovy in Eclipse RCP

How to use Groovy code in Eclipse RCP applications?

Torsten Witte

2012-05-02 • 10:00 AM

Java, Eclipse

Some days ago I found the time to take a closer look at Groovy, the second standard language for the Java platform. I liked the idea of Groovy and since Groovy classes can be called within Java classes (and vice versa) I thought about how to use Groovy code in Eclipse RCP plug-ins for resolving some domain problems and making programmers daily work much easier (e.g. XML file handling). Here is a short overview of the steps I have done to make Groovy code in my RCP application work.

read more »

The Sprint Process At A Glance

Scrumclipse: An Eclipse IDE Plug-In To Follow The Sprint Process

Torsten Witte

2011-12-09 • 02:58 PM

Java, Eclipse, Agile

Like described in a previous article subshell organizes its software development with the agile methodology of scrum. Of course we have a big scrum board with DIN A5 cards for each task and a burndown chart to illustrate the process of the sprint. Thereby each task has a corresponding issue in our JIRA bug and issue tracking system and the whole life cycle of the tasks is managed there:

  • The issues are assigned to the developer who currently works on it.
  • The estimate and the spent time is logged in the working log.
  • The state of the issues (e.g. "In Progress", "Review", "Test", "Done") is switched in JIRA.
  • And so on...
  • Finally the burndown chart is calculated out of the working logs automatically.

In addition to the "traditional" scrum board and burndown chart we created an Eclipse IDE plug-in that integrates the scrum board, the burndown chart and a sprint statistic into the developer's IDE.

read more »

Investigating USER handles with the SWT Detective

What to do when your SWT application runs out of user handles.
Jens Theeß

Jens Theeß

2011-11-30 • 03:47 PM

Java, Eclipse

"No more handles." Have you ever got this error message in your SWT application? We've had reports of this error cropping up in our Sophora DeskClient when the user had a lot of documents open simultaneously. To investigate this error, we first needed to know the kind of the unavailable handles. These could be e.g., file or GDI handles, but in our case turned out to be USER handles.

read more »

Referencing Maven projects from Eclipse plugins

Jens Theeß

Jens Theeß

2011-09-22 • 12:33 PM

Java, Eclipse

Maven makes dependency management between java projects easy, and with maven tycho, building Eclipse RCP plugins and products from the command-line is just as simple. But Eclipse RCP projects and maven projects have very different dependency resolutions, and mixing both project types is not as simple as adding a pom.xml to an Eclipse plugin project. In this blog post, I'll show what I've done to reference maven projects from our Eclipse RCP application.

read more »

Eclipse RCP - Change Your Perspective

Torsten Witte

2011-08-03 • 01:43 PM

Java, Eclipse

The benefit of Eclipse perspectives is to group and organize views, actions etc. relative to specific user tasks and workflows. Every Eclipse developer switches over to different perspectives several times a day, e.g. for developing an Eclipse RCP application in the "Plug-In Development perspective", for debugging it in the "Debug perspective" and for committing or updating  changes to/from SVN in "Team Synchronizing perspective". Users can arrange the views, add or close views and move or minimize them to the user's preferred layout and usage. Additional custom perspectives can be saved with a custom name, so users can create and switch over to their individual UI layouts.

read more »

Changing from m2eclipse to m2e (Eclipse 3.7 - Indigo)

Sven Hoffmann

Sven Hoffmann

2011-06-24 • 10:49 AM

Java, Eclipse

Yesterday I switched from Eclipse 3.6. (Helios) to the new Eclipse version 3.7. (Indigo)and I experienced some problems with the maven integration for Eclipse. In 3.7 Sonatype's m2eclipse plugin, which I used before, was integrated in the Indigo release train and is now available on the standard eclipse update site. Unfortunately there seems to be some incompatibility between the "old" m2eclipse plugin and the "new" m2e plugin which comes with Eclipse Indigo.

Eclipse Indigo

read more »

Create Info Graphics with Sophora

Steffen Kuche

Steffen Kuche

Mon Mar 14 13:14:00 CET 2011 • Mon Mar 14 13:14:00 CET 2011

Java, Sophora

Our goal is to create, manage and publish highly customisable info graphics or statistics within Sophora. The actual generation of the graphics is done by Maongo, a high-class Authoring Framework for the creation of web or television media. Maongo is a product of our partner 4=1. Hence the graphics are generated, they are treated like normal Sophora image documents. Thus they integrate seamlessly into the work flow of Sophora. For example the graphics can easily be used as a teaser or as a paragraph image of a story.

read more »

Spring 3 MVC: Dependency Injection for annotated Controllers

Sven Hoffmann

Sven Hoffmann

Fri Feb 11 12:14:00 CET 2011 • Fri Feb 11 12:14:00 CET 2011

Java, Web Technology

Declaring controllers via annotations instead of implementing an interface is a pretty neat thing in Spring 3 compared to version 2.5, in my opinion. You get some new flexibility in naming and constructing your Controller classes and in addition you don't have to care about declaring your controller within a spring configuration file.

read more »

Equinox p2 and proxy configuration in your own RCP Application

Torsten Witte

2010-11-26 • 05:42 AM

Eclipse, Java

A few days ago I had the problem to add proxy support for p2 updates in my own RCP application. The solution was very quick and simple.

read more »

Eclipse RCP: Hiding a View inside the View Dialog

Sven Hoffmann

Sven Hoffmann

2010-10-11 • 02:35 AM

Java, Eclipse

If you want to add a view to your Eclipse RCP application, you usually have to register your view using the "org.eclipse.ui.views" extension point. Eclipse then takes care of adding your view to the view dialog automatically, so that users can open this view by selecting it from the menu. But for some reasons you might want to hide a view inside Eclipse's view dialog within your RCP application. For example if you want to open views only programatically or if you have to set specifing parameters when creating the view (e.g. a secondary id when using multiple instances of one view).

read more »

Implementing a Color Picker Dialog With Canvas and GWT

Maik Schreiber

Maik Schreiber

Tue Oct 05 03:49:00 CEST 2010 • Tue Oct 05 03:49:00 CEST 2010

Java

Google Web Toolkit is a powerful framework that can be used to do a variety of things. In this article I'll be showing what GWT's JavaScript overlay types are, what they can be used for, and I'll be showing a concrete example that uses them.

To follow the code examples it is best if you have the GWT plugin installed in Eclipse, which simplifies programming and makes it easy to do debugging if necessary.

read more »

Automatic Calculation and Visualization of Burndown Charts

Steffen Kuche

Steffen Kuche

Fri Sep 24 11:44:00 CEST 2010 • Fri Sep 24 11:44:00 CEST 2010

Agile, Java

We manage our software development with the agile methodology scrum. As usual in scrum we use a Burndown Chart to visualize our sprint progress. For a couple of years we calculated the daily values for this chart manually. But recently we discovered a possibility to automate this task. This article describes how we reached this goal, through the power of JIRA, Groovy, Google Spreadsheet and Google Chart Tools. But first of all I will briefly explain our workflow for each ticket or in scrum terminology for each user story.

read more »

Eclipse RCP: Comboboxes inside a JFace TableViewer

Sven Hoffmann

Sven Hoffmann

2010-09-24 • 02:30 AM

Java, Eclipse

A few days ago I had to replace a TreeViewer with checkboxes with a TableViewer using dropdown comboboxes to allow the user editing values inside the table. It took me quite some time to find some useful documentation on how to manage to do that. The eclipse snippet page just deals with SWT whereas I wanted to use JFace. A tutorial is provided by eclipse as well, but unfortunately it is about 7 years old. In addition the eclipse API is far away from being detailed and helpful. Have a look at the JavaDoc of the class EditingSupport for instance. It is supposed to be one of the important classes to add editing support to your TableViewer and it's description simply says "EditingSupport is the abstract superclass of the support for cell editing."...

read more »

Publishing Webservices with Java 6 and Spring-WS

Sven Hoffmann

Sven Hoffmann

2010-08-12 • 06:11 AM

Eclipse, Java, Web Technology

Lately I had to add a webservice interface to our XML importer component and so I was taking a closer look on some webservice frameworks. While reading several feature lists and technical documentations I came across this description of Spring-WS. Chapter 17.5.6 deals with using Spring-WS together with the Java 6 JDK webservice features, published in a build-in HTTP-Server. Because the attached code samples looked really simple, I decided to give it a shot.

read more »

Working with Eclipse, Maven and WTP

Sven Hoffmann

Sven Hoffmann

2010-07-19 • 02:38 AM

Java, Eclipse, Web Technology

I spend several hours lately to get Eclipse Helios to work with Maven (m2eclipse plugin) and the Eclipse Web Tools Platform (WTP). I wanted Maven to resolve my dependencies for a web project and WTP to deploy my application on a Tomcat server automatically. Actually this should be managed by the "Maven Integration for WTP" plugin - but it doesn't ...

read more »

Eclipse Tip: Automatic Cleanup On Save

Maik Schreiber

Maik Schreiber

2010-07-09 • 01:45 AM

Java, Eclipse

Probably not a new tip for everyone, but here's how to have the Eclipse Java editor cleanup your code whenever you save a file. In the preferences, navigate to Java > Editor > Save Actions, activate the checkbox "Perform the selected actions on save", and check anything you like. For example, the screenshot shows what to activate to never leave unused import statements behind.

Eclipse Preferences

read more »

How to use JFace field editors in a custom dialog

JFace preference pages are easy to create using field editors. The are several editor types available, most consist of a label and one or two controls for displaying and changing a value. E.g., a StringFieldEditor consists of a label and a text field. This article will show how to use JFace field editors in a custom dialog.
Jens Theeß

Jens Theeß

2010-07-08 • 10:56 AM

Java, Eclipse

Amongst others, there are editors for color, font, and a file path. Field editors can be created using one liners, their layout is managed by the FieldEditorPreferencePage. They work with a preference store to load and save data and have built-in validation. This saves a lot of code when building preference pages, but what about using them outside of preferences?

First off, I haven't found a lot of publications about field editors on the net. There's an old article on eclipse.org that's a good introduction to field editors and is still mostly valid: http://www.eclipse.org/articles/Article-Field-Editors/field_editors.html.

read more »

Equinox p2 in your own RCP Application

With Eclipse 3.6 (Helios) the Equinox p2 API for update support of RCP applications becomes stable. Time to use it in your own application, but how?

Torsten Witte

2010-06-29 • 10:51 AM

Java, Eclipse

The best documentation of how to use Equinox p2 is the article Adding Self-Update to an RCP Application in the eclipse wiki. Following that article I will describe the steps I had to do to use p2 in my application.

First of all I want to use p2 "as is". Users should be allowed to choose and add update-sites (or "repositories" in p2 terms) and use Help > Check for Updates or Help > Install New Software... in the main menu like in Eclipse IDE. So I followed the chapter "Reusing the Eclipse SDK UI in its entirety" of the article above.

read more »

Update auf Eclipse 3.6 Helios

Sven Hoffmann

Sven Hoffmann

2010-06-29 • 10:40 AM

Java, Eclipse

Möchte man seine Eclipse-Entwicklungsumgebung auf Version 3.6 (Helios) aktualisieren, kann man sich meiner Meinung nach eine Menge Arbeit (und Frust) ersparen, wenn man folgende Schritte beachtet.

Ein Backup des "workspace"-Verzeichnisses anlegen. Dabei ist vor allem der Unterordner ".metadata" wichtig, der alle Einstellungen enthält. Zudem lohnt es sich den Ordner ".eclipse" im Benutzerverzeichnis zu sichern. Unter Windows 7 befindet sich dieser beispielsweise unter "C:\Users\Benutzername\.eclipse".

Die neue Eclipse-Version in einem separaten Ordner entpacken und nicht drüberkopieren. Es bietet sich beispielsweise an, den alten "eclipse"-Ordner in "eclipse_alt" umzubenennen und dann die neue Version im "eclipse"-Ordner abzulegen. So bleiben auch alle bereits angelegten Verweise erhalten.

read more »

Categories

Sophora CMS - A New Take on Content Management

Toromiro for the Administration and Editing of Java Content Repositories (JCR)