com.legyver.fenxlib.widgets.filetree.tree.internal.TreeRoot Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of fenxlib.widgets.filetree Show documentation
Show all versions of fenxlib.widgets.filetree Show documentation
FileTree widget for Fenxlib projects
package com.legyver.fenxlib.widgets.filetree.tree.internal;
import com.legyver.fenxlib.widgets.filetree.factory.FileTreeRemoveEventHandlerFactory;
import com.legyver.fenxlib.widgets.filetree.nodes.FileReference;
import com.legyver.fenxlib.widgets.filetree.tree.FileTreeItem;
import com.legyver.fenxlib.widgets.filetree.tree.TreeFolder;
import javafx.beans.property.SimpleBooleanProperty;
import java.util.Collection;
import java.util.Iterator;
/**
* Tree root node that files/folders can be associated with
*/
public class TreeRoot extends TreeFolder {
/**
* Construct a Tree root node that files/folders can be associated with
* @param fileReference the pseudo-reference
*/
public TreeRoot(FileReference fileReference) {
super("", fileReference);
}
/**
* Refresh children
* @return true if this node can be removed from parent
*/
@Override
@SuppressWarnings("unchecked")
public boolean refreshAndCheckIfRemovable() {
Collection children = getChildren();
for (Iterator childIt = children.iterator(); childIt.hasNext(); ) {
FileTreeItem child = childIt.next();
if (child.refreshAndCheckIfRemovable()) {
childIt.remove();
}
}
return false;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy