@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); } }); } }
@Override public void update(final AnActionEvent event) { if (CodeInsightActions.GOTO_SUPER.hasAnyExtensions()) { event.getPresentation().setVisible(true); super.update(event); } else { event.getPresentation().setVisible(false); } }
@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); } }
@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; }
@Override public void update(final AnActionEvent event) { if (CodeInsightActions.DELEGATE_METHODS.hasAnyExtensions()) { event.getPresentation().setVisible(true); super.update(event); } else { event.getPresentation().setVisible(false); } }
@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); } }
@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); } }
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)); }
@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); } }
@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); } }
@Override public void update(final AnActionEvent event) { if (CodeInsightActions.IMPLEMENT_METHOD.hasAnyExtensions()) { event.getPresentation().setVisible(true); super.update(event); } else { event.getPresentation().setVisible(false); } }
@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; }
@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; }
@Override public void update(final AnActionEvent event) { if (CodeInsightActions.OVERRIDE_METHOD.hasAnyExtensions()) { event.getPresentation().setVisible(true); super.update(event); } else { event.getPresentation().setVisible(false); } }
@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); } }
@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); } }
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)); }
@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); } }
@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); } }
@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); } }
@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); } }
@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; }
@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); } }
@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; }
@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); } }
@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); } }
@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); } }
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"); }
@NotNull @Override protected LanguageExtension<CodeInsightActionHandler> getLanguageExtension() { return CodeInsightActions.GOTO_SUPER; }
@NotNull @Override protected LanguageExtension<LanguageCodeInsightActionHandler> getLanguageExtension() { return CodeInsightActions.IMPLEMENT_METHOD; }
@NotNull @Override protected LanguageExtension<LanguageCodeInsightActionHandler> getLanguageExtension() { return CodeInsightActions.OVERRIDE_METHOD; }
@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); }
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"); }
@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); }