void () { myParent.clearOwnActionsIds(); myChild.clearOwnActionsIds(); String BASE = "BASE_ACTION"; String DEPENDENT = "DEPENDENT_ACTION"; KeymapManagerEx.getInstanceEx().bindShortcuts(BASE, DEPENDENT); try { myParent.addShortcut(BASE, shortcut1); myParent.addShortcut(BASE, shortcut2); assertTrue(myParent.hasOwnActionId(BASE)); assertSameElements(myParent.getShortcuts(BASE), shortcut1, shortcut2); assertFalse(myChild.hasOwnActionId(BASE)); assertSameElements(myChild.getShortcuts(BASE), shortcut1, shortcut2); assertFalse(myChild.hasOwnActionId(DEPENDENT)); assertSameElements(myChild.getShortcuts(DEPENDENT), shortcut1, shortcut2); // child::BASE don't have it's own mapping myChild.removeShortcut(DEPENDENT, shortcut1); assertFalse(myChild.hasOwnActionId(BASE)); assertSameElements(myChild.getShortcuts(BASE), shortcut1, shortcut2); assertTrue(myChild.hasOwnActionId(DEPENDENT)); assertSameElements(myChild.getShortcuts(DEPENDENT), shortcut2); myChild.clearOwnActionsIds(); // child::BASE has it's own mapping myChild.addShortcut(BASE, shortcutA); assertTrue(myChild.hasOwnActionId(BASE)); assertSameElements(myChild.getShortcuts(BASE), shortcut1, shortcut2, shortcutA); assertFalse(myChild.hasOwnActionId(DEPENDENT)); assertSameElements(myChild.getShortcuts(DEPENDENT), shortcut1, shortcut2, shortcutA); myChild.removeShortcut(DEPENDENT, shortcut1); assertTrue(myChild.hasOwnActionId(BASE)); assertSameElements(myChild.getShortcuts(BASE), shortcut1, shortcut2, shortcutA); assertTrue(myChild.hasOwnActionId(DEPENDENT)); assertSameElements(myChild.getShortcuts(DEPENDENT), shortcut2, shortcutA); } finally { KeymapManagerEx.getInstanceEx().unbindShortcuts(DEPENDENT); } }