java - Proper way to update UI from EContentAdapter -
i have econtent adapter causing refresh of numerous tables. while theoretically possible filter notifications downwards exact notifications should cause refresh on tables, extraordinarily hard , time-consuming have massive model, , many different events , changes perchance trigger refresh. also, happens single "user-event" (like clicking state->new in our application), triggers 4 objects beingness created behind scenes, of similar notification standpoint , hence makes hard filter out. i'm wondering if there way sort of "delayed job" 4 notifications cause single refresh. example, similar to:
public void notifychanged(final notification notification) super.notifychanged(notification); @override public void run() { if(matchesfilters(notification)) { //some sort of check see if had event have triggered refresh? if(!schedulingjob) { scheduledelayedjob(); } } } }
unfortunately have little experience in jobs , things that, helpful if give assistance in proper way of doing is.
as example, if hits control-n 20 times in our application rapidly, rapidly create 20 new states, , want update ui @ end of 20 notifications, not refresh 20 times.
if understand correctly, eclipse provides need this. first, guis should updated on display thread. second, there method asynchronous execution, follows:
final iworkbench workbench = platformui.getworkbench(); workbench.getdisplay().asyncexec(new runnable() { public void run() { // thing, e.g. refresh() } });
what in runner depends on gui framework. if you're using jface, can refresh(), believe smart queuing work.
java user-interface eclipse-emf eclipse-emf-ecore emf
No comments:
Post a Comment