Search in sources :

Example 1 with VOnlyCurrentDays

use of org.compiere.grid.VOnlyCurrentDays in project adempiere by adempiere.

the class APanel method cmd_history.

//	lock
/**
	 *	Toggle History
	 */
private void cmd_history() {
    log.info("");
    if (m_mWorkbench.getMWindow(getWindowIndex()).isTransaction()) {
        if (m_curTab.needSave(true, true) && !cmd_save(false))
            return;
        Point pt = new Point(0, aHistory.getButton().getBounds().height);
        SwingUtilities.convertPointToScreen(pt, aHistory.getButton());
        VOnlyCurrentDays ocd = new VOnlyCurrentDays(Env.getFrame(this), pt);
        if (!ocd.isCancel()) {
            m_onlyCurrentDays = ocd.getCurrentDays();
            if (//	Day
            m_onlyCurrentDays == 1) {
                m_onlyCurrentRows = true;
                //	no Created restriction
                m_onlyCurrentDays = 0;
            } else
                m_onlyCurrentRows = false;
            //
            //	reset previous queries
            m_curTab.setQuery(null);
            MRole role = MRole.getDefault();
            int maxRows = role.getMaxQueryRecords();
            //
            log.config("OnlyCurrent=" + m_onlyCurrentRows + ", Days=" + m_onlyCurrentDays + ", MaxRows=" + maxRows);
            //  autoSize
            m_curGC.query(m_onlyCurrentRows, m_onlyCurrentDays, maxRows);
        } else // Restore history button's pressed status
        {
            if (isFirstTab())
                aHistory.setPressed(!m_curTab.isOnlyCurrentRows());
        }
    }
}
Also used : VOnlyCurrentDays(org.compiere.grid.VOnlyCurrentDays) MRole(org.compiere.model.MRole) Point(java.awt.Point) Point(java.awt.Point)

Aggregations

Point (java.awt.Point)1 VOnlyCurrentDays (org.compiere.grid.VOnlyCurrentDays)1 MRole (org.compiere.model.MRole)1