[vcs-log] correct collapse all/expand all actions text and icons in linear bek mode

This commit is contained in:
Julia Beliaeva
2015-02-13 15:52:06 +03:00
parent 5dc4c4d4d6
commit a9ec8e7258
11 changed files with 33 additions and 3 deletions
Binary file not shown.

After

Width:  |  Height:  |  Size: 229 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 371 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 314 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 231 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 230 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 377 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 339 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 232 B

@@ -114,7 +114,12 @@ public class VcsLogUiImpl implements VcsLogUi, Disposable {
ApplicationManager.getApplication().invokeLater(new Runnable() {
@Override
public void run() {
assert updater != null : "Action:" + title + "\nController: " + myVisiblePack.getVisibleGraph().getActionController() + "\nAnswer:" + answer;
assert updater != null : "Action:" +
title +
"\nController: " +
myVisiblePack.getVisibleGraph().getActionController() +
"\nAnswer:" +
answer;
updater.run();
getTable().handleAnswer(answer, true, null);
}
@@ -124,11 +129,13 @@ public class VcsLogUiImpl implements VcsLogUi, Disposable {
}
public void expandAll() {
performLongAction(new GraphAction.GraphActionImpl(null, GraphAction.Type.BUTTON_EXPAND), "Expanding linear branches...");
performLongAction(new GraphAction.GraphActionImpl(null, GraphAction.Type.BUTTON_EXPAND),
"Expanding " + (getBekType() == PermanentGraph.SortType.LinearBek ? "merges..." : "linear branches..."));
}
public void collapseAll() {
performLongAction(new GraphAction.GraphActionImpl(null, GraphAction.Type.BUTTON_COLLAPSE), "Collapsing linear branches...");
performLongAction(new GraphAction.GraphActionImpl(null, GraphAction.Type.BUTTON_COLLAPSE),
"Collapsing " + (getBekType() == PermanentGraph.SortType.LinearBek ? "merges..." : "linear branches..."));
}
public void setLongEdgeVisibility(boolean visibility) {
@@ -25,6 +25,7 @@ import com.intellij.vcs.log.*;
import com.intellij.vcs.log.data.VcsLogDataHolder;
import com.intellij.vcs.log.data.VcsLogUiProperties;
import com.intellij.vcs.log.data.VisiblePack;
import com.intellij.vcs.log.graph.PermanentGraph;
import com.intellij.vcs.log.graph.impl.facade.bek.BekSorter;
import com.intellij.vcs.log.ui.VcsLogUiImpl;
import com.intellij.vcs.log.ui.filter.VcsLogClassicFilterUi;
@@ -195,6 +196,16 @@ public class MainFrame extends JPanel implements TypeSafeDataProvider {
if (!myFilterUi.getFilters().isEmpty()) {
e.getPresentation().setEnabled(false);
}
if (myUI.getBekType() == PermanentGraph.SortType.LinearBek) {
e.getPresentation().setIcon(VcsLogIcons.CollapseMerges);
e.getPresentation().setText("Collapse all merges");
e.getPresentation().setDescription("Collapse all merges");
}
else {
e.getPresentation().setIcon(VcsLogIcons.CollapseBranches);
e.getPresentation().setText("Collapse all linear branches");
e.getPresentation().setDescription("Collapse all linear branches");
}
}
};
@@ -210,6 +221,16 @@ public class MainFrame extends JPanel implements TypeSafeDataProvider {
if (!myFilterUi.getFilters().isEmpty()) {
e.getPresentation().setEnabled(false);
}
if (myUI.getBekType() == PermanentGraph.SortType.LinearBek) {
e.getPresentation().setIcon(VcsLogIcons.ExpandMerges);
e.getPresentation().setText("Expand all merges");
e.getPresentation().setDescription("Expand all merges");
}
else {
e.getPresentation().setIcon(VcsLogIcons.ExpandBranches);
e.getPresentation().setText("Expand all linear branches");
e.getPresentation().setDescription("Expand all linear branches");
}
}
};
@@ -15,6 +15,8 @@ public class VcsLogIcons {
public static final Icon Branch = load("/icons/branch.png"); // 16x16
public static final Icon CollapseBranches = load("/icons/CollapseBranches.png"); // 16x16
public static final Icon CollapseMerges = load("/icons/CollapseMerges.png"); // 16x16
public static final Icon ExpandBranches = load("/icons/ExpandBranches.png"); // 16x16
public static final Icon ExpandMerges = load("/icons/ExpandMerges.png"); // 16x16
public static final Icon ShowHideLongEdges = load("/icons/ShowHideLongEdges.png"); // 16x16
}