refresh zest graph on click [message #975310] |
Wed, 07 November 2012 14:38  |
Eclipse User |
|
|
|
I want to know if this is possible with zest framework. I mean, first, the results are displayed as a tree view, with the root and the next level children, the rest of the children are displayed when the user clicks on one of the nodes. So my question is, it is possible to create a graph with hidden nodes and making them appear when the user clicks on one of the roots, refreshing the original graph?
|
|
|
Re: refresh zest graph on click [message #975383 is a reply to message #975310] |
Wed, 07 November 2012 15:55   |
Eclipse User |
|
|
|
Hi,
there is no direct support for these features, however there are some ways to tackle the issue:
* If you are using a GraphViewer API, you could add org.eclipse.zest.layouts.Filter (in version 1.x) or org.eclipse.zest.core.widgets.LayoutFilter (version 2.x). A GraphViewer supports multiple filters, or your filter could have a switch functionality for selected items. In case of filtering changes you have to refresh the viewer.
* You could define with the GraphViewer API a content provider that reacts to the selection changes. If new elements are to be added, then you have to refresh the input, so the content provider runs again.
* Zest 2 introduces a new functionality called SubGraph handling (see http://wiki.eclipse.org/index.php/Zest#New_subgraph_rendering for details). Although this functionality does not directly support, what you need, but might form a basis to create it.
* All of the previous solutions relied on the creation and removal of nodes. If you want to have a dedicated place for non-visible objects, you would either need a very specific layout algorithm (quite probably custom written). If this is not acceptable, you could implement in your LabelProvider the IFigureProvider interface, and replace the filtered elements with non-visible Figures.
I hope, at least one of the ideas is useful to you.
Cheers,
Zoltán
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.81144 seconds