Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » refresh file with refreshLocal( ), does not sync all tabs in Multipage ed
refresh file with refreshLocal( ), does not sync all tabs in Multipage ed [message #332406] Tue, 21 October 2008 02:48 Go to next message
Zori Aldana is currently offline Zori AldanaFriend
Messages: 5
Registered: July 2009
Junior Member
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 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33264
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 #332441 is a reply to message #332416] Tue, 21 October 2008 17:54 Go to previous messageGo to next message
Zori Aldana is currently offline Zori AldanaFriend
Messages: 5
Registered: July 2009
Junior Member
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 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33264
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/
Previous Topic:How to remote debug?
Next Topic:Databinding for Combo behaves differently in 3.4
Goto Forum:
  


Current Time: Fri Dec 27 00:14:22 GMT 2024

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

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

Back to the top