Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8329293

Labeled: textTruncated property

XMLWordPrintable

    • Icon: CSR CSR
    • Resolution: Approved
    • Icon: P3 P3
    • jfx23
    • javafx
    • None
    • source
    • minimal
    • Might present compatibility risk when the application code extends Labeled control or its descendants and declares either a property with the same name, or adds methods with the same signature.
    • Java API
    • JDK

      Summary

      Adds Labeled.textTruncated property which indicates when the text is visually truncated in order to fit the available width.

      Problem

      Customers expressed desire to be able to show a tooltip when the text is truncated in a table or a similar situation. There is currently no public API to achieve that goal.

      Solution

      The solution is to add a read-only boolean property which indicates the condition.

      Specification

      +    /**
      +     * Indicates whether the text has been truncated
      +     * because it cannot fit into the available width.
      +     * <p>
      +     * When truncated, the {@link #ellipsisStringProperty() ellipsisString}
      +     * gets inserted in the place dictated by the
      +     * {@link #textOverrunProperty textOverrun} property.
      +     *
      +     * @since 23
      +     */
      +    public final ReadOnlyBooleanProperty textTruncatedProperty() {
      +
      +    public final boolean isTextTruncated() {

            angorya Andy Goryachev
            swpalmer Scott Palmer
            Kevin Rushforth
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: