Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » TreeView updating code doesn't work with Eclipse 3.5
TreeView updating code doesn't work with Eclipse 3.5 [message #483837] Thu, 03 September 2009 10:00
Andreas Pakulat is currently offline Andreas PakulatFriend
Messages: 127
Registered: July 2009
Senior Member
Hi,

I've recently tried to upgrade to Eclipse 3.5 and stumbled over a behaviour
change that I cannot explain here.

I have a common-navigator here with a tree content provider that listens to
resource changes to update its data (the provider doesn't provide resources
directly). So if a resource is added, in particular a new project I'm
trying to use CommonViewer.add() to add a new object to the treeview.

This object does show up in the tree, but the viewer never asks for children
and hence one cannot open the project. I can make it call the content
providers hasChildren() method by adding a viewer.refresh() call, this adds
the expand/collapse handle but when I try to open I still get no children
(and getChildren is not called).

If however the provider is populated with these projects during start of the
application, then everything works fine.

Does anybody know wether there were significant changes to CommonViewer or
the CN framework that could influence this? In particular do I maybe have
to do more than just adding the item.

The code adding the items is this (addedResource is the newly added resource
object, viewer is the CommonViewer I get via inputChanged()):

final MyProjectItem item = new MyProjectItem( addedResource );
final IWorkspaceRoot parent = ResourcesPlugin.getWorkspace().getRoot()
new UIJob( "Adding Item from view" ) {
public IStatus runInUIThread( IProgressMonitor monitor ) {
viewer.add( parent, item );
return Status.OK_STATUS;
}
}.schedule();

Andreas
Previous Topic:Linking to external resources
Next Topic:How to move the lookup table of a input method to the correct positon?
Goto Forum:
  


Current Time: Mon Nov 24 03:09:48 GMT 2014

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

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