plugins - Eclipse Plug-In developement, long running task -


i have several ui-components have listeners. these listeners invoke method dialogchanged(). goal make long processing in method , don't let ui freeze. according lars vogel possible of uisynchronize being injected during runtime. fails me, field of type not being injected , nullpointerexception. here's relevant part of code:

@inject uisynchronize sync; job job = new job("my job") {      @override     protected istatus run(iprogressmonitor arg0)     {         sync.asyncexec(new runnable()         {             @override             public void run()             {                 updatestatus("checking connection...");                 if (bisinstalldirselected)                     bissettingschanged();                 else                     jarsettingschanged();             }         });         return status.ok_status;     }  }; protected void dialogchanged() {     job.schedule(); } 

the methods updatestatus(string s), bissettingschanged() , jarsettingschanged() interact ui, presice, use method seterrormessage(string newmessage) of superclass org.eclipse.jface.wizard.wizardpage i'd appreciate if tell me doing wrong or suggest better way handle problem.

you can use @inject in classes e4 application model creates (such class part or command handler).

you can use contextinjectionfactory injection on own classes.

for classes injection has not been done can use 'traditional' way of running code in ui thread:

display.getdefault().asyncexec(runnable); 

Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -