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

Preserving fx:id on copy/paste and dealing with duplicate fx:id

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P2 P2
    • 8
    • 7u40
    • javafx
    • None

      SB1.1 Has two drawbacks concerning this subject.

      1. When you copy Button(fx:id: myButton) and paste into a new document the fx:id is lost which is unhelpful because:
      - The fx:id is lost silently so the user may not notice, causing attached logic to fail
      - We cause unwanted work for the user as they need to investigate and restore every fx:id that was lost

      2. When you copy and paste Button(fx:id: myButton) into the same document the fx:id is lost.
      - Again, the fx:id is removed silently from the pasted node

      I propose the following:

      Button (fx:id: myButton) in Clipboard
      User pastes into Document
      Does the fx:id: myButton already exist?
      - No: Button (fx:id: myButton) is pasted
      - Yes: Button (fx:id: myButton-1) is pasted and Info bar shows warning: “The fx:id myButton already exists - renamed to myButton-1”

            eleponn Eric Le Ponner
            mchicharro Moises Chicharro
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: