mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[vcs-log] move selected filter up in the recent list
This commit is contained in:
+1
-3
@@ -107,9 +107,7 @@ public class VcsLogProjectTabsProperties implements PersistentStateComponent<Vcs
|
||||
stateField.put(filterName, recentGroups);
|
||||
}
|
||||
RecentGroup group = new RecentGroup(values);
|
||||
if (recentGroups.contains(group)) {
|
||||
return;
|
||||
}
|
||||
recentGroups.remove(group);
|
||||
recentGroups.add(0, group);
|
||||
while (recentGroups.size() > RECENTLY_FILTERED_VALUES_LIMIT) {
|
||||
recentGroups.remove(recentGroups.size() - 1);
|
||||
|
||||
+2
-2
@@ -118,7 +118,7 @@ public class BranchFilterPopupComponent extends MultipleValueFilterPopupComponen
|
||||
|
||||
@Override
|
||||
protected void createFavoritesAction(@NotNull DefaultActionGroup actionGroup, @NotNull List<String> favorites) {
|
||||
actionGroup.add(new PredefinedValueAction("Favorites", favorites));
|
||||
actionGroup.add(new PredefinedValueAction("Favorites", favorites, false));
|
||||
}
|
||||
|
||||
private class BranchFilterAction extends PredefinedValueAction {
|
||||
@@ -128,7 +128,7 @@ public class BranchFilterPopupComponent extends MultipleValueFilterPopupComponen
|
||||
private boolean myIsFavorite;
|
||||
|
||||
public BranchFilterAction(@NotNull String value, @NotNull Collection<VcsRef> references) {
|
||||
super(value, true);
|
||||
super(value);
|
||||
myReferences = references;
|
||||
myIcon = new LayeredIcon(AllIcons.Nodes.Favorite, EmptyIcon.ICON_16);
|
||||
myHoveredIcon = new LayeredIcon(AllIcons.Nodes.FavoriteOnHover, AllIcons.Nodes.NotFavoriteOnHover);
|
||||
|
||||
+4
-8
@@ -104,23 +104,19 @@ abstract class MultipleValueFilterPopupComponent<Filter extends VcsLogFilter> ex
|
||||
@NotNull protected final List<String> myValues;
|
||||
private boolean myAddToRecent;
|
||||
|
||||
public PredefinedValueAction(@NotNull String value, boolean addToRecent) {
|
||||
this(Collections.singletonList(value));
|
||||
myAddToRecent = addToRecent;
|
||||
}
|
||||
|
||||
public PredefinedValueAction(@NotNull String value) {
|
||||
this(value, true);
|
||||
this(Collections.singletonList(value));
|
||||
}
|
||||
|
||||
public PredefinedValueAction(@NotNull List<String> values) {
|
||||
this(displayableText(values), values);
|
||||
this(displayableText(values), values, true);
|
||||
}
|
||||
|
||||
public PredefinedValueAction(@NotNull String name, @NotNull List<String> values) {
|
||||
public PredefinedValueAction(@NotNull String name, @NotNull List<String> values, boolean addToRecent) {
|
||||
super(null, tooltip(values), null);
|
||||
getTemplatePresentation().setText(name, false);
|
||||
myValues = values;
|
||||
myAddToRecent = addToRecent;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user