[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
[cdt-core-dev] the elusive progress monitor
|
Alain,
Your pointers have been wonderful, thank you!
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
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?
public class CreateProject implements IWorkbenchWindowActionDelegate {
private IWorkbenchWindow window;
public ProgressMonitorPart monitor;
public CreateProject() {
}
public void run(IAction action) {
...
monitor = new ProgressMonitorPart(window.getShell(), null);
monitor.beginTask("Creating " + projectName +
" project", TOTAL_WORK);
...
monitor.worked(2); // 2% done
...
monitor.done();
}
...
}
I've searched the manuals a lot today, and most every place where it talks
about a progress monitor, the required first parameter is Composite parent.
I'm passing in window.getShell() because it's all I have to work with...
(from org.eclipse.platform.doc.isv_3.0.1_doc/reference/api/org/eclipse/-
swt/widgets/Shell.html...)
|
+--org.eclipse.swt.widgets.Composite
|
+--org.clipse.swt.widgets.Canvas
|
+--org.eclipse.swt.widgets.Decorations
|
+--org.eclipse.swt.widgets.Shell
...but I'm guessing that's where the problem is.
Any pointers would be greatly appreciated.
Regards,
David Spakes
On Wed, 2 Mar 2005, Alain Magloire wrote:
> You were on the right track. You need to add the Standard Make Nature
> to your project, something like:
>
> IProgressMonitor monitor = ...;
> String projectName = ...;
>
> // get a project handle.
> IProject myProject = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
>
> // Add the C Nature or the C++ Nature with CCProjectNature
> CProjectNature.addCNature(myProject, monitor);
>
> // Add the Standard Make builder Nature
> // this will configure the builders etc ...
> MakeProjectNature.addNature(myProject, monitor);
>
> // You may also want the autodiscovery scanner configurations.
> ScannerConfigNature.addScannerConfigNature(myProject);
>
> Take a look at articles and documentation(on Eclipse) explaining the
> relation between nature vs Builder
> Also look at IProjectNature class.
-------------------------------------------------------------
David Spakes email: spakes@xxxxxxxx
SNMP Research voice: +1 865 573 1434
3001 Kimberlin Heights Road fax: +1 865 573 9197
Knoxville, TN 37920-9716 USA http://www.snmp.com
-------------------------------------------------------------
SNMPv3 is now...
the Full Internet Management Framework
(RFC 3410-3418)
Are your management tools secure, open, flexible, and scalable?
Rely on the proven experts when taking your next step