mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-182879 vcs: move Collapse/Expand actions to the right in "Unversioned Files"
This commit is contained in:
@@ -10,6 +10,7 @@ import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.ui.DialogWrapper;
|
||||
import com.intellij.openapi.vcs.changes.ui.ChangesBrowserNode;
|
||||
import com.intellij.openapi.vcs.changes.ui.ChangesListView;
|
||||
import com.intellij.openapi.vcs.changes.ui.TreeActionsToolbarPanel;
|
||||
import com.intellij.openapi.vcs.changes.ui.TreeModelBuilder;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.ui.GuiUtils;
|
||||
@@ -107,10 +108,14 @@ abstract class SpecificFilesViewDialog extends DialogWrapper {
|
||||
final Expander expander = new Expander();
|
||||
group.addSeparator();
|
||||
group.add(ActionManager.getInstance().getAction(GROUP_BY_ACTION_GROUP));
|
||||
group.add(cam.createExpandAllAction(expander, myView));
|
||||
group.add(cam.createCollapseAllAction(expander, myView));
|
||||
|
||||
myPanel.add(actionToolbar.getComponent(), BorderLayout.NORTH);
|
||||
DefaultActionGroup treeActions = new DefaultActionGroup();
|
||||
treeActions.add(cam.createExpandAllHeaderAction(expander, myView));
|
||||
treeActions.add(cam.createCollapseAllHeaderAction(expander, myView));
|
||||
|
||||
JPanel toolbarPanel = new TreeActionsToolbarPanel(actionToolbar, treeActions);
|
||||
|
||||
myPanel.add(toolbarPanel, BorderLayout.NORTH);
|
||||
myPanel.add(ScrollPaneFactory.createScrollPane(myView), BorderLayout.CENTER);
|
||||
myView.getGroupingSupport().setGroupingKeysOrSkip(set(DEFAULT_GROUPING_KEYS));
|
||||
}
|
||||
|
||||
+18
-5
@@ -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.openapi.actionSystem.ActionGroup;
|
||||
import com.intellij.openapi.actionSystem.ActionManager;
|
||||
import com.intellij.openapi.actionSystem.ActionToolbar;
|
||||
import com.intellij.openapi.actionSystem.DefaultActionGroup;
|
||||
@@ -14,12 +15,16 @@ public class TreeActionsToolbarPanel extends JPanel {
|
||||
this(toolbar.getComponent(), tree);
|
||||
}
|
||||
|
||||
public TreeActionsToolbarPanel(@NotNull Component toolbarComponent, @NotNull ChangesTree tree) {
|
||||
super(new BorderLayout());
|
||||
public TreeActionsToolbarPanel(@NotNull ActionToolbar toolbar, @NotNull ActionGroup group) {
|
||||
this(toolbar.getComponent(), group);
|
||||
}
|
||||
|
||||
DefaultActionGroup group = new DefaultActionGroup();
|
||||
group.add(tree.createExpandAllAction(true));
|
||||
group.add(tree.createCollapseAllAction(true));
|
||||
public TreeActionsToolbarPanel(@NotNull Component toolbarComponent, @NotNull ChangesTree tree) {
|
||||
this(toolbarComponent, createTreeActions(tree));
|
||||
}
|
||||
|
||||
public TreeActionsToolbarPanel(@NotNull Component toolbarComponent, @NotNull ActionGroup group) {
|
||||
super(new BorderLayout());
|
||||
|
||||
ActionToolbar additionalToolbar = ActionManager.getInstance().createActionToolbar("TreeActionsToolbar", group, true);
|
||||
additionalToolbar.setTargetComponent(this);
|
||||
@@ -28,4 +33,12 @@ public class TreeActionsToolbarPanel extends JPanel {
|
||||
add(toolbarComponent, BorderLayout.CENTER);
|
||||
add(additionalToolbar.getComponent(), BorderLayout.EAST);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private static DefaultActionGroup createTreeActions(@NotNull ChangesTree tree) {
|
||||
DefaultActionGroup group = new DefaultActionGroup();
|
||||
group.add(tree.createExpandAllAction(true));
|
||||
group.add(tree.createCollapseAllAction(true));
|
||||
return group;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user