Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Common Navigator and IMArker
Common Navigator and IMArker [message #544416] Fri, 02 July 2010 15:37 Go to next message
BLANC Philippe is currently offline BLANC PhilippeFriend
Messages: 89
Registered: July 2009
Member
Hello,

I have a problem with my application.
I use a common navigator to display my custom file system.
Of course, each element of my file system is linked to a IResource.

I also added a builder to my project nature. During my build, I add some markers to my resources.

The markers are correctly displayed in my Error view. However, my common navigator view is not refreshed. I see my errors iff I select the corresponding node in the common navigator.

After my build, I tried to perform a workspace.refreshLocal, but nothing works.

Any ideas? Thanks in advance.

Regards,

Philippe BLANC

Re: Common Navigator and IMArker [message #544764 is a reply to message #544416] Mon, 05 July 2010 13:08 Go to previous messageGo to next message
BLANC Philippe is currently offline BLANC PhilippeFriend
Messages: 89
Registered: July 2009
Member
Humm, I found a workaround...

Once my build has finished, I refresh the common navigator via:

protected IProject[] build(int kind, Map args, IProgressMonitor monitor)
			throws CoreException {
		ResourcesPlugin.getWorkspace().run(
					new IWorkspaceRunnable() {
						@Override
						public void run(IProgressMonitor monitor) throws CoreException {
							auditDPSpecification(getDelta(getProject()));
						}
					}
				, monitor);
		PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
			public void run() {
				...getCommonNavigator().getCommonViewer().refresh(true);
			}
		});
		return null;
	}
Re: Common Navigator and IMArker [message #551920 is a reply to message #544764] Tue, 10 August 2010 07:50 Go to previous message
Martin Domig is currently offline Martin DomigFriend
Messages: 12
Registered: August 2010
Junior Member
Calling refresh on a common navigator viewer should not be necessary, since changes in the tree can be handled in the content providers. To do that, declare a navigatorContent extension that overrides org.eclipse.ui.navigator.resourceContent and has a content provider that implements IPipelinedTreeContentProvider. The platform will call the interceptXxx methods when resources change.

However, error markers should already be handled by the platform, so my guess is that you don't use the resourceContent in your view. Still, refreshing the view should not be necessary. I'd recommend using a label decorator instead (use the org.eclipse.ui.decorators extension point).

-Martin
Previous Topic:Capturing the 'Save' event
Next Topic:Error "org.eclipse.jface"
Goto Forum:
  


Current Time: Thu Apr 25 00:36:20 GMT 2024

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

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

Back to the top