rvmiller89 / multitype

Eclipse Plug-in for collaborative code editing similar to Google Docs
0 stars 0 forks source link

Disable Save prompt (No/Cancel/Yes) for non-host clients closing file with "X" on tab #24

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Host shares file
2. Non-host opens file
3. Non-host closes file, and is prompted to save
4. Non-host selects 'Yes'

What is the expected output? What do you see instead?
Expected: Save dialog
Getting: Nothing.  File does not get saved.

Original issue reported on code.google.com by rvmille...@gmail.com on 13 Apr 2011 at 7:48

GoogleCodeExporter commented 9 years ago
I have an idea on how to fix this

Original comment by rvmille...@gmail.com on 13 Apr 2011 at 9:29

GoogleCodeExporter commented 9 years ago

Original comment by rvmille...@gmail.com on 14 Apr 2011 at 5:25

GoogleCodeExporter commented 9 years ago
Workaround for Build 2 demo

Future versions will need some improvement

Original comment by rvmille...@gmail.com on 15 Apr 2011 at 1:12

GoogleCodeExporter commented 9 years ago
Azfar - I'm going to assign this to you so I can get started on packaging the 
plugin...

I've found it easier for the editor to prompt with a editor.doSaveAs() when 
it's closing.

The problem is that those editor tabs have a default way of prompting to save 
when they're being closed...

Two solutions that I found that you can explore:

(1) Override the isSaveOnCloseNeeded() method in ISaveablePart (which is a 
subclass of IEditorPart, returned when the editor is opened)

Problem: I don't know how to override this method when the openEditor() call 
returns an instance of IEditorPart.

(2) Do a editor.save(null) immediately when the user hits the "X" on the tab.  
It will not actually save anywhere, but will prevent the default dialog from 
coming up.

Problem:  I could not find a listener that responds immediately when the "X" is 
clicked.  Only when the part is closed.

Original comment by rvmille...@gmail.com on 18 Apr 2011 at 6:55

GoogleCodeExporter commented 9 years ago

Original comment by azfarkha...@gmail.com on 18 Apr 2011 at 8:35