From 4ed1b3b0ba9fed0a851da40fe6b8375380a417d1 Mon Sep 17 00:00:00 2001 From: hengsin Date: Tue, 6 Jul 2021 19:25:12 +0800 Subject: [PATCH] IDEMPIERE-4864 Fix shortcut handling for combobox and ad window (#769) Fix toolbar shortcut is active when it is block by process log dialog --- .../adwindow/AbstractADWindowContent.java | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/AbstractADWindowContent.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/AbstractADWindowContent.java index 1fff788235..6ba4838714 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/AbstractADWindowContent.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/AbstractADWindowContent.java @@ -53,6 +53,7 @@ import org.adempiere.webui.apps.ProcessModalDialog; import org.adempiere.webui.apps.form.WCreateFromFactory; import org.adempiere.webui.apps.form.WCreateFromWindow; import org.adempiere.webui.apps.form.WQuickForm; +import org.adempiere.webui.component.DesktopTabpanel; import org.adempiere.webui.component.Mask; import org.adempiere.webui.component.ProcessInfoDialog; import org.adempiere.webui.component.Window; @@ -3318,9 +3319,12 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements * @return true if window is block by mask or highlighted window */ public boolean isBlock() { + //check blocking by local mask if (mask != null && mask.getParent() != null) { return true; } + + //check blocking by highlighted window if (getComponent() != null && getComponent().getPage() != null) { Collection roots = getComponent().getPage().getRoots(); for(Component comp : roots) { @@ -3331,6 +3335,26 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements } } } + + //check blocking by mask from ISupportMask (window, tabpanel) + if (getComponent() != null) { + Component p = getComponent().getParent(); + while (p != null) { + if (p instanceof Mask) { + if (p.isVisible()) { + return true; + } + } else if (p instanceof DesktopTabpanel) { + for(Component c : p.getChildren()) { + if (c instanceof Mask) { + if (c.isVisible()) + return true; + } + } + } + p = p.getParent(); + } + } return false; }