From af75e7911f9cefe99ac652f618efee7635e099b2 Mon Sep 17 00:00:00 2001 From: hieplq Date: Wed, 24 Oct 2018 11:21:10 +0700 Subject: [PATCH] IDEMPIERE-3798:Move iDempiere default branch to openjdk 10 (deprecated constant of swing) --- .../compiere/install/util/ConfirmPanel.java | 3 +- .../apps/graph/PerformanceIndicator.java | 2 +- .../plaf/AdempiereButtonListener.java | 6 +- .../src/org/compiere/apps/ADialogDialog.java | 5 +- .../src/org/compiere/apps/AMenu.java | 15 +++-- .../src/org/compiere/apps/APanel.java | 63 +++++++++---------- .../src/org/compiere/apps/ConfirmPanel.java | 3 +- .../src/org/compiere/apps/WindowMenu.java | 2 +- .../src/org/compiere/apps/form/FormFrame.java | 15 +++-- .../src/org/compiere/apps/search/Find.java | 3 +- .../src/org/compiere/grid/VSortTab.java | 17 ++--- .../src/org/compiere/grid/ed/VLookup.java | 2 +- .../src/org/compiere/grid/ed/VNumber.java | 2 +- .../org/compiere/grid/tree/VTreePanel.java | 2 +- .../compiere/plaf/CompiereButtonListener.java | 6 +- .../org/compiere/plaf/CompiereTextAreaUI.java | 6 +- .../org/compiere/plaf/CompiereToolTipUI.java | 2 +- .../src/org/compiere/pos/SubCurrentLine.java | 5 +- .../src/org/compiere/print/Viewer.java | 29 +++++---- .../src/org/compiere/swing/CButton.java | 4 +- .../src/org/compiere/swing/CCheckBox.java | 6 +- .../src/org/compiere/swing/CDialog.java | 3 +- .../src/org/compiere/swing/CTabbedPane.java | 7 +-- 23 files changed, 101 insertions(+), 107 deletions(-) diff --git a/org.adempiere.install/src/org/compiere/install/util/ConfirmPanel.java b/org.adempiere.install/src/org/compiere/install/util/ConfirmPanel.java index 30cc4f97e1..c313a0b2db 100644 --- a/org.adempiere.install/src/org/compiere/install/util/ConfirmPanel.java +++ b/org.adempiere.install/src/org/compiere/install/util/ConfirmPanel.java @@ -20,6 +20,7 @@ import java.awt.BorderLayout; import java.awt.Component; import java.awt.FlowLayout; import java.awt.Insets; +import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.KeyEvent; @@ -241,7 +242,7 @@ public final class ConfirmPanel extends JPanel public static final JButton createProcessButton (String text) { AppsAction aa = new AppsAction (A_PROCESS, - KeyStroke.getKeyStroke(KeyEvent.VK_F4, KeyEvent.SHIFT_MASK), text); + KeyStroke.getKeyStroke(KeyEvent.VK_F4, ActionEvent.SHIFT_MASK), text); JButton button = (JButton)aa.getButton(); button.setMargin(s_insets); return button; diff --git a/org.adempiere.ui.swing/src/org/adempiere/apps/graph/PerformanceIndicator.java b/org.adempiere.ui.swing/src/org/adempiere/apps/graph/PerformanceIndicator.java index 8760be95f7..eb7d8b2161 100644 --- a/org.adempiere.ui.swing/src/org/adempiere/apps/graph/PerformanceIndicator.java +++ b/org.adempiere.ui.swing/src/org/adempiere/apps/graph/PerformanceIndicator.java @@ -301,7 +301,7 @@ public class PerformanceIndicator extends JPanel // Lazily create the event: if (e == null) e = new ActionEvent(this, ActionEvent.ACTION_PERFORMED, - "pi", event.getWhen(), event.getModifiers()); + "pi", event.getWhen(), event.getModifiersEx()); listeners[i].actionPerformed(e); } } // fireActionPerformed diff --git a/org.adempiere.ui.swing/src/org/adempiere/plaf/AdempiereButtonListener.java b/org.adempiere.ui.swing/src/org/adempiere/plaf/AdempiereButtonListener.java index c025962544..edee8a5f21 100644 --- a/org.adempiere.ui.swing/src/org/adempiere/plaf/AdempiereButtonListener.java +++ b/org.adempiere.ui.swing/src/org/adempiere/plaf/AdempiereButtonListener.java @@ -13,7 +13,7 @@ *****************************************************************************/ package org.adempiere.plaf; -import java.awt.event.InputEvent; +import java.awt.event.ActionEvent; import java.beans.PropertyChangeEvent; import javax.swing.AbstractButton; @@ -83,10 +83,10 @@ public class AdempiereButtonListener extends BasicButtonListener } map.clear(); String className = b.getClass().getName(); - int mask = InputEvent.ALT_MASK; // Default Buttons + int mask = ActionEvent.ALT_MASK; // Default Buttons if (b instanceof JCheckBox // In Tab || className.indexOf("VButton") != -1) - mask = InputEvent.SHIFT_MASK + InputEvent.CTRL_MASK; + mask = ActionEvent.SHIFT_MASK + ActionEvent.CTRL_MASK; map.put(KeyStroke.getKeyStroke(m, mask, false), "pressed"); map.put(KeyStroke.getKeyStroke(m, mask, true), "released"); map.put(KeyStroke.getKeyStroke(m, 0, true), "released"); diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/ADialogDialog.java b/org.adempiere.ui.swing/src/org/compiere/apps/ADialogDialog.java index 45e4f64844..0900121fc7 100644 --- a/org.adempiere.ui.swing/src/org/compiere/apps/ADialogDialog.java +++ b/org.adempiere.ui.swing/src/org/compiere/apps/ADialogDialog.java @@ -19,7 +19,6 @@ package org.compiere.apps; import java.awt.BorderLayout; import java.awt.Dialog; import java.awt.Dimension; -import java.awt.Event; import java.awt.Frame; import java.awt.GridBagConstraints; import java.awt.GridBagLayout; @@ -173,14 +172,14 @@ public final class ADialogDialog extends CDialog implements ActionListener mPrintScreen.addActionListener(this); mScreenShot.setIcon(Env.getImageIcon("ScreenShot16.gif")); mScreenShot.setText(Msg.getMsg(Env.getCtx(), "ScreenShot")); - mScreenShot.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_PRINTSCREEN, Event.SHIFT_MASK)); + mScreenShot.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_PRINTSCREEN, ActionEvent.SHIFT_MASK)); mScreenShot.addActionListener(this); mPreference.setIcon(Env.getImageIcon("Preference16.gif")); mPreference.setText(Msg.getMsg(Env.getCtx(), "Preference")); mPreference.addActionListener(this); mEnd.setIcon(Env.getImageIcon("End16.gif")); mEnd.setText(Msg.getMsg(Env.getCtx(), "End")); - mEnd.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_X, Event.ALT_MASK)); + mEnd.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_X, ActionEvent.ALT_MASK)); mEnd.addActionListener(this); // westPanel.setLayout(westLayout); diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/AMenu.java b/org.adempiere.ui.swing/src/org/compiere/apps/AMenu.java index f34b624254..62934fb15a 100644 --- a/org.adempiere.ui.swing/src/org/compiere/apps/AMenu.java +++ b/org.adempiere.ui.swing/src/org/compiere/apps/AMenu.java @@ -19,7 +19,6 @@ package org.compiere.apps; import java.awt.BorderLayout; import java.awt.Cursor; import java.awt.Dimension; -import java.awt.Event; import java.awt.Frame; import java.awt.GridLayout; import java.awt.Insets; @@ -427,10 +426,10 @@ public final class AMenu extends CFrame JMenu mFile = AEnv.getMenu("File"); menuBar.add(mFile); AEnv.addMenuItem("PrintScreen", null, KeyStroke.getKeyStroke(KeyEvent.VK_PRINTSCREEN, 0), mFile, this); - AEnv.addMenuItem("ScreenShot", null, KeyStroke.getKeyStroke(KeyEvent.VK_PRINTSCREEN, KeyEvent.SHIFT_MASK), mFile, this); + AEnv.addMenuItem("ScreenShot", null, KeyStroke.getKeyStroke(KeyEvent.VK_PRINTSCREEN, ActionEvent.SHIFT_MASK), mFile, this); mFile.addSeparator(); - AEnv.addMenuItem("Logout", null, KeyStroke.getKeyStroke(KeyEvent.VK_L, Event.SHIFT_MASK+Event.ALT_MASK), mFile, this); - AEnv.addMenuItem("Exit", null, KeyStroke.getKeyStroke(KeyEvent.VK_X, Event.SHIFT_MASK+Event.ALT_MASK), mFile, this); + AEnv.addMenuItem("Logout", null, KeyStroke.getKeyStroke(KeyEvent.VK_L, ActionEvent.SHIFT_MASK + ActionEvent.ALT_MASK), mFile, this); + AEnv.addMenuItem("Exit", null, KeyStroke.getKeyStroke(KeyEvent.VK_X, ActionEvent.SHIFT_MASK+ActionEvent.ALT_MASK), mFile, this); // View JMenu mView = AEnv.getMenu("View"); @@ -438,15 +437,15 @@ public final class AMenu extends CFrame if (MRole.getDefault().isAllow_Info_Product()) { - AEnv.addMenuItem("InfoProduct", null, KeyStroke.getKeyStroke(KeyEvent.VK_I, Event.ALT_MASK), mView, this); + AEnv.addMenuItem("InfoProduct", null, KeyStroke.getKeyStroke(KeyEvent.VK_I, ActionEvent.ALT_MASK), mView, this); } if (MRole.getDefault().isAllow_Info_BPartner()) { - AEnv.addMenuItem("InfoBPartner", null, KeyStroke.getKeyStroke(KeyEvent.VK_I, Event.ALT_MASK+Event.CTRL_MASK), mView, this); + AEnv.addMenuItem("InfoBPartner", null, KeyStroke.getKeyStroke(KeyEvent.VK_I, ActionEvent.ALT_MASK+ActionEvent.CTRL_MASK), mView, this); } if (MRole.getDefault().isShowAcct() && MRole.getDefault().isAllow_Info_Account()) { - AEnv.addMenuItem("InfoAccount", null, KeyStroke.getKeyStroke(KeyEvent.VK_I, Event.ALT_MASK+Event.CTRL_MASK), mView, this); + AEnv.addMenuItem("InfoAccount", null, KeyStroke.getKeyStroke(KeyEvent.VK_I, ActionEvent.ALT_MASK+ActionEvent.CTRL_MASK), mView, this); } if (MRole.getDefault().isAllow_Info_Schedule()) { @@ -511,7 +510,7 @@ public final class AMenu extends CFrame //Window Menu m_WindowMenu = new WindowMenu(windowManager, this); menuBar.add(m_WindowMenu); - KeyStroke ks = KeyStroke.getKeyStroke(KeyEvent.VK_W, KeyEvent.CTRL_MASK); + KeyStroke ks = KeyStroke.getKeyStroke(KeyEvent.VK_W, ActionEvent.CTRL_MASK); this.getRootPane().getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(ks, "ShowAllWindow"); AppsAction action = new AppsAction("ShowAllWindow", ks, false); this.getRootPane().getActionMap().put("ShowAllWindow", action); diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/APanel.java b/org.adempiere.ui.swing/src/org/compiere/apps/APanel.java index a770efee31..a73a42c411 100644 --- a/org.adempiere.ui.swing/src/org/compiere/apps/APanel.java +++ b/org.adempiere.ui.swing/src/org/compiere/apps/APanel.java @@ -28,13 +28,11 @@ import java.awt.Color; import java.awt.Component; import java.awt.Cursor; import java.awt.Dimension; -import java.awt.Event; import java.awt.FlowLayout; import java.awt.Image; import java.awt.Point; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; -import java.awt.event.InputEvent; import java.awt.event.KeyEvent; import java.io.File; import java.sql.PreparedStatement; @@ -44,6 +42,7 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; import java.util.Iterator; +import java.util.List; import java.util.Map; import java.util.Properties; import java.util.TreeMap; @@ -357,28 +356,28 @@ public final class APanel extends CPanel JMenu mFile = AEnv.getMenu("File"); menuBar.add(mFile); aPrintScr = addAction("PrintScreen", mFile, KeyStroke.getKeyStroke(KeyEvent.VK_PRINTSCREEN, 0), false); - aScrShot = addAction("ScreenShot", mFile, KeyStroke.getKeyStroke(KeyEvent.VK_PRINTSCREEN, Event.SHIFT_MASK), false); + aScrShot = addAction("ScreenShot", mFile, KeyStroke.getKeyStroke(KeyEvent.VK_PRINTSCREEN, ActionEvent.SHIFT_MASK), false); aReport = addAction("Report", mFile, KeyStroke.getKeyStroke(KeyEvent.VK_F11, 0), false); aPrint = addAction("Print", mFile, KeyStroke.getKeyStroke(KeyEvent.VK_F12, 0), false); - aPrintPreview = addAction("PrintPreview", mFile, KeyStroke.getKeyStroke(KeyEvent.VK_P, Event.SHIFT_MASK+Event.ALT_MASK), false); + aPrintPreview = addAction("PrintPreview", mFile, KeyStroke.getKeyStroke(KeyEvent.VK_P, ActionEvent.SHIFT_MASK+ActionEvent.ALT_MASK), false); if (MRole.getDefault().isCanExport()) { aExport = addAction("Export", mFile, null, false); } mFile.addSeparator(); - aEnd = addAction("End", mFile, KeyStroke.getKeyStroke(KeyEvent.VK_X, Event.ALT_MASK), false); - aLogout = addAction("Logout", mFile, KeyStroke.getKeyStroke(KeyEvent.VK_L, Event.SHIFT_MASK+Event.ALT_MASK), false); - aExit = addAction("Exit", mFile, KeyStroke.getKeyStroke(KeyEvent.VK_X, Event.SHIFT_MASK+Event.ALT_MASK), false); + aEnd = addAction("End", mFile, KeyStroke.getKeyStroke(KeyEvent.VK_X, ActionEvent.ALT_MASK), false); + aLogout = addAction("Logout", mFile, KeyStroke.getKeyStroke(KeyEvent.VK_L, ActionEvent.SHIFT_MASK+ActionEvent.ALT_MASK), false); + aExit = addAction("Exit", mFile, KeyStroke.getKeyStroke(KeyEvent.VK_X, ActionEvent.SHIFT_MASK+ActionEvent.ALT_MASK), false); // Edit JMenu mEdit = AEnv.getMenu("Edit"); menuBar.add(mEdit); aNew = addAction("New", mEdit, KeyStroke.getKeyStroke(KeyEvent.VK_F2, 0), false); aSave = addAction("Save", mEdit, KeyStroke.getKeyStroke(KeyEvent.VK_F4, 0), false); - aSaveAndCreate = addAction("SaveCreate", mEdit, KeyStroke.getKeyStroke(KeyEvent.VK_Q, KeyEvent.CTRL_MASK), false); + aSaveAndCreate = addAction("SaveCreate", mEdit, KeyStroke.getKeyStroke(KeyEvent.VK_Q, ActionEvent.CTRL_MASK), false); mEdit.addSeparator(); - aCopy = addAction("Copy", mEdit, KeyStroke.getKeyStroke(KeyEvent.VK_F2, Event.SHIFT_MASK), false); + aCopy = addAction("Copy", mEdit, KeyStroke.getKeyStroke(KeyEvent.VK_F2, ActionEvent.SHIFT_MASK), false); aDelete = addAction("Delete", mEdit, KeyStroke.getKeyStroke(KeyEvent.VK_F3, 0), false); - aDeleteSelection = addAction("DeleteSelection", mEdit, KeyStroke.getKeyStroke(KeyEvent.VK_D, Event.CTRL_MASK), false); + aDeleteSelection = addAction("DeleteSelection", mEdit, KeyStroke.getKeyStroke(KeyEvent.VK_D, ActionEvent.CTRL_MASK), false); aIgnore = addAction("Ignore", mEdit, KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0), false); aRefresh = addAction("Refresh", mEdit, KeyStroke.getKeyStroke(KeyEvent.VK_F5, 0), false); mEdit.addSeparator(); @@ -390,15 +389,15 @@ public final class APanel extends CPanel menuBar.add(mView); if (MRole.getDefault().isAllow_Info_Product()) { - aProduct = addAction("InfoProduct", mView, KeyStroke.getKeyStroke(KeyEvent.VK_I, Event.ALT_MASK), false); + aProduct = addAction("InfoProduct", mView, KeyStroke.getKeyStroke(KeyEvent.VK_I, ActionEvent.ALT_MASK), false); } if (MRole.getDefault().isAllow_Info_BPartner()) { - aBPartner = addAction("InfoBPartner", mView, KeyStroke.getKeyStroke(KeyEvent.VK_I, Event.SHIFT_MASK+Event.ALT_MASK), false); + aBPartner = addAction("InfoBPartner", mView, KeyStroke.getKeyStroke(KeyEvent.VK_I, ActionEvent.SHIFT_MASK+ActionEvent.ALT_MASK), false); } if (MRole.getDefault().isShowAcct() && MRole.getDefault().isAllow_Info_Account()) { - aAccount = addAction("InfoAccount",mView, KeyStroke.getKeyStroke(KeyEvent.VK_I, Event.ALT_MASK+Event.CTRL_MASK), false); + aAccount = addAction("InfoAccount",mView, KeyStroke.getKeyStroke(KeyEvent.VK_I, ActionEvent.ALT_MASK+ActionEvent.CTRL_MASK), false); } if (MRole.getDefault().isAllow_Info_Schedule()) { @@ -455,13 +454,13 @@ public final class APanel extends CPanel // Go JMenu mGo = AEnv.getMenu("Go"); menuBar.add(mGo); - aFirst = addAction("First", mGo, KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_UP, Event.ALT_MASK), false); - aPrevious = addAction("Previous", mGo, KeyStroke.getKeyStroke(KeyEvent.VK_UP, Event.ALT_MASK), false); - aNext = addAction("Next", mGo, KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, Event.ALT_MASK), false); - aLast = addAction("Last", mGo, KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_DOWN, Event.ALT_MASK), false); + aFirst = addAction("First", mGo, KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_UP, ActionEvent.ALT_MASK), false); + aPrevious = addAction("Previous", mGo, KeyStroke.getKeyStroke(KeyEvent.VK_UP, ActionEvent.ALT_MASK), false); + aNext = addAction("Next", mGo, KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, ActionEvent.ALT_MASK), false); + aLast = addAction("Last", mGo, KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_DOWN, ActionEvent.ALT_MASK), false); mGo.addSeparator(); - aParent = addAction("Parent", mGo, KeyStroke.getKeyStroke(KeyEvent.VK_LEFT, Event.ALT_MASK), false); - aDetail = addAction("Detail", mGo, KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT, Event.ALT_MASK), false); + aParent = addAction("Parent", mGo, KeyStroke.getKeyStroke(KeyEvent.VK_LEFT, ActionEvent.ALT_MASK), false); + aDetail = addAction("Detail", mGo, KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT, ActionEvent.ALT_MASK), false); mGo.addSeparator(); aZoomAcross = addAction("ZoomAcross", mGo, null, false); aRequest = addAction("Request", mGo, null, false); @@ -490,7 +489,7 @@ public final class APanel extends CPanel AMenu aMenu = (AMenu)AEnv.getWindow(0); m_WindowMenu = new WindowMenu(aMenu.getWindowManager(), m_window); menuBar.add(m_WindowMenu); - aShowAllWindow = addAction("ShowAllWindow", null, KeyStroke.getKeyStroke(KeyEvent.VK_W, KeyEvent.CTRL_MASK), false); + aShowAllWindow = addAction("ShowAllWindow", null, KeyStroke.getKeyStroke(KeyEvent.VK_W, ActionEvent.CTRL_MASK), false); // Help JMenu mHelp = AEnv.getMenu("Help"); @@ -2042,10 +2041,10 @@ public final class APanel extends CPanel if(okCancel != null && okCancel == JOptionPane.OK_OPTION) { log.fine("ok"); - Object[] selectedValues = list.getSelectedValues(); - for (int i = 0; i < selectedValues.length; i++) + List selectedValues = list.getSelectedValuesList(); + for (int i = 0; i < selectedValues.size(); i++) { - if (log.isLoggable(Level.FINE)) log.fine(selectedValues[i].toString()); + if (log.isLoggable(Level.FINE)) log.fine(selectedValues.get(i).toString()); } int[] indices = list.getSelectedIndices(); Arrays.sort(indices); @@ -2540,7 +2539,7 @@ public final class APanel extends CPanel if (record_ID == -1) // No Key return; // Control Pressed - if ((m_lastModifiers & InputEvent.CTRL_MASK) != 0) + if ((m_lastModifiers & ActionEvent.CTRL_MASK) != 0) { new RecordAccessDialog(AEnv.getFrame(this), m_curTab.getAD_Table_ID(), record_ID); } @@ -3072,26 +3071,26 @@ public final class APanel extends CPanel */ private void initSwitchLineAction() { aSwitchLinesDownAction = new SwitchAction("switchLinesDown", KeyStroke.getKeyStroke( - KeyEvent.VK_DOWN, Event.SHIFT_MASK), this); + KeyEvent.VK_DOWN, ActionEvent.SHIFT_MASK), this); aSwitchLinesUpAction = new SwitchAction("switchLinesUp", KeyStroke.getKeyStroke( - KeyEvent.VK_UP, Event.SHIFT_MASK), this); + KeyEvent.VK_UP, ActionEvent.SHIFT_MASK), this); JTable table = m_curGC.getTable(); table.getInputMap(CPanel.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put( - KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, Event.SHIFT_MASK), "none"); + KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, ActionEvent.SHIFT_MASK), "none"); table.getInputMap(CPanel.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put( - KeyStroke.getKeyStroke(KeyEvent.VK_UP, Event.SHIFT_MASK), "none"); + KeyStroke.getKeyStroke(KeyEvent.VK_UP, ActionEvent.SHIFT_MASK), "none"); table.getInputMap(CPanel.WHEN_FOCUSED).put( - KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, Event.SHIFT_MASK), "none"); + KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, ActionEvent.SHIFT_MASK), "none"); table.getInputMap(CPanel.WHEN_FOCUSED).put( - KeyStroke.getKeyStroke(KeyEvent.VK_UP, Event.SHIFT_MASK), "none"); + KeyStroke.getKeyStroke(KeyEvent.VK_UP, ActionEvent.SHIFT_MASK), "none"); getInputMap(CPanel.WHEN_IN_FOCUSED_WINDOW).put( - KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, Event.SHIFT_MASK), + KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, ActionEvent.SHIFT_MASK), aSwitchLinesDownAction.getName()); getActionMap().put(aSwitchLinesDownAction.getName(), aSwitchLinesDownAction); getInputMap(CPanel.WHEN_IN_FOCUSED_WINDOW).put( - KeyStroke.getKeyStroke(KeyEvent.VK_UP, Event.SHIFT_MASK), + KeyStroke.getKeyStroke(KeyEvent.VK_UP, ActionEvent.SHIFT_MASK), aSwitchLinesUpAction.getName()); getActionMap().put(aSwitchLinesUpAction.getName(), aSwitchLinesUpAction); } diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/ConfirmPanel.java b/org.adempiere.ui.swing/src/org/compiere/apps/ConfirmPanel.java index 0d36c9fcb5..d46a86b3b3 100644 --- a/org.adempiere.ui.swing/src/org/compiere/apps/ConfirmPanel.java +++ b/org.adempiere.ui.swing/src/org/compiere/apps/ConfirmPanel.java @@ -20,6 +20,7 @@ import java.awt.BorderLayout; import java.awt.Component; import java.awt.FlowLayout; import java.awt.Insets; +import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.KeyEvent; @@ -242,7 +243,7 @@ public final class ConfirmPanel extends CPanel public static final CButton createProcessButton (String text) { AppsAction aa = new AppsAction (A_PROCESS, - KeyStroke.getKeyStroke(KeyEvent.VK_F4, KeyEvent.SHIFT_MASK), text); + KeyStroke.getKeyStroke(KeyEvent.VK_F4, ActionEvent.SHIFT_MASK), text); CButton button = (CButton)aa.getButton(); button.setMargin(s_insets); return button; diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/WindowMenu.java b/org.adempiere.ui.swing/src/org/compiere/apps/WindowMenu.java index 9ec024000a..2134a701a7 100644 --- a/org.adempiere.ui.swing/src/org/compiere/apps/WindowMenu.java +++ b/org.adempiere.ui.swing/src/org/compiere/apps/WindowMenu.java @@ -134,7 +134,7 @@ public class WindowMenu extends JMenu { } }); setEnvText(expose, "ShowAllWindow"); - expose.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_W, KeyEvent.CTRL_MASK)); + expose.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_W, ActionEvent.CTRL_MASK)); setEnvText(closeOthers, "CloseOtherWindows"); addMenuListener(new MenuListener() { public void menuCanceled (MenuEvent e) {} diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/form/FormFrame.java b/org.adempiere.ui.swing/src/org/compiere/apps/form/FormFrame.java index e575e7af81..c02715d626 100644 --- a/org.adempiere.ui.swing/src/org/compiere/apps/form/FormFrame.java +++ b/org.adempiere.ui.swing/src/org/compiere/apps/form/FormFrame.java @@ -17,7 +17,6 @@ package org.compiere.apps.form; import java.awt.Cursor; -import java.awt.Event; import java.awt.GraphicsConfiguration; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; @@ -148,11 +147,11 @@ public class FormFrame extends CFrame JMenu mFile = AEnv.getMenu("File"); menuBar.add(mFile); AEnv.addMenuItem("PrintScreen", null, KeyStroke.getKeyStroke(KeyEvent.VK_PRINTSCREEN, 0), mFile, this); - AEnv.addMenuItem("ScreenShot", null, KeyStroke.getKeyStroke(KeyEvent.VK_PRINTSCREEN, Event.SHIFT_MASK), mFile, this); - AEnv.addMenuItem("Report", null, KeyStroke.getKeyStroke(KeyEvent.VK_P, Event.ALT_MASK), mFile, this); + AEnv.addMenuItem("ScreenShot", null, KeyStroke.getKeyStroke(KeyEvent.VK_PRINTSCREEN, ActionEvent.SHIFT_MASK), mFile, this); + AEnv.addMenuItem("Report", null, KeyStroke.getKeyStroke(KeyEvent.VK_P, ActionEvent.ALT_MASK), mFile, this); mFile.addSeparator(); - AEnv.addMenuItem("End", null, KeyStroke.getKeyStroke(KeyEvent.VK_X, Event.ALT_MASK), mFile, this); - AEnv.addMenuItem("Exit", null, KeyStroke.getKeyStroke(KeyEvent.VK_X, Event.SHIFT_MASK+Event.ALT_MASK), mFile, this); + AEnv.addMenuItem("End", null, KeyStroke.getKeyStroke(KeyEvent.VK_X, ActionEvent.ALT_MASK), mFile, this); + AEnv.addMenuItem("Exit", null, KeyStroke.getKeyStroke(KeyEvent.VK_X, ActionEvent.SHIFT_MASK+ActionEvent.ALT_MASK), mFile, this); // View JMenu mView = AEnv.getMenu("View"); @@ -160,15 +159,15 @@ public class FormFrame extends CFrame if (MRole.getDefault().isAllow_Info_Product()) { - AEnv.addMenuItem("InfoProduct", null, KeyStroke.getKeyStroke(KeyEvent.VK_I, Event.ALT_MASK), mView, this); + AEnv.addMenuItem("InfoProduct", null, KeyStroke.getKeyStroke(KeyEvent.VK_I, ActionEvent.ALT_MASK), mView, this); } if (MRole.getDefault().isAllow_Info_BPartner()) { - AEnv.addMenuItem("InfoBPartner", null, KeyStroke.getKeyStroke(KeyEvent.VK_I, Event.ALT_MASK+Event.CTRL_MASK), mView, this); + AEnv.addMenuItem("InfoBPartner", null, KeyStroke.getKeyStroke(KeyEvent.VK_I, ActionEvent.ALT_MASK+ActionEvent.CTRL_MASK), mView, this); } if (MRole.getDefault().isShowAcct() && MRole.getDefault().isAllow_Info_Account()) { - AEnv.addMenuItem("InfoAccount", null, KeyStroke.getKeyStroke(KeyEvent.VK_I, Event.ALT_MASK+Event.CTRL_MASK), mView, this); + AEnv.addMenuItem("InfoAccount", null, KeyStroke.getKeyStroke(KeyEvent.VK_I, ActionEvent.ALT_MASK+ActionEvent.CTRL_MASK), mView, this); } if (MRole.getDefault().isAllow_Info_Schedule()) { diff --git a/org.adempiere.ui.swing/src/org/compiere/apps/search/Find.java b/org.adempiere.ui.swing/src/org/compiere/apps/search/Find.java index 7de7c92beb..9677d7b428 100644 --- a/org.adempiere.ui.swing/src/org/compiere/apps/search/Find.java +++ b/org.adempiere.ui.swing/src/org/compiere/apps/search/Find.java @@ -25,7 +25,6 @@ import java.awt.GridBagLayout; import java.awt.Insets; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; -import java.awt.event.InputEvent; import java.awt.event.KeyEvent; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; @@ -646,7 +645,7 @@ public final class Find extends CDialog } }; advancedTable.getActionMap().put(im.get(tab), tabActionWrapper); - KeyStroke shiftTab = KeyStroke.getKeyStroke(KeyEvent.VK_TAB, InputEvent.SHIFT_MASK); + KeyStroke shiftTab = KeyStroke.getKeyStroke(KeyEvent.VK_TAB, ActionEvent.SHIFT_MASK); final Action shiftTabAction = advancedTable.getActionMap().get(im.get(shiftTab)); Action shiftTabActionWrapper = new AbstractAction() { diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/VSortTab.java b/org.adempiere.ui.swing/src/org/compiere/grid/VSortTab.java index 5c69e7de99..b5702475b6 100644 --- a/org.adempiere.ui.swing/src/org/compiere/grid/VSortTab.java +++ b/org.adempiere.ui.swing/src/org/compiere/grid/VSortTab.java @@ -39,6 +39,7 @@ import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.util.Arrays; +import java.util.List; import java.util.logging.Level; import javax.swing.DefaultListCellRenderer; @@ -525,11 +526,11 @@ public class VSortTab extends CPanel implements APanelTab void migrateValueAcrossLists (AWTEvent event) { Object source = event.getSource(); - Object[] selObjects = (source == bAdd || source == noList) ? - noList.getSelectedValues() : yesList.getSelectedValues(); - for (int i = 0; i < selObjects.length; i++) + List selObjects = (source == bAdd || source == noList) ? + noList.getSelectedValuesList() : yesList.getSelectedValuesList(); + for (int i = 0; i < selObjects.size(); i++) { - ListItem selObject = (ListItem)selObjects[i]; + ListItem selObject = (ListItem)selObjects.get(i); if (selObject == null || !selObject.isUpdateable()) continue; @@ -554,10 +555,10 @@ public class VSortTab extends CPanel implements APanelTab */ void migrateValueWithinYesList (AWTEvent event) { - Object[] selObjects = yesList.getSelectedValues(); + List selObjects = yesList.getSelectedValuesList(); if (selObjects == null) return; - int length = selObjects.length; + int length = selObjects.size(); if (length == 0) return; // Object selObject = selObjects[0]; @@ -572,7 +573,7 @@ public class VSortTab extends CPanel implements APanelTab if (source == bUp) { for (int i = 0; i < length; i++) { - ListItem selObject = (ListItem)selObjects[i]; + ListItem selObject = (ListItem)selObjects.get(i); int index = indices[i]; if (index == 0) break; @@ -589,7 +590,7 @@ public class VSortTab extends CPanel implements APanelTab else if (source == bDown) { for (int i = length - 1; i >= 0; i--) { - ListItem selObject = (ListItem)selObjects[i]; + ListItem selObject = (ListItem)selObjects.get(i); int index = indices[i]; if (index >= yesModel.size () - 1) break; diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VLookup.java b/org.adempiere.ui.swing/src/org/compiere/grid/ed/VLookup.java index 480a9b2363..79abb36910 100644 --- a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VLookup.java +++ b/org.adempiere.ui.swing/src/org/compiere/grid/ed/VLookup.java @@ -165,7 +165,7 @@ public class VLookup extends JComponent Action action = (binding==null) ? null : am.get(binding); if(action!=null){ return SwingUtilities.notifyAction(action, ks, e, editorComp, - e.getModifiers()); + e.getModifiersEx()); } } return false; diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VNumber.java b/org.adempiere.ui.swing/src/org/compiere/grid/ed/VNumber.java index 5c1c2d33bb..713871d31d 100644 --- a/org.adempiere.ui.swing/src/org/compiere/grid/ed/VNumber.java +++ b/org.adempiere.ui.swing/src/org/compiere/grid/ed/VNumber.java @@ -825,7 +825,7 @@ public final class VNumber extends JComponent int modifiers = 0; AWTEvent currentEvent = EventQueue.getCurrentEvent(); if (currentEvent instanceof InputEvent) - modifiers = ((InputEvent)currentEvent).getModifiers(); + modifiers = ((InputEvent)currentEvent).getModifiersEx(); else if (currentEvent instanceof ActionEvent) modifiers = ((ActionEvent)currentEvent).getModifiers(); ActionEvent ae = new ActionEvent (this, ActionEvent.ACTION_PERFORMED, diff --git a/org.adempiere.ui.swing/src/org/compiere/grid/tree/VTreePanel.java b/org.adempiere.ui.swing/src/org/compiere/grid/tree/VTreePanel.java index 75e3119fb3..d671fc4ca9 100644 --- a/org.adempiere.ui.swing/src/org/compiere/grid/tree/VTreePanel.java +++ b/org.adempiere.ui.swing/src/org/compiere/grid/tree/VTreePanel.java @@ -514,7 +514,7 @@ public final class VTreePanel extends CPanel // *** Tree *** if (e.getSource() instanceof JTree - || (e.getSource() == treeSearch && e.getModifiers() != 0)) // InputEvent.CTRL_MASK + || (e.getSource() == treeSearch && e.getModifiersEx() != 0)) // InputEvent.CTRL_MASK { TreePath tp = tree.getSelectionPath(); if (tp == null) diff --git a/org.adempiere.ui.swing/src/org/compiere/plaf/CompiereButtonListener.java b/org.adempiere.ui.swing/src/org/compiere/plaf/CompiereButtonListener.java index 89ecb6fbc0..252fa8afc1 100644 --- a/org.adempiere.ui.swing/src/org/compiere/plaf/CompiereButtonListener.java +++ b/org.adempiere.ui.swing/src/org/compiere/plaf/CompiereButtonListener.java @@ -16,7 +16,7 @@ *****************************************************************************/ package org.compiere.plaf; -import java.awt.event.InputEvent; +import java.awt.event.ActionEvent; import java.beans.PropertyChangeEvent; import javax.swing.AbstractButton; @@ -86,10 +86,10 @@ public class CompiereButtonListener extends BasicButtonListener } map.clear(); String className = b.getClass().getName(); - int mask = InputEvent.ALT_MASK; // Default Buttons + int mask = ActionEvent.ALT_MASK; // Default Buttons if (b instanceof JCheckBox // In Tab || className.indexOf("VButton") != -1) - mask = InputEvent.SHIFT_MASK + InputEvent.CTRL_MASK; + mask = ActionEvent.SHIFT_MASK + ActionEvent.CTRL_MASK; map.put(KeyStroke.getKeyStroke(m, mask, false), "pressed"); map.put(KeyStroke.getKeyStroke(m, mask, true), "released"); map.put(KeyStroke.getKeyStroke(m, 0, true), "released"); diff --git a/org.adempiere.ui.swing/src/org/compiere/plaf/CompiereTextAreaUI.java b/org.adempiere.ui.swing/src/org/compiere/plaf/CompiereTextAreaUI.java index 1cbe08af9b..e3649cd9d8 100644 --- a/org.adempiere.ui.swing/src/org/compiere/plaf/CompiereTextAreaUI.java +++ b/org.adempiere.ui.swing/src/org/compiere/plaf/CompiereTextAreaUI.java @@ -18,7 +18,7 @@ package org.compiere.plaf; import java.awt.AWTKeyStroke; import java.awt.KeyboardFocusManager; -import java.awt.event.InputEvent; +import java.awt.event.ActionEvent; import java.awt.event.KeyEvent; import java.beans.PropertyChangeEvent; import java.util.HashSet; @@ -63,7 +63,7 @@ public class CompiereTextAreaUI extends BasicTextAreaUI /** The Editor */ private JTextComponent m_editor = null; /** Tab Stroke */ - private static KeyStroke s_stroke = KeyStroke.getKeyStroke (KeyEvent.VK_TAB, InputEvent.CTRL_MASK); + private static KeyStroke s_stroke = KeyStroke.getKeyStroke (KeyEvent.VK_TAB, ActionEvent.CTRL_MASK); /** Tab Action */ private static Action s_action = new DefaultEditorKit.InsertTabAction(); @@ -109,7 +109,7 @@ public class CompiereTextAreaUI extends BasicTextAreaUI // forwardTraversalKeys.add (KeyStroke.getKeyStroke (KeyEvent.VK_TAB, 0)); forwardTraversalKeys.remove(s_stroke); - backwardTraversalKeys.add (KeyStroke.getKeyStroke (KeyEvent.VK_TAB, InputEvent.SHIFT_MASK)); + backwardTraversalKeys.add (KeyStroke.getKeyStroke (KeyEvent.VK_TAB, ActionEvent.SHIFT_MASK)); // LookAndFeel.installProperty (m_editor, "focusTraversalKeysForward", forwardTraversalKeys); LookAndFeel.installProperty (m_editor, "focusTraversalKeysBackward", backwardTraversalKeys); diff --git a/org.adempiere.ui.swing/src/org/compiere/plaf/CompiereToolTipUI.java b/org.adempiere.ui.swing/src/org/compiere/plaf/CompiereToolTipUI.java index 66f900cedb..a8bb4d214a 100644 --- a/org.adempiere.ui.swing/src/org/compiere/plaf/CompiereToolTipUI.java +++ b/org.adempiere.ui.swing/src/org/compiere/plaf/CompiereToolTipUI.java @@ -79,7 +79,7 @@ public class CompiereToolTipUI extends MetalToolTipUI int condition = comp.getConditionForKeyStroke (keys[i]); if (condition == JComponent.WHEN_IN_FOCUSED_WINDOW) { - String prefix = KeyEvent.getKeyModifiersText (mod); + String prefix = KeyEvent.getModifiersExText (mod); if (prefix.length() > 1) { if (controlKeyStr.length() > 0) diff --git a/org.adempiere.ui.swing/src/org/compiere/pos/SubCurrentLine.java b/org.adempiere.ui.swing/src/org/compiere/pos/SubCurrentLine.java index c1264376cd..7605ddb62f 100644 --- a/org.adempiere.ui.swing/src/org/compiere/pos/SubCurrentLine.java +++ b/org.adempiere.ui.swing/src/org/compiere/pos/SubCurrentLine.java @@ -14,7 +14,6 @@ package org.compiere.pos; -import java.awt.Event; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.FocusEvent; @@ -131,7 +130,7 @@ public class SubCurrentLine extends PosSubPanel implements ActionListener, Focus String buttonSize = "w 50!, h 50!,"; // - f_bSearch = createButtonAction ("Product", KeyStroke.getKeyStroke(KeyEvent.VK_I, Event.CTRL_MASK)); + f_bSearch = createButtonAction ("Product", KeyStroke.getKeyStroke(KeyEvent.VK_I, ActionEvent.CTRL_MASK)); f_bSearch.setName("ProductSearch"); add (f_bSearch, buttonSize ); @@ -179,7 +178,7 @@ public class SubCurrentLine extends PosSubPanel implements ActionListener, Focus add (f_down, buttonSize); - f_delete = createButtonAction("Cancel", KeyStroke.getKeyStroke(KeyEvent.VK_DELETE, Event.SHIFT_MASK)); + f_delete = createButtonAction("Cancel", KeyStroke.getKeyStroke(KeyEvent.VK_DELETE, ActionEvent.SHIFT_MASK)); add (f_delete, buttonSize); // diff --git a/org.adempiere.ui.swing/src/org/compiere/print/Viewer.java b/org.adempiere.ui.swing/src/org/compiere/print/Viewer.java index 73cb561a20..40ee7f5b6d 100644 --- a/org.adempiere.ui.swing/src/org/compiere/print/Viewer.java +++ b/org.adempiere.ui.swing/src/org/compiere/print/Viewer.java @@ -22,7 +22,6 @@ import java.awt.BorderLayout; import java.awt.Component; import java.awt.Cursor; import java.awt.Dimension; -import java.awt.Event; import java.awt.GraphicsConfiguration; import java.awt.Point; import java.awt.Rectangle; @@ -522,21 +521,21 @@ public class Viewer extends CFrame JMenu mFile = AEnv.getMenu("File"); menuBar.add(mFile); AEnv.addMenuItem("PrintScreen", null, KeyStroke.getKeyStroke(KeyEvent.VK_PRINTSCREEN, 0), mFile, this); - AEnv.addMenuItem("ScreenShot", null, KeyStroke.getKeyStroke(KeyEvent.VK_PRINTSCREEN, Event.SHIFT_MASK), mFile, this); - AEnv.addMenuItem("Report", null, KeyStroke.getKeyStroke(KeyEvent.VK_P, Event.ALT_MASK), mFile, this); + AEnv.addMenuItem("ScreenShot", null, KeyStroke.getKeyStroke(KeyEvent.VK_PRINTSCREEN, ActionEvent.SHIFT_MASK), mFile, this); + AEnv.addMenuItem("Report", null, KeyStroke.getKeyStroke(KeyEvent.VK_P, ActionEvent.ALT_MASK), mFile, this); mFile.addSeparator(); AEnv.addMenuItem("PrintCustomize", "Preference", null, mFile, this); AEnv.addMenuItem("Translate", null, null, mFile, this); - AEnv.addMenuItem("Find", null, KeyStroke.getKeyStroke(KeyEvent.VK_F, Event.CTRL_MASK), mFile, this); + AEnv.addMenuItem("Find", null, KeyStroke.getKeyStroke(KeyEvent.VK_F, ActionEvent.CTRL_MASK), mFile, this); mFile.addSeparator(); AEnv.addMenuItem("PageSetup", null, null, mFile, this); - AEnv.addMenuItem("Print", null, KeyStroke.getKeyStroke(KeyEvent.VK_P, Event.CTRL_MASK), mFile, this); + AEnv.addMenuItem("Print", null, KeyStroke.getKeyStroke(KeyEvent.VK_P, ActionEvent.CTRL_MASK), mFile, this); if (m_isCanExport) AEnv.addMenuItem("Export", null, null, mFile, this); mFile.addSeparator(); - AEnv.addMenuItem("End", null, KeyStroke.getKeyStroke(KeyEvent.VK_X, Event.ALT_MASK), mFile, this); - AEnv.addMenuItem("Logout", null, KeyStroke.getKeyStroke(KeyEvent.VK_L, Event.SHIFT_MASK+Event.ALT_MASK), mFile, this); - AEnv.addMenuItem("Exit", null, KeyStroke.getKeyStroke(KeyEvent.VK_X, Event.SHIFT_MASK+Event.ALT_MASK), mFile, this); + AEnv.addMenuItem("End", null, KeyStroke.getKeyStroke(KeyEvent.VK_X, ActionEvent.ALT_MASK), mFile, this); + AEnv.addMenuItem("Logout", null, KeyStroke.getKeyStroke(KeyEvent.VK_L, ActionEvent.SHIFT_MASK+ActionEvent.ALT_MASK), mFile, this); + AEnv.addMenuItem("Exit", null, KeyStroke.getKeyStroke(KeyEvent.VK_X, ActionEvent.SHIFT_MASK+ActionEvent.ALT_MASK), mFile, this); // View JMenu mView = AEnv.getMenu("View"); @@ -544,15 +543,15 @@ public class Viewer extends CFrame if (MRole.getDefault().isAllow_Info_Product()) { - AEnv.addMenuItem("InfoProduct", null, KeyStroke.getKeyStroke(KeyEvent.VK_I, Event.ALT_MASK), mView, this); + AEnv.addMenuItem("InfoProduct", null, KeyStroke.getKeyStroke(KeyEvent.VK_I, ActionEvent.ALT_MASK), mView, this); } if (MRole.getDefault().isAllow_Info_BPartner()) { - AEnv.addMenuItem("InfoBPartner", null, KeyStroke.getKeyStroke(KeyEvent.VK_I, Event.ALT_MASK+Event.CTRL_MASK), mView, this); + AEnv.addMenuItem("InfoBPartner", null, KeyStroke.getKeyStroke(KeyEvent.VK_I, ActionEvent.ALT_MASK+ActionEvent.CTRL_MASK), mView, this); } if (MRole.getDefault().isShowAcct() && MRole.getDefault().isAllow_Info_Account()) { - AEnv.addMenuItem("InfoAccount", null, KeyStroke.getKeyStroke(KeyEvent.VK_I, Event.ALT_MASK+Event.CTRL_MASK), mView, this); + AEnv.addMenuItem("InfoAccount", null, KeyStroke.getKeyStroke(KeyEvent.VK_I, ActionEvent.ALT_MASK+ActionEvent.CTRL_MASK), mView, this); } if (MRole.getDefault().isAllow_Info_Schedule()) { @@ -601,10 +600,10 @@ public class Viewer extends CFrame // Go JMenu mGo = AEnv.getMenu("Go"); menuBar.add(mGo); - AEnv.addMenuItem("First", "First", KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_UP, Event.ALT_MASK), mGo, this); - AEnv.addMenuItem("PreviousPage", "Previous", KeyStroke.getKeyStroke(KeyEvent.VK_UP, Event.ALT_MASK), mGo, this); - AEnv.addMenuItem("NextPage", "Next", KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, Event.ALT_MASK), mGo, this); - AEnv.addMenuItem("Last", "Last", KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_DOWN, Event.ALT_MASK), mGo, this); + AEnv.addMenuItem("First", "First", KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_UP, ActionEvent.ALT_MASK), mGo, this); + AEnv.addMenuItem("PreviousPage", "Previous", KeyStroke.getKeyStroke(KeyEvent.VK_UP, ActionEvent.ALT_MASK), mGo, this); + AEnv.addMenuItem("NextPage", "Next", KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, ActionEvent.ALT_MASK), mGo, this); + AEnv.addMenuItem("Last", "Last", KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_DOWN, ActionEvent.ALT_MASK), mGo, this); // Tools JMenu mTools = AEnv.getMenu("Tools"); diff --git a/org.adempiere.ui.swing/src/org/compiere/swing/CButton.java b/org.adempiere.ui.swing/src/org/compiere/swing/CButton.java index e1c807717f..9b15112726 100644 --- a/org.adempiere.ui.swing/src/org/compiere/swing/CButton.java +++ b/org.adempiere.ui.swing/src/org/compiere/swing/CButton.java @@ -26,7 +26,7 @@ package org.compiere.swing; import java.awt.Color; -import java.awt.event.InputEvent; +import java.awt.event.ActionEvent; import java.awt.event.KeyEvent; import javax.swing.Action; @@ -331,7 +331,7 @@ public class CButton extends JButton implements CEditor { JComponent.WHEN_IN_FOCUSED_WINDOW, map); } map.clear(); - int mask = InputEvent.ALT_MASK + InputEvent.CTRL_MASK; // Default + int mask = ActionEvent.ALT_MASK + ActionEvent.CTRL_MASK; // Default // Buttons map.put(KeyStroke.getKeyStroke(mnemonic, mask, false), "pressed"); map.put(KeyStroke.getKeyStroke(mnemonic, mask, true), "released"); diff --git a/org.adempiere.ui.swing/src/org/compiere/swing/CCheckBox.java b/org.adempiere.ui.swing/src/org/compiere/swing/CCheckBox.java index 42937befcc..5a385503c1 100644 --- a/org.adempiere.ui.swing/src/org/compiere/swing/CCheckBox.java +++ b/org.adempiere.ui.swing/src/org/compiere/swing/CCheckBox.java @@ -26,7 +26,7 @@ package org.compiere.swing; import java.awt.Color; -import java.awt.event.InputEvent; +import java.awt.event.ActionEvent; import javax.swing.Action; import javax.swing.Icon; @@ -334,10 +334,10 @@ public class CCheckBox extends JCheckBox implements CEditor { } map.clear(); String className = this.getClass().getName(); - int mask = InputEvent.ALT_MASK; // Default Buttons + int mask = ActionEvent.ALT_MASK; // Default Buttons if (this instanceof JCheckBox // In Tab || className.indexOf("VButton") != -1) - mask = InputEvent.SHIFT_MASK + InputEvent.CTRL_MASK; + mask = ActionEvent.SHIFT_MASK + ActionEvent.CTRL_MASK; map.put(KeyStroke.getKeyStroke(mnemonic, mask, false), "pressed"); map.put(KeyStroke.getKeyStroke(mnemonic, mask, true), "released"); map.put(KeyStroke.getKeyStroke(mnemonic, 0, true), "released"); diff --git a/org.adempiere.ui.swing/src/org/compiere/swing/CDialog.java b/org.adempiere.ui.swing/src/org/compiere/swing/CDialog.java index 39d43360cd..9dec64fdd4 100644 --- a/org.adempiere.ui.swing/src/org/compiere/swing/CDialog.java +++ b/org.adempiere.ui.swing/src/org/compiere/swing/CDialog.java @@ -24,7 +24,6 @@ import java.awt.HeadlessException; import java.awt.Window; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; -import java.awt.event.InputEvent; import java.awt.event.KeyEvent; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; @@ -255,7 +254,7 @@ public class CDialog extends JDialog protected static DialogAction s_dialogAction = new DialogAction(ACTION_DISPOSE); /** ALT-EXCAPE */ protected static KeyStroke s_disposeKeyStroke = - KeyStroke.getKeyStroke(KeyEvent.VK_PAUSE, InputEvent.ALT_MASK); + KeyStroke.getKeyStroke(KeyEvent.VK_PAUSE, ActionEvent.ALT_MASK); /** * Adempiere Dialog Action diff --git a/org.adempiere.ui.swing/src/org/compiere/swing/CTabbedPane.java b/org.adempiere.ui.swing/src/org/compiere/swing/CTabbedPane.java index 2e365b6151..661c9f5240 100644 --- a/org.adempiere.ui.swing/src/org/compiere/swing/CTabbedPane.java +++ b/org.adempiere.ui.swing/src/org/compiere/swing/CTabbedPane.java @@ -18,7 +18,6 @@ package org.compiere.swing; import java.awt.Color; import java.awt.Component; -import java.awt.Event; import java.awt.event.ActionEvent; import java.awt.event.KeyEvent; import java.util.ArrayList; @@ -221,10 +220,10 @@ public class CTabbedPane extends JTabbedPane { if (index < 9) getInputMap(WHEN_IN_FOCUSED_WINDOW) - .put(KeyStroke.getKeyStroke(KeyEvent.VK_1+index, Event.ALT_MASK), ACTION_SELECT); + .put(KeyStroke.getKeyStroke(KeyEvent.VK_1+index, ActionEvent.ALT_MASK), ACTION_SELECT); else if (index == 9) getInputMap(WHEN_IN_FOCUSED_WINDOW) - .put(KeyStroke.getKeyStroke(KeyEvent.VK_0, Event.ALT_MASK), ACTION_SELECT); + .put(KeyStroke.getKeyStroke(KeyEvent.VK_0, ActionEvent.ALT_MASK), ACTION_SELECT); } // } // insertTab @@ -261,7 +260,7 @@ public class CTabbedPane extends JTabbedPane char keyCode = m_mnemonic.get(index); if (keyCode != 0) getInputMap(WHEN_IN_FOCUSED_WINDOW) - .remove(KeyStroke.getKeyStroke(keyCode, Event.ALT_MASK)); + .remove(KeyStroke.getKeyStroke(keyCode, ActionEvent.ALT_MASK)); m_mnemonic.set(index, (char)0); // if (!text.startsWith(""))