diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ChangesViewManager.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ChangesViewManager.java index 6f55414f06dd..90dd482ef931 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ChangesViewManager.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ChangesViewManager.java @@ -153,6 +153,8 @@ public class ChangesViewManager implements ChangesViewI, ProjectComponent, Persi myContentManager.addToolWindowTitleAction(expandAll); myContentManager.addToolWindowTitleAction(collapseAll); + myView.setTreeExpander(expander); + scheduleRefresh(); myProject.getMessageBus().connect().subscribe(RemoteRevisionsCache.REMOTE_VERSION_CHANGED, () -> ApplicationManager.getApplication().invokeLater(() -> refreshView(), ModalityState.NON_MODAL, myProject.getDisposed())); diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/ChangesListView.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/ChangesListView.java index 24b5f2575e36..4d2d499901d0 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/ChangesListView.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/ChangesListView.java @@ -1,6 +1,7 @@ // Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.openapi.vcs.changes.ui; +import com.intellij.ide.TreeExpander; import com.intellij.ide.dnd.DnDAware; import com.intellij.ide.util.PsiNavigationSupport; import com.intellij.ide.util.treeView.TreeState; @@ -50,6 +51,8 @@ public class ChangesListView extends ChangesTree implements DataProvider, DnDAwa @NonNls public static final DataKey> MISSING_FILES_DATA_KEY = DataKey.create("ChangeListView.MissingFiles"); @NonNls public static final DataKey> LOCALLY_DELETED_CHANGES = DataKey.create("ChangeListView.LocallyDeletedChanges"); + private TreeExpander myTreeExpander; + public ChangesListView(@NotNull Project project) { super(project, false, true); setDragEnabled(true); @@ -179,6 +182,9 @@ public class ChangesListView extends ChangesTree implements DataProvider, DnDAwa if (PlatformDataKeys.HELP_ID.is(dataId)) { return HELP_ID; } + if (PlatformDataKeys.TREE_EXPANDER.is(dataId) && myTreeExpander != null) { + return myTreeExpander; + } return super.getData(dataId); } @@ -399,4 +405,8 @@ public class ChangesListView extends ChangesTree implements DataProvider, DnDAwa return seen.add(change); } } + + public void setTreeExpander(TreeExpander expander) { + myTreeExpander = expander; + } } \ No newline at end of file