Bug 64928 - Change builder when workspace is locked
Summary: Change builder when workspace is locked
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Ant (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.0 RC2   Edit
Assignee: Kevin Barnes CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 66429
Blocks:
  Show dependency tree
 
Reported: 2004-06-01 08:45 EDT by Dirk Baeumer CLA
Modified: 2004-06-11 15:22 EDT (History)
5 users (show)

See Also:


Attachments
Patch for BuilderPropertyPage (3.88 KB, patch)
2004-06-09 16:09 EDT, Darin Swanson CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dirk Baeumer CLA 2004-06-01 08:45:07 EDT
RC1

- lock workspace in background operation
- open project properties
- select Builders
- uncheck Java Builder
- press OK

observe: nothing happens. 

There should be a blocking dialog informing me about the conflict with the 
background operation. What is dangerous in this scenario is the fact that I 
can cancel the dialog and starting another operation which basically stacks 
operations.
Comment 1 Dirk Baeumer CLA 2004-06-01 09:13:21 EDT
Same behaviour when adding a JRE to the list of installed JREs via Preferences-
>Java->Installed JREs.
Comment 2 Darin Wright CLA 2004-06-01 09:30:34 EDT
These are two different bugs. The JRE update uses the progress service, so I'm 
not sure what the problem is there... I will open a new bug for this. This one 
belongs in Ant.
Comment 3 Dirk Baeumer CLA 2004-06-01 09:41:02 EDT
According to Erich this might be a workspace problem. I see the same behaviour 
with User libraries. When I cancel the dialog after I have pressed OK (yes 
that's possible) then the blocking dialog appears.
Comment 4 Darin Wright CLA 2004-06-01 09:47:58 EDT
I added this related bug to JDT-Debug (please verify steps) - bug 64937 
Comment 5 Erich Gamma CLA 2004-06-01 10:16:34 EDT
The code is calling PlatformUI.getWorkbench().getProgressService
().busyCursorWhile() which is the correct thing to do.

Need to track down why busyCursorWhile() doesn't show the progress dialog.

Don't change your code until we understand the issue with busyCursorWhile()
Comment 6 Erich Gamma CLA 2004-06-01 10:26:18 EDT
oops - my previous comment should have be assigned to bug# 64937 (will add it 
there as well) - sorry
Comment 7 Darin Swanson CLA 2004-06-03 15:18:25 EDT
Erich in your spare time :-) could you please direct me to what would be the 
appropriate use of the progress service in this case?
I would assume busyCursorWhile() but that will not give the user any dialog as 
we are already in a modal situation. Thanks
Comment 8 Erich Gamma CLA 2004-06-03 16:42:13 EDT
OK - there are actual 3 problems you have to solve:
1) make sure that the progress monitor is passed through from the properties 
dialog down to each call. From the stack traces I've seen I saw several 
occasions where the progress monitor got "lost" and then a null progress 
monitor got passed down.
2) make sure that you can run with forked=true
3) create an initial runnable context from the Properties dialog when starting 
the operation. IProgressService.busyCursorWhile() is the best way to do so. 
I'm still optimistic that this will be possible (see bug# 64937). For now you 
can verify that the progress monitor is properly passed around you can run the 
runnable by using an old ProgressMonitorDialog. It will not have all the 
desired characteristics of busyCursorWhile() (appears with a delay, can report 
blockage). Actually IProgressService.run(true, false, runnable) should also 
work, but I haven't verified it.
Comment 9 Darin Swanson CLA 2004-06-09 16:07:56 EDT
Kevin I will attach a patch for BuilderPropertyPage. Could you review it and 
give me any feedback, thanks.
Comment 10 Darin Swanson CLA 2004-06-09 16:09:34 EDT
Created attachment 11838 [details]
Patch for BuilderPropertyPage
Comment 11 Kevin Barnes CLA 2004-06-09 17:33:37 EDT
DarinS. Are you seeing the ProgressDialog? When I lock the work space for 1 min, then remove the 
builder, I see the busy cursor until my background job is finished. This is the same behaviour 
that I am seeing when the default JRE is changed (see bug 65504). 
Comment 12 Tod Creasey CLA 2004-06-09 17:46:20 EDT
Kevin is right - we are blocking on a syncExec in the UIThread. Bug 66429 has 
a patch that fixes this - I would appreciate it if you tested against your 
case before I release it.
Comment 13 Darin Swanson CLA 2004-06-09 17:52:29 EDT
Tod, what would we need from head to test this out...please list all the 
dependant plugins.
Comment 14 Kevin Barnes CLA 2004-06-09 18:10:57 EDT
org.eclipse.ui.workbench was all I needed.
Comment 15 Tod Creasey CLA 2004-06-10 07:49:46 EDT
All you need is the workbench from HEAD. Kevin is right (I am saying that a 
lot lately <grin>!)
Comment 16 Darin Swanson CLA 2004-06-10 11:10:15 EDT
Tod, with bug 66429 closed what bug describes that fix that will make this 
work?
Comment 17 Tod Creasey CLA 2004-06-10 11:15:40 EDT
This is the one.

You should look out for a couple of things

1) I can't report blockage on anything without a monitor. Any operation that 
can be blocked needs a monitor sent to it. If it is API then run it in a 
UserJob so at least you can lock out the UI

2) Try to not open multiple dialogs for a series of different code paths. 
Creating user jobs and then doing a busyCursorWhile will likely block one of 
them.
Comment 18 Darin Swanson CLA 2004-06-10 17:14:57 EDT
With the changes I have made you can no longer get into the state Dirk 
described but we cannot always present a blocking dialog (see bug 66591) but 
will always at least present a busy cursor.

Decreasing severity to normal.
Comment 19 Darin Swanson CLA 2004-06-10 17:16:33 EDT
Changes to BuilderPropertyPage and ExternalToolsUIMessages.
Comment 20 Darin Swanson CLA 2004-06-11 12:13:49 EDT
Any further improvements would require changes in API methods to take a 
progress monitor. These will be addressed post 3.0 and via other bug reports 
such as bug 66591
Comment 21 Darin Swanson CLA 2004-06-11 12:14:03 EDT
Please verify Kevin.
Comment 22 Kevin Barnes CLA 2004-06-11 14:06:07 EDT
verified, DarinS please update build notes
Comment 23 Darin Swanson CLA 2004-06-11 15:22:32 EDT
Thanks. Build notes updated.