Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » ViewerRefresh delay break setting selection
ViewerRefresh delay break setting selection [message #1797285] Mon, 29 October 2018 14:21 Go to next message
Rolf Theunissen is currently offline Rolf TheunissenFriend
Messages: 260
Registered: April 2012
Senior Member
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 14:26]

Report message to a moderator

Re: ViewerRefresh delay break setting selection [message #1797299 is a reply to message #1797285] Mon, 29 October 2018 15:54 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33142
Registered: July 2009
Senior Member
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?

Ed Merks
Professional Support: https://www.macromodeling.com/
Re: ViewerRefresh delay break setting selection [message #1797363 is a reply to message #1797299] Tue, 30 October 2018 10:40 Go to previous messageGo to next message
Rolf Theunissen is currently offline Rolf TheunissenFriend
Messages: 260
Registered: April 2012
Senior Member
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 12:28 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33142
Registered: July 2009
Senior Member
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().

Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:Prevent XCore to change the .project file.
Next Topic:[CDO] How delete all revisions of object?
Goto Forum:
  


Current Time: Fri Apr 26 17:07:43 GMT 2024

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

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

Back to the top