int (@NotNull SimpleTextAttributes attributes, boolean isActive) { int linkStyle = attributes.getStyle() & ~SimpleTextAttributes.STYLE_WAVED & ~SimpleTextAttributes.STYLE_BOLD_DOTTED_LINE; if (isActive) { linkStyle |= SimpleTextAttributes.STYLE_UNDERLINE; } else { linkStyle &= ~SimpleTextAttributes.STYLE_UNDERLINE; } return linkStyle; }