modules/controls/src/main/java/javafx/scene/control/skin/TooltipSkin.java

Print this page
rev 9240 : 8076423: JEP 253: Prepare JavaFX UI Controls & CSS APIs for Modularization

*** 21,31 **** * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. */ ! package com.sun.javafx.scene.control.skin; import javafx.scene.Node; import javafx.scene.control.Label; import javafx.scene.control.Skin; import javafx.scene.control.Tooltip; --- 21,31 ---- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. */ ! package javafx.scene.control.skin; import javafx.scene.Node; import javafx.scene.control.Label; import javafx.scene.control.Skin; import javafx.scene.control.Tooltip;
*** 36,49 **** --- 36,67 ---- * implements some of the Skin interface methods. * * TooltipContent class is the actual skin implementation of the tooltip. */ public class TooltipSkin implements Skin<Tooltip> { + + /*************************************************************************** + * * + * Private fields * + * * + **************************************************************************/ + private Label tipLabel; private Tooltip tooltip; + + + /*************************************************************************** + * * + * Constructors * + * * + **************************************************************************/ + + /** + * Creates a new TooltipSkin instance for the given {@link Tooltip}. + */ public TooltipSkin(Tooltip t) { this.tooltip = t; tipLabel = new Label(); tipLabel.contentDisplayProperty().bind(t.contentDisplayProperty()); tipLabel.fontProperty().bind(t.fontProperty());
*** 66,83 **** --- 84,112 ---- tipLabel.getStyleClass().setAll(t.getStyleClass()); tipLabel.setStyle(t.getStyle()); tipLabel.setId(t.getId()); } + + + /*************************************************************************** + * * + * Public API * + * * + **************************************************************************/ + + /** {@inheritDoc} */ @Override public Tooltip getSkinnable() { return tooltip; } + /** {@inheritDoc} */ @Override public Node getNode() { return tipLabel; } + /** {@inheritDoc} */ @Override public void dispose() { tooltip = null; tipLabel = null; } }