class MailPromptController implements Initializable {

    private static final Pattern INVALID_MAIL =
        Pattern.compile("^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,6}$");
    
    private static final Predicate<String> IS_INVALID_MAIL =
        mail -> !INVALID_MAIL.matcher(mail).find();
    
    public @Inject ProjectComponent projects;
    public @Inject UserInterfaceComponent ui;
    public @Inject InjectionLoader loader;
    public @Inject EventComponent events;
    
    private @FXML TextField email;
    private @FXML TextArea terms;
    private @FXML Button okay;

    @Override
    public void initialize(URL location, ResourceBundle resources) {<FILL_FUNCTION_BODY>}
    
    private static String inputToString(InputStream in) throws IOException {
        try (final BufferedInputStream bis = new BufferedInputStream(in)) {
            try (final ByteArrayOutputStream buf = new ByteArrayOutputStream()) {
                int result = bis.read();
                while(result != -1) {
                    byte b = (byte) result;
                    buf.write(b);
                    result = bis.read();
                }
                return buf.toString();
            }
        }
    }
}


        okay.setGraphic(FontAwesome.CHECK.view());
        okay.disableProperty().bind(Bindings.createBooleanBinding(
            () -> IS_INVALID_MAIL.test(email.getText()), 
            email.textProperty()
        ));

        okay.setOnAction(ev -> {
            loader.loadAndShow("Connect");

            if (EmailUtil.hasEmail()) {
                if (projects.getProject().dbmses().noneMatch(dbms -> true)) {
                    loader.loadAndShow("Connect");
                } else {
                    loader.loadAndShow("Scene");
                    ui.showNotification(
                        "Metadata has been loaded from an offline file. " +
                        "Click here to reload from database.",
                        FontAwesome.REFRESH,
                        Palette.INFO,
                        ui::reload
                    );
                }
            } else {
                loader.loadAndShow("MailPrompt");
            }

            EmailUtil.setEmail(email.getText());
            events.notify(UIEvent.OPEN_CONNECT_WINDOW);
        });
        
        try {
            final InputStream in = MailPromptController.class.getResourceAsStream("/text/terms.txt");
            final String str = inputToString(in);
            terms.setText(str);
        } catch (final IOException ex) {
            ui.showError(
                "Failed to load file", 
                "The terms and conditions of this software couldn't be loaded.", 
                ex
            );
        }
    
<no_super_class>