swt Tag

Often when I use SWT templates in a presentation, some people look amazed, so I thought it's worth sharing. If you write SWT code and don't know these templates yet, you may be wasting time typing the same code over and over again. Whenever you write an SWT snippet, you start with a Display, a Shell, and the SWT mainloop. That's this piece of code that...

Read More

Eclipse Luna ships tomorrow and that means we've made it to number 2 on the Eclipse Luna Top 10 Features That I'm Excited About. Number 2 is a feature enhancement that was first requested in 2002. Over 200 people voted for this enhancement and 181 comments have been posted on Bugzilla! The bug even celebrated a 10 year anniversary. Of course I'm talking about bug 8009: Split Editors, and with...

Read More

When Eclipse 3.0 shipped in 2004 it brought a new look to the workbench. Now, 10 years later, an entirely new Dark Theme is launching. Eclipse Luna will ship in less than a week and to help mark the occasion, I'm counting down the Top 10 Eclipse Luna features that I'm really excited about. Number 5 on my list is the new Dark Theme. Developers are passionate about...

Read More

In my last blog post, I started to describe the framework EMF Forms in more detail and compared it to manual UI programming. To recap, EMF Forms is a framework for efficiently creating form-based user interfaces. Instead of programming form-based UIs manually, they can be described by a simple view model. This model is then interpreted by a customizable rendering component to display the actual...

Read More

As you might have noticed, Java 8 was released last week ;). Most programers consider Java 8 the biggest change to the Java programming language ever made. This is mostly because of lambda expressions, default methods and streams. As an SWT/RAP/Tabris coder, the first thing that came to my mind was: "How can this make my SWT code better?". This blog will show you how to...

Read More

Here is a widespread way of creating a label with a bold font: [raw] Label label = new Label(shell, SWT.NONE); Font boldFont = new Font( label.getDisplay(), new FontData( "Arial", 12, SWT.BOLD ) ); label.setFont( boldFont ); label.setText("Bold Label"); [/raw] Everything seems to be fine with this code. A Label is created with the default font "Arial", the default size "12" and our desired style "BOLD". So what's the problem with this snippet? With the...

Read More

Creating UIs with SWT or RAP is a common task in many projects. While we have a comprehensive set of widgets at our disposal, we only have a handful of layouts to choose from. One of the more popular layouts is the GridLayout. Together with its child the GridData it allows you to cover most of your layout needs. Sometimes nesting several composites is required...

Read More

With all of the current mobile and desktop operating systems we use all day, most users expect a great deal from an application user interface. People take things like animated transitions, gesture-based navigation, transparent controls and high resolution graphics, for granted. Yes, SWT recently added Touch- and Gesture Listeners. And yes, you can set alpha on a shell. And yes, you can use a FormLayout to have overlapping UI elements. But...

Read More

Working with tables or trees with more than a handful of rows, you quickly find that you need a way to filter or search for content, otherwise they become unusable. The Eclipse workbench offers an out-of-the-box component named FilteredTree which adds an input field to an SWT tree where filter strings can be entered by the user. However, support for SWT tables is missing. This...

Read More