Unverified Commit 44d5ff3f authored by Kay Kasemir's avatar Kay Kasemir Committed by GitHub
Browse files

Merge pull request #2462 from ControlSystemStudio/patches

#2461 check the "isEnabled" before adding context menu actions
parents 1f80bcae 5627f47c
Pipeline #123726 passed with stage
in 13 minutes and 19 seconds
......@@ -2,6 +2,7 @@ package org.phoebus.ui.application;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import java.util.ServiceLoader;
import java.util.ServiceLoader.Provider;
......@@ -82,10 +83,10 @@ public class ContextMenuService {
final List<ContextMenuEntry> result = contextMenuEntries
.stream()
.filter(p -> {
return allAdaptableSelectionType.contains(p.getSupportedType());
return p.isEnabled() && allAdaptableSelectionType.contains(p.getSupportedType());
})
.collect(Collectors.toList());
result.sort((a, b) -> a.getName().compareTo(b.getName()));
result.sort(Comparator.comparing(ContextMenuEntry::getName));
return result;
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment