package org.workcraft.presets;

import org.workcraft.gui.dialogs.ModalDialog;
import org.workcraft.utils.DesktopApi;

import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionListener;
import java.io.File;

public abstract class PresetDialog<T> extends ModalDialog<PresetManager<T>> {

    public PresetDialog(Window owner, String title, PresetManager<T> presetManager) {
        super(owner, title, presetManager);
    }

    public JButton addCheckerButton(ActionListener action) {
        return addButton("Check syntax", action, false);
    }

    public JButton addHelpButton(File helpFile) {
        return addButton("Help", event -> DesktopApi.open(helpFile), true);
    }

    public abstract T getPresetData();

}

@@ -210,16 +210,37 @@
 io.File;
+%0Aimport java.net.URI;
 %0A%0Apublic
@@ -612,21 +612,17 @@
 on(File 
-helpF
+f
 ile) %7B%0A 
@@ -682,16 +682,136 @@
 pen(
-helpFile
+file), true);%0A    %7D%0A%0A    public JButton addHelpButton(URI uri) %7B%0A        return addButton(%22Help%22, event -%3E DesktopApi.browse(uri
 ), t

Enable linking external URI to Help button