IDEMPIERE-4864 Fix shortcut handling for combobox and ad window (#769)

Fix toolbar shortcut is active when it is block by process log dialog
This commit is contained in:
hengsin 2021-07-06 19:25:12 +08:00 committed by GitHub
parent 7b55139ffa
commit 4ed1b3b0ba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 24 additions and 0 deletions

View File

@ -53,6 +53,7 @@ import org.adempiere.webui.apps.ProcessModalDialog;
import org.adempiere.webui.apps.form.WCreateFromFactory; import org.adempiere.webui.apps.form.WCreateFromFactory;
import org.adempiere.webui.apps.form.WCreateFromWindow; import org.adempiere.webui.apps.form.WCreateFromWindow;
import org.adempiere.webui.apps.form.WQuickForm; import org.adempiere.webui.apps.form.WQuickForm;
import org.adempiere.webui.component.DesktopTabpanel;
import org.adempiere.webui.component.Mask; import org.adempiere.webui.component.Mask;
import org.adempiere.webui.component.ProcessInfoDialog; import org.adempiere.webui.component.ProcessInfoDialog;
import org.adempiere.webui.component.Window; 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 * @return true if window is block by mask or highlighted window
*/ */
public boolean isBlock() { public boolean isBlock() {
//check blocking by local mask
if (mask != null && mask.getParent() != null) { if (mask != null && mask.getParent() != null) {
return true; return true;
} }
//check blocking by highlighted window
if (getComponent() != null && getComponent().getPage() != null) { if (getComponent() != null && getComponent().getPage() != null) {
Collection<Component> roots = getComponent().getPage().getRoots(); Collection<Component> roots = getComponent().getPage().getRoots();
for(Component comp : roots) { 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; return false;
} }