Skip to content

Commit f4d76e4

Browse files
committed
Fix context menu for all other non-control widgets
Previous change is only applicable to control widgets with the confirm dialog. Other widgets do not have these properties and so first we should check if they are present.
1 parent 0bb2fe5 commit f4d76e4

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

app/display/runtime/src/main/java/org/csstudio/display/builder/runtime/app/ContextMenuSupport.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -138,12 +138,14 @@ private void fillMenu(Runnable setFocus, final Widget widget) {
138138
final Optional<WidgetProperty<Boolean>> prompt = widget.checkProperty(propConfirmDialog);
139139
final Optional<WidgetProperty<ConfirmDialog>> promptOptions = widget.checkProperty(propConfirmDialogOptions);
140140
Boolean promptBool = false;
141-
if (promptOptions.get().getValue() instanceof ConfirmDialog) {
142-
if (((ConfirmDialog) promptOptions.get().getValue()) != ConfirmDialog.NONE) {
143-
promptBool = true;
141+
if (prompt.isPresent() && promptOptions.isPresent()) {
142+
if (promptOptions.get().getValue() instanceof ConfirmDialog) {
143+
if (((ConfirmDialog) promptOptions.get().getValue()) != ConfirmDialog.NONE) {
144+
promptBool = true;
145+
}
146+
} else {
147+
promptBool = prompt.get().getValue();
144148
}
145-
} else {
146-
promptBool = prompt.get().getValue();
147149
}
148150
final boolean need_dialog = (pass.isPresent() && !pass.get().getValue().isBlank()) ||
149151
(prompt.isPresent() && promptBool );

0 commit comments

Comments
 (0)