Module swing.tree.component.main
Class DefaultMutableTreeNodeExtensions
java.lang.Object
io.github.astrapi69.swing.tree.factory.DefaultMutableTreeNodeExtensions
The class
DefaultMutableTreeNodeExtensions provides methods for copy of
DefaultMutableTreeNode objects-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T extends DefaultMutableTreeNode>
Tcopy(T source, T target) Copies the given sourceDefaultMutableTreeNodeobject to the given targetDefaultMutableTreeNodeobjectstatic <T> voidcopyOf(DefaultMutableTreeNode selectedDefaultMutableTreeNode, T copyOfUserObject) Makes a exact copy of the givenDefaultMutableTreeNodeobject with the copy of the given user object and all descendantsDefaultMutableTreeNodeobjects
-
Constructor Details
-
DefaultMutableTreeNodeExtensions
public DefaultMutableTreeNodeExtensions()
-
-
Method Details
-
copyOf
public static <T> void copyOf(DefaultMutableTreeNode selectedDefaultMutableTreeNode, T copyOfUserObject) Makes a exact copy of the givenDefaultMutableTreeNodeobject with the copy of the given user object and all descendantsDefaultMutableTreeNodeobjects- Type Parameters:
T- the generic type of the given user object- Parameters:
selectedDefaultMutableTreeNode- theDefaultMutableTreeNodeobject to copycopyOfUserObject- a copy of the user object
-
copy
Copies the given sourceDefaultMutableTreeNodeobject to the given targetDefaultMutableTreeNodeobject- Type Parameters:
T- the generic type- Parameters:
source- the sourceDefaultMutableTreeNodeobjecttarget- the targetDefaultMutableTreeNodeobject- Returns:
- the copied target
DefaultMutableTreeNodeobject
-