Lines 379-389
Link Here
|
379 |
extent.x = Math.max(extent.x, e.x); |
379 |
extent.x = Math.max(extent.x, e.x); |
380 |
} |
380 |
} |
381 |
} |
381 |
} |
382 |
if (appToolTipText == null) { |
382 |
|
383 |
super.setToolTipText(text); |
383 |
internalSetTooltipText(text, appToolTipText); |
384 |
} |
|
|
385 |
} else { |
384 |
} else { |
386 |
super.setToolTipText(appToolTipText); |
385 |
internalSetTooltipText(null, appToolTipText); |
387 |
} |
386 |
} |
388 |
|
387 |
|
389 |
// determine horizontal position |
388 |
// determine horizontal position |
Lines 500-505
Link Here
|
500 |
} |
499 |
} |
501 |
} |
500 |
} |
502 |
/** |
501 |
/** |
|
|
502 |
* Allows to define a custom way of handling tooltips. |
503 |
* |
504 |
* @param text label's text if it is not completely visible, null otherwise |
505 |
* @param appTooltipText tooltip set by the application |
506 |
*/ |
507 |
protected void internalSetTooltipText(String text, String appTooltipText) { |
508 |
if (appTooltipText != null) |
509 |
super.setToolTipText(appTooltipText); |
510 |
else |
511 |
super.setToolTipText(text); |
512 |
} |
513 |
/** |
503 |
* Paint the Label's border. |
514 |
* Paint the Label's border. |
504 |
*/ |
515 |
*/ |
505 |
private void paintBorder(GC gc, Rectangle r) { |
516 |
private void paintBorder(GC gc, Rectangle r) { |
Lines 744-751
Link Here
|
744 |
} |
755 |
} |
745 |
} |
756 |
} |
746 |
public void setToolTipText (String string) { |
757 |
public void setToolTipText (String string) { |
747 |
super.setToolTipText (string); |
758 |
internalSetTooltipText(null, string); |
748 |
appToolTipText = super.getToolTipText(); |
759 |
appToolTipText = string; // super.getToolTipText(); |
749 |
} |
760 |
} |
750 |
/** |
761 |
/** |
751 |
* Shorten the given text <code>t</code> so that its length doesn't exceed |
762 |
* Shorten the given text <code>t</code> so that its length doesn't exceed |