[ 1733665 ] "Zoom-Popup" not Working after Auto-Completion Patch

This commit is contained in:
Heng Sin Low 2007-06-09 02:46:11 +00:00
parent bf2b26b934
commit 04105b1080
1 changed files with 10 additions and 5 deletions

View File

@ -153,18 +153,18 @@ public class VLookup extends JComponent
setMandatory(mandatory); setMandatory(mandatory);
m_lookup = lookup; m_lookup = lookup;
if (m_lookup != null) if (m_lookup != null)
m_lookup.setMandatory(mandatory); m_lookup.setMandatory(mandatory);
// //
setLayout(new BorderLayout()); setLayout(new BorderLayout());
VLookup_mouseAdapter mouse = new VLookup_mouseAdapter(this); // popup mouseAdapter = new VLookup_mouseAdapter(this); // popup
// *** Text & Button *** // *** Text & Button ***
m_text.addActionListener(this); m_text.addActionListener(this);
m_text.addFocusListener(this); m_text.addFocusListener(this);
m_text.addMouseListener(mouse); m_text.addMouseListener(mouseAdapter);
// Button // Button
m_button.addActionListener(this); m_button.addActionListener(this);
m_button.addMouseListener(mouse); m_button.addMouseListener(mouseAdapter);
m_button.setFocusable(false); // don't focus when tabbing m_button.setFocusable(false); // don't focus when tabbing
m_button.setMargin(new Insets(0, 0, 0, 0)); m_button.setMargin(new Insets(0, 0, 0, 0));
if (columnName.equals("C_BPartner_ID")) if (columnName.equals("C_BPartner_ID"))
@ -183,7 +183,7 @@ public class VLookup extends JComponent
// //
AutoCompletion.enable(m_combo); AutoCompletion.enable(m_combo);
m_combo.addActionListener(this); // Selection m_combo.addActionListener(this); // Selection
m_combo.addMouseListener(mouse); // popup m_combo.getEditor().getEditorComponent().addMouseListener(mouseAdapter); // popup
// FocusListener to refresh selection before opening // FocusListener to refresh selection before opening
m_combo.addFocusListener(this); m_combo.addFocusListener(this);
m_combo.getEditor().getEditorComponent().addFocusListener(this); m_combo.getEditor().getEditorComponent().addFocusListener(this);
@ -237,6 +237,7 @@ public class VLookup extends JComponent
m_mField = null; m_mField = null;
// //
m_combo.getEditor().getEditorComponent().removeFocusListener(this); m_combo.getEditor().getEditorComponent().removeFocusListener(this);
m_combo.getEditor().getEditorComponent().removeMouseListener(mouseAdapter);
m_combo.removeFocusListener(this); m_combo.removeFocusListener(this);
m_combo.removeActionListener(this); m_combo.removeActionListener(this);
m_combo.setModel(new DefaultComboBoxModel()); // remove reference m_combo.setModel(new DefaultComboBoxModel()); // remove reference
@ -280,6 +281,10 @@ public class VLookup extends JComponent
private CMenuItem mRefresh; private CMenuItem mRefresh;
private CMenuItem mBPartnerNew; private CMenuItem mBPartnerNew;
private CMenuItem mBPartnerUpd; private CMenuItem mBPartnerUpd;
// Mouse Listener
private VLookup_mouseAdapter mouseAdapter;
// Field for Value Preference // Field for Value Preference
private GridField m_mField = null; private GridField m_mField = null;
/** Logger */ /** Logger */