Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 28218 - Default provider should prompt in validateEdit if UI context given
Summary: Default provider should prompt in validateEdit if UI context given
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Team (show other bugs)
Version: 2.1   Edit
Hardware: PC Windows XP
: P2 normal (vote)
Target Milestone: 3.1 M2   Edit
Assignee: Michael Valenta CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 33128 73381 75854 75872 (view as bug list)
Depends on: 28216
Blocks:
  Show dependency tree
 
Reported: 2002-12-12 16:32 EST by Kevin McGuire CLA
Modified: 2004-10-28 16:33 EDT (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kevin McGuire CLA 2002-12-12 16:32:30 EST
The validateEdit spec is unclear whether given a UI context that the receiver 
*must* prompt to inform the user of the reason why the file can't be modified.

"By passing a UI context, the caller indicates that the VCM component may
 * contact the user

DefaultFileModificationValidator should probably prompt to inform the user 
that the file isn't writeable.  However, this point is being discussed in bug 
#28216.
Comment 1 Michael Valenta CLA 2002-12-18 15:58:59 EST
Just ran into a problem where a validatEdit was performed by an operation that 
had a progress monitor. The CVS validateEdit also opened a progress monitor and 
this caused deadlock. Since it seems reasonable that a provider may want to 
perform a long running operation to check out a reosurce that an 
IProgressMonitor should be provided to validateSave and validateEdit (see bug 
28646)
Comment 2 Michael Valenta CLA 2002-12-20 10:36:48 EST
What about unmanaged/unshared read-only files in a project that is connected to 
a repository provider. Is it the responsibility of the repository provider to 
prompt for these files as well? It seems it would be given the above 
discussion. I'm not sure that this is a reasonable expectation (i.e. as a 
repository provider implementor, I'd rather not concern myself with unshared or 
ignored files at all).
Comment 3 Kevin McGuire CLA 2003-01-06 17:24:09 EST
Its a subset of the same problem:  (for various reasons) the caller can't 
assume that the provider prompted just because it gave it a UI context.

Ideally the provider would only prompt for files under its control.  However, 
there would need to be a way to inform the caller which files were taken care 
of and which weren't since the argument could contain a mix.  That's a bit more 
complicated, and its easier to just handle all or nothing.
Comment 4 Kevin McGuire CLA 2003-01-29 16:46:55 EST
The default provider will be changed to prompt.  This will be accomplished by 
moving the code to org.eclipse.team.ui, which is ok since we assume nobody 
builds an eclipse without both team.core and team.ui.

The prompt method could be made public API for Michael's case in comment #2.  
They would still need to detect the case, but then could rely on team.ui to 
prompt.  They would have to fold back the stati.
Comment 5 Michael Valenta CLA 2003-02-27 11:56:40 EST
*** Bug 33128 has been marked as a duplicate of this bug. ***
Comment 6 Knut Radloff CLA 2003-03-26 10:18:40 EST
It's bad that this has been pushed back to 2.2. If I copy a file and the file 
exists in the destination and is read-only UI prompts to overwrite the read-
only file and the copy fails silently when I select "yes". The user will not be 
aware that the copy in fact did not happen.
This should be fixed ASAP in 2.2
Comment 7 Knut Radloff CLA 2003-05-08 11:49:51 EDT
Will there also be a prompt for files in projects that are not connected to a 
repository?
Comment 8 Jean-Michel Lemieux CLA 2004-06-11 16:51:38 EDT
Post 3.0
Comment 9 Michael Valenta CLA 2004-06-29 15:25:18 EDT
I just hit this problem as well. I copied a bunch of files from a controlled 
project to an uncontrolled one. The read-only bit on all the resources was 
set. Editing fails silently. I had to manually unset the read-only bit on each 
file individually.
Comment 10 Michael Valenta CLA 2004-08-24 10:02:25 EDT
Fix released to HEAD. The use is now prompted when read-only files are 
modified in unshared projects.
Comment 11 John Arthorne CLA 2004-10-08 10:11:28 EDT
*** Bug 75872 has been marked as a duplicate of this bug. ***
Comment 12 Dirk Baeumer CLA 2004-10-08 10:41:37 EDT
*** Bug 75854 has been marked as a duplicate of this bug. ***
Comment 13 John Arthorne CLA 2004-10-28 16:33:43 EDT
*** Bug 73381 has been marked as a duplicate of this bug. ***