<commit_before>package fr.inria.diverse.k3.ui.wizards.pages;

import java.util.Arrays;
import java.util.Collections;
import java.util.List;

import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.DirectoryDialog;
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PlatformUI;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.viewers.ViewerFilter;
import org.eclipse.emf.common.ui.dialogs.WorkspaceResourceDialog;
import org.eclipse.emf.mapping.ecore2ecore.presentation.Ecore2EcoreEditorPlugin;

import fr.inria.diverse.commons.eclipse.pde.wizards.pages.pde.ui.BaseProjectWizardFields;
import fr.inria.diverse.k3.ui.tools.ErrorMessage;

public class NewK3ProjectWizardPage extends WizardPage {

	protected NewK3ProjectWizardFields		context;
	
	protected static final List<String> FILE_EXTENSIONS = Arrays.asList(new String [] { "ecore" });
	protected ErrorMessage[] errorMessage;
	protected boolean 	enableNext = true;
	
	protected Composite 	container;
	protected Label 		lblProjectName;
//	protected Label 		lblTemplateEcore;
	protected Text 			txtProjectName;
	protected Text 			txtProjectLocation;
//	protected Text 			txtPathEcore;
	protected Button		btnBrowseLocation;
//	protected Button 		btnBrowseEcore;
	//protected Button 		btnCreateEmfProject;
	protected Button 		btnCheckLocation;
//	protected Button 		btnCheckEcore;
//	protected Button 		btnCheckSLE;
	protected Button 		btnCheckEMF;
	protected Button 		btnCheckKMF;
	protected Button 		btnRadioStandAlone;
	protected Button 		btnRadioPlugIn;
	protected Button 		btnRadioMaven;
//	protected Combo 		combo;
	protected Group 		grpGeneral;
	protected Group 		grpKindOfProject;
	protected Group 		grpModelingOptions;
//protected Group 		grpSLEOptions;
	protected Group 		grpTemplateOptions;

	public NewK3ProjectWizardPage(NewK3ProjectWizardFields context){
		super("wizardPage");
		this.context = context;
		setTitle("New Kermeta 3 project");
		setDescription("This wizard creates a new kermeta 3 project");
		this.errorMessage =  new ErrorMessage[2];
		this.errorMessage[0] = new ErrorMessage("A project with this name already exists.", false);
		this.errorMessage[1] = new ErrorMessage("Please select an ecore file.", false);
	}
	
	/**
	 * Constructor for KermetaNewWizardDashboard.
	 * @param pageName
	 */
	public NewK3ProjectWizardPage(ISelection selection) {
		super("wizardPage");
		setTitle("New Kermeta 3 project");
		setDescription("This wizard creates a new kermeta 3 project");
		setPageComplete(true);
	}

	@Override
	public void createControl(Composite parent) {
		container = new Composite(parent, SWT.NULL);
		container.setLayout(new GridLayout(1, false));
		
		
		//-----------------------------------------------
		grpGeneral = new Group(container, SWT.NONE);
		grpGeneral.setText("General");
		grpGeneral.setLayout(new GridLayout(4, false));

		lblProjectName = new Label(grpGeneral, SWT.NONE);
		lblProjectName.setText("project name ");
		new Label(grpGeneral, SWT.NONE);
		new Label(grpGeneral, SWT.NONE);
		new Label(grpGeneral, SWT.NONE);
		
		txtProjectName = new Text(grpGeneral, SWT.BORDER);
		txtProjectName.setText(this.context.projectName);
		txtProjectName.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 3, 1));
		new Label(grpGeneral, SWT.NONE);
				
		txtProjectName.addModifyListener(new ModifyListener() {
			@Override
			public void modifyText(ModifyEvent arg0) {
				if (existNameProject()) {
					activErrorMessage (0, true);
					setPageComplete(false);
				}
				else {
	    			  activErrorMessage(0 , false);
	    			  setPageComplete(true);					
				}
				updateNameProject(txtProjectName.getText());
			}
		});
		
		btnCheckLocation = new Button(grpGeneral, SWT.CHECK);
		btnCheckLocation.setText("use default location");
		btnCheckLocation.setSelection(true);
		new Label(grpGeneral, SWT.NONE);
		new Label(grpGeneral, SWT.NONE);
		new Label(grpGeneral, SWT.NONE);<commit_msg>increase default Text field size of K3 project wizard<commit_after>package fr.inria.diverse.k3.ui.wizards.pages;

import java.util.Arrays;
import java.util.List;

import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.DirectoryDialog;
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;

import fr.inria.diverse.k3.ui.tools.ErrorMessage;

public class NewK3ProjectWizardPage extends WizardPage {

	protected NewK3ProjectWizardFields		context;
	
	protected static final List<String> FILE_EXTENSIONS = Arrays.asList(new String [] { "ecore" });
	protected ErrorMessage[] errorMessage;
	protected boolean 	enableNext = true;
	
	protected Composite 	container;
	protected Label 		lblProjectName;
//	protected Label 		lblTemplateEcore;
	protected Text 			txtProjectName;
	protected Text 			txtProjectLocation;
//	protected Text 			txtPathEcore;
	protected Button		btnBrowseLocation;
//	protected Button 		btnBrowseEcore;
	//protected Button 		btnCreateEmfProject;
	protected Button 		btnCheckLocation;
//	protected Button 		btnCheckEcore;
//	protected Button 		btnCheckSLE;
	protected Button 		btnCheckEMF;
	protected Button 		btnCheckKMF;
	protected Button 		btnRadioStandAlone;
	protected Button 		btnRadioPlugIn;
	protected Button 		btnRadioMaven;
//	protected Combo 		combo;
	protected Group 		grpGeneral;
	protected Group 		grpKindOfProject;
	protected Group 		grpModelingOptions;
//protected Group 		grpSLEOptions;
	protected Group 		grpTemplateOptions;

	public NewK3ProjectWizardPage(NewK3ProjectWizardFields context){
		super("wizardPage");
		this.context = context;
		setTitle("New Kermeta 3 project");
		setDescription("This wizard creates a new kermeta 3 project");
		this.errorMessage =  new ErrorMessage[2];
		this.errorMessage[0] = new ErrorMessage("A project with this name already exists.", false);
		this.errorMessage[1] = new ErrorMessage("Please select an ecore file.", false);
	}
	
	/**
	 * Constructor for KermetaNewWizardDashboard.
	 * @param pageName
	 */
	public NewK3ProjectWizardPage(ISelection selection) {
		super("wizardPage");
		setTitle("New Kermeta 3 project");
		setDescription("This wizard creates a new kermeta 3 project");
		setPageComplete(true);
	}

	@Override
	public void createControl(Composite parent) {
		container = new Composite(parent, SWT.NULL);
		container.setLayout(new GridLayout(1, false));
		
		
		//-----------------------------------------------
		grpGeneral = new Group(container, SWT.NONE);
		grpGeneral.setText("General");
		grpGeneral.setLayout(new GridLayout(4, false));

		lblProjectName = new Label(grpGeneral, SWT.NONE);
		lblProjectName.setText("project name ");
		new Label(grpGeneral, SWT.NONE);
		new Label(grpGeneral, SWT.NONE);
		new Label(grpGeneral, SWT.NONE);
		
		txtProjectName = new Text(grpGeneral, SWT.BORDER);
		txtProjectName.setText(this.context.projectName);
		GridData projectNameGrid = new GridData(SWT.FILL, SWT.CENTER, true, false, 3, 1);
		projectNameGrid.widthHint = 500;
		txtProjectName.setLayoutData(projectNameGrid);
		new Label(grpGeneral, SWT.NONE);
				
		txtProjectName.addModifyListener(new ModifyListener() {
			@Override
			public void modifyText(ModifyEvent arg0) {
				if (existNameProject()) {
					activErrorMessage (0, true);
					setPageComplete(false);
				}
				else {
	    			  activErrorMessage(0 , false);
	    			  setPageComplete(true);					
				}
				updateNameProject(txtProjectName.getText());
			}
		});
		
		btnCheckLocation = new Button(grpGeneral, SWT.CHECK);
		btnCheckLocation.setText("use default location");
		btnCheckLocation.setSelection(true);
		new Label(grpGeneral, SWT.NONE);
		new Label(grpGeneral, SWT.NONE);
		new Label(grpGeneral, SWT.NONE);
{'fraction_non_alphanumeric': 0.11020137198495242, 'fraction_numerical': 0.005310909493250719, 'mean_word_length': 4.638802245789146, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '3321993', 'n_tokens_mistral': 3111, 'n_tokens_neox': 2867, 'n_words': 598}