*[ 1675896 ] Deleting in grid mode deletes wrong product line

This commit is contained in:
Heng Sin Low 2007-03-16 10:50:32 +00:00
parent fe5f84af7b
commit 1f965b3487
2 changed files with 28 additions and 0 deletions

View File

@ -41,6 +41,7 @@ public final class VTable extends CTable
{
super();
setAutoscrolls(true);
putClientProperty("terminateEditOnFocusLost", Boolean.TRUE);
} // VTable
/** Logger */

View File

@ -22,6 +22,7 @@ import java.beans.*;
import java.sql.*;
import java.util.logging.*;
import javax.swing.*;
import org.compiere.apps.*;
import org.compiere.apps.search.*;
import org.compiere.model.*;
@ -43,6 +44,32 @@ import org.compiere.util.*;
public class VLookup extends JComponent
implements VEditor, ActionListener, FocusListener
{
@Override
protected boolean processKeyBinding(KeyStroke ks, KeyEvent e,
int condition, boolean pressed) {
if (e.getSource() == m_combo || e.getSource() == m_text || e.getSource() == this) {
return super.processKeyBinding(ks, e, condition, pressed);
}
JComponent editorComp = null;
if (m_lookup != null && m_lookup.getDisplayType() != DisplayType.Search)
editorComp = m_combo;
else
editorComp = m_text;
InputMap map = editorComp.getInputMap(condition);
ActionMap am = editorComp.getActionMap();
if(map!=null && am!=null && isEnabled()){
Object binding = map.get(ks);
Action action = (binding==null) ? null : am.get(binding);
if(action!=null){
return SwingUtilities.notifyAction(action, ks, e, editorComp,
e.getModifiers());
}
}
return false;
}
/**
* Create Optional BPartner Search Lookup
* @param WindowNo window