Bug 68154 - [EditorMgmt] Custom control over closing an editor
Summary: [EditorMgmt] Custom control over closing an editor
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.0   Edit
Hardware: All Linux
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Platform UI Triaged CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-06-22 08:53 EDT by Dan Winterstein CLA
Modified: 2019-09-06 16:16 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dan Winterstein CLA 2004-06-22 08:53:17 EDT
I have an editor that needs to confirm closure with the user (and give the user
the option to cancel closure) even if it isn't dirty.

This could be achieved by having WorkbenchPage.closeEditor call a method such as
boolean IEditor.confirmClosure(), which would by default return true, but could
be over-ridden by subclasses.

My reason for wanting this is that my editor interacts with non-Eclipse
processes. These need to be informed when the editor closes - which prompts
certain actions. 

Currently I have subclassed IEditor.dispose to notify the user of the
implications of closing an editor. However this means that the user has no
control over these actions, since dispose is called too late for the close
command to be cancelled.
Comment 1 Michael Van Meekeren CLA 2004-10-13 11:28:39 EDT
Interesting.  So your editor is not dirty, i.e. the user has not done something
to have initiated a change somewhere?  And saving what is in the editor is not
actually what you are doing, but rather when the user is done with the editor it
will propegate changes to other processes.  I'm still not clear why this is not
dirtyness, or in this case you're not really an editor but more like a view (the
navigator for example) manipulating the file system for example.
Comment 2 Dan Winterstein CLA 2004-10-13 11:44:04 EDT
Short response:
On reflection, I think I can use the dirty flag and over-ride doSave to achieve
the functionality I'm after.


Longer Response:

My application is a script editor. 
Users edit scripts as text files (making them dirty in the usual way).
They can also 'play' the script, sending bits of it out to an external process
(in this case, a theorem prover sitting on a different machine). This is similar
to stepping in a debugger. It does not dirty the file, and no save is required.

The external process needs to know which script files it's processed/is
processing, and will only work on 1 script at a time. When my users close a
script editor, they are given a choice between  processing the rest of that
script or retracting the bits already processed. 
Since they might not have realised/remembered this would happen, it would be
nice to also give them an option to cancel the close.
Comment 3 Susan McCourt CLA 2009-07-09 19:05:35 EDT
As per http://wiki.eclipse.org/Platform_UI/Bug_Triage_Change_2009
Comment 4 Boris Bokowski CLA 2009-11-17 13:05:41 EST
Remy is now responsible for watching the [EditorMgmt] component area.
Comment 5 Eclipse Webmaster CLA 2019-09-06 16:16:26 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.