Community
Participate
Working Groups
Currently Save menu's enable/disable state is controled by isDirty() flag, but it should not be the only factor to control Save menu's state. For example, suppose a editor has a global setting for output encoding character set and if user changes the setting from ascii to UTF-8. User will open a file which is encoded by ascii format, and will want to save it as the same name without modifing the file. Most windows application allow such usage, but eclipse doesn't allow this since in this case isDirty() returns false. So, my proposal is IEditorPart has a new API called isSaveAllowed() and this method should control Save menu.
In this case, since the encoding is part of the editor's state, changing the output encoding should dirty the editor. Will reconsider this for v3 though.
Changing dirty state will confuse user, since user only changed global preference and not each editor's content. In this case editor should not change dirty state. Also output encoding is just an example. Editor may update their own meta data such as GENERATOR in HTML, editor's private information which usually user don't care or don't change, and so on... However, I agree this is a V3 item.
Reopen for investigation
Moving Dougs bugs
What if the editor is opened on a read-only input (e.g. CVS revision), should changing the encoding dirty the editor as well? Observed in N20090101-2000.
As per http://wiki.eclipse.org/Platform_UI/Bug_Triage_Change_2009
Remy is now responsible for watching the [EditorMgmt] component area.
Usually, on all editors I can figure out, Save is always enabled independently of the state of the file being edited, even if it contains "wrong" data. It's actually important for user to be able to save even invalid content, as a milestone. So despite the idea is interesting, I question how users will really like it or not, compared to established workflows (of Eclipse IDE and all editors in general). It seems to me that in most case, error in files have to be reported in the editor and the decision of whether to save or not should entirely belong to the user.