|
Re: refresh file with refreshLocal( ), does not sync all tabs in Multipage ed [message #332416 is a reply to message #332406] |
Tue, 21 October 2008 08:47 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) ![Go to next message Go to next message](theme/Solstice/images/down.png) |
Ed Merks![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=ed.merks%40gmail.com) Messages: 33196 Registered: July 2009 |
Senior Member |
|
|
Zori,
What are the other pages displaying? How are their contents populated?
Text editors rely on the fact that the underlying IDocument (or whatever
it's called) they're viewing listens for IResourceDelta so that when the
resource they are displaying is known to have changed, they refresh
themselves. Likely you'll need to do something similar or listen to
the document changing...
Zori Aldana wrote:
> Hi,
>
> I have a file which may be modified outside of the workbench, when I
> refresh the project while having the editor opened I can see the
> changes reflecting on the XML page of my custom MultipageEditor but
> not in the other pages. I would like to know which method is called
> (setInput(...), init(...,...) or any other) which I can then
> synchronize the other tabs with the content. None of the methods I
> mention above seem to be called when the project is refreshed, but the
> contents do get refresh on the XML tab only.
>
> Thanks,
>
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
|
Re: refresh file with refreshLocal( ), does not sync all tabs in Multipage ed [message #332456 is a reply to message #332441] |
Tue, 21 October 2008 20:19 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Ed Merks![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=ed.merks%40gmail.com) Messages: 33196 Registered: July 2009 |
Senior Member |
|
|
Zori,
It's really hard to comment based on your descriptions. Generally you
will be responsible for doing all the work of responding to a resource
delta, including calling setInput on your tree viewer...
Zori Aldana wrote:
> Hi Ed,
>
> The other tab of my editor contains a treeviewer which reflects the
> xml structure.
>
> I tried adding a listener as you mentioned and I have the following
> code on the listener:
>
> IFile affectedFile = myDelta.getResource(); //I get the right file
> IWorkbench page = MyPlugin.getActivePage();
> IEditorPart editor = page.findEditor(new FileEditorInput(affectedFile));
> try{
> page.openEditor(new FileEditorInput(affectedFile),
> editorDescriptor.getId());
> }catch(Exception ex) { /*ignore*/ }
>
> I see that the correct editor is found, and that the XML tab in the
> editor is refreshed with the contents when calling
> page.openEditor(...) but I cannot seem to get those new contents so
> that I could repopulate my tree. It seems like openEditor(...) is not
> calling setInput(...) or init(..,..) if my MultipageEditor.
>
> Thanks,
>
> Zori
>
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Powered by
FUDForum. Page generated in 0.03451 seconds