void (@NotNull HintLabel label, @Nullable HyperlinkListener hyperlinkListener, @Nullable MouseListener mouseListener, @Nullable Ref<? super Consumer<@Nls String>> updatedTextConsumer) { if (hyperlinkListener != null) { label.myPane.addHyperlinkListener(hyperlinkListener); } if (mouseListener != null) { label.myPane.addMouseListener(mouseListener); } if (updatedTextConsumer != null) { Consumer<@Nls String> consumer = s -> { label.myPane.setText(s); // Force preferred size recalculation. label.setPreferredSize(null); label.myPane.setPreferredSize(null); }; updatedTextConsumer.set(consumer); } }