equal
deleted
inserted
replaced
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 |