KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > core > internal > resources > refresh > win32 > Win32RefreshProvider


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.resources.refresh.win32;
12
13 import org.eclipse.core.resources.IResource;
14 import org.eclipse.core.resources.refresh.*;
15
16 /**
17  * The <code>Win32RefreshProvider</code> creates monitors that
18  * can monitor drives on Win32 platforms.
19  *
20  * @see org.eclipse.core.resources.refresh.RefreshProvider
21  */

22 public class Win32RefreshProvider extends RefreshProvider {
23     private Win32Monitor monitor;
24
25     /**
26      * Creates a standard Win32 monitor if the given resource is local.
27      *
28      * @see org.eclipse.core.resources.refresh.RefreshProvider#installMonitor(IResource,IRefreshResult)
29      */

30     public IRefreshMonitor installMonitor(IResource resource, IRefreshResult result) {
31         if (resource.getLocation() == null || !resource.exists() || resource.getType() == IResource.FILE)
32             return null;
33         if (monitor == null)
34             monitor = new Win32Monitor(result);
35         if (monitor.monitor(resource))
36             return monitor;
37         return null;
38     }
39 }
40
Popular Tags