mirror of
https://github.com/xpipe-io/xpipe.git
synced 2026-08-23 09:46:36 +00:00
Add option to hide refresh button
This commit is contained in:
@@ -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;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user