예제 #1
0
 private void setTooltip() {
   Tooltip.uninstall(this, tooltip);
   tooltip =
       new Tooltip(
           NbBundle.getMessage(
               this.getClass(), "Timeline.ui.detailview.tooltip.text", formatSpan(getDateTime())));
   Tooltip.install(this, tooltip);
 }
 /**
  * Sets the tooltip text, with the (x, y) location being used for the anchor. If the text is
  * {@code null}, no tooltip will be displayed. This method is intended for calling by the {@link
  * TooltipHandlerFX} class, you won't normally call it directly.
  *
  * @param text the text ({@code null} permitted).
  * @param x the x-coordinate of the mouse pointer.
  * @param y the y-coordinate of the mouse pointer.
  */
 public void setTooltip(String text, double x, double y) {
   if (text != null) {
     if (this.tooltip == null) {
       this.tooltip = new Tooltip(text);
       Tooltip.install(this, this.tooltip);
     } else {
       this.tooltip.setText(text);
       this.tooltip.setAnchorX(x);
       this.tooltip.setAnchorY(y);
     }
   } else {
     Tooltip.uninstall(this, this.tooltip);
     this.tooltip = null;
   }
 }
 /*     */ public void setTooltip(String paramString) /*     */ {
   /*  58 */ WebView localWebView = this.accessor.getView();
   /*  59 */ if (paramString != null) {
     /*  60 */ if (this.tooltip == null) /*  61 */ this.tooltip = new Tooltip(paramString);
     /*     */ else {
       /*  63 */ this.tooltip.setText(paramString);
       /*     */ }
     /*  65 */ if (!this.isTooltipRegistered) {
       /*  66 */ Tooltip.install(localWebView, this.tooltip);
       /*  67 */ this.isTooltipRegistered = true;
       /*     */ }
     /*  69 */ } else if (this.isTooltipRegistered) {
     /*  70 */ Tooltip.uninstall(localWebView, this.tooltip);
     /*  71 */ this.isTooltipRegistered = false;
     /*     */ }
   /*     */ }