void () { super.afterTemplateStart(); TemplateState templateState = TemplateManagerImpl.getTemplateState(myEditor); if (templateState == null) return; TextRange currentVariableRange = templateState.getCurrentVariableRange(); if (currentVariableRange == null) return; final PsiVariable variable = getVariable(); boolean canBeVarType = myCanBeVarType && variable instanceof PsiLocalVariable; if (myCantChangeFinalModifier && !canBeVarType) return; IntroduceVariablePopupComponent popupComponent = new IntroduceVariablePopupComponent(myEditor, myProject, myCantChangeFinalModifier, canBeVarType, getCommandName(), () -> getVariable()); SelectableInlayPresentation presentation = TemplateInlayUtil.createSettingsPresentation((EditorImpl)templateState.getEditor(), popupComponent.logStatisticsOnShowCallback()); TemplateInlayUtil.SelectableTemplateElement templateElement = new TemplateInlayUtil.SelectableTemplateElement(presentation) { @Override public void onSelect(@NotNull TemplateState templateState) { super.onSelect(templateState); popupComponent.logStatisticsOnShow(null); } }; TemplateInlayUtil.createNavigatableButtonWithPopup(templateState, currentVariableRange.getEndOffset(), presentation, popupComponent.createPopupPanel(), templateElement, popupComponent.logStatisticsOnHideCallback()); }