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

项目:intellij-ce-playground    文件:GotoSuperAction.java   
@Override
public void invoke(@NotNull final Project project, @NotNull final Editor editor, @NotNull final PsiFile file) {
  PsiDocumentManager.getInstance(project).commitAllDocuments();

  int offset = editor.getCaretModel().getOffset();
  final Language language = PsiUtilCore.getLanguageAtOffset(file, offset);

  final CodeInsightActionHandler codeInsightActionHandler = CodeInsightActions.GOTO_SUPER.forLanguage(language);
  if (codeInsightActionHandler != null) {
    DumbService.getInstance(project).withAlternativeResolveEnabled(new Runnable() {
      @Override
      public void run() {
        codeInsightActionHandler.invoke(project, editor, file);
      }
    });
  }
}
项目:intellij-ce-playground    文件:GotoSuperAction.java   
@Override
public void update(final AnActionEvent event) {
  if (CodeInsightActions.GOTO_SUPER.hasAnyExtensions()) {
    event.getPresentation().setVisible(true);
    super.update(event);
  }
  else {
    event.getPresentation().setVisible(false);
  }
}
项目: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    文件:DelegateMethodsAction.java   
@Override
public void update(final AnActionEvent event) {
  if (CodeInsightActions.DELEGATE_METHODS.hasAnyExtensions()) {
    event.getPresentation().setVisible(true);
    super.update(event);
  }
  else {
    event.getPresentation().setVisible(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);
  }
}
项目:intellij-ce-playground    文件:GroovyGoToSuperTest.java   
private void doTest() throws Throwable {
  final List<String> data = TestUtils.readInput(getTestDataPath() + getTestName(true) + ".test");
  myFixture.configureByText(GroovyFileType.GROOVY_FILE_TYPE, data.get(0));
  final CodeInsightActionHandler handler = CodeInsightActions.GOTO_SUPER.forLanguage(GroovyLanguage.INSTANCE);
  handler.invoke(getProject(), myFixture.getEditor(), myFixture.getFile());

  myFixture.checkResult(data.get(1));
}
项目:tools-idea    文件:GotoSuperAction.java   
@Override
public void invoke(@NotNull final Project project, @NotNull Editor editor, @NotNull PsiFile file) {
  PsiDocumentManager.getInstance(project).commitAllDocuments();

  int offset = editor.getCaretModel().getOffset();
  final Language language = PsiUtilBase.getLanguageAtOffset(file, offset);

  final CodeInsightActionHandler codeInsightActionHandler = CodeInsightActions.GOTO_SUPER.forLanguage(language);
  if (codeInsightActionHandler != null) {
    codeInsightActionHandler.invoke(project, editor, file);
  }
}
项目:tools-idea    文件:GotoSuperAction.java   
@Override
public void update(final AnActionEvent event) {
  if (CodeInsightActions.GOTO_SUPER.hasAnyExtensions()) {
    event.getPresentation().setVisible(true);
    super.update(event);
  }
  else {
    event.getPresentation().setVisible(false);
  }
}
项目: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    文件:ImplementMethodsAction.java   
@Override
public void update(final AnActionEvent event) {
  if (CodeInsightActions.IMPLEMENT_METHOD.hasAnyExtensions()) {
    event.getPresentation().setVisible(true);
    super.update(event);
  }
  else {
    event.getPresentation().setVisible(false);
  }
}
项目: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    文件:DelegateMethodsAction.java   
@Override
public void update(final AnActionEvent event) {
  if (CodeInsightActions.DELEGATE_METHODS.hasAnyExtensions()) {
    event.getPresentation().setVisible(true);
    super.update(event);
  }
  else {
    event.getPresentation().setVisible(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    文件:OverrideMethodsAction.java   
@Override
public void update(final AnActionEvent event) {
  if (CodeInsightActions.OVERRIDE_METHOD.hasAnyExtensions()) {
    event.getPresentation().setVisible(true);
    super.update(event);
  }
  else {
    event.getPresentation().setVisible(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);
  }
}
项目:tools-idea    文件:GroovyGoToSuperTest.java   
private void doTest() throws Throwable {
  final List<String> data = TestUtils.readInput(getTestDataPath() + getTestName(true) + ".test");
  myFixture.configureByText(GroovyFileType.GROOVY_FILE_TYPE, data.get(0));
  final CodeInsightActionHandler handler = CodeInsightActions.GOTO_SUPER.forLanguage(GroovyFileType.GROOVY_LANGUAGE);
  handler.invoke(getProject(), myFixture.getEditor(), myFixture.getFile());

  myFixture.checkResult(data.get(1));
}
项目:consulo    文件:GotoSuperAction.java   
@RequiredDispatchThread
@Override
public void invoke(@Nonnull final Project project, @Nonnull Editor editor, @Nonnull PsiFile file) {
  PsiDocumentManager.getInstance(project).commitAllDocuments();

  int offset = editor.getCaretModel().getOffset();
  final Language language = PsiUtilCore.getLanguageAtOffset(file, offset);

  final CodeInsightActionHandler codeInsightActionHandler = CodeInsightActions.GOTO_SUPER.forLanguage(language);
  if (codeInsightActionHandler != null) {
    codeInsightActionHandler.invoke(project, editor, file);
  }
}
项目:consulo    文件:GotoSuperAction.java   
@RequiredDispatchThread
@Override
public void update(final AnActionEvent event) {
  if (CodeInsightActions.GOTO_SUPER.hasAnyExtensions()) {
    event.getPresentation().setVisible(true);
    super.update(event);
  }
  else {
    event.getPresentation().setVisible(false);
  }
}
项目: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    文件:ImplementMethodsAction.java   
@RequiredDispatchThread
@Override
public void update(final AnActionEvent event) {
  if (CodeInsightActions.IMPLEMENT_METHOD.hasAnyExtensions()) {
    event.getPresentation().setVisible(true);
    super.update(event);
  }
  else {
    event.getPresentation().setVisible(false);
  }
}
项目: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    文件:DelegateMethodsAction.java   
@RequiredDispatchThread
@Override
public void update(final AnActionEvent event) {
  if (CodeInsightActions.DELEGATE_METHODS.hasAnyExtensions()) {
    event.getPresentation().setVisible(true);
    super.update(event);
  }
  else {
    event.getPresentation().setVisible(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    文件:OverrideMethodsAction.java   
@RequiredDispatchThread
@Override
public void update(final AnActionEvent event) {
  if (CodeInsightActions.OVERRIDE_METHOD.hasAnyExtensions()) {
    event.getPresentation().setVisible(true);
    super.update(event);
  }
  else {
    event.getPresentation().setVisible(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    文件:JavaGotoSuperTest.java   
private void doTest() {
  configureByFile(getBasePath() + getTestName(false) + ".java");
  final CodeInsightActionHandler handler = CodeInsightActions.GOTO_SUPER.forLanguage(JavaLanguage.INSTANCE);
  handler.invoke(getProject(), getEditor(), getFile());
  checkResultByFile(getBasePath() + getTestName(false) + ".after.java");
}
项目:intellij-ce-playground    文件:GotoSuperAction.java   
@NotNull
@Override
protected LanguageExtension<CodeInsightActionHandler> getLanguageExtension() {
  return CodeInsightActions.GOTO_SUPER;
}
项目: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);
}
项目:intellij-haxe    文件:HaxeGoToSuperTest.java   
private void doTest() throws Throwable {
  myFixture.configureByFile(getTestName(false) + ".hx");
  final CodeInsightActionHandler handler = CodeInsightActions.GOTO_SUPER.forLanguage(HaxeLanguage.INSTANCE);
  handler.invoke(getProject(), myFixture.getEditor(), myFixture.getFile());
  myFixture.checkResultByFile(getTestName(false) + ".txt");
}
项目:consulo-haxe    文件:HaxeGoToSuperTest.java   
private void doTest() throws Throwable {
  myFixture.configureByFile(getTestName(false) + ".hx");
  final CodeInsightActionHandler handler = CodeInsightActions.GOTO_SUPER.forLanguage(HaxeLanguage.INSTANCE);
  handler.invoke(getProject(), myFixture.getEditor(), myFixture.getFile());
  myFixture.checkResultByFile(getTestName(false) + ".txt");
}
项目: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);
}