Add option to hide refresh button

This commit is contained in:
crschnick
2025-05-04 10:19:56 +00:00
parent b6690405d4
commit 97421cf1bd
2 changed files with 10 additions and 1 deletions
@@ -8,6 +8,10 @@ import java.util.List;
public interface FixedHierarchyStore extends DataStore {
default boolean canManuallyRefresh() {
return true;
}
default boolean removeLeftovers() {
return true;
}
@@ -42,6 +42,11 @@ public class RefreshChildrenStoreAction implements ActionProvider {
public LabelGraphic getIcon(DataStoreEntryRef<FixedHierarchyStore> store) {
return new LabelGraphic.IconGraphic("mdi2r-refresh");
}
@Override
public boolean isApplicable(DataStoreEntryRef<FixedHierarchyStore> o) {
return o.getStore().canManuallyRefresh();
}
};
}
@@ -61,7 +66,7 @@ public class RefreshChildrenStoreAction implements ActionProvider {
@Override
public boolean isApplicable(DataStoreEntryRef<FixedHierarchyStore> o) {
return DataStorage.get().getStoreChildren(o.get()).size() == 0;
return o.getStore().canManuallyRefresh() && DataStorage.get().getStoreChildren(o.get()).size() == 0;
}
};
}