Skip to content

Instantly share code, notes, and snippets.

@Centaur
Created July 27, 2013 13:46
Show Gist options
  • Save Centaur/6094927 to your computer and use it in GitHub Desktop.
Save Centaur/6094927 to your computer and use it in GitHub Desktop.
Inherit Parent
package net.oschina.oldpig
import javafx.scene.{Node, Parent}
object InheritParent {
implicit class SParent[T <: Parent](parent: T) extends Parent {
// override protected def getChildren = parent.getChildren
def apply(children: Seq[Node]) = {
println(children)
parent.getChildren.addAll(children: _*)
println(parent.getChildren)
parent
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment