use of com.intellij.openapi.actionSystem.MouseShortcut in project intellij-community by JetBrains.
the class EditorMultiCaretTest method doWithAltClickShortcut.
private static void doWithAltClickShortcut(ThrowableRunnable runnable) throws Throwable {
Keymap keymap = KeymapManager.getInstance().getActiveKeymap();
MouseShortcut shortcut = new MouseShortcut(1, InputEvent.ALT_DOWN_MASK, 1);
try {
keymap.addShortcut(IdeActions.ACTION_EDITOR_ADD_OR_REMOVE_CARET, shortcut);
runnable.run();
} finally {
keymap.removeShortcut(IdeActions.ACTION_EDITOR_ADD_OR_REMOVE_CARET, shortcut);
}
}
use of com.intellij.openapi.actionSystem.MouseShortcut in project intellij-community by JetBrains.
the class KeymapTest method testRemoveMouseShortcut.
public void testRemoveMouseShortcut() throws Exception {
myParent.clearOwnActionsIds();
myChild.clearOwnActionsIds();
MouseShortcut mouseShortcut = new MouseShortcut(1, InputEvent.BUTTON2_MASK, 1);
myParent.addShortcut(ACTION_2, mouseShortcut);
assertThat(myChild.getActionIds(mouseShortcut)).containsExactly(ACTION_2);
myChild.removeShortcut(ACTION_2, mouseShortcut);
assertThat(myChild.getActionIds(mouseShortcut)).isEmpty();
}
use of com.intellij.openapi.actionSystem.MouseShortcut in project intellij-community by JetBrains.
the class MouseShortcutEqualityTest method testEqualMouseShortcutsAreEqual.
public void testEqualMouseShortcutsAreEqual() {
assertEquals("Mouse shortcuts with equal data are equal", new MouseShortcut(MouseEvent.BUTTON1, 0, 1), new MouseShortcut(MouseEvent.BUTTON1, 0, 1));
assertEquals("Mouse shortcuts with equal data are equal", new MouseShortcut(MouseEvent.BUTTON2, InputEvent.ALT_DOWN_MASK, 2), new MouseShortcut(MouseEvent.BUTTON2, InputEvent.ALT_DOWN_MASK, 2));
}
use of com.intellij.openapi.actionSystem.MouseShortcut in project intellij-community by JetBrains.
the class MouseShortcutEqualityTest method testTheSameMouseShortcutIsEqual.
public void testTheSameMouseShortcutIsEqual() {
MouseShortcut mouseShortcut = new MouseShortcut(MouseEvent.BUTTON1, 0, 1);
assertEquals("The same MouseShortcut should be equals to itself", mouseShortcut, mouseShortcut);
mouseShortcut = new MouseShortcut(MouseEvent.BUTTON2, 0, 1);
assertEquals("The same MouseShortcut should be equals to itself", mouseShortcut, mouseShortcut);
mouseShortcut = new MouseShortcut(MouseEvent.BUTTON1, InputEvent.ALT_DOWN_MASK, 1);
assertEquals("The same MouseShortcut should be equals to itself", mouseShortcut, mouseShortcut);
mouseShortcut = new MouseShortcut(MouseEvent.BUTTON1, InputEvent.CTRL_DOWN_MASK, 2);
assertEquals("The same MouseShortcut should be equals to itself", mouseShortcut, mouseShortcut);
}
use of com.intellij.openapi.actionSystem.MouseShortcut in project intellij-community by JetBrains.
the class MouseShortcutEqualityTest method testSubclassesOfMouseEventsAreNotEqualToMouseEvents.
public void testSubclassesOfMouseEventsAreNotEqualToMouseEvents() {
MouseShortcut mouseShortcut = new MouseShortcut(MouseEvent.BUTTON2, InputEvent.ALT_DOWN_MASK, 2);
PressureShortcut pressureShortcut = new PressureShortcut(1);
assertFalse("MouseShortcut is not equal to PressureShortcut", mouseShortcut.equals(pressureShortcut));
assertFalse("MouseShortcut is not equal to PressureShortcut", pressureShortcut.equals(mouseShortcut));
}
Aggregations