// Path: easyfxml/src/main/java/moe/tristan/easyfxml/util/Buttons.java
// public static void setOnClick(final Button button, final Runnable action) {
//     button.setOnAction(e -> Platform.runLater(action));
// }
// 
// Path: easyfxml/src/main/java/moe/tristan/easyfxml/api/FxmlController.java
// public interface FxmlController {
// 
//     /**
//      * This method is automatically called by the JavaFX {@link Platform} as soon as all the components are loaded (not
//      * necessarily rendered). This is where initial UX/UI setup should be done (enabling, disabling hiding etc...)
//      * <p>
//      * Calling it from the constructor is a hazard and will generally cause failures.
//      */
//     @SuppressWarnings("unused")
//     void initialize();
// 
// }


import static java.util.function.Predicate.not;
import static moe.tristan.easyfxml.util.Buttons.setOnClick;
import java.util.Optional;
import org.springframework.stereotype.Component;
import javafx.fxml.FXML;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.control.TextField;
import javafx.scene.layout.HBox;
import moe.tristan.easyfxml.api.FxmlController;
/*
 * Copyright 2017 - 2019 EasyFXML project and contributors
 *
 *    Licensed under the Apache License, Version 2.0 (the "License");
 *    you may not use this file except in compliance with the License.
 *    You may obtain a copy of the License at
 *
 *        http://www.apache.org/licenses/LICENSE-2.0
 *
 *    Unless required by applicable law or agreed to in writing, software
 *    distributed under the License is distributed on an "AS IS" BASIS,
 *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *    See the License for the specific language governing permissions and
 *    limitations under the License.
 */

package moe.tristan.easyfxml.samples.helloworld.view.hello;






@Component
public class HelloController implements FxmlController {

    @FXML
    private TextField userNameTextField;

    @FXML
    private Button helloButton;

    @FXML
    public HBox greetingBox;

    @FXML
    private Label greetingName;

    @Override
    public void initialize() {
        greetingBox.setVisible(false);
// Path: easyfxml/src/main/java/moe/tristan/easyfxml/util/Buttons.java
// public static void setOnClick(final Button button, final Runnable action) {
//     button.setOnAction(e -> Platform.runLater(action));
// }
// 
// Path: easyfxml/src/main/java/moe/tristan/easyfxml/api/FxmlController.java
// public interface FxmlController {
// 
//     /**
//      * This method is automatically called by the JavaFX {@link Platform} as soon as all the components are loaded (not
//      * necessarily rendered). This is where initial UX/UI setup should be done (enabling, disabling hiding etc...)
//      * <p>
//      * Calling it from the constructor is a hazard and will generally cause failures.
//      */
//     @SuppressWarnings("unused")
//     void initialize();
// 
// }


// Path: easyfxml-samples/easyfxml-sample-hello-world/src/main/java/moe/tristan/easyfxml/samples/helloworld/view/hello/HelloController.java
import static java.util.function.Predicate.not;
import static moe.tristan.easyfxml.util.Buttons.setOnClick;
import java.util.Optional;
import org.springframework.stereotype.Component;
import javafx.fxml.FXML;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.control.TextField;
import javafx.scene.layout.HBox;
import moe.tristan.easyfxml.api.FxmlController;

/*
 * Copyright 2017 - 2019 EasyFXML project and contributors
 *
 *    Licensed under the Apache License, Version 2.0 (the "License");
 *    you may not use this file except in compliance with the License.
 *    You may obtain a copy of the License at
 *
 *        http://www.apache.org/licenses/LICENSE-2.0
 *
 *    Unless required by applicable law or agreed to in writing, software
 *    distributed under the License is distributed on an "AS IS" BASIS,
 *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *    See the License for the specific language governing permissions and
 *    limitations under the License.
 */

package moe.tristan.easyfxml.samples.helloworld.view.hello;






@Component
public class HelloController implements FxmlController {

    @FXML
    private TextField userNameTextField;

    @FXML
    private Button helloButton;

    @FXML
    public HBox greetingBox;

    @FXML
    private Label greetingName;

    @Override
    public void initialize() {
        greetingBox.setVisible(false);
        setOnClick(helloButton, this::greet);