Java 类com.intellij.lang.LanguageCodeInsightActionHandler 实例源码

项目:intellij-ce-playground    文件:PresentableActionHandlerBasedAction.java   
@Nullable
private CodeInsightActionHandler getValidHandler(@NotNull Editor editor, @NotNull PsiFile file) {
  Language language = PsiUtilCore.getLanguageAtOffset(file, editor.getCaretModel().getOffset());
  final CodeInsightActionHandler codeInsightActionHandler = getLanguageExtension().forLanguage(language);
  if (codeInsightActionHandler != null) {
    if (codeInsightActionHandler instanceof LanguageCodeInsightActionHandler) {
      if (((LanguageCodeInsightActionHandler)codeInsightActionHandler).isValidFor(editor, file)) {
        return codeInsightActionHandler;
      }
    }
    else {
      return codeInsightActionHandler;
    }
  }
  return null;
}
项目:intellij-ce-playground    文件:ImplementMethodsHandler.java   
@Override
public final void invoke(@NotNull final Project project, @NotNull final Editor editor, @NotNull PsiFile file) {
  if (!CodeInsightUtilBase.prepareEditorForWrite(editor)) return;
  if (!FileDocumentManager.getInstance().requestWriting(editor.getDocument(), project)){
    return;
  }

  Language language = PsiUtilCore.getLanguageAtOffset(file, editor.getCaretModel().getOffset());
  final LanguageCodeInsightActionHandler codeInsightActionHandler = CodeInsightActions.IMPLEMENT_METHOD.forLanguage(language);
  if (codeInsightActionHandler != null) {
    codeInsightActionHandler.invoke(project, editor, file);
  }
}
项目:intellij-ce-playground    文件:DelegateMethodsAction.java   
@Override
protected boolean isValidForFile(@NotNull Project project, @NotNull Editor editor, @NotNull final PsiFile file) {
  Language language = PsiUtilCore.getLanguageAtOffset(file, editor.getCaretModel().getOffset());
  final LanguageCodeInsightActionHandler codeInsightActionHandler = CodeInsightActions.DELEGATE_METHODS.forLanguage(language);
  if (codeInsightActionHandler != null) {
    return codeInsightActionHandler.isValidFor(editor, file);
  }
  return false;
}
项目:intellij-ce-playground    文件:DelegateMethodsHandler.java   
@Override
public final void invoke(@NotNull final Project project, @NotNull final Editor editor, @NotNull PsiFile file) {
  if (!CodeInsightUtilBase.prepareEditorForWrite(editor)) return;
  if (!FileDocumentManager.getInstance().requestWriting(editor.getDocument(), project)){
    return;
  }

  Language language = PsiUtilCore.getLanguageAtOffset(file, editor.getCaretModel().getOffset());
  final LanguageCodeInsightActionHandler codeInsightActionHandler = CodeInsightActions.DELEGATE_METHODS.forLanguage(language);
  if (codeInsightActionHandler != null) {
    codeInsightActionHandler.invoke(project, editor, file);
  }
}
项目:intellij-ce-playground    文件:OverrideMethodsHandler.java   
@Override
public final void invoke(@NotNull final Project project, @NotNull final Editor editor, @NotNull PsiFile file) {
  if (!CodeInsightUtilBase.prepareEditorForWrite(editor)) return;
  if (!FileDocumentManager.getInstance().requestWriting(editor.getDocument(), project)){
    return;
  }

  Language language = PsiUtilCore.getLanguageAtOffset(file, editor.getCaretModel().getOffset());
  final LanguageCodeInsightActionHandler codeInsightActionHandler = CodeInsightActions.OVERRIDE_METHOD.forLanguage(language);
  if (codeInsightActionHandler != null) {
    codeInsightActionHandler.invoke(project, editor, file);
  }
}
项目:tools-idea    文件:ImplementMethodsHandler.java   
@Override
public final void invoke(@NotNull final Project project, @NotNull final Editor editor, @NotNull PsiFile file) {
  if (!CodeInsightUtilBase.prepareEditorForWrite(editor)) return;
  if (!FileDocumentManager.getInstance().requestWriting(editor.getDocument(), project)){
    return;
  }

  Language language = PsiUtilBase.getLanguageAtOffset(file, editor.getCaretModel().getOffset());
  final LanguageCodeInsightActionHandler codeInsightActionHandler = CodeInsightActions.IMPLEMENT_METHOD.forLanguage(language);
  if (codeInsightActionHandler != null) {
    codeInsightActionHandler.invoke(project, editor, file);
  }
}
项目:tools-idea    文件:DelegateMethodsAction.java   
@Override
protected boolean isValidForFile(@NotNull Project project, @NotNull Editor editor, @NotNull final PsiFile file) {
  Language language = PsiUtilBase.getLanguageAtOffset(file, editor.getCaretModel().getOffset());
  final LanguageCodeInsightActionHandler codeInsightActionHandler = CodeInsightActions.DELEGATE_METHODS.forLanguage(language);
  if (codeInsightActionHandler != null) {
    return codeInsightActionHandler.isValidFor(editor, file);
  }
  return false;
}
项目:tools-idea    文件:OverrideMethodsAction.java   
@Override
protected boolean isValidForFile(@NotNull Project project, @NotNull Editor editor, @NotNull final PsiFile file) {
  Language language = PsiUtilBase.getLanguageAtOffset(file, editor.getCaretModel().getOffset());
  final LanguageCodeInsightActionHandler codeInsightActionHandler = CodeInsightActions.OVERRIDE_METHOD.forLanguage(language);
  if (codeInsightActionHandler != null) {
    return codeInsightActionHandler.isValidFor(editor, file);
  }
  return false;
}
项目:tools-idea    文件:DelegateMethodsHandler.java   
@Override
public final void invoke(@NotNull final Project project, @NotNull final Editor editor, @NotNull PsiFile file) {
  if (!CodeInsightUtilBase.prepareEditorForWrite(editor)) return;
  if (!FileDocumentManager.getInstance().requestWriting(editor.getDocument(), project)){
    return;
  }

  Language language = PsiUtilBase.getLanguageAtOffset(file, editor.getCaretModel().getOffset());
  final LanguageCodeInsightActionHandler codeInsightActionHandler = CodeInsightActions.DELEGATE_METHODS.forLanguage(language);
  if (codeInsightActionHandler != null) {
    codeInsightActionHandler.invoke(project, editor, file);
  }
}
项目:tools-idea    文件:OverrideMethodsHandler.java   
@Override
public final void invoke(@NotNull final Project project, @NotNull final Editor editor, @NotNull PsiFile file) {
  if (!CodeInsightUtilBase.prepareEditorForWrite(editor)) return;
  if (!FileDocumentManager.getInstance().requestWriting(editor.getDocument(), project)){
    return;
  }

  Language language = PsiUtilBase.getLanguageAtOffset(file, editor.getCaretModel().getOffset());
  final LanguageCodeInsightActionHandler codeInsightActionHandler = CodeInsightActions.OVERRIDE_METHOD.forLanguage(language);
  if (codeInsightActionHandler != null) {
    codeInsightActionHandler.invoke(project, editor, file);
  }
}
项目:consulo    文件:ImplementMethodsHandler.java   
@RequiredDispatchThread
@Override
public final void invoke(@Nonnull final Project project, @Nonnull final Editor editor, @Nonnull PsiFile file) {
  if (!CodeInsightUtilBase.prepareEditorForWrite(editor)) return;
  if (!FileDocumentManager.getInstance().requestWriting(editor.getDocument(), project)){
    return;
  }

  Language language = PsiUtilCore.getLanguageAtOffset(file, editor.getCaretModel().getOffset());
  final LanguageCodeInsightActionHandler codeInsightActionHandler = CodeInsightActions.IMPLEMENT_METHOD.forLanguage(language);
  if (codeInsightActionHandler != null) {
    codeInsightActionHandler.invoke(project, editor, file);
  }
}
项目:consulo    文件:DelegateMethodsAction.java   
@Override
protected boolean isValidForFile(@Nonnull Project project, @Nonnull Editor editor, @Nonnull final PsiFile file) {
  Language language = PsiUtilCore.getLanguageAtOffset(file, editor.getCaretModel().getOffset());
  final LanguageCodeInsightActionHandler codeInsightActionHandler = CodeInsightActions.DELEGATE_METHODS.forLanguage(language);
  if (codeInsightActionHandler != null) {
    return codeInsightActionHandler.isValidFor(editor, file);
  }
  return false;
}
项目:consulo    文件:OverrideMethodsAction.java   
@Override
protected boolean isValidForFile(@Nonnull Project project, @Nonnull Editor editor, @Nonnull final PsiFile file) {
  Language language = PsiUtilCore.getLanguageAtOffset(file, editor.getCaretModel().getOffset());
  final LanguageCodeInsightActionHandler codeInsightActionHandler = CodeInsightActions.OVERRIDE_METHOD.forLanguage(language);
  if (codeInsightActionHandler != null) {
    return codeInsightActionHandler.isValidFor(editor, file);
  }
  return false;
}
项目:consulo    文件:DelegateMethodsHandler.java   
@RequiredDispatchThread
@Override
public final void invoke(@Nonnull final Project project, @Nonnull final Editor editor, @Nonnull PsiFile file) {
  if (!CodeInsightUtilBase.prepareEditorForWrite(editor)) return;
  if (!FileDocumentManager.getInstance().requestWriting(editor.getDocument(), project)){
    return;
  }

  Language language = PsiUtilCore.getLanguageAtOffset(file, editor.getCaretModel().getOffset());
  final LanguageCodeInsightActionHandler codeInsightActionHandler = CodeInsightActions.DELEGATE_METHODS.forLanguage(language);
  if (codeInsightActionHandler != null) {
    codeInsightActionHandler.invoke(project, editor, file);
  }
}
项目:consulo    文件:OverrideMethodsHandler.java   
@RequiredDispatchThread
@Override
public final void invoke(@Nonnull final Project project, @Nonnull final Editor editor, @Nonnull PsiFile file) {
  if (!CodeInsightUtilBase.prepareEditorForWrite(editor)) return;
  if (!FileDocumentManager.getInstance().requestWriting(editor.getDocument(), project)){
    return;
  }

  Language language = PsiUtilCore.getLanguageAtOffset(file, editor.getCaretModel().getOffset());
  final LanguageCodeInsightActionHandler codeInsightActionHandler = CodeInsightActions.OVERRIDE_METHOD.forLanguage(language);
  if (codeInsightActionHandler != null) {
    codeInsightActionHandler.invoke(project, editor, file);
  }
}
项目:intellij-ce-playground    文件:ImplementMethodsAction.java   
@NotNull
@Override
protected LanguageExtension<LanguageCodeInsightActionHandler> getLanguageExtension() {
  return CodeInsightActions.IMPLEMENT_METHOD;
}
项目:intellij-ce-playground    文件:OverrideMethodsAction.java   
@NotNull
@Override
protected LanguageExtension<LanguageCodeInsightActionHandler> getLanguageExtension() {
  return CodeInsightActions.OVERRIDE_METHOD;
}
项目:tools-idea    文件:ImplementMethodsAction.java   
@Override
protected boolean isValidForFile(@NotNull Project project, @NotNull Editor editor, @NotNull final PsiFile file) {
  final Language language = PsiUtilBase.getLanguageAtOffset(file, editor.getCaretModel().getOffset());
  final LanguageCodeInsightActionHandler codeInsightActionHandler = CodeInsightActions.IMPLEMENT_METHOD.forLanguage(language);
  return codeInsightActionHandler != null && codeInsightActionHandler.isValidFor(editor, file);
}
项目:consulo    文件:ImplementMethodsAction.java   
@Override
protected boolean isValidForFile(@Nonnull Project project, @Nonnull Editor editor, @Nonnull final PsiFile file) {
  final Language language = PsiUtilCore.getLanguageAtOffset(file, editor.getCaretModel().getOffset());
  final LanguageCodeInsightActionHandler codeInsightActionHandler = CodeInsightActions.IMPLEMENT_METHOD.forLanguage(language);
  return codeInsightActionHandler != null && codeInsightActionHandler.isValidFor(editor, file);
}