@Override public boolean isApplicable(PsiFile file, int offset, boolean wrapping) { PostfixTemplatesSettings settings = PostfixTemplatesSettings.getInstance(); if (wrapping || file == null || settings == null || !settings.isPostfixTemplatesEnabled() || PsiUtilCore.getLanguageAtOffset(file, offset) != JavaLanguage.INSTANCE) { return false; } return StringUtil.isNotEmpty( computeTemplateKeyWithoutContextChecking(file.getText(), offset + 1)); }
@Override public char getShortcut() { PostfixTemplatesSettings settings = PostfixTemplatesSettings.getInstance(); return settings != null ? (char) settings.getShortcut() : TemplateSettings.TAB_CHAR; }