Community
Participate
Working Groups
Currently RevertToSavedAction depends on TextEditor, but I think this should depend on only IDocumentProvider, not an ITextEditor so that other editors which are basedon IDocumentProvider can reuse this action. .
The document provider is shared and does not know the element. We would have to pass in the document provider and an element to save. In addition, actions often report failure which requires a handle to a shell (parent). If you need such an action you can write it using existing API. There are no plans to add this.
If this action needs the document provider, an element and the shell, there are many ways to provide them to Action. Creating the action which has the same functionality is a duplicate effort. Please reconsider.
Sorry, but we won't add this. In order to work with the document provider you'll need the editor input which you most likely get from the editor. Hence you can pass in the editor directly.
Reopening again. If you need IEditorInput, we can pass it through, for example, IEditorPart. ( Editor needs to be the implementaion of IEditorPart, so requiring this interface is fair enough. ) Let me explain more. We develop MultiPageEditor which has mainly two editors. One is a graphical editor and another one is a TextEditor (for its source file.) Most users use its graphical editor, but TextEditor provides very useful IActions and if they are not TextEditor specific ( like the action I'm talking about ) we would like to offer them to our users. But to use them, we need to instantiate TextEditor for only using these actions, and this is a memory usage/performance consideration. ( so we usually instantiate either of graphical or text editor ) Hence, we would like to ask this enhancement. Please reconsider again.
If you don't instantiate the text editor then the editor input which connects to the editor input to the document won't be in the document provider and hence the action would not work. Or does your graphical editor create the document and register it correctly with the document provider even if the text editor is not there?
(In reply to comment #5) > action would not work. Or does your graphical editor create the document and > register it correctly with the document provider even if the text editor is not > there? yes.
The RevertToSaved action is an action that acts on the text editor i.e. the UI: it reverts the presentation to the saved state of the model. Providing this action for a case where the UI isn't even constructed makes no sense and is against the API specification of that action. In addition most editors - be it a text editor or a graphical editor - will also have to perform some UI resetting. If you think revert to saved is interesting for a general set of editors including multi-page editor you should file a bug report against Platform UI to add doRevertToSaved() to IEditorPart and provide a generic RevertToSaved action that calls IEditorPart.doRevertToSaved(). In your case revert to saved should only revert the graphical editor to the saved state of its model. If the model is the same as the one for the text editor i.e. if you use a document via document provider then please copy the code in AbstractTextEditor.performRevert() Please do not reopen again.
Having IEditorPart.doRevertToSaved() might be a good idea. Per request, I'm assigning this enhancment request to PlatformUI component.
>Per request, For the records: I did not request this.
There are currently no plans to work on this feature. PW
Changes requested on bug 193523
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.