/****************************************************************************** * Product: iDempiere ERP & CRM Smart Business Solution * * Copyright (C) 2012 Trek Global * * 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. * *****************************************************************************/ package org.adempiere.webui.panel; import java.util.ArrayList; import org.adempiere.webui.component.Checkbox; import org.adempiere.webui.component.Column; import org.adempiere.webui.component.Columns; import org.adempiere.webui.component.Grid; import org.adempiere.webui.component.Row; import org.adempiere.webui.component.Rows; import org.adempiere.webui.component.Window; import org.adempiere.webui.util.ZKUpdateUtil; import org.compiere.print.MPrintFormatItem; import org.compiere.util.Language; import org.zkoss.zk.ui.event.Event; import org.zkoss.zk.ui.event.EventListener; import org.zkoss.zk.ui.event.Events; /** * Panel to edit grouping of print format */ public class WRC4GroupingCriteriaPanel extends WRCTabPanel implements EventListener { /** * generated serial id */ private static final long serialVersionUID = -3142169077710161360L; private static final int RENDER_IN_COLUMNS=2; protected Checkbox m_chkboxes[]=null; protected String m_oldLabel[]=null; /** print format items with IsOrderBy=Y */ protected ArrayList orderfield=new ArrayList(); protected Grid grid = new Grid(); /** * Default constructor */ public WRC4GroupingCriteriaPanel() { super(); } /** * Add order by print format items to {@link #orderfield} */ @Override public void refresh() { orderfield = new ArrayList(); for(int i=0 ; i < m_pfi.size(); i++){ if(m_pfi.get(i) != null && m_pfi.get(i).isOrderBy()){ orderfield.add(m_pfi.get(i)); } } dynamicInit(); } /** * Update IsGroupBy of print format items */ @Override public void updatePFI() { for(int i=0 ; i