|Re: How to set an editor unmodifiable? [message #498259 is a reply to message #498224]
||Mon, 16 November 2009 08:43
Originally posted by: formatzeh.gmx.de|
yes this is clear. I imagined that it is possible with a wrapper but I
thought there is a setModifiable method or something similar anywhere ;)
Thanks so much.
> Hi Gilbert,
> Sorry I didn't check new group at weekend :)
> I assume the input is an IFileEditorInput.
> 1. You need write a FileEditorInput wrapper.
> 2. File Wrapper which indicates all files as readonly.
> The idea is that in the FileEditorInput wrapper delegates all the method
> to the warpped FileEditorInput, but overwrite the getFile method. In the
> getFile method, return the read only file wrapper.
> Since all other methods are just delegating to the original one, it'll
> not affect the normal file opening process. The only change is that all
> files will be marked as read only, so that the editor will be read only
> as well.
> Hope this is clear.
> Q.S. Wang
> Gilbert Mirenque wrote:
>> Hi Wang,
>> yes I have control of opening the editor.
>> IWorkbenchPage page = window.getActivePage();
>> IEditorInput input = // generically determine input
>> String editorID = // determine id for input
>> IEditorPart editorPart = page.openEditor(input, newEditorID);
>> Input and id definitely belong together. I searched in the editorPart
>> for possibilities of setting it unmodifiable but without success. Do you
>> have an idea?
Powered by FUDForum
. Page generated in 0.13747 seconds