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

org.datafx.controller.flow.action.FlowMethodAction Maven / Gradle / Ivy

There is a newer version: 8.0b5
Show newest version
package org.datafx.controller.flow.action;

import org.datafx.controller.flow.FlowException;
import org.datafx.controller.flow.FlowHandler;

import java.lang.reflect.InvocationTargetException;

public class FlowMethodAction implements FlowAction {

    private String actionMethodName;

    public FlowMethodAction(String actionMethodName) {
        this.actionMethodName = actionMethodName;
    }

    @Override
    public void handle(FlowHandler flowHandler, String actionId) throws FlowException {
        Object controller = flowHandler.getCurrentViewContext().getController();
        try {
            controller.getClass().getMethod(actionMethodName).invoke(controller);
        } catch (Exception e) {
            throw new FlowException(e);
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy