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

org.dominokit.domino.ui.datatable.plugins.DoubleClickPlugin Maven / Gradle / Ivy

There is a newer version: 1.0.139
Show newest version
package org.dominokit.domino.ui.datatable.plugins;

import org.dominokit.domino.ui.datatable.DataTable;
import org.dominokit.domino.ui.datatable.TableRow;
import org.jboss.elemento.EventType;

public class DoubleClickPlugin implements DataTablePlugin {

    private DoublClickHandler handler;

    public DoubleClickPlugin(DoublClickHandler handler) {
        this.handler = handler;
    }

    @Override
    public void onRowAdded(DataTable dataTable, TableRow tableRow) {
        tableRow.element().addEventListener(EventType.dblclick.getName(), evt -> {
            handler.onDoubleClick(tableRow);
        });
    }

    @FunctionalInterface
    public interface DoublClickHandler {
        void onDoubleClick(TableRow tableRow);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy