Reputation: 818
I am developing an Eclipse plugin that creates a project in the current workspace. I want to show a progress bar in the wizard window (above the next - previous - finish buttons ) to represent the progress of creation. However, when the finish button is pressed, the progress bar is not shown. Below is my code.
@Override
WorkspaceModifyOperation op = new WorkspaceModifyOperation() {
@Override
protected void execute(IProgressMonitor monitor) throws CoreException,
InvocationTargetException, InterruptedException {
monitor.beginTask("Create *** Project", 100);
try {
ProjectUtil.createProject(monitor);
} catch (Exception e) {
} finally {
monitor.done();
}
monitor.done();
}
};
try {
getContainer().run(true, true, op);
} catch (InvocationTargetException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
Inside the createProject(IProgressMonitor monitor)
method of class ProjectUtil
, I have monitor.worked(someWork)
after each operation.
What am I missing?
Upvotes: 0
Views: 622
Reputation: 3304
Try to set setNeedsProgressMonitor(true); in the class, which extends Wizard. Hope this helps.
Upvotes: 1