Skip to main content



      Home
Home » Eclipse Projects » Rich Client Platform (RCP) » How to check editor input for external changes?
How to check editor input for external changes? [message #463544] Tue, 13 February 2007 08:18 Go to next message
Eclipse UserFriend
Originally posted by: Henry.Grippa.googlemail.com

A have implemented my own editor which is the subclass of
AbstractTextEditor. But I don't know what should I implement to get this
Eclipse built-in functionality which allow to notify user about external
changes of editor input.
Could you please provide me any helpful information?

Thanks in advance.

Regards,
Henry
Re: How to check editor input for external changes? [message #463545 is a reply to message #463544] Tue, 13 February 2007 08:30 Go to previous messageGo to next message
Eclipse UserFriend
Maybe try to read this:
http://www.eclipse.org/articles/Article-Resource-deltas/reso urce-deltas.html

regards,
Jakub Jurkiewicz

Henry Grippa wrote:
> A have implemented my own editor which is the subclass of
> AbstractTextEditor. But I don't know what should I implement to get this
> Eclipse built-in functionality which allow to notify user about external
> changes of editor input.
> Could you please provide me any helpful information?
>
> Thanks in advance.
>
> Regards,
> Henry
Re: How to check editor input for external changes? [message #463546 is a reply to message #463545] Tue, 13 February 2007 08:33 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: peter_ossipov.mail.ru

Hi Jakub.
I just do not get it. What are you giving this info for? It is to do
with resources whilst Henry might not even being touching the resources.
What if he edits a file outside of any workspace or anything else?
Jakub Jurkiewicz wrote:
> Maybe try to read this:
> http://www.eclipse.org/articles/Article-Resource-deltas/reso urce-deltas.html
>
>
> regards,
> Jakub Jurkiewicz
>
> Henry Grippa wrote:
>> A have implemented my own editor which is the subclass of
>> AbstractTextEditor. But I don't know what should I implement to get
>> this Eclipse built-in functionality which allow to notify user about
>> external changes of editor input.
>> Could you please provide me any helpful information?
>>
>> Thanks in advance.
>>
>> Regards,
>> Henry
Re: How to check editor input for external changes? [message #463553 is a reply to message #463546] Tue, 13 February 2007 09:40 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: Henry.Grippa.googlemail.com

You're right Peter. I want to display notification if the file has been
changed from outside. Just as it works in Eclipse (I mean "File has been
changed on the file system. Do you want to load the changes?")

Peter Osipov wrote:
> Hi Jakub.
> I just do not get it. What are you giving this info for? It is to do
> with resources whilst Henry might not even being touching the
> resources. What if he edits a file outside of any workspace or
> anything else?
> Jakub Jurkiewicz wrote:
>> Maybe try to read this:
>> http://www.eclipse.org/articles/Article-Resource-deltas/reso urce-deltas.html
>>
>>
>> regards,
>> Jakub Jurkiewicz
>>
>> Henry Grippa wrote:
>>> A have implemented my own editor which is the subclass of
>>> AbstractTextEditor. But I don't know what should I implement to get
>>> this Eclipse built-in functionality which allow to notify user about
>>> external changes of editor input.
>>> Could you please provide me any helpful information?
>>>
>>> Thanks in advance.
>>>
>>> Regards,
>>> Henry
Re: How to check editor input for external changes? [message #463618 is a reply to message #463553] Tue, 13 February 2007 12:02 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: peter_ossipov.mail.ru

Well, actually, I would like to know an answer to that question myself. :-)
Henry Grippa wrote:
> You're right Peter. I want to display notification if the file has
> been changed from outside. Just as it works in Eclipse (I mean "File
> has been changed on the file system. Do you want to load the changes?")
>
> Peter Osipov wrote:
>> Hi Jakub.
>> I just do not get it. What are you giving this info for? It is to do
>> with resources whilst Henry might not even being touching the
>> resources. What if he edits a file outside of any workspace or
>> anything else?
>> Jakub Jurkiewicz wrote:
>>> Maybe try to read this:
>>> http://www.eclipse.org/articles/Article-Resource-deltas/reso urce-deltas.html
>>>
>>>
>>> regards,
>>> Jakub Jurkiewicz
>>>
>>> Henry Grippa wrote:
>>>> A have implemented my own editor which is the subclass of
>>>> AbstractTextEditor. But I don't know what should I implement to get
>>>> this Eclipse built-in functionality which allow to notify user
>>>> about external changes of editor input.
>>>> Could you please provide me any helpful information?
>>>>
>>>> Thanks in advance.
>>>>
>>>> Regards,
>>>> Henry
Re: How to check editor input for external changes? [message #463638 is a reply to message #463553] Tue, 13 February 2007 20:23 Go to previous messageGo to next message
Eclipse UserFriend
Look at AbstractTextEditor.sanityCheckState(IEditorInput input) (or
safelySanityCheckState()).
You can call this method from the PartListener.partActivated() method.

Snjeza

Henry Grippa wrote:
> You're right Peter. I want to display notification if the file has been
> changed from outside. Just as it works in Eclipse (I mean "File has been
> changed on the file system. Do you want to load the changes?")
>
> Peter Osipov wrote:
>> Hi Jakub.
>> I just do not get it. What are you giving this info for? It is to do
>> with resources whilst Henry might not even being touching the
>> resources. What if he edits a file outside of any workspace or
>> anything else?
>> Jakub Jurkiewicz wrote:
>>> Maybe try to read this:
>>> http://www.eclipse.org/articles/Article-Resource-deltas/reso urce-deltas.html
>>>
>>>
>>> regards,
>>> Jakub Jurkiewicz
>>>
>>> Henry Grippa wrote:
>>>> A have implemented my own editor which is the subclass of
>>>> AbstractTextEditor. But I don't know what should I implement to get
>>>> this Eclipse built-in functionality which allow to notify user about
>>>> external changes of editor input.
>>>> Could you please provide me any helpful information?
>>>>
>>>> Thanks in advance.
>>>>
>>>> Regards,
>>>> Henry
Re: How to check editor input for external changes? [message #463663 is a reply to message #463638] Wed, 14 February 2007 03:48 Go to previous messageGo to next message
Eclipse UserFriend
Snjezana Peco wrote:

> Look at AbstractTextEditor.sanityCheckState(IEditorInput input) (or
> safelySanityCheckState()).
> You can call this method from the PartListener.partActivated() method.

This already happens for free if you switch back from outside but you
need to have document provider that can detect the change. Take a look
at TextFileDocumentProvider.

Dani

>
> Snjeza
>
> Henry Grippa wrote:
>
>> You're right Peter. I want to display notification if the file has
>> been changed from outside. Just as it works in Eclipse (I mean "File
>> has been changed on the file system. Do you want to load the changes?")
>>
>> Peter Osipov wrote:
>>
>>> Hi Jakub.
>>> I just do not get it. What are you giving this info for? It is to do
>>> with resources whilst Henry might not even being touching the
>>> resources. What if he edits a file outside of any workspace or
>>> anything else?
>>> Jakub Jurkiewicz wrote:
>>>
>>>> Maybe try to read this:
>>>> http://www.eclipse.org/articles/Article-Resource-deltas/reso urce-deltas.html
>>>>
>>>>
>>>> regards,
>>>> Jakub Jurkiewicz
>>>>
>>>> Henry Grippa wrote:
>>>>
>>>>> A have implemented my own editor which is the subclass of
>>>>> AbstractTextEditor. But I don't know what should I implement to
>>>>> get this Eclipse built-in functionality which allow to notify user
>>>>> about external changes of editor input.
>>>>> Could you please provide me any helpful information?
>>>>>
>>>>> Thanks in advance.
>>>>>
>>>>> Regards,
>>>>> Henry
>>>>
Re: How to check editor input for external changes? [message #463704 is a reply to message #463663] Wed, 14 February 2007 12:51 Go to previous message
Eclipse UserFriend
This happens for free if we inherit the AbstractTextEditor. If we have a
multi-page editor and create the source page, we have to add this method
to the PartListener (see XMLMultiPageEditorPart$ActivationListener in
the webtools project).

Snjeza

Daniel Megert wrote:
> Snjezana Peco wrote:
>
>> Look at AbstractTextEditor.sanityCheckState(IEditorInput input) (or
>> safelySanityCheckState()).
>> You can call this method from the PartListener.partActivated() method.
>
> This already happens for free if you switch back from outside but you
> need to have document provider that can detect the change.
Previous Topic:property view tooltip
Next Topic:ProgressMonitorDialog misbehavior in RCP
Goto Forum:
  


Current Time: Sat Mar 15 04:53:22 EDT 2025

Powered by FUDForum. Page generated in 0.03900 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top