FR [ 1779403 ] Report Viewer: add PgUp and PgDown key handlers

* Viewer: add serialVersionUID
* Viewer: removed 1 unused variable warning
This commit is contained in:
teo_sarca 2009-01-27 09:40:34 +00:00
parent ecdab9670f
commit d79fca0414
1 changed files with 31 additions and 3 deletions

View File

@ -41,9 +41,11 @@ import java.util.ArrayList;
import java.util.Properties; import java.util.Properties;
import java.util.logging.Level; import java.util.logging.Level;
import javax.swing.AbstractAction;
import javax.swing.AbstractButton; import javax.swing.AbstractButton;
import javax.swing.Icon; import javax.swing.Icon;
import javax.swing.ImageIcon; import javax.swing.ImageIcon;
import javax.swing.JComponent;
import javax.swing.JFileChooser; import javax.swing.JFileChooser;
import javax.swing.JFrame; import javax.swing.JFrame;
import javax.swing.JMenu; import javax.swing.JMenu;
@ -108,8 +110,9 @@ import org.compiere.util.ValueNamePair;
* Colin Rooney 2007/03/20 RFE#1670185 & BUG#1684142 * Colin Rooney 2007/03/20 RFE#1670185 & BUG#1684142
* Extend security to Info queries * Extend security to Info queries
* *
* @author Teo Sarca, SC ARHIPAC SERVICE SRL * @author Teo Sarca, www.arhipac.ro
* <li>FR [ 1762466 ] Add "Window" menu to report viewer. * <li>FR [ 1762466 ] Add "Window" menu to report viewer.
* <li>FR [ 1779403 ] Report Viewer: add PgUp and PgDown key handlers
* <li>BF [ 1836908 ] Report customize NPE when no window access * <li>BF [ 1836908 ] Report customize NPE when no window access
* <li>FR [ 1894640 ] Report Engine: Excel Export support * <li>FR [ 1894640 ] Report Engine: Excel Export support
* @author victor.perez@e-evolution.com * @author victor.perez@e-evolution.com
@ -120,6 +123,12 @@ import org.compiere.util.ValueNamePair;
public class Viewer extends CFrame public class Viewer extends CFrame
implements ActionListener, ChangeListener, WindowStateListener implements ActionListener, ChangeListener, WindowStateListener
{ {
/**
*
*/
private static final long serialVersionUID = 7306392362119021781L;
/** /**
* Viewer Constructor * Viewer Constructor
* @param re report engine * @param re report engine
@ -238,6 +247,26 @@ public class Viewer extends CFrame
toolBar.add(spinner); toolBar.add(spinner);
spinner.setToolTipText(Msg.getMsg(m_ctx, "GoToPage")); spinner.setToolTipText(Msg.getMsg(m_ctx, "GoToPage"));
toolBar.add(bNext); toolBar.add(bNext);
// Add PgUp and PgDown key handlers - teo_sarca FR [ 1779403 ]
m_viewPanel.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW)
.put(KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_UP, 0), "PAGE_UP");
m_viewPanel.getActionMap().put("PAGE_UP", new AbstractAction() {
private static final long serialVersionUID = -6439939910196779649L;
public void actionPerformed(ActionEvent e) {
setPage(m_pageNo-1);
}
});
//
m_viewPanel.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW)
.put(KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_DOWN, 0), "PAGE_DOWN");
m_viewPanel.getActionMap().put("PAGE_DOWN", new AbstractAction() {
private static final long serialVersionUID = -4468272400181368278L;
public void actionPerformed(ActionEvent e) {
setPage(m_pageNo+1);
}
});
// Zoom Level // Zoom Level
toolBar.addSeparator(); toolBar.addSeparator();
// toolBar.add(comboZoom, null); // toolBar.add(comboZoom, null);
@ -869,10 +898,9 @@ public class Viewer extends CFrame
log.log(Level.SEVERE, "", e); log.log(Level.SEVERE, "", e);
} }
EMailDialog emd = new EMailDialog (this, new EMailDialog (this,
Msg.getMsg(Env.getCtx(), "SendMail"), Msg.getMsg(Env.getCtx(), "SendMail"),
from, to, subject, message, attachment); from, to, subject, message, attachment);
} // cmd_sendMail } // cmd_sendMail
/** /**