Constructors for Bindings that take the bind() parameters

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Won't Fix
    • Priority: P4
    • None
    • Affects Version/s: fx2.1
    • Component/s: javafx
    • Environment:

      Any

      To make the use of (usually) StringBinding a bit less cumbersum, please consider making it possible to provide the parameters for bind() in the constructor, like this:

      new StringBinding(volumeProperty()) {
        protected String computeValue() {
          return "" + getVolume() + "%";
        }
      }

      Although I suppose this comes close, but just look ugly:

      new StringBinding() { { bind(volumeProperty()); }
        protected String computeValue() {
          return "" + getVolume() + "%";
        }
      }

      There's probably a good reason why it was never considered, but I couldn't find a related issue. I know of Bindings.createStringBinding(), but unfortunately, its parameters are in the "wrong" order which makes code look odd when the anonymous inner class is not the last parameter...

            Assignee:
            Michael Heinrichs (Inactive)
            Reporter:
            John Hendrikx
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: