KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > team > internal > core > PessimisticResourceRuleFactory


1 /*******************************************************************************
2  * Copyright (c) 2000, 2006 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 Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.team.internal.core;
12
13 import org.eclipse.core.resources.*;
14 import org.eclipse.core.resources.team.ResourceRuleFactory;
15 import org.eclipse.core.runtime.jobs.ISchedulingRule;
16
17 /**
18  * A pessimistic rule factory used to ensure older repository providers
19  * are not broken by new scheduling rule locking. The workspace root
20  * is returned for all rules.
21  */

22 public class PessimisticResourceRuleFactory extends ResourceRuleFactory {
23     
24     IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
25     
26     /* (non-Javadoc)
27      * @see org.eclipse.core.resources.IResourceRuleFactory#copyRule(org.eclipse.core.resources.IResource, org.eclipse.core.resources.IResource)
28      */

29     public ISchedulingRule copyRule(IResource source, IResource destination) {
30         return root;
31     }
32     /* (non-Javadoc)
33      * @see org.eclipse.core.resources.IResourceRuleFactory#createRule(org.eclipse.core.resources.IResource)
34      */

35     public ISchedulingRule createRule(IResource resource) {
36         return root;
37     }
38     /* (non-Javadoc)
39      * @see org.eclipse.core.resources.IResourceRuleFactory#deleteRule(org.eclipse.core.resources.IResource)
40      */

41     public ISchedulingRule deleteRule(IResource resource) {
42         return root;
43     }
44     /* (non-Javadoc)
45      * @see org.eclipse.core.resources.IResourceRuleFactory#modifyRule(org.eclipse.core.resources.IResource)
46      */

47     public ISchedulingRule modifyRule(IResource resource) {
48         return root;
49     }
50     /* (non-Javadoc)
51      * @see org.eclipse.core.resources.IResourceRuleFactory#moveRule(org.eclipse.core.resources.IResource, org.eclipse.core.resources.IResource)
52      */

53     public ISchedulingRule moveRule(IResource source, IResource destination) {
54         return root;
55     }
56     /* (non-Javadoc)
57      * @see org.eclipse.core.resources.IResourceRuleFactory#refreshRule(org.eclipse.core.resources.IResource)
58      */

59     public ISchedulingRule refreshRule(IResource resource) {
60         return root;
61     }
62     /* (non-Javadoc)
63      * @see org.eclipse.core.resources.IResourceRuleFactory#validateEditRule(org.eclipse.core.resources.IResource[])
64      */

65     public ISchedulingRule validateEditRule(IResource[] resources) {
66         return root;
67     }
68     
69     /* (non-Javadoc)
70      * @see org.eclipse.core.resources.team.ResourceRuleFactory#charsetRule(org.eclipse.core.resources.IResource)
71      */

72     public ISchedulingRule charsetRule(IResource resource) {
73         return root;
74     }
75 }
76
Popular Tags