KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > core > internal > refresh > InternalRefreshProvider


1 /*******************************************************************************
2  * Copyright (c) 2004, 2005 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM - Initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.core.internal.refresh;
12
13 import org.eclipse.core.internal.resources.Workspace;
14 import org.eclipse.core.resources.IResource;
15 import org.eclipse.core.resources.refresh.IRefreshMonitor;
16
17 /**
18  * Internal abstract superclass of all refresh providers. This class must not be
19  * subclassed directly by clients. All refresh providers must subclass the public
20  * API class <code>org.eclipse.core.resources.refresh.RefreshProvider</code>.
21  *
22  * @since 3.0
23  */

24 public class InternalRefreshProvider {
25     /* (non-Javadoc)
26      * @see org.eclipse.core.resources.refresh.RefreshProvider#createPollingMonitor(IResource)
27      */

28     protected IRefreshMonitor createPollingMonitor(IResource resource) {
29         PollingMonitor monitor = ((Workspace)resource.getWorkspace()).getRefreshManager().monitors.pollMonitor;
30         monitor.monitor(resource);
31         return monitor;
32     }
33
34     /* (non-Javadoc)
35      * @see org.eclipse.core.resources.refresh.RefreshProvider#resetMonitors(IResource)
36      */

37     public void resetMonitors(IResource resource) {
38         MonitorManager manager = ((Workspace)resource.getWorkspace()).getRefreshManager().monitors;
39         manager.unmonitor(resource);
40         manager.monitor(resource);
41     }
42 }
43
Popular Tags