Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-core-dev] the elusive progress monitor

> 
> As it turns out, since I was creating the proejct with createCProject(),
> it already had a C nature, so I didn't need to call addCNature().
> 
> I spent most of the day today banging my head on my desk trying to figure

8-), yes eclipse learning curve can be a "little" steep ... my curly salt/pepper
hair is a testimony.

> out how to change the buildArguments for the Make nature.  Finally, I
> found the right APIs and the right order in which to call them!
> 
> The only major omission in my plug-in at this phase is a progress monitor.
> I've tried several different approaches through the day to try to get a
> progress bar to come up on my screen with no success.  Here's what my
> plug-in looks like at the moment.  Compiles fine, but does not display a
> progress bar.  Do you (or anyone on this list willing to help) have a clue
> as to why?
> 
...
> Any pointers would be greatly appreciated.

Maybe in your run() method you can use a job

public void run(IAction ..) {
	Job job= new Job("My Creation Project") {
		protected IStatus run(IProgressMonitor monitor) {
			monitor.beginTask(..);
			try {
				// do stuff
			} finally {
				monitor.done();
			}
		}
	};
	job.setUser(true);
	job.schedule();
}

or maybe use the ProgressService:

public void run(IAction ..) {
	IRunnableWithProgress runnable= new IRunnableWithProgress() {
		public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
			// do stuff
		}
	};
	IRunnableContext context = PlatformUI.getWorkbench().getProgressService()
	context.run(true, true, runnable);
}


Only suggestions, maybe folks here have other ideas.




Back to the top