コード例 #1
0
  @Override
  public void update(AnActionEvent e) {
    final DataContext context = e.getDataContext();

    final DataContext patchedContext =
        new DataContext() {
          @Override
          public Object getData(@NonNls String dataId) {
            final Object data = context.getData(dataId);
            if (data != null) {
              return data;
            }
            if (LangDataKeys.PSI_ELEMENT.is(dataId)) {
              return getComponentTag(context);
            }
            return null;
          }
        };
    super.update(
        new AnActionEvent(
            e.getInputEvent(),
            patchedContext,
            e.getPlace(),
            e.getPresentation(),
            e.getActionManager(),
            e.getModifiers()));
  }
コード例 #2
0
 private AnActionEvent stopConsole(AnActionEvent e) {
   if (myPydevConsoleCommunication != null) {
     e =
         new AnActionEvent(
             e.getInputEvent(),
             e.getDataContext(),
             e.getPlace(),
             e.getPresentation(),
             e.getActionManager(),
             e.getModifiers());
     try {
       closeCommunication();
       // waiting for REPL communication before destroying process handler
       Thread.sleep(300);
     } catch (Exception ignored) {
       // Ignore
     }
   }
   return e;
 }