All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.legyver.fenxlib.widgets.filetree.factory.FileTreeRemoveEventHandlerFactory Maven / Gradle / Ivy

There is a newer version: 3.0.2
Show newest version
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