void (JComponent component, IdeTooltip tooltip) { component.putClientProperty(CUSTOM_TOOLTIP, tooltip); // We need to register a dummy mouse listener to make sure events will be generated for this specific component, not its parent component.removeMouseListener(DUMMY_LISTENER); component.removeMouseMotionListener(DUMMY_LISTENER); if (tooltip != null) { component.addMouseListener(DUMMY_LISTENER); component.addMouseMotionListener(DUMMY_LISTENER); } }