From 9ad3f5ce467b7c24a18c95c145c130e179b9f3d7 Mon Sep 17 00:00:00 2001 From: Andreas Sumerauer Date: Tue, 22 Jun 2021 08:35:58 +0200 Subject: [PATCH] IDEMPIERE-4839 IQuickForm interface (#731) * IDEMPIERE-4839 IQuickEdit interface * Added javadoc comments to IQuickForm method definitions. * removed outcommented interfaces from class definition Co-authored-by: Andreas --- .../adwindow/AbstractADWindowContent.java | 8 +++ .../webui/adwindow/QuickGridView.java | 6 +- .../adempiere/webui/apps/form/IQuickForm.java | 69 +++++++++++++++++++ .../adempiere/webui/apps/form/WQuickForm.java | 12 ++-- 4 files changed, 85 insertions(+), 10 deletions(-) create mode 100644 org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/IQuickForm.java 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 ec7aae9aec..77a0af299f 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 @@ -3752,6 +3752,14 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements return statusBarQF; } + /** + * @param statusBar + */ + public void setStatusBarQF(StatusBar statusBar) + { + statusBarQF = statusBar; + } + /** * Implementation to work key listener for the current open Quick Form. */ diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/QuickGridView.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/QuickGridView.java index 3346422d1d..2a182abe57 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/QuickGridView.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/QuickGridView.java @@ -27,7 +27,7 @@ import org.adempiere.base.Core; import org.adempiere.model.MTabCustomization; import org.adempiere.util.Callback; import org.adempiere.webui.ClientInfo; -import org.adempiere.webui.apps.form.WQuickForm; +import org.adempiere.webui.apps.form.IQuickForm; import org.adempiere.webui.component.Checkbox; import org.adempiere.webui.component.Columns; import org.adempiere.webui.component.Combobox; @@ -171,7 +171,7 @@ public class QuickGridView extends Vbox // To prevent 'onFocus' event fire twice on same component. private Component preEventComponent; - public WQuickForm quickForm; + public IQuickForm quickForm; public GridField[] getGridField() { return gridFields; @@ -239,7 +239,7 @@ public class QuickGridView extends Vbox addEventListener(EVENT_ONFOCUS_AFTER_SAVE, this); } - public QuickGridView(AbstractADWindowContent abstractADWindowContent, GridTab gridTab, WQuickForm wQuickForm) + public QuickGridView(AbstractADWindowContent abstractADWindowContent, GridTab gridTab, IQuickForm wQuickForm) { this(abstractADWindowContent.getWindowNo()); setADWindowPanel(abstractADWindowContent); diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/IQuickForm.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/IQuickForm.java new file mode 100644 index 0000000000..1e9ccbf700 --- /dev/null +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/IQuickForm.java @@ -0,0 +1,69 @@ +/****************************************************************************** + * Copyright (C) Contributors * + * This program is free software; you can redistribute it and/or modify it * + * under the terms version 2 of the GNU General Public License as published * + * by the Free Software Foundation. This program is distributed in the hope * + * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied * + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * + * See the GNU General Public License for more details. * + * You should have received a copy of the GNU General Public License along * + * with this program; if not, write to the Free Software Foundation, Inc., * + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * Contributors: * + * Andreas Sumerauer * + *****************************************************************************/ + +package org.adempiere.webui.apps.form; + +import org.compiere.model.DataStatusListener; +import org.zkoss.zk.ui.event.Event; +import org.zkoss.zk.ui.event.EventListener; + +/** + * Quick entry form Interface based on WQuickForm by Logilite + * + * @author Andreas Sumerauer + * + */ +public interface IQuickForm extends EventListener , DataStatusListener +{ + /** + * Close dialog without saving + */ + public void onCancel(); + + /** + * Unsort grid view + */ + public void onUnSort(); + + /** + * Show grid view customization dialog for quick form panel + */ + public void onCustomize(); + + /** + * Ignore user changes on active row. + */ + public void onIgnore(); + + /** + * Delete selected records. If no record is selected delete current row. + */ + public void onDelete(); + + /** + * Save active record. + */ + public void onSave(); + + /** + * Refresh all data + */ + public void onRefresh(); + + /** + * Dispose + */ + public void dispose(); +} \ No newline at end of file diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/WQuickForm.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/WQuickForm.java index 7c67eece44..30deca00ca 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/WQuickForm.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/WQuickForm.java @@ -9,6 +9,9 @@ * You should have received a copy of the GNU General Public License along * * with this program; if not, write to the Free Software Foundation, Inc., * * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * + * * + * Contributor: * + * Andreas Sumerauer * *****************************************************************************/ package org.adempiere.webui.apps.form; @@ -33,18 +36,15 @@ import org.adempiere.webui.util.ZKUpdateUtil; import org.adempiere.webui.window.CustomizeGridViewDialog; import org.adempiere.webui.window.FDialog; import org.compiere.model.DataStatusEvent; -import org.compiere.model.DataStatusListener; import org.compiere.model.GridField; import org.compiere.model.GridTab; import org.compiere.model.MRole; import org.compiere.util.Env; import org.compiere.util.Msg; -import org.compiere.util.Trx; import org.zkforge.keylistener.Keylistener; import org.zkoss.zk.ui.Component; import org.zkoss.zk.ui.Executions; import org.zkoss.zk.ui.event.Event; -import org.zkoss.zk.ui.event.EventListener; import org.zkoss.zk.ui.event.Events; import org.zkoss.zul.Column; import org.zkoss.zul.Columns; @@ -55,15 +55,13 @@ import org.zkoss.zul.Columns; * @author Logilite Technologies * @since Nov 03, 2017 */ -public class WQuickForm extends Window implements EventListener , DataStatusListener +public class WQuickForm extends Window implements IQuickForm { /** * */ private static final long serialVersionUID = -5363771364595732977L; - public Trx trx = null; - private Borderlayout mainLayout = new Borderlayout(); private AbstractADWindowContent adWinContent = null; private QuickGridView quickGridView = null; @@ -437,4 +435,4 @@ public class WQuickForm extends Window implements EventListener , DataSta int col = e.getChangedColumn(); quickGridView.dynamicDisplay(col); } // dataStatusChanged -} \ No newline at end of file +}