Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 29570

Summary: [EditorMgmt] too successful at opening an editor on non-existent file
Product: [Eclipse Project] Platform Reporter: Jim des Rivieres <jeem>
Component: UIAssignee: Platform UI Triaged <platform-ui-triaged>
Status: RESOLVED WORKSFORME QA Contact: Remy Suen <remy.suen>
Severity: normal    
Priority: P3 CC: daniel_megert, dmaliarevich, eduardo_pereira, piotr.aniola
Version: 2.1   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
Error message file not found none

Description Jim des Rivieres CLA 2003-01-15 15:40:59 EST
Build 20030114

1. Create a project P1
2. Create a file P1/foo.txt
3. Close editor foo.txt
4. Outside Eclipse, delete foo.txt from the workspace.
5. Double click on foo.txt in Navigator to open editor

Observe: This appears to open an editor on foo.txt. The editor page contains
the message:
"Resource /P1/foo.txt does not exist."
(plus a horizontal blue line).
The editor page is useless (cannot be edited).

Expectation: This is a highly non-standard way to present an error situation 
to the user. It would better to bring up a message dialog informing the user 
of the error, and not open an editor page.
Comment 1 Eduardo Pereira CLA 2003-01-16 11:00:32 EST
The editor is created by "Text".
Comment 2 Dani Megert CLA 2006-11-22 03:55:12 EST
>The editor is created by "Text".
Sure but because we were told to be opened the editor ;-)

The OpenFileAction could check whether the file exists. Another place where this could be implemented is IDE.openEditor(*).

Moving to Platform UI who owns the action.
Comment 3 Boris Bokowski CLA 2009-11-17 13:01:51 EST
Remy is now responsible for watching the [EditorMgmt] component area.
Comment 4 Dani Megert CLA 2009-12-16 02:40:36 EST
*** Bug 296920 has been marked as a duplicate of this bug. ***
Comment 5 Dani Megert CLA 2009-12-16 02:53:38 EST
>*** Bug 296920 has been marked as a duplicate of this bug. ***
Actually not: the delete action should close the editors before deletion.
Comment 6 DMaliarevich CLA 2009-12-16 02:56:51 EST
Bug 296920(In reply to comment #5)
> >*** Bug 296920 has been marked as a duplicate of this bug. ***
> Actually not: the delete action should close the editors before deletion.

So to my mind Bug 296920 should be reopened in this case.
Comment 7 Remy Suen CLA 2009-12-16 07:41:55 EST
(In reply to comment #6)
> Bug 296920(In reply to comment #5)
> > >*** Bug 296920 has been marked as a duplicate of this bug. ***
> > Actually not: the delete action should close the editors before deletion.
> 
> So to my mind Bug 296920 should be reopened in this case.

We'll use bug 41431 to cover both cases.
Comment 8 Piotr Aniola CLA 2014-02-03 11:13:13 EST
Created attachment 239577 [details]
Error message file not found
Comment 9 Piotr Aniola CLA 2014-02-03 11:13:42 EST
I cannot reproduce, I get an error popup when following the scenario
Comment 10 Dani Megert CLA 2014-02-06 09:49:43 EST
(In reply to Piotr Aniola from comment #9)
> I cannot reproduce, I get an error popup when following the scenario

Yes, that's because of 'Refresh on access' now being true. If this is disabled, then you still get the editor, but since a few years now, this editor allows to refresh the file.