Questions tagged [treeviewer]
144 questions
10
votes
2 answers
Saving TreeViewer state before setInput()
I'm trying to save JFace TreeViewer expansion state to refresh it after calling setInput() method. I tried getExpandedElements, setExpandedElements, getExpandedTreePaths, setExpandedTreePaths methods of TreeViewer but it doesn't work.
Object[]…

penguru
- 4,342
- 11
- 46
- 56
10
votes
4 answers
How best to use ViewerFilter on a TreeViewer?
I am applying a ViewerFilter to a tree of a few branches, but mostly leaves. The filter really applies to the leaves, using properties within the leaf. All branches are left untouched so that their leaves can appear.
However I would like to filter…

Martin Cowie
- 2,788
- 7
- 38
- 74
9
votes
1 answer
Lazy and Deferred TreeViewer questions
I have actually two questions but they are kind of related so here they go as one...
How to ensure garbage collection of tree nodes that are not currently displayed using TreeViewer(SWT.VIRTUAL) and ILazeTreeContentProvider?
If a node has 5000…

Svilen
- 1,377
- 1
- 16
- 23
6
votes
2 answers
Change SWT tree node text foreground when highlighted
I’m pretty new in SWT/JFace technology and I’ve found a problem that it’s driving me crazy. In an Eclipse RCP application I have a view where I’ve placed a SWT tree with a JFace TreeViewer which provides the labels and the icons by means of a label…

Alejandro González
- 481
- 9
- 22
5
votes
2 answers
SWT: How to use only one scrollbar to scroll two seaparate viewers
I'm putting two TreeViewers in an SWT Shell.
They each have their own scrollbars. However, I would like to have only one Scrollbar in the Shell which controls the scrolling of both TreeViewers simultaneously.
The only example of this I've been able…

CodyBugstein
- 21,984
- 61
- 207
- 363
4
votes
2 answers
SWT/JFace TreeColumn reordering - issue with setMoveable()
I am trying to set up a multi-column SWT Tree (via a JFace TreeViewer) that allows its columns to be re-ordered by the user by dragging the column headers. However, the first column should remain fixed and unmoveable. I can use the setMoveable(true)…

Dave Hartnoll
- 1,144
- 11
- 21
4
votes
1 answer
How to create a mouse rightclick menu for a jface treeviewer
I have created a TreeViewer using JFace, but now I have to add a right click listener to the nodes. When the right click is done it has to show a menu like:
Do something
Do Nothing
Delete
I am trying to do this as follows, but it is throwing a…

vinod raj
- 69
- 2
- 10
4
votes
0 answers
Select column showing expand/collapse buttons in jface TreeViewer
I am searching if it is possible to select which of the columns of a org.eclipse.jface.viewers.TreeViewer.TreeViewer shows the expand/collapse buttons.
I have a setup with with 3 TreeViewerColumns, where the first column is fixed width and only…

user2623580
- 91
- 1
- 2
3
votes
5 answers
How do you get a TreeViewer in SWT to refresh properly?
I have an app that uses a JFace TreeViewer. I have it hooked up to a ContentProvider. Mostly, it works great. However, for some actions, like adding a Node in the middle of a list of Nodes or changing a value which should change the label for a…

Mark
- 1,988
- 2
- 24
- 42
3
votes
3 answers
JFace - How can I make only one column editable in TreeViewer based on checkbox value from another column in the same row?
I have a TreeViewer which has two columns: ProximityClustersColumn: which has names as String, selectionColumn: which has checkbox as shown in the figure
TreeViewer
I have two questions:
On clicking the selection column's checkbox, the…

anjalli
- 53
- 6
3
votes
1 answer
How to get the columns of a jface Tree Viewer?
Having a reference to a jface TreeViewer, how can you get a list of its columns, e.g. TreeViewerColumn objects? Something like:
TreeViewer treeViewer = (TreeViewer)viewer;
TreeViewerColumn[] treeViewerColumns = treeViewer.getColumns();
Is it just…

pm_
- 853
- 6
- 15
3
votes
1 answer
Hiding empty parents - JFace's TreeViewer
I'm creating a tree viewer in JFace and I want to achieve something.
I use filter in it. The filter works well, but not perfectly. When I use filter.expandAll() method, the filter filters all of the tree's items, but there's something really…

m4tx
- 4,139
- 5
- 37
- 61
3
votes
1 answer
How to hide a first column with tree hierarchy in treeviewer?
I want to completely hide the 1st column in TreeViewer. If I hide it with setWidth(0) then the next visible column gets triangles and paddings. The most silly way is to dispose TreeViewer and create TableViewer every time when 1st column is hidden.…

Ezhik
- 876
- 6
- 23
2
votes
1 answer
Selected added item in TreeViewer
I have and Add button and TableViewer in my application. When the Add button is pressed, I'm adding a new element to my model, then refreshing that viewer.
The question is: How to select this newly added item in my viewer?

execc
- 1,083
- 12
- 25
2
votes
3 answers
SWT JFace: How to implement a "leveled or expandable TableViewer"?
I think this question is quite common.
Recently I have got a requirement that I need to make a leveled or expandable table-like view. If you need an example, you can refer to Mac OS X's Activity Monitor:
At the same time I tried an example here…

Dennis Wong
- 189
- 4
- 11