Eclipse RCP ProjectExplorer.refreshLocal() not working for added resource
<p>My RCP app provides content through the <code>CommonNavigator</code> to the <code>ProjectExplorer</code> view. It provides a node whose children are resources which exist in various places on the file system inside the project, similar to how JDT or other toolkits provide a container that provides access to library resources, etc.</p>

<p>When a file is created on the file system inside the project, by a program external to eclipse, I detect it with an <code>IResourceChangeListener</code> and invoke</p>

<pre><code>refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor())
</code></pre>

<p>on the resource, and the file appears automatically in the file tree of <code>ProjectExplorer</code>, in the node corresponding to its actual place on the file system. But it doesn't appear under the custom node that I contributed to the <code>CommonNavigator</code>, unless I manually refresh the tree from the UI.</p>

<p>I worked around the problem somewhat by getting a reference to the <code>ProjectExplorer</code> view, and calling <code>refresh()</code> on its <code>CommonViewer</code> instance. The problem with this is that the entire tree is refreshed, collapsing all nodes. But when they're re-expanded the new file shows up in my custom node as desired. I tried calling <code>refresh(theResource)</code> on the <code>CommonViewer</code>, but that has no effect.</p>

<p>Is there any way to cause the file to be added automatically to my custom node when it's created from outside eclipse, just as it's added to its regular place in the file tree?</p>

<p>UPDATE: I implemented an <code>ICommonviewerMapper</code>, which I set on the viewer so that it reports the mapping of model objects to <code>Tree</code> items. With this class I call <code>viewer.refresh(item)</code>, where <code>item</code> is the <code>Tree</code> item that the viewer indicated to the mapper is mapped to the model object that I'm updating. In my case, the model object is an <code>IContainer</code> instance to which the <code>ContentProvider</code> adds IFile instances as children (it's one of these files that is being created outside of eclipse, which I want the viewer to show).</p>

<p>So I'm calling <code>viewer.refresh()</code> with the <code>Tree</code> element that is a container to which the <code>ContentProvider</code>  will add as a child the file that was created, and still the viewer takes no action. The <code>ContentProvider</code>'s <code>getChildren()</code> method is not called after <code>refresh</code> is invoked on the viewer. The viewer seems to be ignoring the invocation of <code>refresh</code> with a Tree item that I know exists in the viewer.</p>