/** * Show the given tooltip on the component with the given anchorKey with the specified offsets * from the given position. * * @deprecated * @see {{@link #showTooltip(ComponentContext, LithoTooltip, String, int, int)}} */ @Deprecated public static void showTooltip( ComponentContext c, DeprecatedLithoTooltip tooltip, String anchorKey, TooltipPosition tooltipPosition, int xOffset, int yOffset) { final ComponentTree componentTree = c.getComponentTree(); final Component rootComponent = c.getComponentScope(); if (componentTree == null) { return; } final String anchorGlobalKey = rootComponent == null ? anchorKey : ComponentKeyUtils.getKeyWithSeparator(rootComponent.getGlobalKey(), anchorKey); componentTree.showTooltip(tooltip, anchorGlobalKey, tooltipPosition, xOffset, yOffset); }
/** * Show the given tooltip on the component with the given anchorKey. * * @param c * @param lithoTooltip A {@link LithoTooltip} implementation to be shown on the anchor. * @param anchorKey key of the Litho Component that will be used as anchor * @param xOffset horizontal offset from default position where the tooltip shows. * @param yOffset vertical offset from default position where the tooltip shows. */ public static void showTooltip( ComponentContext c, LithoTooltip lithoTooltip, String anchorKey, int xOffset, int yOffset) { final ComponentTree componentTree = c.getComponentTree(); final Component rootComponent = c.getComponentScope(); if (componentTree == null || componentTree.isReleased() || !componentTree.hasMounted()) { return; } final String anchorGlobalKey = rootComponent == null ? anchorKey : ComponentKeyUtils.getKeyWithSeparator(rootComponent.getGlobalKey(), anchorKey); componentTree.showTooltip(lithoTooltip, anchorGlobalKey, xOffset, yOffset); }