Make an editor readonly thru API [message #162219] |
Mon, 24 July 2006 15:22  |
Eclipse User |
|
|
|
Originally posted by: akshay_shrivastava.hotmail.com
Ok, I have searched for this in all the possible forums. I am creating a
new plugin, that adds a 'toggle readonly' button to my toolbar. It
toggles the readonly flag on the underlying IResource based on my current
selection.
I have used IResource.setReadonly(...) method for this.
I am able to set the flag correctly on the resource, but the editor in
which the resource is still open (and being edited) is not reflecting that
change.
I have looked thru the API and have had no luck trying out all the
possible combinations so far. I have access to the EditorPart object
(which in this case is an AbstractTextEditor) because its the currently
Active Part, available thru PartService. But there are no methods on this
or any closely related classes to set the readonly flag.
The end result of my problem is that I make a file readonly using this
shiny new toolbar button, but I can still edit the file... !!!
PLEASE HELP. I need to make a text editor readonly thru API calls.
|
|
|
Re: Make an editor readonly thru API [message #163356 is a reply to message #162219] |
Wed, 02 August 2006 09:07  |
Eclipse User |
|
|
|
Akshay S wrote:
> Ok, I have searched for this in all the possible forums. I am
> creating a new plugin, that adds a 'toggle readonly' button to my
> toolbar. It toggles the readonly flag on the underlying IResource
> based on my current selection.
>
> I have used IResource.setReadonly(...) method for this.
> I am able to set the flag correctly on the resource, but the editor in
> which the resource is still open (and being edited) is not reflecting
> that change.
>
> I have looked thru the API and have had no luck trying out all the
> possible combinations so far. I have access to the EditorPart object
> (which in this case is an AbstractTextEditor) because its the
> currently Active Part, available thru PartService. But there are no
> methods on this or any closely related classes to set the readonly flag.
> The end result of my problem is that I make a file readonly using this
> shiny new toolbar button, but I can still edit the file... !!!
> PLEASE HELP. I need to make a text editor readonly thru API calls.
Try sending validateEditorInputState() to the AbstractTextEditor.
Dani
|
|
|
Powered by
FUDForum. Page generated in 0.07988 seconds