mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
avoid refreshing project view from wrong thread
This commit is contained in:
+10
-3
@@ -44,12 +44,17 @@ class FileAssociationsManagerImpl extends FileAssociationsManager implements Pro
|
||||
private final VirtualFilePointerManager myFilePointerManager;
|
||||
private final Map<VirtualFilePointer, VirtualFilePointerContainer> myAssociations;
|
||||
private long myModCount;
|
||||
private boolean myTempCopy;
|
||||
|
||||
public FileAssociationsManagerImpl(Project project, VirtualFilePointerManager filePointerManager) {
|
||||
myProject = project;
|
||||
myFilePointerManager = filePointerManager;
|
||||
myAssociations = new LinkedHashMap<VirtualFilePointer, VirtualFilePointerContainer>();
|
||||
}
|
||||
|
||||
public void markAsTempCopy() {
|
||||
myTempCopy = true;
|
||||
}
|
||||
|
||||
@SuppressWarnings({"unchecked"})
|
||||
public void readExternal(Element element) throws InvalidDataException {
|
||||
@@ -114,9 +119,11 @@ class FileAssociationsManagerImpl extends FileAssociationsManager implements Pro
|
||||
|
||||
private void touch() {
|
||||
myModCount++;
|
||||
final ProjectView view = ProjectView.getInstance(myProject);
|
||||
if (view != null) {
|
||||
view.refresh();
|
||||
if (!myTempCopy) {
|
||||
final ProjectView view = ProjectView.getInstance(myProject);
|
||||
if (view != null) {
|
||||
view.refresh();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
@@ -31,6 +31,7 @@ class TempManager extends TransactionalManager {
|
||||
|
||||
TempManager(FileAssociationsManagerImpl impl, Project project, VirtualFilePointerManager filePointerManager) {
|
||||
myTmp = new FileAssociationsManagerImpl(project, filePointerManager);
|
||||
myTmp.markAsTempCopy();
|
||||
myTmp.copyFrom(impl);
|
||||
|
||||
myImpl = impl;
|
||||
|
||||
Reference in New Issue
Block a user