private void performAction(
     final String fileName, final EditorActionHandler handler, final String afterFileName)
     throws Exception {
   configureByFile(fileName);
   final boolean enabled = handler.isEnabled(myEditor, null);
   assertEquals(
       "not enabled for " + afterFileName,
       new File(getTestDataPath(), afterFileName).exists(),
       enabled);
   if (enabled) {
     handler.execute(myEditor, null);
     checkResultByFile(afterFileName);
   }
 }
 @Override
 public boolean isEnabled(Editor editor, DataContext dataContext) {
   LookupImpl lookup = (LookupImpl) LookupManager.getActiveLookup(editor);
   return lookup != null || myOriginalHandler.isEnabled(editor, dataContext);
 }
 @Override
 public boolean isEnabled(Editor editor, DataContext dataContext) {
   return myOriginalHandler.isEnabled(editor, dataContext);
 }
Exemplo n.º 4
0
 @Override
 public boolean isEnabledForCaret(
     @NotNull Editor editor, @NotNull Caret caret, DataContext dataContext) {
   return myOriginalHandler.isEnabled(editor, caret, dataContext);
 }