mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[vcs-log] better text and description for IntelliSort
This commit is contained in:
@@ -45,9 +45,9 @@ public interface PermanentGraph<CommitId> {
|
||||
Set<CommitId> getContainingBranches(@NotNull CommitId commit);
|
||||
|
||||
enum SortType {
|
||||
Normal("Off", "Sort commits topologically and by date."),
|
||||
Bek("Standard", "In case of merge show incoming commits first (directly below merge commit)."),
|
||||
LinearBek("Linear", "In case of merge show incoming commits on top of main branch commits as if they were rebased.");
|
||||
Normal("Off", "Sort commits topologically and by date"),
|
||||
Bek("Standard", "In case of merge show incoming commits first (directly below merge commit)"),
|
||||
LinearBek("Linear", "In case of merge show incoming commits on top of main branch commits as if they were rebased");
|
||||
|
||||
@NotNull private final String myPresentation;
|
||||
@NotNull private final String myDescription;
|
||||
|
||||
+1
-1
@@ -79,7 +79,7 @@ public class IntelliSortChooserPopupAction extends DumbAwareAction {
|
||||
private final VcsLogUi myUI;
|
||||
|
||||
public SelectIntelliSortTypeAction(VcsLogUi logUi, PermanentGraph.SortType sortType) {
|
||||
super(sortType.getName(), sortType.getDescription(), null);
|
||||
super(sortType.getName(), sortType.getDescription() + ".", null);
|
||||
myUI = logUi;
|
||||
mySortType = sortType;
|
||||
}
|
||||
|
||||
+9
-2
@@ -27,10 +27,11 @@ import icons.VcsLogIcons;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class IntelliSortChooserToggleAction extends ToggleAction implements DumbAware {
|
||||
@NotNull private static final String DEFAULT_TEXT = "IntelliSort";
|
||||
@NotNull private static final String DEFAULT_DESCRIPTION = "Turn IntelliSort On/Off";
|
||||
|
||||
public IntelliSortChooserToggleAction() {
|
||||
super("IntelliSort", DEFAULT_DESCRIPTION, IconUtil.flip(VcsLogIcons.Branch, false));
|
||||
super(DEFAULT_TEXT, DEFAULT_DESCRIPTION, IconUtil.flip(VcsLogIcons.Branch, false));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -54,9 +55,15 @@ public class IntelliSortChooserToggleAction extends ToggleAction implements Dumb
|
||||
e.getPresentation().setEnabled(BekSorter.isBekEnabled() && logUI != null);
|
||||
|
||||
if (logUI != null) {
|
||||
e.getPresentation().setDescription("Turn IntelliSort " + (logUI.getBekType() == PermanentGraph.SortType.Normal ? "On" : "Off" + ""));
|
||||
boolean off = logUI.getBekType() == PermanentGraph.SortType.Normal;
|
||||
e.getPresentation().setText("IntelliSort is " + (off ? "Off" : "On"));
|
||||
e.getPresentation().setDescription("Turn IntelliSort " + (off ? "on" : "off") + " (" +
|
||||
(off
|
||||
? PermanentGraph.SortType.Bek.getDescription().toLowerCase()
|
||||
: PermanentGraph.SortType.Normal.getDescription().toLowerCase()) + ").");
|
||||
}
|
||||
else {
|
||||
e.getPresentation().setText(DEFAULT_TEXT);
|
||||
e.getPresentation().setDescription(DEFAULT_DESCRIPTION);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user