Revision 6754 trunk/libraries/libUI/src/org/gvsig/gui/beans/comboBoxItemsSeeker/JComboBoxItemsSeekerConfigurable.java
JComboBoxItemsSeekerConfigurable.java | ||
---|---|---|
546 | 546 |
{ |
547 | 547 |
public void keyPressed(KeyEvent ke) // Executed on the Start view state or Search view state |
548 | 548 |
{ |
549 |
logger.debug("Tecla apretada: ->" + ke.getKeyChar() + "<-");
|
|
549 |
logger.debug("Tecla apretada: ->" + ke.getKeyChar() + "<- ; Su keyCode es: " + ke.getKeyCode());
|
|
550 | 550 |
|
551 | 551 |
if (model.getParentSize() == 0) |
552 | 552 |
{ |
... | ... | |
587 | 587 |
// This avoids that popup listener could report about it detected item (Este no va) |
588 | 588 |
// textKeyPressed = true; |
589 | 589 |
|
590 |
// If we remove characters by default if we use two color -> set color red ; and if the item would match in the lookUp algorithm of the PlainDocumentSeeker |
|
591 |
// text will be on black color |
|
592 |
if (!isOnlyOneColor()) |
|
593 |
comboBoxReference.getEditor().getEditorComponent().setForeground(Color.RED); |
|
594 |
|
|
590 |
|
|
595 | 591 |
// Remove selected text: |
596 | 592 |
logger.debug("GETMARK: " + editor.getCaret().getMark() + "GETCARETPOSITION" + editor.getCaretPosition()); |
597 | 593 |
|
... | ... | |
685 | 681 |
break; |
686 | 682 |
} |
687 | 683 |
|
684 |
// If we remove characters by default if we use two color -> set color red ; and if the item would match in the lookUp algorithm of the PlainDocumentSeeker |
|
685 |
// text will be on black color |
|
686 |
if (!isOnlyOneColor()) |
|
687 |
{ |
|
688 |
if (isKeySensitive()) |
|
689 |
{ |
|
690 |
try { |
|
691 |
if (document.getText(0, document.getLength()).compareTo(getSelectedItem().toString()) == 0) |
|
692 |
comboBoxReference.getEditor().getEditorComponent().setForeground(Color.BLACK); |
|
693 |
else |
|
694 |
comboBoxReference.getEditor().getEditorComponent().setForeground(Color.RED); |
|
695 |
} catch (BadLocationException e2) { |
|
696 |
// TODO Auto-generated catch block |
|
697 |
e2.printStackTrace(); |
|
698 |
} |
|
699 |
} |
|
700 |
else |
|
701 |
{ |
|
702 |
try { |
|
703 |
if (document.getText(0, document.getLength()).compareToIgnoreCase(getSelectedItem().toString()) == 0) |
|
704 |
comboBoxReference.getEditor().getEditorComponent().setForeground(Color.BLACK); |
|
705 |
else |
|
706 |
comboBoxReference.getEditor().getEditorComponent().setForeground(Color.RED); |
|
707 |
} catch (BadLocationException e2) { |
|
708 |
// TODO Auto-generated catch block |
|
709 |
e2.printStackTrace(); |
|
710 |
} |
|
711 |
} |
|
712 |
} |
|
713 |
|
|
688 | 714 |
updatePopUpView(); |
689 | 715 |
|
690 | 716 |
break; |
... | ... | |
1042 | 1068 |
logger.debug("LASTITEM1 :" + lastSelectedItem); |
1043 | 1069 |
|
1044 | 1070 |
logger.debug("GETMARK: " + editor.getCaret().getMark() + "GETCARETPOSITION" + editor.getCaretPosition()); |
1071 |
|
|
1072 |
if (!isOnlyOneColor()) |
|
1073 |
comboBoxReference.getEditor().getEditorComponent().setForeground(Color.RED); |
|
1045 | 1074 |
|
1046 | 1075 |
if (model.isDynamicSearch()) |
1047 | 1076 |
{ |
Also available in: Unified diff