use of il.org.spartan.Leonidas.plugin.utils.logging.Logger in project Main by SpartanRefactoring.
the class SpartanizerAnnotator method annotate.
@Override
public void annotate(@NotNull final PsiElement e, @NotNull AnnotationHolder h) {
try {
if (!Spartanizer.canTip(e) || e.getContainingFile().getName().contains("Spartanizer"))
return;
Annotation annotation = h.createInfoAnnotation(e, "Spartanize This!");
annotation.registerFix(new IntentionAction() {
@SuppressWarnings("unchecked")
@Nls
@NotNull
@Override
public String getText() {
return Toolbox.getInstance().getTipper(e).description(e);
}
@Nls
@NotNull
@Override
public String getFamilyName() {
return "SpartanizerAction";
}
@Override
public boolean isAvailable(@NotNull Project __, Editor e, PsiFile f) {
return true;
}
@Override
public void invoke(@NotNull Project p, Editor ed, PsiFile f) throws IncorrectOperationException {
Spartanizer.spartanizeElement(e);
}
@Override
public boolean startInWriteAction() {
return false;
}
});
TextAttributesKey.createTextAttributesKey("");
annotation.setEnforcedTextAttributes((new TextAttributes(null, null, JBColor.BLUE, EffectType.WAVE_UNDERSCORE, 0)));
} catch (Throwable t) {
Logger l = new Logger(this.getClass());
l.error("", t);
}
}
Aggregations