Feb 18

There is a great tutorial on vogella.de describing how to add a pie chart with JFreeChart to an Eclipse RCP application or plug-in. The ChartFactory that is used to create the pie chart does not include a method to create a speedometer (or dial) as shown in the sample section of JFreeChart. The following code fragment creates a view that displays a very basic speedometer using the org.jfree.chart.plot.MeterPlot class:

package com.martinklinke.eclipse.jfreechart.demo.views;
 
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.part.ViewPart;
import org.jfree.chart.JFreeChart;
import org.jfree.chart.plot.MeterPlot;
import org.jfree.data.general.DefaultValueDataset;
import org.jfree.experimental.chart.swt.ChartComposite;
 
/**
* @author martin
*
*/
public class MeterChartView extends ViewPart {
   public static final String ID = "com.martinklinke.eclipse.jfreechart.demo.views.MeterChartView";
 
   public void createPartControl(Composite parent) {
      JFreeChart chart = createChart();
      final ChartComposite frame = new ChartComposite(parent, SWT.NONE, chart, true);
   }
 
   public void setFocus() {
   }
 
   /**
    * Creates the Chart based on a dataset
    */
   private JFreeChart createChart() {
      DefaultValueDataset data = new DefaultValueDataset(20.0);
      MeterPlot plot = new MeterPlot(data);
      JFreeChart chart = new JFreeChart("Meter Chart",
      JFreeChart.DEFAULT_TITLE_FONT, plot, false);
      plot.setNoDataMessage("No data available");
      return chart;
   }
}

The result should look like the following screenshot:

JFreeChart Speedometer in Eclipse View

JFreeChart Speedometer in Eclipse View

Of course, the MeterPlot can be further customized by calling the plot.setXXX(…) methods. However, this exercise is left to the willing reader ;)

Oct 21

I just discovered TextUML, an Eclipse extension that enables you to define UML models textually. It started out as a free but closed source project and was open sourced eventually.

The core of this tool is the editor for the textual UML representation that provides many features that developers are used to (syntax highlighting, validation, outline view etc.). Additionally, Graphviz can be integrated to create diagrams from the textual models.

There are detailed instructions for the installation of TextUML and the Graphviz integration and a tutorial to get started with textual modeling.

A huge advantage of textual over graphical notations is in my opinion the possibility to create diffs which means you can easily put those textual models under version control and profit from Eclipse’s compare mechanism. This enables teams of developers to share a common model and to edit it concurrently like any other piece of source code.

According to Rafael Chaves’ (the author of the project) comment on the previously linked article,

[…] the final goal is at some point to submit a proposal to Eclipse.org […]

I hope that this goal will be reached, because TextUML is a very interesting and promising project. Claiming

  • increased modeling productivity
  • live graphical visualization of your class diagrams

as two of the key benefits of using TextUML, the goal should not be too far away. Productivity is always welcome and the graphical visualization may be one of the key arguments for your manager ;)

Seriously, even if it’s not the core feature of TextUML, a simple and efficient way to create class diagrams quickly would be a great win for any technical documentation or idea sketching as well.

Jul 11

Eclipse JBoss server runtime library lost

Tags: , , , Comments Off on Eclipse JBoss server runtime library lost

Today, I had a strange problem with Eclipse. I have an EJB project with JBoss v4.2 selected in targeted runtimes (project properties) and as such the JBoss v4.2 server runtime classpath variable. I have really no idea what happened, but the effect was that the JBoss classpath entry didn’t show up any longer. My first thought was that maybe the .classpath file got mixed up, but it still contained the required entry. The project properties also contained all the correct information. Just the package explorer didn’t show the entry and it definitely wasn’t there as the build for the project failed because the required classes could not be found.

The <workspace>/.metadata/.log file contained the following error message many times:

!ENTRY org.eclipse.jst.server.core 4 0 2008-07-11 16:24:46.251
!MESSAGE Error calling delegate RuntimeClasspathProviderWrapper[org.eclipse.jst.server.generic.runtimeTarget]: null

So this must have been a bug in resolving the server classpath. I couldn’t find an equivalent problem description, and after playing around with the project settings, adding and removing the library manually, which didn’t help any further, I tried updating the Java Standard Tools. There was indeed a patch available. My previous version of JST was org.eclipse.jst_2.0.2.v200802150100-7B-7_8dDTOvmuz0di_U5vgUfz0em and I installed the patch org.eclipse.jst.web_core.feature.patch_2.0.2.v200803241913-208i8s733I395D6BA7. My Eclipse SDK version used is 3.3.2, Build id M20080221-1800.

After the installation of the patch and a restart of Eclipse, the JBoss v4.2 entry showed up again and the error message didn’t occur any longer in the log file. As I said, I don’t really know what had happened, but the patch might have resolved the issue for me, so maybe this helps someone out there, who runs into the same problem.

Jul 10

Eclipse is a great IDE for developing any kind of Java code, e.g. Rich Client (RCP), Web or standalone applications. However, when a project is built using any IDE (yes, there are others – e.g. Netbeans or IntelliJ IDEA), there may be some dependencies towards the chosen tool when it comes to compiling and packaging the code. This doesn’t matter too much as long as there is no requirement to automate the build process. This will happen, as soon as you decide to set up Continuous Integration for your project.

Continue reading »

Apr 25

This just made my day:

When you’re in Eclipse (IDE), press Ctrl+3, then enter the name of a view, editor, preference, command, menu etc. or previously opened resource (e.g. a Java class), select the desired match from the list and voilà – Eclipse navigates you there. You can also enter the initials of the words you are looking for, e.g. “pe” for “Package Explorer”. That’s really a cool feature and available since Eclipse 3.3. It brings kind of a “spotlight feeling” to your development work ;)

Good bye, “Show View” and “Open Perspective” ;)

Feb 04

Tag vs. Location in Subversive tag dialog

Tags: , , , Comments Off on Tag vs. Location in Subversive tag dialog

Have you ever wondered why you have to enter the full location for a tag (like http://svnserver/tags/v20080204) instead of simply entering the tag name (like v20080204) when you are about to create a new tag for a project via the context menu (Team -> Tag…)?

The solution is to enable structure detection for the Subversion repository:

  • Switch to the SVN Repository Exploring perspective in Eclipse
  • In the SVN Repositories view, right-click on the repository and select Location Properties…
  • Go to the Advanced tab and activate Enable Structure Detection

Of course, the Resource Names must correspond to the folders in the repository to make this work.

From now on, the tag dialog will ask you for the Tag instead of the full Location.

Feb 02

I have been using Polarion.org’s Subversive plug-in for quite some time now. The latest version from Polarion was 1.1.9. Since the project is now hosted on Eclipse.org, the old update site does not provide the up-to-date version of Subversive. Fortunately, there is a migration guide for those who want to make the switch. The current version is 0.7, since Eclipse projects in incubation phase should have a version less than 1.0.

Migration in a nutshell:

  1. DO NOT UNINSTALL the Polarion.org version before installing the Eclipse.org version, otherwise you may lose all your SVN settings.
  2. Install the new version of Subversive + the SVN connectors (still from the Polarion site).
  3. Migrate your workspace via Help > Subversive > Migrate Projects and Settings. Do this for EACH workspace you want to be up-to-date.

(Please refer to the above mentioned migration guide for details.)

Unfortunately, shortly after I started the migration of projects and settings in my workspace, the dialog did not show any further progress after reporting that settings were converted and Eclipse seemed to hang somehow. Since nothing happened after a while, I decided to terminate the process and restart Eclipse. This time the migration worked, except for a warning that some closed projects could not be remapped. So I opened those projects and performed another migration which finished without any errors.

The next weeks will show whether it was a good idea to migrate to the still incubating project ;)

Feb 01

Enterprise application development with Eclipse Riena

Tags: , , Comments Off on Enterprise application development with Eclipse Riena

While browsing the sessions of this year’s JAX conference I stumbled on the Eclipse Riena project.
The project page says:

“The Riena platform will be the foundation for building multi-tier enterprise client/server applications. As such Riena will broaden the usage of the service oriented architecture of OSGi/Equinox by providing access to local and remote services in a transparent way. Using this uniform programming model, the components of Riena and the business components of the enterprise application can be developed regardless of their target location. Components are later easily placed on client or server depending on the business requirements.”

The ideas behind Riena look very promising. If you have previously faced the task of writing a RCP client for an enterprise application, e.g. based on EJBs, then you have probably already struggled with at least some of the items on the project plan. Instead of putting all your effort into the features and usability of the application, you end up spending a considerable amount of time debugging RMI classloading issues (until you place Thread.currentThread().setContextClassLoader(this.getClass().getClassLoader() in your bundle’s start method or before any remote access in some ServiceLocator…) or configuring authentication/authorization mechanisms. Not to mention the tedious exception handling of pre-EJB3 session beans… Of course, you can solve such problems somehow on your own, but you should always ask yourself why you have to solve them and why there is no built-in framework or component that handles the intricacies for you.

I’m also very curious about the announced persistence support. I wonder if service tiers for data access will be addressed. You have to decide at some point to either provide dedicated data transfer objects or the mapped entities themselves. However, the latter brings up further questions regarding lazy loading of uninitialized fields of objects that have already been transfered to the client. But more on this possibly in another post…

Hopefully, with Riena, we can soon spend less effort on infrastructure and concentrate more on things that matter.

Apr 25

Sessions that I attended today (most of the titles are actually in German, so I had to translate some):

  • Rating of software architectures, Part 1: Method
    Dr. Gernot Starke – very good speaker
    Experience is required for rating architectures; functional requirements are not enough; Quality tree -> ISO…, ATAM (Architecture Tradeoff Analysis Method (SEI))
  • SOA – Defining services from a business point of view
    Lars Roewekamp, OpenKnowledge GmbH – ok, slides hardly readable from the back (small fonts)
    Some interesting thoughts about structuring services and service operations according to business requirements rather than existing IT architectures.
  • Keynote: Bringing Web 2.0 in the Enterprise
    Rahul Patel (Oracle)
  • Persistence with Spring
    Eberhard Wolff, Interface21 Germany – very good speaker
    Comparison of different persistence approaches using spring templates for plain JDBC, iBatis and O/R-mappers like Hibernate; recommendation to use O/R-mappers with great care, especially if database-centric/relational concepts have to be considered (batch operations, stored procedures etc.).
  • Keynote: The security development lifecycle at Microsoft
    Sebastian Weber, Microsoft Deutschland GmbH
    www.thedailywtf.com ;)
  • Message-oriented architectures based on Spring
    Jürgen Höller, Interface21 – good speaker
    API-oriented approach outlining the differences between messaging and asynchronous execution; would have expected to see some example architectures, but there were “only” small source code examples; nevertheless an interesting topic
  • Eclipse Code Camp Night
    Moderated by Wayne Beaton, Eclipse Foundation
    Some specific eclipse development problems were discussed ad-hoc; had some discussion with Wayne and Bernd Kolb about security in enterprise application clients based on RCP, but came to the conclusion that there is no project/proposal yet, unless I wrote one ;)
Mar 28

Eclipse 3.3 M6 runs on Windows Presentation Foundation

Tags: , , , Comments Off on Eclipse 3.3 M6 runs on Windows Presentation Foundation

Milestone 6 of Eclipse 3.3 development runs on Windows Presentation Foundation (WPF) as you can see on the New & Noteworthy page. Furthermore, SWT now uses native Vista features for improved performance. I haven’t tried it yet, but since I’m running Vista on my work laptop, I will probably look into it soon.

blog