refresh file with refreshLocal( ), does not sync all tabs in Multipage ed [message #332406] |
Tue, 21 October 2008 02:48  |
Eclipse User |
|
|
|
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,
|
|
|
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   |
Eclipse User |
|
|
|
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,
>
|
|
|
Re: refresh file with refreshLocal( ), does not sync all tabs in Multipage ed [message #332441 is a reply to message #332416] |
Tue, 21 October 2008 17:54   |
Eclipse User |
|
|
|
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
|
|
|
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  |
Eclipse User |
|
|
|
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
>
|
|
|
Powered by
FUDForum. Page generated in 14.65857 seconds