title: Passing parameters to custom TreeItem constructor
body: <p>Relatively new to Scala and ScalaFX but I've worked with Java and JavaFX before. My question is if there is a way to pass parameters to a custom TreeItem?</p>
  
  <p>Code looks like this:</p>
  
  <p>I'd like to do this:</p>
  
  <pre><code>def makePictureHolder(picture: Picture): TreeItem[Picture] = {
      new TemporaryHolderTreeItem(picture)
    }
  </code></pre>
  
  <p>With this:</p>
  
  <pre><code>class TemporaryHolderTreeItem extends TreeItem[Picture] {
  
    private val gridPane = new GridPane
    private val progressBar = new ProgressBar {
      prefWidth = 250
    }
    private val columnConstraints = ObservableBuffer(
      new ColumnConstraints(500),
      new ColumnConstraints(250)
    )
  
    def this(picture: Picture) = this() {
      value = picture
  
      gridPane.addColumn(0, new Label(resourceBundle
        .getString("uploadHolderText") + " " + picture.path))
  
      gridPane.addColumn(1, progressBar)
  
      gridPane.columnConstraints = columnConstraints
      graphic = gridPane
    }
  } 
  </code></pre>
  
  <p>But I get this error message:</p>
  
  <pre><code>TemporaryHolderTreeItem.scala:24: com.nodefactory.diehard.gail.views.TemporaryHolderTreeItem does not take parameters
  [error]   def this(picture: Picture) = this() {
  [error]             
  </code></pre>
  
  <p>I tried placing the parameter picture in the class argument list but that does not work either.
  Like this:</p>
  
  <pre><code>class TemporaryHolderTreeItem(picture: Picture) extends TreeItem[Picture](picture) {
  
    private val gridPane = new GridPane
    private val progressBar = new ProgressBar {
      prefWidth = 250
    }
    private val columnConstraints = ObservableBuffer(
      new ColumnConstraints(500),
      new ColumnConstraints(250)
    )
  
    def this() = this() {
      gridPane.addColumn(0, new Label(resourceBundle
        .getString("uploadHolderText") + " " + picture.path))
  
      gridPane.addColumn(1, progressBar)
  
      gridPane.columnConstraints = columnConstraints
      graphic = gridPane
    }
  }
  </code></pre>
  
  <p>Same error message as above.               </p>