Skip to main content



      Home
Home » Modeling » EMF » ViewerRefresh delay break setting selection
ViewerRefresh delay break setting selection [message #1797285] Mon, 29 October 2018 10:21 Go to next message
Eclipse UserFriend
In a editor, for the selectionViewer I use the AdapterFactoryContentProvider as a content provider.
I am (asynchronously) loading a resource in the editingdomain resourceset, after the editor has opened. When the resource is loaded, I set the selection on the treeviewer to the newly created resource. In EMF <2.14 this worked fine.
However, in EMF 2.14 this no longer works correctly. The new ViewerRefresh delays the refresh of the tree-viewer, as a result, the selection is set before the new tree is displayed. And setting the selection fails.

Is there a way to set the selection after the viewer is refreshed?

Best Regards,
Rolf

[Updated on: Mon, 29 October 2018 10:26] by Moderator

Re: ViewerRefresh delay break setting selection [message #1797299 is a reply to message #1797285] Mon, 29 October 2018 11:54 Go to previous messageGo to next message
Eclipse UserFriend
ViewerRefresh is very old and has always been delayed. The only new thing is org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider.ViewerRefresh.ViewerRefresh(Viewer, int) with a threshold because a single refresh is faster than a large number of incremental updates. Does Display.asyncExec to set the selection help?
Re: ViewerRefresh delay break setting selection [message #1797363 is a reply to message #1797299] Tue, 30 October 2018 06:40 Go to previous messageGo to next message
Eclipse UserFriend
Using Display.asyncExec does not help, still the selection is set before the (200ms) delay of the refresh. After looking some more in our code, we already did some tricks to delay all notification while loading the model, to reduce the number of updates (for performance reasons). When this code is disabled, the model is created a little more gradually, and the element to be selected is available before the selection is set. And the performance seems to be good too.
Re: ViewerRefresh delay break setting selection [message #1797373 is a reply to message #1797363] Tue, 30 October 2018 08:28 Go to previous message
Eclipse UserFriend
Note too that you can control the threshold and delay via org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider.getViewerRefreshTheshold() and org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider.getViewerRefreshDelay().
Previous Topic:Prevent XCore to change the .project file.
Next Topic:[CDO] How delete all revisions of object?
Goto Forum:
  


Current Time: Tue Jul 08 20:48:17 EDT 2025

Powered by FUDForum. Page generated in 0.03325 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top