Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Common Navigator Framework - Trigger refresh
Common Navigator Framework - Trigger refresh [message #731204] Fri, 30 September 2011 05:06 Go to next message
Christian Pontesegger is currently offline Christian Pontesegger
Messages: 40
Registered: July 2009
Location: Graz, Austria
Member
Hi,

is there a way to programmatically trigger a refresh of all navigators?

Background is that I have a custom decorator. On changes of that decorator I want all the labels to be refreshed (not the resources though)

thanks
Christian
Re: Common Navigator Framework - Trigger refresh [message #731286 is a reply to message #731204] Fri, 30 September 2011 10:12 Go to previous messageGo to next message
Francis Upton IV is currently offline Francis Upton IV
Messages: 472
Registered: July 2009
Location: Oakland, CA
Senior Member
There is nothing that knows about all instances of the Common Navigator, so you have to know about them and refresh them yourself.

Re: Common Navigator Framework - Trigger refresh [message #733590 is a reply to message #731286] Wed, 05 October 2011 02:59 Go to previous messageGo to next message
Christian Pontesegger is currently offline Christian Pontesegger
Messages: 40
Registered: July 2009
Location: Graz, Austria
Member
I found a way to achieve this for some cases by triggering the refresh command:

// trigger a refresh
IHandlerService handlerService = (IHandlerService) PlatformUI.getWorkbench().getService(IHandlerService.class);
if (handlerService != null) {
	try {
		handlerService.executeCommand("org.eclipse.ui.file.refresh", null);
	} catch (Exception e) {
	}
}


Not exactly what I wanted but helps in some cases.
Re: Common Navigator Framework - Trigger refresh [message #733831 is a reply to message #733590] Wed, 05 October 2011 14:23 Go to previous message
Lubos Pochman is currently offline Lubos Pochman
Messages: 29
Registered: July 2009
Junior Member
If you have a resource available you can call refreshLocal() on it:

IFile resource = <get resource somehow>
if (resource != null) resource.refreshLocal(IResource.DEPTH_INFINITE, monitor);
Previous Topic:Cannot save proxy authentication details
Next Topic:Adding a predefined popup menu to a TreeViewer without an id
Goto Forum:
  


Current Time: Wed Apr 23 20:42:01 EDT 2014

Powered by FUDForum. Page generated in 0.01717 seconds