VCS: fix group by structure for Changes | Local
[fedora-idea.git] / platform / vcs-impl / src / com / intellij / openapi / vcs / changes / LogicallyLockedHolder.java
blobfbd5b9ee7d27e13e175961ff81a62620dd1a7ecf
1 /*
2 * Copyright 2000-2009 JetBrains s.r.o.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
16 package com.intellij.openapi.vcs.changes;
18 import com.intellij.openapi.project.Project;
19 import com.intellij.openapi.vfs.VirtualFile;
21 import java.util.HashMap;
22 import java.util.Map;
24 public class LogicallyLockedHolder implements FileHolder {
25 private final Map<VirtualFile, LogicalLock> myMap;
26 private final Project myProject;
28 public LogicallyLockedHolder(final Project project) {
29 myProject = project;
30 myMap = new HashMap<VirtualFile, LogicalLock>();
33 public void cleanAll() {
34 myMap.clear();
37 public void add(final VirtualFile file, final LogicalLock lock) {
38 myMap.put(file, lock);
41 public void cleanScope(VcsDirtyScope scope) {
42 VirtualFileHolder.cleanScope(myProject, myMap.keySet(), scope);
45 public FileHolder copy() {
46 final LogicallyLockedHolder result = new LogicallyLockedHolder(myProject);
47 result.myMap.putAll(myMap);
48 return result;
51 public HolderType getType() {
52 return HolderType.LOGICALLY_LOCKED;
55 public Map<VirtualFile, LogicalLock> getMap() {
56 return myMap;