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

xworker.javafx.control.ColorPickerActions Maven / Gradle / Ivy

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

import javafx.scene.paint.Color;
import org.xmeta.ActionContext;
import org.xmeta.Thing;

import javafx.scene.control.ColorPicker;
import xworker.javafx.util.JavaFXUtils;

public class ColorPickerActions {
	public static void init(ColorPicker picker, Thing thing, ActionContext actionContext) {
		ComboBoxBaseActions.init(picker, thing, actionContext);


		if(thing.valueExists("value")){
			Color value = JavaFXUtils.getObject(thing, "value", actionContext);
			if(value != null){
				picker.setValue(value);
			}
		}
	}
	
	public static ColorPicker create(ActionContext actionContext) {
		Thing self = actionContext.getObject("self");
		
		ColorPicker picker = new ColorPicker();
		init(picker, self, actionContext);
		actionContext.g().put(self.getMetadata().getName(), picker);
		
		actionContext.peek().put("parent", picker);
		for(Thing child : self.getChilds()) {
			child.doAction("create", actionContext);
		}

		
		return picker;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy