jdk/src/share/classes/javax/swing/LookAndFeel.java
changeset 8380 9b9f901a909d
parent 5506 202f599c92aa
child 9035 1255eb81cc2f
equal deleted inserted replaced
8379:3cc0596f81a5 8380:9b9f901a909d
   330      */
   330      */
   331     public static JTextComponent.KeyBinding[] makeKeyBindings(Object[] keyBindingList)
   331     public static JTextComponent.KeyBinding[] makeKeyBindings(Object[] keyBindingList)
   332     {
   332     {
   333         JTextComponent.KeyBinding[] rv = new JTextComponent.KeyBinding[keyBindingList.length / 2];
   333         JTextComponent.KeyBinding[] rv = new JTextComponent.KeyBinding[keyBindingList.length / 2];
   334 
   334 
   335         for(int i = 0; i < keyBindingList.length; i += 2) {
   335         for(int i = 0; i < rv.length; i ++) {
   336             KeyStroke keystroke = (keyBindingList[i] instanceof KeyStroke)
   336             Object o = keyBindingList[2 * i];
   337                 ? (KeyStroke)keyBindingList[i]
   337             KeyStroke keystroke = (o instanceof KeyStroke)
   338                 : KeyStroke.getKeyStroke((String)keyBindingList[i]);
   338                 ? (KeyStroke) o
   339             String action = (String)keyBindingList[i+1];
   339                 : KeyStroke.getKeyStroke((String) o);
   340             rv[i / 2] = new JTextComponent.KeyBinding(keystroke, action);
   340             String action = (String) keyBindingList[2 * i + 1];
       
   341             rv[i] = new JTextComponent.KeyBinding(keystroke, action);
   341         }
   342         }
   342 
   343 
   343         return rv;
   344         return rv;
   344     }
   345     }
   345 
   346