org.eclipse.core.resources.refresh
Class RefreshProvider

java.lang.Object
  extended by org.eclipse.core.internal.refresh.InternalRefreshProvider
      extended by org.eclipse.core.resources.refresh.RefreshProvider
Direct Known Subclasses:
TestRefreshProvider, Win32RefreshProvider

public abstract class RefreshProvider
extends InternalRefreshProvider

The abstract base class for all auto-refresh providers. This class provides the infrastructure for defining an auto-refresh provider and fulfills the contract specified by the org.eclipse.core.resources.refreshProviders standard extension point.

All auto-refresh providers must subclass this class. A RefreshProvider is responsible for creating IRefreshMonitor objects. The provider must decide if it is capable of monitoring the file, or folder and subtree under the path that is provided.

Since:
3.0

Constructor Summary
RefreshProvider()
           
 
Method Summary
abstract  IRefreshMonitor installMonitor(IResource resource, IRefreshResult result)
          Returns an IRefreshMonitor that will monitor a resource.
 void resetMonitors(IResource resource)
          Resets the installed monitors for the given resource.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RefreshProvider

public RefreshProvider()
Method Detail

installMonitor

public abstract IRefreshMonitor installMonitor(IResource resource,
                                               IRefreshResult result)
Returns an IRefreshMonitor that will monitor a resource. If the resource is an IContainer the monitor will also monitor the subtree under the container. Returns null if this provider cannot create a monitor for the given resource. The provider may return the same monitor instance that has been provided for other resources.

The monitor should send results and failures to the provided refresh result.

Parameters:
resource - the resource to monitor
result - the result callback for notifying of failure or of resources that need refreshing
Returns:
a monitor on the resource, or null if the resource cannot be monitored
See Also:
createPollingMonitor(IResource)

resetMonitors

public void resetMonitors(IResource resource)
Resets the installed monitors for the given resource. This will remove all existing monitors that are installed on the resource, and then ask all refresh providers to begin monitoring the resource again.

This method is intended to be used by refresh providers that need to change the refresh monitor that they previously used to monitor a resource.

Overrides:
resetMonitors in class InternalRefreshProvider
Parameters:
resource - The resource to reset the monitors for