kit/src/main/java/com/oracle/javafx/scenebuilder/kit/editor/panel/inspector/editors/EventHandlerEditor.java [69:198]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        super(propMeta, selectedClasses, suggestedMethods); //NOI18N
        initialize(suggestedMethods);
    }

    private void initialize(List<String> suggestedMethods) {
        this.suggestedMethods = suggestedMethods;

        // text field events handling
        EventHandler<ActionEvent> onActionListener = event -> {
            String tfValue = getTextField().getText();
            if (tfValue == null || tfValue.isEmpty()) {
                userUpdateValueProperty(null);
                return;
            }
            if (methodNameMode) {
                // method name should be a java identifier
                if (!JavaLanguage.isIdentifier(tfValue)) {
                    System.err.println(I18N.getString("inspector.event.invalid.method", tfValue)); // Will go in message panel
                    handleInvalidValue(tfValue);
                    return;
                }
            }
            Object value = getValue();
            assert value instanceof String;
            userUpdateValueProperty((String) value);
            getTextField().selectAll();
        };
        setTextEditorBehavior(this, getTextField(), onActionListener);

        scriptMenuItem.setOnAction(e -> {
            getTextField().setText(null);
            userUpdateValueProperty(null);
            switchToScriptMode();
        });

        controllerMethodMenuItem.setOnAction(e -> {
            getTextField().setText(null);
            userUpdateValueProperty(null);
            switchToMethodNameMode();
        });
        getMenu().getItems().add(controllerMethodMenuItem);

        // methodeName mode by default
        switchToMethodNameMode();
    }
    
    @Override
    public Object getValue() {
        String valueTf = getTextField().getText();
        if (valueTf == null || valueTf.isEmpty()) {
            return null; // default value
        }
        String value;
        if (methodNameMode) {
            value = HASH_STR + getTextField().getText();
        } else {
            value = getTextField().getText();
        }
//        System.out.println("EventHandlerEditor : getValue() returns: '" + value + "'");
        return value;
    }

    @Override
    public void setValue(Object value) {
//        System.out.println("EventHandlerEditor : setValue to '" + value + "'");
        setValueGeneric(value);
        if (isSetValueDone()) {
            return;
        }

        String valueStr;
        if (value == null) {
            if (!methodNameMode) {
                switchToMethodNameMode();
            }
            valueStr = null;
        } else {
            assert value instanceof String;
            valueStr = (String) value;
            if (valueStr.startsWith(HASH_STR)) {
                if (!methodNameMode) {
                    switchToMethodNameMode();
                }
                valueStr = valueStr.substring(1);
            } else if (!valueStr.startsWith(HASH_STR) && methodNameMode) {
                switchToScriptMode();
            }
        }
        getTextField().setText(valueStr);
    }

    @Override
    public Node getValueEditor() {
        return super.handleGenericModes(root);
    }

    @Override
    public void reset(String name, String defaultValue, List<String> suggestedList) {
        super.reset(name, defaultValue, suggestedList);
        switchToMethodNameMode();
    }

    private void wrapInHBox() {
        hbox = new HBox();
        hbox.setAlignment(Pos.CENTER);
        Label hashLabel = new Label(HASH_STR);
        hashLabel.getStyleClass().add("symbol-prefix");
        hbox.getChildren().addAll(hashLabel, getRoot());
        HBox.setHgrow(hashLabel, Priority.NEVER);
        root.getChildren().clear();
        root.getChildren().add(hbox);
    }

    private void unwrapHBox() {
        root.getChildren().clear();
        root.getChildren().add(getRoot());
    }

    private void switchToMethodNameMode() {
        methodNameMode = true;
        resetSuggestedList(suggestedMethods);
        replaceMenuItem(controllerMethodMenuItem, scriptMenuItem);
        wrapInHBox();
    }

    private void switchToScriptMode() {
        methodNameMode = false;
        resetSuggestedList(new ArrayList<>());
        replaceMenuItem(scriptMenuItem, controllerMethodMenuItem);
        unwrapHBox();
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



kit/src/main/java/com/oracle/javafx/scenebuilder/kit/editor/panel/inspector/editors/FunctionalInterfaceEditor.java [62:189]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        super(propMeta, selectedClasses, suggestedMethods); //NOI18N
        initialize(suggestedMethods);
    }

    private void initialize(List<String> suggestedMethods) {
        this.suggestedMethods = suggestedMethods;

        // text field events handling
        EventHandler<ActionEvent> onActionListener = event -> {
            String tfValue = getTextField().getText();
            if (tfValue == null || tfValue.isEmpty()) {
                userUpdateValueProperty(null);
                return;
            }
            if (methodNameMode) {
                // method name should be a java identifier
                if (!JavaLanguage.isIdentifier(tfValue)) {
                    System.err.println(I18N.getString("inspector.event.invalid.method", tfValue)); // Will go in message panel
                    handleInvalidValue(tfValue);
                    return;
                }
            }
            Object value = getValue();
            assert value instanceof String;
            userUpdateValueProperty((String) value);
            getTextField().selectAll();
        };
        setTextEditorBehavior(this, getTextField(), onActionListener);

        scriptMenuItem.setOnAction(e -> {
            getTextField().setText(null);
            userUpdateValueProperty(null);
            switchToScriptMode();
        });

        controllerMethodMenuItem.setOnAction(e -> {
            getTextField().setText(null);
            userUpdateValueProperty(null);
            switchToMethodNameMode();
        });
        getMenu().getItems().add(controllerMethodMenuItem);

        // methodeName mode by default
        switchToMethodNameMode();
    }

    @Override
    public Object getValue() {
        String valueTf = getTextField().getText();
        if (valueTf == null || valueTf.isEmpty()) {
            return null; // default value
        }
        String value;
        if (methodNameMode) {
            value = HASH_STR + getTextField().getText();
        } else {
            value = getTextField().getText();
        }
        return value;
    }

    @Override
    public void setValue(Object value) {
        setValueGeneric(value);
        if (isSetValueDone()) {
            return;
        }

        String valueStr;
        if (value == null) {
            if (!methodNameMode) {
                switchToMethodNameMode();
            }
            valueStr = null;
        } else {
            assert value instanceof String;
            valueStr = (String) value;
            if (valueStr.startsWith(HASH_STR)) {
                if (!methodNameMode) {
                    switchToMethodNameMode();
                }
                valueStr = valueStr.substring(1);
            } else if (!valueStr.startsWith(HASH_STR) && methodNameMode) {
                switchToScriptMode();
            }
        }
        getTextField().setText(valueStr);
    }

    @Override
    public Node getValueEditor() {
        return super.handleGenericModes(root);
    }

    @Override
    public void reset(String name, String defaultValue, List<String> suggestedList) {
        super.reset(name, defaultValue, suggestedList);
        switchToMethodNameMode();
    }

    private void wrapInHBox() {
        hbox = new HBox();
        hbox.setAlignment(Pos.CENTER);
        Label hashLabel = new Label(HASH_STR);
        hashLabel.getStyleClass().add("symbol-prefix");
        hbox.getChildren().addAll(hashLabel, getRoot());
        HBox.setHgrow(hashLabel, Priority.NEVER);
        root.getChildren().clear();
        root.getChildren().add(hbox);
    }

    private void unwrapHBox() {
        root.getChildren().clear();
        root.getChildren().add(getRoot());
    }

    private void switchToMethodNameMode() {
        methodNameMode = true;
        resetSuggestedList(suggestedMethods);
        replaceMenuItem(controllerMethodMenuItem, scriptMenuItem);
        wrapInHBox();
    }

    private void switchToScriptMode() {
        methodNameMode = false;
        resetSuggestedList(new ArrayList<>());
        replaceMenuItem(scriptMenuItem, controllerMethodMenuItem);
        unwrapHBox();
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



