BF [ 1824621 ] History button can't be canceled
http://sourceforge.net/tracker/index.php?func=detail&aid=1824621&group_id=176962&atid=879332
This commit is contained in:
parent
8793fa8f6b
commit
8c7f9eacaa
|
@ -50,6 +50,8 @@ import org.compiere.util.*;
|
||||||
* Colin Rooney 2007/03/20 RFE#1670185 & related BUG#1684142 - Extend Sec to Info Queries
|
* Colin Rooney 2007/03/20 RFE#1670185 & related BUG#1684142 - Extend Sec to Info Queries
|
||||||
* @contributor Victor Perez , e-Evolution.SC FR [ 1757088 ]
|
* @contributor Victor Perez , e-Evolution.SC FR [ 1757088 ]
|
||||||
* @contributor fer_luck@centuryon.com , FR [ 1757088 ]
|
* @contributor fer_luck@centuryon.com , FR [ 1757088 ]
|
||||||
|
* @author Teo Sarca, SC ARHIPAC SERVICE SRL
|
||||||
|
* <li>BF [ 1824621 ] History button can't be canceled
|
||||||
*/
|
*/
|
||||||
public final class APanel extends CPanel
|
public final class APanel extends CPanel
|
||||||
implements DataStatusListener, ChangeListener, ActionListener, ASyncProcess
|
implements DataStatusListener, ChangeListener, ActionListener, ASyncProcess
|
||||||
|
@ -1996,23 +1998,30 @@ public final class APanel extends CPanel
|
||||||
Point pt = new Point (0, aHistory.getButton().getBounds().height);
|
Point pt = new Point (0, aHistory.getButton().getBounds().height);
|
||||||
SwingUtilities.convertPointToScreen(pt, aHistory.getButton());
|
SwingUtilities.convertPointToScreen(pt, aHistory.getButton());
|
||||||
VOnlyCurrentDays ocd = new VOnlyCurrentDays(Env.getFrame(this), pt);
|
VOnlyCurrentDays ocd = new VOnlyCurrentDays(Env.getFrame(this), pt);
|
||||||
m_onlyCurrentDays = ocd.getCurrentDays();
|
if (!ocd.isCancel()) {
|
||||||
if (m_onlyCurrentDays == 1) // Day
|
m_onlyCurrentDays = ocd.getCurrentDays();
|
||||||
{
|
if (m_onlyCurrentDays == 1) // Day
|
||||||
m_onlyCurrentRows = true;
|
{
|
||||||
m_onlyCurrentDays = 0; // no Created restriction
|
m_onlyCurrentRows = true;
|
||||||
|
m_onlyCurrentDays = 0; // no Created restriction
|
||||||
|
}
|
||||||
|
else
|
||||||
|
m_onlyCurrentRows = false;
|
||||||
|
//
|
||||||
|
m_curTab.setQuery(null); // reset previous queries
|
||||||
|
MRole role = MRole.getDefault();
|
||||||
|
int maxRows = role.getMaxQueryRecords();
|
||||||
|
//
|
||||||
|
log.config("OnlyCurrent=" + m_onlyCurrentRows
|
||||||
|
+ ", Days=" + m_onlyCurrentDays
|
||||||
|
+ ", MaxRows=" + maxRows);
|
||||||
|
m_curGC.query(m_onlyCurrentRows, m_onlyCurrentDays, maxRows ); // autoSize
|
||||||
|
}
|
||||||
|
// Restore history button's pressed status
|
||||||
|
else {
|
||||||
|
if (isFirstTab())
|
||||||
|
aHistory.setPressed(!m_curTab.isOnlyCurrentRows());
|
||||||
}
|
}
|
||||||
else
|
|
||||||
m_onlyCurrentRows = false;
|
|
||||||
//
|
|
||||||
m_curTab.setQuery(null); // reset previous queries
|
|
||||||
MRole role = MRole.getDefault();
|
|
||||||
int maxRows = role.getMaxQueryRecords();
|
|
||||||
//
|
|
||||||
log.config("OnlyCurrent=" + m_onlyCurrentRows
|
|
||||||
+ ", Days=" + m_onlyCurrentDays
|
|
||||||
+ ", MaxRows=" + maxRows);
|
|
||||||
m_curGC.query(m_onlyCurrentRows, m_onlyCurrentDays, maxRows ); // autoSize
|
|
||||||
}
|
}
|
||||||
} // cmd_history
|
} // cmd_history
|
||||||
|
|
||||||
|
|
|
@ -28,6 +28,9 @@ import org.compiere.util.*;
|
||||||
*
|
*
|
||||||
* @author Jorg Janke
|
* @author Jorg Janke
|
||||||
* @version $Id: VOnlyCurrentDays.java,v 1.2 2006/07/30 00:51:28 jjanke Exp $
|
* @version $Id: VOnlyCurrentDays.java,v 1.2 2006/07/30 00:51:28 jjanke Exp $
|
||||||
|
*
|
||||||
|
* @author Teo Sarca, SC ARHIPAC SERVICE SRL
|
||||||
|
* <li>BF [ 1824621 ] History button can't be canceled
|
||||||
*/
|
*/
|
||||||
public class VOnlyCurrentDays extends CDialog
|
public class VOnlyCurrentDays extends CDialog
|
||||||
implements ActionListener
|
implements ActionListener
|
||||||
|
@ -64,6 +67,8 @@ public class VOnlyCurrentDays extends CDialog
|
||||||
|
|
||||||
/** Days (0=all) */
|
/** Days (0=all) */
|
||||||
private int m_days = 0;
|
private int m_days = 0;
|
||||||
|
/** Is cancel */
|
||||||
|
private boolean m_isCancel = false;
|
||||||
/** Margin */
|
/** Margin */
|
||||||
private static Insets s_margin = new Insets (2, 2, 2, 2);
|
private static Insets s_margin = new Insets (2, 2, 2, 2);
|
||||||
/** Logger */
|
/** Logger */
|
||||||
|
@ -102,6 +107,13 @@ public class VOnlyCurrentDays extends CDialog
|
||||||
mainPanel.setToolTipText(Msg.getMsg(Env.getCtx(), "VOnlyCurrentDays", false));
|
mainPanel.setToolTipText(Msg.getMsg(Env.getCtx(), "VOnlyCurrentDays", false));
|
||||||
this.getContentPane().add(mainPanel, BorderLayout.CENTER);
|
this.getContentPane().add(mainPanel, BorderLayout.CENTER);
|
||||||
this.getRootPane().setDefaultButton(bShowDay);
|
this.getRootPane().setDefaultButton(bShowDay);
|
||||||
|
//
|
||||||
|
addWindowListener(new WindowAdapter() {
|
||||||
|
@Override
|
||||||
|
public void windowClosing(WindowEvent e) {
|
||||||
|
m_isCancel = true;
|
||||||
|
}
|
||||||
|
});
|
||||||
} // jbInit
|
} // jbInit
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -132,4 +144,10 @@ public class VOnlyCurrentDays extends CDialog
|
||||||
return m_days;
|
return m_days;
|
||||||
} // getCurrentDays
|
} // getCurrentDays
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return true if user has canceled this form
|
||||||
|
*/
|
||||||
|
public boolean isCancel() {
|
||||||
|
return m_isCancel;
|
||||||
|
}
|
||||||
} // VOnlyCurrentDays
|
} // VOnlyCurrentDays
|
||||||
|
|
Loading…
Reference in New Issue