How to group elements by type in a JFace TreeViewer?

103 Views Asked by At

I am writing a treeviewer which displays my model, which includes three classes Project, Course and Student. Each project can have multiple courses and each course can have multiple students.

I am using the TreeViewer class of JFace.

To Display this model, I have created a treeviewer, which looks like the following.

enter image description here

I want these Courses (course1, 2 and 3) to be grouped under a node COURSES like following.

enter image description here

Is there a function to group elements under a parent by the element type? Or can I introduce this dummy node "Courses", which is actually not a part of my model.

0

There are 0 best solutions below