Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Resource out of sync with the filesystem in multipage editor
Resource out of sync with the filesystem in multipage editor [message #328475] Mon, 26 May 2008 09:37 Go to next message
RaviKumar is currently offline RaviKumarFriend
Messages: 20
Registered: July 2009
Junior Member
Hi,

I have created a multipage editor(extends MultiPageEditorPart) and named
it as "Sample CEditor"

On one of the page am adding a CEditor like this

int index = addPage(new CEditor(), getEditorInput());
other page contains some view.

Every thing is working fine, but ...

i opened a file say sample.c outside the eclipse workspace and i did some
modifications.

And when i opened the same file inside the workspace using "Text Editor"
it prompts me with the "File Changed" dialog box and asks for,
"The file has been changed on the file system. Do you want to load the
changes?"

If we say "Yes" it refreshes the Contents on the file.

I expecting the same kind of behaviour on my "Sample CEditor", But i don't
know how to implement...

Can any one help me to do the same.....


Thanks and Regards,
Ravi.
Re: Resource out of sync with the filesystem in multipage editor [message #333002 is a reply to message #328475] Wed, 19 November 2008 09:42 Go to previous messageGo to next message
Laurent Petit is currently offline Laurent PetitFriend
Messages: 35
Registered: July 2009
Member
Hello,

I'm currently having the same problem.
Did you find the answer, and could you give me some hints ?

Thanks in advance,

--
Laurent

ravi wrote:
> Hi,
>
> I have created a multipage editor(extends MultiPageEditorPart) and named
> it as "Sample CEditor"

>
> On one of the page am adding a CEditor like this
>
> int index = addPage(new CEditor(), getEditorInput());
> other page contains some view.
>
> Every thing is working fine, but ...
>
> i opened a file say sample.c outside the eclipse workspace and i did
> some modifications.
>
> And when i opened the same file inside the workspace using "Text Editor"
> it prompts me with the "File Changed" dialog box and asks for,
> "The file has been changed on the file system. Do you want to load the
> changes?"
>
> If we say "Yes" it refreshes the Contents on the file.
>
> I expecting the same kind of behaviour on my "Sample CEditor", But i
> don't know how to implement...
>
> Can any one help me to do the same.....
>
>
> Thanks and Regards,
> Ravi.
>
>
>
Re: Resource out of sync with the filesystem in multipage editor [message #333005 is a reply to message #333002] Wed, 19 November 2008 11:46 Go to previous messageGo to next message
Szymon Brandys is currently offline Szymon BrandysFriend
Messages: 11
Registered: July 2009
Junior Member
You should look at
org.eclipse.ui.texteditor.AbstractTextEditor.sanityCheckStat e(IEditorInput).
Re: Resource out of sync with the filesystem in multipage editor [message #333009 is a reply to message #333005] Wed, 19 November 2008 14:04 Go to previous messageGo to next message
Laurent Petit is currently offline Laurent PetitFriend
Messages: 35
Registered: July 2009
Member
Szymon Brandys wrote:
> You should look at
> org.eclipse.ui.texteditor.AbstractTextEditor.sanityCheckStat e(IEditorInput).

OK, I've done it, and it is indeed enlightening : there's a huge amount of work to do to correctly implement the whole sync thing, and it seems to me that it has not been made orthogonal to any kind
of editor, but just for text based editors :-(

And it does not seem to me that I can do "monkey copying", since some useful classes are package protected such as org.eclipse.ui.texteditor.EditorMessages.
-> This prevents me from using the same messages for indicating to the user that the resource is out of sync ...

-> Is there another way to do this (for custom editors) ?

Thanks in advance,

Regards,

--
Laurent
Re: Resource out of sync with the filesystem in multipage editor [message #333027 is a reply to message #333009] Thu, 20 November 2008 10:43 Go to previous message
Szymon Brandys is currently offline Szymon BrandysFriend
Messages: 11
Registered: July 2009
Junior Member
> -> This prevents me from using the same messages for indicating to the user
> that the resource is out of sync ...

Right, you would have to create your own messages.

> -> Is there another way to do this (for custom editors) ?

I think that you have to implement it from a scratch. If nobody else
answers your question, you can try to ask on IRC channel.
Previous Topic:Save Action
Next Topic:Fill menu from plugin (programmatically)
Goto Forum:
  


Current Time: Fri Aug 09 03:13:14 GMT 2024

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

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

Back to the top