Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 258456 - Deleting projects causes editor error instead of close
Summary: Deleting projects causes editor error instead of close
Status: RESOLVED DUPLICATE of bug 186977
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.5   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-12-11 10:16 EST by Paul Webster CLA
Modified: 2008-12-13 06:32 EST (History)
2 users (show)

See Also:


Attachments
Error in the error log (9.54 KB, text/plain)
2008-12-11 10:16 EST, Paul Webster CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Paul Webster CLA 2008-12-11 10:16:14 EST
Created attachment 120205 [details]
Error in the error log

I had about 8 projects in my workspace, and a couple of java editors open.

I selected all the projects and did a delete (delete content on disk).

The Java editor replaced its content with "Error" content, i.e. the file is not found. and none of the editors closed.

PW
Comment 1 Markus Keller CLA 2008-12-12 10:50:09 EST
I can reproduce with I20081211-1908, but only when I
- open multiple editors from a project (stacked)
- restart the workbench (only top-most editor is materialized)
- delete the project (including content on disk)

Similar scenario on startup when an editor's file has gone: Bug 180452.

Paul, does the workbench have a story for how editors should behave when their input is not valid? We currently throw a PartInitException in AbstractTextEditor.internalInit(..), and EditorReference.createPart() line: 463	writes it to the log.

For fully created editors, we just close them when the file buffer gets deleted, but for not-yet restored editors, I don't see a hook for us to do this.

My favorite solution would be that the workbench uses IEditorInput.exists() to check if the input of the editor to be restored still exists. If it doesn't, just close the editor, or open an error editor that tells what really happened, instead of writing an exception to the log and to the Details>> area in the editor.
Comment 2 Paul Webster CLA 2008-12-12 11:25:56 EST
(In reply to comment #1)
> For fully created editors, we just close them when the file buffer gets
> deleted, but for not-yet restored editors, I don't see a hook for us to do
> this.

This might be a Platform UI problem then.  I don't think we handle that gracefully (and the client code has not yet been instantiated, so it's not their problem).

PW
Comment 3 Dani Megert CLA 2008-12-13 06:32:34 EST

*** This bug has been marked as a duplicate of bug 186977 ***