I am implementing the the views for the OS X version of our SWT Java application, and would like to use the ‘source list’ option offered by NSOutlineView in my SWT Tree.
I implemented this by hacking my own version of Tree.class by adding this code to the #createHandle() method:
long NSTableViewSelectionHighlightStyleSourceList = 1;
long hi = OS.sel_registerName("setSelectionHighlightStyle:");
OS.objc_msgSend(widget.id, hi, NSTableViewSelectionHighlightStyleSourceList);
Which essentially just flags the underlying NSOutlineView to use the NSTableViewSelectionHighlightStyleSourceList style.
It looks like this:

which kind of works, but does not fully emulate the NSOutlineView behavior. For example, when selecting root nodes, even though the title has enough space it still truncates it like this:

Another problem with this is that I don’t know how to implement categories (or groups/folders) like you see in Finder.app/iTunes.app/Mail.app/the following example:

Notice the FAVORITES category, and how it is formatted. This is handled in a regular ObjC application by returning true in the outlineView:isGroupItem method in the outlineView delegate, but I have no idea where to hack that in.
So my question is
How do I go about implementing the category(isGroupItem) functionality in SWT on OS X?
I managed to make the adjustments to the SWT java source and native source to get this working as shown in the image below.
A custom SWT for mac cocoa x86_64 can be dowloaded here.
The changes made to the source at the time can be seen in this commit
A snippet showing how this works is shown below. The
SWT.SOURCE_LISTstyle is used to mark the tree as a source list and theSWT.GROUP_ITEMstyle is used to mark the items that are group items.