851 }
852
853 Rectangle dirtyRect = table.getCellRect(lr, lc, false);
854 table.repaint(dirtyRect);
855 }
856
857 public void focusGained(FocusEvent e) {
858 repaintLeadCell();
859 }
860
861 public void focusLost(FocusEvent e) {
862 repaintLeadCell();
863 }
864
865
866 // KeyListener
867 public void keyPressed(KeyEvent e) { }
868
869 public void keyReleased(KeyEvent e) { }
870
871 public void keyTyped(KeyEvent e) {
872 KeyStroke keyStroke = KeyStroke.getKeyStroke(e.getKeyChar(),
873 e.getModifiers());
874
875 // We register all actions using ANCESTOR_OF_FOCUSED_COMPONENT
876 // which means that we might perform the appropriate action
877 // in the table and then forward it to the editor if the editor
878 // had focus. Make sure this doesn't happen by checking our
879 // InputMaps.
880 InputMap map = table.getInputMap(JComponent.WHEN_FOCUSED);
881 if (map != null && map.get(keyStroke) != null) {
882 return;
883 }
884 map = table.getInputMap(JComponent.
885 WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
886 if (map != null && map.get(keyStroke) != null) {
887 return;
888 }
889
890 keyStroke = KeyStroke.getKeyStrokeForEvent(e);
|
851 }
852
853 Rectangle dirtyRect = table.getCellRect(lr, lc, false);
854 table.repaint(dirtyRect);
855 }
856
857 public void focusGained(FocusEvent e) {
858 repaintLeadCell();
859 }
860
861 public void focusLost(FocusEvent e) {
862 repaintLeadCell();
863 }
864
865
866 // KeyListener
867 public void keyPressed(KeyEvent e) { }
868
869 public void keyReleased(KeyEvent e) { }
870
871 @SuppressWarnings("deprecation")
872 public void keyTyped(KeyEvent e) {
873 KeyStroke keyStroke = KeyStroke.getKeyStroke(e.getKeyChar(),
874 e.getModifiers());
875
876 // We register all actions using ANCESTOR_OF_FOCUSED_COMPONENT
877 // which means that we might perform the appropriate action
878 // in the table and then forward it to the editor if the editor
879 // had focus. Make sure this doesn't happen by checking our
880 // InputMaps.
881 InputMap map = table.getInputMap(JComponent.WHEN_FOCUSED);
882 if (map != null && map.get(keyStroke) != null) {
883 return;
884 }
885 map = table.getInputMap(JComponent.
886 WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
887 if (map != null && map.get(keyStroke) != null) {
888 return;
889 }
890
891 keyStroke = KeyStroke.getKeyStrokeForEvent(e);
|