/*********************************************************************** * This file is part of iDempiere ERP Open Source * * http://www.idempiere.org * * * * Copyright (C) Contributors * * * * This program is free software; you can redistribute it and/or * * modify it under the terms of the GNU General Public License * * as published by the Free Software Foundation; either version 2 * * of the License, or (at your option) any later version. * * * * 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., 51 Franklin Street, Fifth Floor, Boston, * * MA 02110-1301, USA. * * * * Contributors: * * - hengsin * **********************************************************************/ package org.adempiere.webui.adwindow; import java.util.List; import org.adempiere.util.Callback; import org.adempiere.webui.adwindow.validator.WindowValidatorEvent; import org.adempiere.webui.adwindow.validator.WindowValidatorEventType; import org.adempiere.webui.adwindow.validator.WindowValidatorManager; import org.adempiere.webui.component.Menupopup; import org.adempiere.webui.editor.IProcessButton; import org.adempiere.webui.editor.WButtonEditor; import org.adempiere.webui.panel.WDocActionPanel; import org.compiere.model.GridTab; import org.compiere.util.Env; import org.compiere.util.Msg; import org.compiere.util.Util; 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.Button; import org.zkoss.zul.Listitem; import org.zkoss.zul.Menu; import org.zkoss.zul.Menuitem; import org.zkoss.zul.Menuseparator; /** * @author hengsin */ public class ProcessButtonPopup extends Menupopup implements EventListener { /** sclass for document action menu items **/ private static final String DOCUMENT_ACTION_MENUITEM_SCLASS = "document-action-menuitem"; /** Menupopup attribute to store reference to WDocActionPanel **/ private static final String DOC_ACTION_PANEL_ATTRIBUTE = "doc-action-panel"; /** Menupopup/Menuitem attribute to store reference to Button **/ private static final String BUTTON_ATTRIBUTE = "button"; /** Button yes/no attribute (Y/N) to store whether button is pressed **/ public static final String BUTTON_ATTRIBUTE_PRESSED = "buttonPressed"; /** * generated serial id */ private static final long serialVersionUID = 304878472233552113L; /** * Render buttons as menu items. * Special treatment for DocAction - render each available document action as a sub menu item. * @param buttons */ public void render(List