<commit_before>package org.deidentifier.arx.gui.view.impl.wizard.importdata;

import org.deidentifier.arx.gui.view.impl.wizard.importdata.ImportData.SourceType;
import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;


/**
 * Source selection page
 *
 * This page provides means to select the source the user wants to import data
 * from. Once the user makes a choice, it is stored stored using
 * {@link ImportData#setSourceType(SourceType)} and the page is marked as
 * completed.
 *
 * These source types are supported:
 *
 * <ul>
 *  <li>{@link CsvPage} CSV</li>
 *  <li>{@link JdbcPage} Database (JDBC)</li>
 *  <li>{@link ExcelPage} Excel (XLS, XLSX)</li>
 * </ul>
 */
public class SourcePage extends WizardPage {

    /* Widgets */
    private Button btnCsv;
    private Button btnJdbc;
    private Button btnExcel;

    /**
     * Reference to the wizard containing this page
     */
    private ImportDataWizard wizardImport;


    /**
     * Creates a new instance of this page and sets its title and description
     *
     * @param wizardImport Reference to wizard containing this page
     */
    public SourcePage(ImportDataWizard wizardImport)
    {

        super("WizardImportSourcePage");
        setTitle("Source");
        setDescription("Select the source you want to import data from");

        this.wizardImport = wizardImport;

    }

    /**
     * Creates the design of this page
     *
     * This adds all the controls to the page along with their listeners. It
     * basically waits for any radio button to be pressed, which will mark the
     * page as completed and lets the user proceed to the next page.
     */
    public void createControl(Composite parent)
    {

        Composite container = new Composite(parent, SWT.NULL);

        setControl(container);
        container.setLayout(new GridLayout(1, false));

        /* Add button for CSV */
        btnCsv = new Button(container, SWT.RADIO);
        btnCsv.setText("CSV");
        btnCsv.addSelectionListener(new SelectionAdapter() {

            @Override
            public void widgetSelected(SelectionEvent arg0) {

                wizardImport.getData().setSourceType(SourceType.CSV);
                setPageComplete(true);

            }

        });

        /* Add button for JDBC */
        btnJdbc = new Button(container, SWT.RADIO);
        btnJdbc.setEnabled(false);
        btnJdbc.setText("Database (JDBC)");
        btnJdbc.addSelectionListener(new SelectionAdapter() {

            @Override
            public void widgetSelected(SelectionEvent arg0) {

                wizardImport.getData().setSourceType(SourceType.JDBC);
                setPageComplete(true);

            }

        });

        /* Add button for Excel */
        btnExcel = new Button(container, SWT.RADIO);
        btnExcel.setText("Excel (XLS, XLSX)");
        btnExcel.addSelectionListener(new SelectionAdapter() {

            @Override
            public void widgetSelected(SelectionEvent arg0) {

                wizardImport.getData().setSourceType(SourceType.EXCEL);
                setPageComplete(true);

            }

        });

        /* Mark page as incomplete until a button is pressed */
        setPageComplete(false);

    }

}
<commit_msg>src: gui: wizard: importdata: SourcePage: Swap Excel and JDBC<commit_after>package org.deidentifier.arx.gui.view.impl.wizard.importdata;

import org.deidentifier.arx.gui.view.impl.wizard.importdata.ImportData.SourceType;
import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;


/**
 * Source selection page
 *
 * This page provides means to select the source the user wants to import data
 * from. Once the user makes a choice, it is stored stored using
 * {@link ImportData#setSourceType(SourceType)} and the page is marked as
 * completed.
 *
 * These source types are supported:
 *
 * <ul>
 *  <li>{@link CsvPage} CSV</li>
 *  <li>{@link JdbcPage} Database (JDBC)</li>
 *  <li>{@link ExcelPage} Excel (XLS, XLSX)</li>
 * </ul>
 */
public class SourcePage extends WizardPage {

    /* Widgets */
    private Button btnCsv;
    private Button btnExcel;
    private Button btnJdbc;

    /**
     * Reference to the wizard containing this page
     */
    private ImportDataWizard wizardImport;


    /**
     * Creates a new instance of this page and sets its title and description
     *
     * @param wizardImport Reference to wizard containing this page
     */
    public SourcePage(ImportDataWizard wizardImport)
    {

        super("WizardImportSourcePage");
        setTitle("Source");
        setDescription("Select the source you want to import data from");

        this.wizardImport = wizardImport;

    }

    /**
     * Creates the design of this page
     *
     * This adds all the controls to the page along with their listeners. It
     * basically waits for any radio button to be pressed, which will mark the
     * page as completed and lets the user proceed to the next page.
     */
    public void createControl(Composite parent)
    {

        Composite container = new Composite(parent, SWT.NULL);

        setControl(container);
        container.setLayout(new GridLayout(1, false));

        /* Add button for CSV */
        btnCsv = new Button(container, SWT.RADIO);
        btnCsv.setText("CSV");
        btnCsv.addSelectionListener(new SelectionAdapter() {

            @Override
            public void widgetSelected(SelectionEvent arg0) {

                wizardImport.getData().setSourceType(SourceType.CSV);
                setPageComplete(true);

            }

        });

        /* Add button for Excel */
        btnExcel = new Button(container, SWT.RADIO);
        btnExcel.setText("Excel (XLS, XLSX)");
        btnExcel.addSelectionListener(new SelectionAdapter() {

            @Override
            public void widgetSelected(SelectionEvent arg0) {

                wizardImport.getData().setSourceType(SourceType.EXCEL);
                setPageComplete(true);

            }

        });

        /* Add button for JDBC */
        btnJdbc = new Button(container, SWT.RADIO);
        btnJdbc.setEnabled(false);
        btnJdbc.setText("Database (JDBC)");
        btnJdbc.addSelectionListener(new SelectionAdapter() {

            @Override
            public void widgetSelected(SelectionEvent arg0) {

                wizardImport.getData().setSourceType(SourceType.JDBC);
                setPageComplete(true);

            }

        });

        /* Mark page as incomplete until a button is pressed */
        setPageComplete(false);

    }

}

{'fraction_non_alphanumeric': 0.09603310502283105, 'fraction_numerical': 0.001141552511415525, 'mean_word_length': 2.5381120646138315, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '6963553', 'n_tokens_mistral': 2006, 'n_tokens_neox': 1896, 'n_words': 532}