Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » Common Navigator and IMArker
Common Navigator and IMArker [message #544416] Fri, 02 July 2010 11:37 Go to next message
Eclipse UserFriend
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 09:08 Go to previous messageGo to next message
Eclipse UserFriend
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 03:50 Go to previous message
Eclipse UserFriend
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: Sat Aug 30 16:20:12 EDT 2025

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

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

Back to the top