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

makeImmutable() method for properties

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Won't Fix
    • Icon: P4 P4
    • None
    • None
    • javafx

      I think, Property interface needs method that will protect value from further rewriting.

      Example, why it can be needed:
      I`m making GraphEditor control, based on the ScrollPane. It contains complex logic for zoomming in/out (that`s why I took ScrollPane), creating, moving, editing and deleting graph nodes. The top ScrollPane contains Pane with a lot of listeners attached to it. There is absolutly no sense in allowing user to reset ScrollPane`s content to something else, but I can`t protect it. The only way I can do it is by adding ChangeListener, which would catch setting events and return initial Pane back.

      P.S. makeImmutable() - is the first name I came up with, there should be better one

            msladecek Martin Sládeček
            duke J. Duke
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: