Created
July 27, 2013 13:46
-
-
Save Centaur/6094927 to your computer and use it in GitHub Desktop.
Inherit Parent
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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