1 11 package org.eclipse.jface.bindings.keys; 12 13 import org.eclipse.core.commands.ParameterizedCommand; 14 import org.eclipse.jface.bindings.Binding; 15 import org.eclipse.jface.bindings.TriggerSequence; 16 17 25 public final class KeyBinding extends Binding { 26 27 31 private final KeySequence keySequence; 32 33 64 public KeyBinding(final KeySequence keySequence, 65 final ParameterizedCommand command, final String schemeId, 66 final String contextId, final String locale, final String platform, 67 final String windowManager, final int type) { 68 super(command, schemeId, contextId, locale, platform, windowManager, 69 type); 70 71 if (keySequence == null) { 72 throw new NullPointerException ("The key sequence cannot be null"); } 74 75 if (!keySequence.isComplete()) { 76 throw new IllegalArgumentException ( 77 "Cannot bind to an incomplete key sequence"); } 79 80 if (keySequence.isEmpty()) { 81 throw new IllegalArgumentException ( 82 "Cannot bind to an empty key sequence"); } 84 85 this.keySequence = keySequence; 86 } 87 88 94 public final KeySequence getKeySequence() { 95 return keySequence; 96 } 97 98 103 public TriggerSequence getTriggerSequence() { 104 return getKeySequence(); 105 } 106 } 107 | Popular Tags |