org.eclipse.core.internal.refresh
Class RefreshManager

java.lang.Object
  extended by org.eclipse.core.internal.refresh.RefreshManager
All Implemented Interfaces:
java.util.EventListener, IManager, IRefreshResult, org.eclipse.core.runtime.Preferences.IPropertyChangeListener

public class RefreshManager
extends java.lang.Object
implements IRefreshResult, IManager, org.eclipse.core.runtime.Preferences.IPropertyChangeListener

Manages auto-refresh functionality, including maintaining the active set of monitors and controlling the job that performs periodic refreshes on out of sync resources.

Since:
3.0

Field Summary
static boolean DEBUG
           
static java.lang.String DEBUG_PREFIX
           
 
Constructor Summary
RefreshManager(IWorkspace workspace)
           
 
Method Summary
 void monitorFailed(IRefreshMonitor monitor, IResource resource)
          Notifies that the given monitor has encountered a failure from which it cannot recover while monitoring the given resource.
 void propertyChange(org.eclipse.core.runtime.Preferences.PropertyChangeEvent event)
          Checks for changes to the PREF_AUTO_UPDATE property.
 void refresh(IResource resource)
          Requests that the provided resource be refreshed.
 void shutdown(org.eclipse.core.runtime.IProgressMonitor monitor)
          Shuts down the refresh manager.
 void startup(org.eclipse.core.runtime.IProgressMonitor monitor)
          Initializes the refresh manager.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEBUG

public static boolean DEBUG

DEBUG_PREFIX

public static final java.lang.String DEBUG_PREFIX
See Also:
Constant Field Values
Constructor Detail

RefreshManager

public RefreshManager(IWorkspace workspace)
Method Detail

monitorFailed

public void monitorFailed(IRefreshMonitor monitor,
                          IResource resource)
Description copied from interface: IRefreshResult
Notifies that the given monitor has encountered a failure from which it cannot recover while monitoring the given resource.

If the given resource is null it indicates that the monitor has failed completely, and the refresh manager will have to take over the monitoring responsibilities for all resources that the monitor was monitoring.

Specified by:
monitorFailed in interface IRefreshResult
Parameters:
monitor - a monitor which has encountered a failure that it cannot recover from
resource - the resource that the monitor can no longer monitor, or null to indicate that the monitor can no longer monitor any of the resources it was monitoring

propertyChange

public void propertyChange(org.eclipse.core.runtime.Preferences.PropertyChangeEvent event)
Checks for changes to the PREF_AUTO_UPDATE property.

Specified by:
propertyChange in interface org.eclipse.core.runtime.Preferences.IPropertyChangeListener
See Also:
Preferences.IPropertyChangeListener#propertyChange(Preferences.PropertyChangeEvent)

refresh

public void refresh(IResource resource)
Description copied from interface: IRefreshResult
Requests that the provided resource be refreshed. The refresh will occur in the background during the next scheduled refresh.

Specified by:
refresh in interface IRefreshResult
Parameters:
resource - the resource to refresh

shutdown

public void shutdown(org.eclipse.core.runtime.IProgressMonitor monitor)
Shuts down the refresh manager. This only happens when the resources plugin is going away.

Specified by:
shutdown in interface IManager

startup

public void startup(org.eclipse.core.runtime.IProgressMonitor monitor)
Initializes the refresh manager. This does a minimal amount of work if auto-refresh is turned off.

Specified by:
startup in interface IManager