Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[platform-dev] Question about Using IProgressService

Hello:
I would like to show the progress of a job in the progress view but I could not send the job to be run.
Here is my code:
		Job job = new Job("My Job") {
            		     @SuppressWarnings("static-access")
						protected IStatus run(IProgressMonitor monitor) {
            	     	           setProperty(IProgressConstants.ICON_PROPERTY, "\\icons\\sample.gif");
            		           if (isModal(this)) {            	
            		           	  PlatformUI.getWorkbench().getDisplay().getDefault().asyncExec(
            		    				new Runnable(){
            		    					public void run() {
            		    						rjparam.callProgram(.....);//HERE is where I call my //method
            		    					}
            		    				}
            		    			);
            		              } else {
            		              setProperty(IProgressConstants.KEEP_PROPERTY, Boolean.TRUE);
            		              setProperty(IProgressConstants.ACTION_PROPERTY, getAnalysisCompletedAction());
            		              }
            		           return Status.OK_STATUS;
            		        }
            		     };
            		  job.setPriority(Job.SHORT);
            		  job.setUser(true);
            		  job.schedule();
            	


	     IProgressService service = PlatformUI.getWorkbench().getProgressService();
            		     try {
            		     service.run(.....);//HERE, i want to send my job (somehow) to be run
            		     } catch (InvocationTargetException e) {
            		        // Operation was canceled
            		     } catch (InterruptedException e) {
            		        // Handle the wrapped exception
            		     }

Thank you in advance.
Magna


Back to the top