iargin
iargin

Reputation: 818

Progress is not shown in Eclipse wizard window

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

Answers (1)

Alex K.
Alex K.

Reputation: 3304

Try to set setNeedsProgressMonitor(true); in the class, which extends Wizard. Hope this helps.

Upvotes: 1

Related Questions