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

xworker.javafx.util.RunAction Maven / Gradle / Ivy

There is a newer version: 2.0.2
Show newest version
package xworker.javafx.util;

import javafx.beans.property.SimpleMapProperty;
import org.xmeta.ActionContext;
import org.xmeta.Thing;
import xworker.lang.actions.ActionContainer;

public class RunAction {
    public static Object create(ActionContext actionContext){
        Thing self = actionContext.getObject("self");
        Object result = null;
        for(Thing child : self.getChilds()){
            result = child.getAction().run(actionContext);
        }

        return result;
    }

    public static Object createActionContainer(ActionContext actionContext){
        Thing self = (Thing) actionContext.get("self");

        ActionContainer scriptContainer = new ActionContainer(self, actionContext);
        for(Thing ext : self.getExtends()) {
            scriptContainer.append(ext);
        }

        actionContext.getScope(0).put(self.getMetadata().getName(), scriptContainer);
        return scriptContainer;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy