package resumeonline.jfx.core;

import java.io.File;

import javafx.beans.value.WritableStringValue;
import javafx.scene.layout.AnchorPane;
import resumeonline.commons.EventAction;
import resumeonline.commons.EventActionType;
import resumeonline.commons.io.file.Directory;
import resumeonline.commons.si.NoEventAction;
import resumeonline.jfx.core.JFXChooser;

public final class WritableDirectoryAction
    implements
    EventActionType<EventActionType<? super File>>,
    EventAction {

    private final WritableStringValue field;
    private final AnchorPane pane;
    private final Directory directory;

    public WritableDirectoryAction(
        final AnchorPane pane,
        final WritableStringValue field) {
        this(pane, field, new Directory(field.get()));
    }

    private WritableDirectoryAction(
        final AnchorPane pane,
        final WritableStringValue field,
        final Directory directory) {
        this.pane = pane;
        this.field = field;
        this.directory = directory;
    }

    @Override
    public void execute(
        final EventActionType<? super File> action) {
        if (action == null) {
            throw new IllegalArgumentException();
        }
        File file = JFXChooser.showDirectoryChooser(pane, directory);
        if (file != null) {
            field.setValue(file.getAbsolutePath());
            action.execute(file);
        }
    }

    @Override
    public void execute() {
        execute(new NoEventAction<>());
    }
}

@@ -315,49 +315,8 @@
 ion;
-%0Aimport resumeonline.jfx.core.JFXChooser;
 %0A%0Apu
@@ -1168,16 +1168,22 @@
         
+final 
 File fil

fix PMD issue : https://pmd.github.io/pmd-5.6.1/pmd-java/rules/java/imports.html#ImportFromSamePackage