IDEMPIERE-72 F4 shortcut not working within a ComboBox

This commit is contained in:
Carlos Ruiz 2011-09-24 16:56:14 -05:00
parent 537570f32b
commit 4de5a6bb87
1 changed files with 5 additions and 6 deletions

View File

@ -35,7 +35,6 @@ import javax.swing.Icon;
import javax.swing.JButton; import javax.swing.JButton;
import javax.swing.JComboBox; import javax.swing.JComboBox;
import javax.swing.JComponent; import javax.swing.JComponent;
import javax.swing.JTextField;
import javax.swing.MutableComboBoxModel; import javax.swing.MutableComboBoxModel;
import javax.swing.SwingUtilities; import javax.swing.SwingUtilities;
import javax.swing.event.EventListenerList; import javax.swing.event.EventListenerList;
@ -134,7 +133,7 @@ public class CComboBox extends JComboBox
* @param items an array of vectors to insert into the combo box * @param items an array of vectors to insert into the combo box
* @see DefaultComboBoxModel * @see DefaultComboBoxModel
*/ */
public CComboBox(Vector items) public CComboBox(Vector<?> items)
{ {
super(items); super(items);
init(); init();
@ -169,9 +168,6 @@ public class CComboBox extends JComboBox
/** Key listener for triggering an update the filtering model . */ /** Key listener for triggering an update the filtering model . */
private ReducibleKeyListener reducibleKeyListener = new ReducibleKeyListener(); private ReducibleKeyListener reducibleKeyListener = new ReducibleKeyListener();
/** Reference Field */
private static JTextField s_text = new JTextField(15);
/** /**
* Common Init * Common Init
*/ */
@ -947,7 +943,7 @@ public class CComboBox extends JComboBox
* @see java.awt.event.KeyAdapter#keyPressed(java.awt.event.KeyEvent) * @see java.awt.event.KeyAdapter#keyPressed(java.awt.event.KeyEvent)
*/ */
public void keyPressed(KeyEvent ke) public void keyPressed(KeyEvent ke)
{ {
if (ke.getKeyCode() != KeyEvent.VK_CONTROL && if (ke.getKeyCode() != KeyEvent.VK_CONTROL &&
ke.getKeyCode() != KeyEvent.VK_ALT && ke.getKeyCode() != KeyEvent.VK_ALT &&
ke.getKeyCode() != KeyEvent.VK_SHIFT && ke.getKeyCode() != KeyEvent.VK_SHIFT &&
@ -975,6 +971,9 @@ public class CComboBox extends JComboBox
// up or down selects new value // up or down selects new value
SwingUtilities.invokeLater(m_updateMenu); SwingUtilities.invokeLater(m_updateMenu);
} }
else if (ke.getKeyChar() == KeyEvent.CHAR_UNDEFINED) {
; // ignore keys not modifying text
}
else else
{ {
// key typed, so filter // key typed, so filter