com.legyver.fenxlib.widgets.filetree.factory.FileTreeRemoveEventHandlerFactory 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.factory;
import com.legyver.fenxlib.widgets.filetree.event.FileTreeRemoveEventHandler;
import com.legyver.fenxlib.widgets.filetree.registry.FileTreeRegistry;
import com.legyver.fenxlib.widgets.filetree.tree.FileTreeItem;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import java.util.function.BiFunction;
/**
* Factory to produce an event handler that removes an item from the file tree
*/
public class FileTreeRemoveEventHandlerFactory implements BiFunction> {
/**
* Name of Menu Item
*/
public static final String MENU_ITEM_NAME = "Remove";
/**
* Make the remove event handler for top-level entries in the tree.
* If the item is not a top-level entry, the event handler is null.
* @param fileTreeRegistry the registry for the file explorer tree
* @param fileTreeItem the item in the file explorer tree
* @return the event handler
*/
@Override
public EventHandler apply(FileTreeRegistry fileTreeRegistry, FileTreeItem fileTreeItem) {
return new FileTreeRemoveEventHandler(fileTreeRegistry, fileTreeItem);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy