« Upgrading to Leopard (finally) | Main | Up to my neck in SWT GUI »

May 22, 2008

The Platform Ends Here

Dead-end I apologize for the somewhat grim title. I just couldn't help it. I'm working on my Eclipse plug-in, deep into shaping my UI. Working with SWT is fine, I don't have many complaints. Well, until I reached the border. SWT controls have many limitations. It's natural for a framework to have limitations. However, SWT is a framework suited for running on multiple platforms, which means it's the lowest common denominator.

I reached one of these borders this week - I found out that I cannot have a list with variable row height. All rows must be of the same height. Since I want a list with fixed width and word wrap and this is simply impossible without having huge gaps between the lines (each line will have the height of the tallest line). It's not the first time I come across such a limitation. For example, a few weeks ago I found that I cannot have a list without scrollbars. Yep. Even if I don't need them, they will always be there.

Each time I encounter such a block, it usually takes me time just to understand that this is a platform limitation. These limitations are tucked inside the Eclipse Bugzilla or in the Eclipse discussion forums (both not indexed by Google regular search, by the way). It is very time consuming.

My main option now is to simply create a list myself by using more basic controls. This means I'm going to have to write a lot of code which is already written inside the framework. That's mostly because the framework is very hard to extend. Most of the classes implementing the controls are specifically marked as "do not extend". That's mainly because of the implementation which is platform specific. I can understand the rationale.

What I can't understand is JFace. JFace is a neat little framework that works on top and with SWT to provide common tasks like working with lists, trees, etc. There are many important features there. However, this framework simply cannot be extended. It is fixed to the SWT widgets, which cannot be extended, so extending it is out of the question. Needless to say, there is no documentation what so ever on the topic.

Designing a reusable framework is a delicate task. It is far more complex than designing a framework which is to be used as is, without extensions. A reusable framework is measured by the amount of code you have to rewrite. In the case of JFace, it simply failed.

TrackBack

TrackBack URL for this entry:
http://www.typepad.com/services/trackback/6a00d83548421753ef00e5526a86108833

Listed below are links to weblogs that reference The Platform Ends Here:

Comments

About nWire

  • nWire Logo
    Browse & visualize all code association in one extremely powerful view, quick search for methods, fields and more. Boost your coding productivity in Eclipse™.
    Watch a 4 minute demo that will change the way you look at your code.
    Visit nwiresoftware.com

Twitter Updates

    follow me on Twitter
    My Photo

    My Other Accounts

    Delicious Digg Facebook FriendFeed Google Talk LinkedIn Reddit Twitter

    AddThis Social Bookmark Button
    Blog powered by TypePad
    Member since 05/2007