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());
}
}
}
Aggregations