Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
ics-software
phoebus
Commits
44d5ff3f
Unverified
Commit
44d5ff3f
authored
Nov 14, 2022
by
Kay Kasemir
Committed by
GitHub
Nov 14, 2022
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
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
core/ui/src/main/java/org/phoebus/ui/application/ContextMenuService.java
View file @
44d5ff3f
...
...
@@ -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
;
}
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment