[Openproj-commitlog] openproj_ui/src/com/projity/pm/graphic/spreadsheet/editor SimpleComboBoxEdito
Open Source desktop project management
Brought to you by:
akheirol
From: Anthony V. <av...@us...> - 2009-06-22 21:44:21
|
Update of /cvsroot/openproj/openproj_ui/src/com/projity/pm/graphic/spreadsheet/editor In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv21057/src/com/projity/pm/graphic/spreadsheet/editor Modified Files: SimpleComboBoxEditor.java Log Message: DEF158590: searching on multiple letters (3 second delay between letters max, no match blanks out search string) Index: SimpleComboBoxEditor.java =================================================================== RCS file: /cvsroot/openproj/openproj_ui/src/com/projity/pm/graphic/spreadsheet/editor/SimpleComboBoxEditor.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- SimpleComboBoxEditor.java 15 Aug 2007 23:28:25 -0000 1.1 +++ SimpleComboBoxEditor.java 22 Jun 2009 21:42:59 -0000 1.2 @@ -58,21 +58,22 @@ import javax.swing.JTextField; import com.projity.field.Field; +import com.projity.pm.graphic.MultipleKeyJComboBox; import com.projity.pm.graphic.spreadsheet.SpreadSheetModel; /** * */ public class SimpleComboBoxEditor extends DefaultCellEditor { - JTable cachedTable = null; - JComboBox component; - String oldValue; - Field field; + private JComboBox component; + private Field field; + private int lastRow=-1; + /** * @param arg0 */ public SimpleComboBoxEditor(ComboBoxModel arg0) { - super(new JComboBox(arg0)); + super(new MultipleKeyJComboBox(arg0)); } /* (non-Javadoc) @@ -80,15 +81,16 @@ */ public Component getTableCellEditorComponent(JTable arg0, Object arg1, boolean arg2, int row, int column) { - cachedTable = arg0; + component=(JComboBox)super.getTableCellEditorComponent(arg0, arg1, arg2, row, column); field = ((SpreadSheetModel)arg0.getModel()).getFieldInColumn(column+1); component.setEditable(field.hasDynamicSelect()); // don't allow the user to type a choice if field has fixed values JTextField f = (JTextField) component.getEditor().getEditorComponent(); - oldValue = f.getText(); + if(row>-1 && row!=lastRow){ + ((MultipleKeyJComboBox)getComponent()).resetKey(); + } + lastRow = row; return component; - } - - + } } |