Skip to main content



      Home
Home » Eclipse Projects » Rich Client Platform (RCP) » file change events
file change events [message #460101] Wed, 13 December 2006 11:57 Go to next message
Eclipse UserFriend
Originally posted by: peter_ossipov.mail.ru

Hi everybody!
Is there a way to add a listener somewhere, so that if an *.xml file is
changed from somewhere I could be notified of it. I mean, I have
searched regarding this and everybody talks about
IResourceChangeListener and some workspaces. But it just confuses me - I
do not have any workspaces - it is just a file somewhere in the file
system, not related to eclipse at all!
So, thanks so much in advance.
Re: file change events [message #460102 is a reply to message #460101] Wed, 13 December 2006 12:26 Go to previous messageGo to next message
Eclipse UserFriend
The IResourceChangeListener support (AFAIK) is only effective within an
eclipse workspace.

For regular files, I think you would have to rely on some 3rd party
library, since I don't recall java having the capability.

Later,
PW
Re: file change events [message #460104 is a reply to message #460101] Wed, 13 December 2006 13:06 Go to previous messageGo to next message
Eclipse UserFriend
You could create links to the XML Files outside of the eclipse workspace.
Then register a document provider for xml extensions in the plugin.xml.

So, if you have an XML File object, the steps would be:

IFile linkFile = ..// create a File link for the XML File
IEditorInput inp = new FileEditorInput(linkFile);
DocumentProviderRegistry dpr = DocumentProviderRegistry.getDefault();
IDocumentProvider dp = dpr.getDocumentProvider(inp);
dp.connect(inp);

Your registered document provider will be invoked when changes are made to
the underlying
XML file.

Hope this helps



"Peter Osipov" <peter_ossipov@mail.ru> wrote in message
news:elpbcs$1ht$1@utils.eclipse.org...
> Hi everybody!
> Is there a way to add a listener somewhere, so that if an *.xml file is
> changed from somewhere I could be notified of it. I mean, I have searched
> regarding this and everybody talks about IResourceChangeListener and some
> workspaces. But it just confuses me - I do not have any workspaces - it is
> just a file somewhere in the file system, not related to eclipse at all!
> So, thanks so much in advance.
Re: file change events [message #460114 is a reply to message #460104] Thu, 14 December 2006 04:23 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: peter_ossipov.mail.ru

Thanks, Vikram!
Let me try it out!
Vikram wrote:
> You could create links to the XML Files outside of the eclipse workspace.
> Then register a document provider for xml extensions in the plugin.xml.
>
> So, if you have an XML File object, the steps would be:
>
> IFile linkFile = ..// create a File link for the XML File
> IEditorInput inp = new FileEditorInput(linkFile);
> DocumentProviderRegistry dpr = DocumentProviderRegistry.getDefault();
> IDocumentProvider dp = dpr.getDocumentProvider(inp);
> dp.connect(inp);
>
> Your registered document provider will be invoked when changes are made to
> the underlying
> XML file.
>
> Hope this helps
>
>
>
> "Peter Osipov" <peter_ossipov@mail.ru> wrote in message
> news:elpbcs$1ht$1@utils.eclipse.org...
>> Hi everybody!
>> Is there a way to add a listener somewhere, so that if an *.xml file is
>> changed from somewhere I could be notified of it. I mean, I have searched
>> regarding this and everybody talks about IResourceChangeListener and some
>> workspaces. But it just confuses me - I do not have any workspaces - it is
>> just a file somewhere in the file system, not related to eclipse at all!
>> So, thanks so much in advance.
>
>
Re: file change events [message #460115 is a reply to message #460102] Thu, 14 December 2006 04:23 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: peter_ossipov.mail.ru

Thanks Paul again for your answer! :-) You are always there to help us!
Paul Webster wrote:
> The IResourceChangeListener support (AFAIK) is only effective within an
> eclipse workspace.
>
> For regular files, I think you would have to rely on some 3rd party
> library, since I don't recall java having the capability.
>
> Later,
> PW
Re: file change events [message #460116 is a reply to message #460114] Thu, 14 December 2006 05:27 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: peter_ossipov.mail.ru

Huh, I cannot figure out where DocumentProviderRegistry in 3.2
Documentations says org.eclipse.ui.texteditor.DocumentProviderRegistry,
but I have not got this plug-in...

Peter Osipov wrote:> Thanks, Vikram!
> Let me try it out!
> Vikram wrote:
>> You could create links to the XML Files outside of the eclipse workspace.
>> Then register a document provider for xml extensions in the plugin.xml.
>>
>> So, if you have an XML File object, the steps would be:
>>
>> IFile linkFile = ..// create a File link for the XML File
>> IEditorInput inp = new FileEditorInput(linkFile);
>> DocumentProviderRegistry dpr = DocumentProviderRegistry.getDefault();
>> IDocumentProvider dp = dpr.getDocumentProvider(inp);
>> dp.connect(inp);
>>
>> Your registered document provider will be invoked when changes are
>> made to the underlying
>> XML file.
>>
>> Hope this helps
>>
>>
>>
>> "Peter Osipov" <peter_ossipov@mail.ru> wrote in message
>> news:elpbcs$1ht$1@utils.eclipse.org...
>>> Hi everybody!
>>> Is there a way to add a listener somewhere, so that if an *.xml file
>>> is changed from somewhere I could be notified of it. I mean, I have
>>> searched regarding this and everybody talks about
>>> IResourceChangeListener and some workspaces. But it just confuses me
>>> - I do not have any workspaces - it is just a file somewhere in the
>>> file system, not related to eclipse at all!
>>> So, thanks so much in advance.
>>
>>
Re: file change events [message #460118 is a reply to message #460116] Thu, 14 December 2006 05:36 Go to previous messageGo to next message
Eclipse UserFriend
Peter Osipov wrote:

> Huh, I cannot figure out where DocumentProviderRegistry in 3.2
> Documentations says
> org.eclipse.ui.texteditor.DocumentProviderRegistry, but I have not got
> this plug-in...

It's in org.eclipse.ui.editors which is not officially part of RCP.

Dani

>
> Peter Osipov wrote:> Thanks, Vikram!
>
>> Let me try it out!
>> Vikram wrote:
>>
>>> You could create links to the XML Files outside of the eclipse
>>> workspace.
>>> Then register a document provider for xml extensions in the plugin.xml.
>>>
>>> So, if you have an XML File object, the steps would be:
>>>
>>> IFile linkFile = ..// create a File link for the XML File
>>> IEditorInput inp = new FileEditorInput(linkFile);
>>> DocumentProviderRegistry dpr = DocumentProviderRegistry.getDefault();
>>> IDocumentProvider dp = dpr.getDocumentProvider(inp);
>>> dp.connect(inp);
>>>
>>> Your registered document provider will be invoked when changes are
>>> made to the underlying
>>> XML file.
>>>
>>> Hope this helps
>>>
>>>
>>>
>>> "Peter Osipov" <peter_ossipov@mail.ru> wrote in message
>>> news:elpbcs$1ht$1@utils.eclipse.org...
>>>
>>>> Hi everybody!
>>>> Is there a way to add a listener somewhere, so that if an *.xml
>>>> file is changed from somewhere I could be notified of it. I mean, I
>>>> have searched regarding this and everybody talks about
>>>> IResourceChangeListener and some workspaces. But it just confuses
>>>> me - I do not have any workspaces - it is just a file somewhere in
>>>> the file system, not related to eclipse at all!
>>>> So, thanks so much in advance.
>>>
>>>
>>>
Re: file change events [message #460120 is a reply to message #460118] Thu, 14 December 2006 05:45 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: peter_ossipov.mail.ru

Huh. thanks God, you told me!
Let me try it.
Daniel Megert wrote:
> Peter Osipov wrote:
>
>> Huh, I cannot figure out where DocumentProviderRegistry in 3.2
>> Documentations says
>> org.eclipse.ui.texteditor.DocumentProviderRegistry, but I have not got
>> this plug-in...
>
> It's in org.eclipse.ui.editors which is not officially part of RCP.
>
> Dani
>
>>
>> Peter Osipov wrote:> Thanks, Vikram!
>>
>>> Let me try it out!
>>> Vikram wrote:
>>>
>>>> You could create links to the XML Files outside of the eclipse
>>>> workspace.
>>>> Then register a document provider for xml extensions in the plugin.xml.
>>>>
>>>> So, if you have an XML File object, the steps would be:
>>>>
>>>> IFile linkFile = ..// create a File link for the XML File
>>>> IEditorInput inp = new FileEditorInput(linkFile);
>>>> DocumentProviderRegistry dpr = DocumentProviderRegistry.getDefault();
>>>> IDocumentProvider dp = dpr.getDocumentProvider(inp);
>>>> dp.connect(inp);
>>>>
>>>> Your registered document provider will be invoked when changes are
>>>> made to the underlying
>>>> XML file.
>>>>
>>>> Hope this helps
>>>>
>>>>
>>>>
>>>> "Peter Osipov" <peter_ossipov@mail.ru> wrote in message
>>>> news:elpbcs$1ht$1@utils.eclipse.org...
>>>>
>>>>> Hi everybody!
>>>>> Is there a way to add a listener somewhere, so that if an *.xml
>>>>> file is changed from somewhere I could be notified of it. I mean, I
>>>>> have searched regarding this and everybody talks about
>>>>> IResourceChangeListener and some workspaces. But it just confuses
>>>>> me - I do not have any workspaces - it is just a file somewhere in
>>>>> the file system, not related to eclipse at all!
>>>>> So, thanks so much in advance.
>>>>
>>>>
>>>>
Re: file change events [message #460121 is a reply to message #460120] Thu, 14 December 2006 05:47 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: peter_ossipov.mail.ru

Dani, can you tell me where I can download that plug-in?
Peter Osipov wrote:
> Huh. thanks God, you told me!
> Let me try it.
> Daniel Megert wrote:
>> Peter Osipov wrote:
>>
>>> Huh, I cannot figure out where DocumentProviderRegistry in 3.2
>>> Documentations says
>>> org.eclipse.ui.texteditor.DocumentProviderRegistry, but I have not
>>> got this plug-in...
>>
>> It's in org.eclipse.ui.editors which is not officially part of RCP.
>>
>> Dani
>>
>>>
>>> Peter Osipov wrote:> Thanks, Vikram!
>>>
>>>> Let me try it out!
>>>> Vikram wrote:
>>>>
>>>>> You could create links to the XML Files outside of the eclipse
>>>>> workspace.
>>>>> Then register a document provider for xml extensions in the
>>>>> plugin.xml.
>>>>>
>>>>> So, if you have an XML File object, the steps would be:
>>>>>
>>>>> IFile linkFile = ..// create a File link for the XML File
>>>>> IEditorInput inp = new FileEditorInput(linkFile);
>>>>> DocumentProviderRegistry dpr = DocumentProviderRegistry.getDefault();
>>>>> IDocumentProvider dp = dpr.getDocumentProvider(inp);
>>>>> dp.connect(inp);
>>>>>
>>>>> Your registered document provider will be invoked when changes are
>>>>> made to the underlying
>>>>> XML file.
>>>>>
>>>>> Hope this helps
>>>>>
>>>>>
>>>>>
>>>>> "Peter Osipov" <peter_ossipov@mail.ru> wrote in message
>>>>> news:elpbcs$1ht$1@utils.eclipse.org...
>>>>>
>>>>>> Hi everybody!
>>>>>> Is there a way to add a listener somewhere, so that if an *.xml
>>>>>> file is changed from somewhere I could be notified of it. I mean,
>>>>>> I have searched regarding this and everybody talks about
>>>>>> IResourceChangeListener and some workspaces. But it just confuses
>>>>>> me - I do not have any workspaces - it is just a file somewhere in
>>>>>> the file system, not related to eclipse at all!
>>>>>> So, thanks so much in advance.
>>>>>
>>>>>
>>>>>
Re: file change events [message #460123 is a reply to message #460121] Thu, 14 December 2006 05:57 Go to previous message
Eclipse UserFriend
Peter Osipov wrote:

> Dani, can you tell me where I can download that plug-in?

Either download Eclipse Platform or Eclipse SDK.

Dani

> Peter Osipov wrote:
>
>> Huh. thanks God, you told me!
>> Let me try it.
>> Daniel Megert wrote:
>>
>>> Peter Osipov wrote:
>>>
>>>> Huh, I cannot figure out where DocumentProviderRegistry in 3.2
>>>> Documentations says
>>>> org.eclipse.ui.texteditor.DocumentProviderRegistry, but I have not
>>>> got this plug-in...
>>>
>>>
>>> It's in org.eclipse.ui.editors which is not officially part of RCP.
>>>
>>> Dani
>>>
>>>>
>>>> Peter Osipov wrote:> Thanks, Vikram!
>>>>
>>>>> Let me try it out!
>>>>> Vikram wrote:
>>>>>
>>>>>> You could create links to the XML Files outside of the eclipse
>>>>>> workspace.
>>>>>> Then register a document provider for xml extensions in the
>>>>>> plugin.xml.
>>>>>>
>>>>>> So, if you have an XML File object, the steps would be:
>>>>>>
>>>>>> IFile linkFile = ..// create a File link for the XML File
>>>>>> IEditorInput inp = new FileEditorInput(linkFile);
>>>>>> DocumentProviderRegistry dpr =
>>>>>> DocumentProviderRegistry.getDefault();
>>>>>> IDocumentProvider dp = dpr.getDocumentProvider(inp);
>>>>>> dp.connect(inp);
>>>>>>
>>>>>> Your registered document provider will be invoked when changes
>>>>>> are made to the underlying
>>>>>> XML file.
>>>>>>
>>>>>> Hope this helps
>>>>>>
>>>>>>
>>>>>>
>>>>>> "Peter Osipov" <peter_ossipov@mail.ru> wrote in message
>>>>>> news:elpbcs$1ht$1@utils.eclipse.org...
>>>>>>
>>>>>>> Hi everybody!
>>>>>>> Is there a way to add a listener somewhere, so that if an *.xml
>>>>>>> file is changed from somewhere I could be notified of it. I
>>>>>>> mean, I have searched regarding this and everybody talks about
>>>>>>> IResourceChangeListener and some workspaces. But it just
>>>>>>> confuses me - I do not have any workspaces - it is just a file
>>>>>>> somewhere in the file system, not related to eclipse at all!
>>>>>>> So, thanks so much in advance.
>>>>>>
>>>>>>
>>>>>>
>>>>>>
Previous Topic:Applying TreeViewer Filter for a specific node
Next Topic:Add a progress bar to splash screen in eclipse product
Goto Forum:
  


Current Time: Tue Apr 15 02:10:25 EDT 2025

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

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

Back to the top