As mentioned here and here and here, the GTK version of SWT wastes much space in tables and trees. Even with the GTK theming, rows in trees have still too much space between them:

I spent some time with GDB to find out where the additional padding above and below the text of each item comes from. In the end I found out, that text cell renderers in GTK (gtk/gtkcellrenderertext.c) have a default y-padding of 2 pixels set:
GTK_CELL_RENDERER (celltext)->ypad = 2
While you can’t do much to fix it in Eclipse right now, here’s the hack to make it work for your own SWT programs:
val t: swt.widgets.Tree = //
import swt.internal.gtk.OS
val rendererMethod = t.getClass.getDeclaredMethod("getTextRenderer", java.lang.Long.TYPE)
rendererMethod.setAccessible(true)
val h = OS.gtk_tree_view_get_column (t.handle, 0)
val r = rendererMethod.invoke(t,java.lang.Long.valueOf(h)).asInstanceOf[java.lang.Long].longValue
OS.g_object_set (r, OS.ypad, 0, 0)
With this set, the tree from above looks much more compact:

Advertisement
is it possible to change eclipse _only_ to use less spacein trees. compared to other IDEs such as IDEA, it seems to be wasting a lot of space.
No, unfortunaltely it isn’t possible to change that from the outside. You would need a patch to SWT GTK to make this setting controlable.