<commit_before>/* 
 * This file is part of the PDF Split And Merge source code
 * Created on 25/ott/2013
 * Copyright 2013 by <NAME> (<EMAIL>).
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
package org.pdfsam.ui.io;

import javafx.scene.control.Button;
import javafx.scene.layout.BorderPane;

import org.pdfsam.context.DefaultI18nContext;
import org.pdfsam.ui.ValidableTextField;
import org.pdfsam.ui.support.Style;

/**
 * {@link ValidableTextField} with attached a browse button to let the user select a file
 * 
 * @author <NAME>
 * 
 */
abstract class BrowsableField extends BorderPane {
    private Button browseButton;
    private ValidableTextField textField = new ValidableTextField();
    private String browseWindowTitle = DefaultI18nContext.getInstance().i18n("Select");

    public BrowsableField() {
        browseButton = new Button(DefaultI18nContext.getInstance().i18n("Browse"));
        browseButton.getStyleClass().addAll(Style.BROWSE_BUTTON.css());
        browseButton.setMinHeight(USE_PREF_SIZE);
        browseButton.setMaxHeight(USE_PREF_SIZE);
        browseButton.prefHeightProperty().bind(textField.heightProperty());
        setCenter(textField);
        setRight(browseButton);
    }

    /**
     * @return the internal {@link ValidableTextField}
     */
    public ValidableTextField getTextField() {
        return textField;
    }

    Button getBrowseButton() {
        return browseButton;
    }

    String getBrowseWindowTitle() {
        return browseWindowTitle;
    }

    public void setBrowseWindowTitle(String browseWindowTitle) {<commit_msg>Changed layout for BrowsableField.<commit_after>/* 
 * This file is part of the PDF Split And Merge source code
 * Created on 25/ott/2013
 * Copyright 2013 by <NAME> (<EMAIL>).
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
package org.pdfsam.ui.io;

import javafx.geometry.Pos;
import javafx.scene.control.Button;
import javafx.scene.layout.HBox;
import javafx.scene.layout.Priority;

import org.pdfsam.context.DefaultI18nContext;
import org.pdfsam.ui.ValidableTextField;
import org.pdfsam.ui.support.Style;

/**
 * {@link ValidableTextField} with attached a browse button to let the user select a file
 * 
 * @author <NAME>
 * 
 */
abstract class BrowsableField extends HBox {
    private Button browseButton;
    private ValidableTextField textField = new ValidableTextField();
    private String browseWindowTitle = DefaultI18nContext.getInstance().i18n("Select");

    public BrowsableField() {
        setHgrow(textField, Priority.ALWAYS);
        browseButton = new Button(DefaultI18nContext.getInstance().i18n("Browse"));
        browseButton.getStyleClass().addAll(Style.BROWSE_BUTTON.css());
        browseButton.prefHeightProperty().bind(textField.heightProperty());
        browseButton.setMaxHeight(USE_PREF_SIZE);
        browseButton.setMinHeight(USE_PREF_SIZE);
        browseButton.setAlignment(Pos.CENTER);
        getChildren().addAll(textField, browseButton);
    }

    /**
     * @return the internal {@link ValidableTextField}
     */
    public ValidableTextField getTextField() {
        return textField;
    }

    Button getBrowseButton() {
        return browseButton;
    }

    String getBrowseWindowTitle() {
        return browseWindowTitle;
    }

    public void setBrowseWindowTitle(String browseWindowTitle) {
{'fraction_non_alphanumeric': 0.0878080985915493, 'fraction_numerical': 0.009242957746478873, 'mean_word_length': 3.729448491155047, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5273177', 'n_tokens_mistral': 1309, 'n_tokens_neox': 1239, 'n_words': 406}