Bug 219756 - doSave using an IRunnableWithProgress fails to re-enable menu items afterwards
Summary: doSave using an IRunnableWithProgress fails to re-enable menu items afterwards
Status: RESOLVED WORKSFORME
Alias: None
Product: RAP
Classification: RT
Component: Workbench (show other bugs)
Version: 1.0   Edit
Hardware: PC Windows XP
: P2 major (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: needinfo
Depends on:
Blocks:
 
Reported: 2008-02-21 05:36 EST by Matt Biggs CLA
Modified: 2009-08-10 16:44 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Matt Biggs CLA 2008-02-21 05:36:02 EST
I have created a RAP application that implements a standard eclipse SAVE action and an EditorPart. 

Inside the doSave() method if i use an IRunnableWithProgress for a long operation, the menu items (eg File) correctly disable but then fail to re-enable after the progress dialog dissapears. 

I have tested this in normal RCP and it works correctly. I have also checked an EMF editor that i was working on it and it uses very similar code. Am i doing something wrong? It looks as if the dialog is blocking the menu enablement. 

This has been tested with 1.1 M2


 @Override
  public void doSave(IProgressMonitor progressMonitor)
  { 
    // Do the work within an operation because this is a long running activity that modifies the workbench.
    //
    IRunnableWithProgress operation = new IRunnableWithProgress()
    {
      // This is the method that gets invoked when the operation runs.
      //
      public void run(IProgressMonitor monitor)
      {
        // Do long operation
        //
        for( int i = 0; i < 1000000; i++ )
        {
          System.out.println("Print this");
        }
      }
    };
    
    try
    {
//      // This runs the options, and shows progress.
//      new ProgressMonitorDialog(getSite().getShell()).run(true, false, operation);
      
      PlatformUI.getWorkbench().getProgressService().busyCursorWhile( operation );
      
      ((BasicCommandStack)editingDomain.getCommandStack()).saveIsDone();
      firePropertyChange(IEditorPart.PROP_DIRTY);
    }
    catch(Exception e)
    {
      e.printStackTrace();
    } 
}
Comment 1 Ivan Furnadjiev CLA 2009-05-18 11:45:43 EDT
Matt, in 1.2M7 we fixed a bug 245100. Can you check if the issue persist with the latest milestone build or CVS HEAD?
Comment 2 Benjamin Muskalla CLA 2009-08-07 08:57:42 EDT
Matt, I cannot reproduce this issue with your snippet.
Marking this as WORKSFORME. If you still encounter problems, please reopen with a snippet.