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

xworker.gluon.attach.StatusbarActions Maven / Gradle / Ivy

The newest version!
package xworker.gluon.attach;

import com.gluonhq.attach.statusbar.StatusBarService;
import javafx.scene.paint.Color;
import org.xmeta.ActionContext;
import org.xmeta.Thing;
import xworker.javafx.scene.paint.ColorActions;

public class StatusbarActions {
    public static void setColor(ActionContext actionContext){
        Thing self = actionContext.getObject("self");
        Color color = null;
        String key = self.getStringBlankAsNull("color");
        if(key != null){
            color = ColorActions.colors.get(key);
        }

        if(color == null){
            String web = self.getStringBlankAsNull("webColor");
            if(web != null){
                color = Color.web(web);
            }
        }

        if(color != null) {
            Color finalColor = color;
            StatusBarService.create().ifPresent(service -> service.setColor(finalColor));
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy