// Path: src/com/noticeditorteam/noticeditor/io/importers/HtmlImportMode.java
// public enum HtmlImportMode {
//     RELAXED("relaxed", Whitelist.relaxed()),
//     ONLY_TEXT("only_text", Whitelist.none()),
//     ORIGINAL("original", null),
//     BASIC("basic", Whitelist.basic()),
//     BASIC_WITH_IMAGES("basic_with_img", Whitelist.basicWithImages()),
//     SIMPLE_TEXT("simple_text", Whitelist.simpleText());
// 
//     private final String name;
//     private final Whitelist whitelist;
// 
//     private HtmlImportMode(String name, Whitelist whitelist) {
//         this.name = name;
//         this.whitelist = whitelist;
//     }
// 
//     public String getName() {
//         return name;
//     }
// 
//     public Whitelist getWhitelist() {
//         return whitelist;
//     }
// }
// 
// Path: src/com/noticeditorteam/noticeditor/io/importers/ImportCallback.java
// @FunctionalInterface
// public interface ImportCallback<R, O> {
// 
//     public void call(R result, O optional);
// }
// 
// Path: src/com/noticeditorteam/noticeditor/io/importers/WebImporter.java
// public class WebImporter extends HtmlImporter {
// 
//     private final Map<String, String> cache = new HashMap<>();
// 
//     @Override
//     protected String cleanHtml(String url, Whitelist whitelist) throws Exception {
//         String html;
//         if (cache.containsKey(url)) {
//             html = cache.get(url);
//         } else {
//             html = IOUtil.stringFromStream(new URL(url).openStream());
//             cache.put(url, html);
//         }
//         return super.cleanHtml(html, whitelist);
//     }
// }


import com.noticeditorteam.noticeditor.io.importers.HtmlImportMode;
import com.noticeditorteam.noticeditor.io.importers.ImportCallback;
import com.noticeditorteam.noticeditor.io.importers.WebImporter;
import java.net.URL;
import java.util.ResourceBundle;
import javafx.collections.ObservableList;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.Node;
import javafx.scene.control.RadioButton;
import javafx.scene.control.TextField;
import javafx.scene.control.ToggleGroup;
import javafx.scene.layout.VBox;
import javafx.scene.web.WebView;
package com.noticeditorteam.noticeditor.controller;


/**
 * @author aNNiMON
 */
public class WebImportController implements Initializable {

    @FXML
    private VBox modesBox;

    @FXML
    private WebView pagePreview;

    @FXML
    private TextField urlField;

// Path: src/com/noticeditorteam/noticeditor/io/importers/HtmlImportMode.java
// public enum HtmlImportMode {
//     RELAXED("relaxed", Whitelist.relaxed()),
//     ONLY_TEXT("only_text", Whitelist.none()),
//     ORIGINAL("original", null),
//     BASIC("basic", Whitelist.basic()),
//     BASIC_WITH_IMAGES("basic_with_img", Whitelist.basicWithImages()),
//     SIMPLE_TEXT("simple_text", Whitelist.simpleText());
// 
//     private final String name;
//     private final Whitelist whitelist;
// 
//     private HtmlImportMode(String name, Whitelist whitelist) {
//         this.name = name;
//         this.whitelist = whitelist;
//     }
// 
//     public String getName() {
//         return name;
//     }
// 
//     public Whitelist getWhitelist() {
//         return whitelist;
//     }
// }
// 
// Path: src/com/noticeditorteam/noticeditor/io/importers/ImportCallback.java
// @FunctionalInterface
// public interface ImportCallback<R, O> {
// 
//     public void call(R result, O optional);
// }
// 
// Path: src/com/noticeditorteam/noticeditor/io/importers/WebImporter.java
// public class WebImporter extends HtmlImporter {
// 
//     private final Map<String, String> cache = new HashMap<>();
// 
//     @Override
//     protected String cleanHtml(String url, Whitelist whitelist) throws Exception {
//         String html;
//         if (cache.containsKey(url)) {
//             html = cache.get(url);
//         } else {
//             html = IOUtil.stringFromStream(new URL(url).openStream());
//             cache.put(url, html);
//         }
//         return super.cleanHtml(html, whitelist);
//     }
// }


// Path: src/com/noticeditorteam/noticeditor/controller/WebImportController.java
import com.noticeditorteam.noticeditor.io.importers.HtmlImportMode;
import com.noticeditorteam.noticeditor.io.importers.ImportCallback;
import com.noticeditorteam.noticeditor.io.importers.WebImporter;
import java.net.URL;
import java.util.ResourceBundle;
import javafx.collections.ObservableList;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.Node;
import javafx.scene.control.RadioButton;
import javafx.scene.control.TextField;
import javafx.scene.control.ToggleGroup;
import javafx.scene.layout.VBox;
import javafx.scene.web.WebView;

package com.noticeditorteam.noticeditor.controller;


/**
 * @author aNNiMON
 */
public class WebImportController implements Initializable {

    @FXML
    private VBox modesBox;

    @FXML
    private WebView pagePreview;

    @FXML
    private TextField urlField;

    private WebImporter importer;