// Path: src/name/admitriev/jhelper/task/TaskData.java
// public class TaskData {
// 	private final String name;
// 	private final String className;
// 	private final String cppPath;
// 	private final StreamConfiguration input;
// 	private final StreamConfiguration output;
// 	private final TestType testType;
// 	private final Test[] tests;
// 
// 	public TaskData(
// 			String name,
// 			String className,
// 			String cppPath,
// 			StreamConfiguration input,
// 			StreamConfiguration output,
// 			TestType testType,
// 			Test[] tests
// 	) {
// 		this.input = input;
// 		this.output = output;
// 		this.name = name;
// 		this.className = className;
// 		this.cppPath = cppPath;
// 		this.testType = testType;
// 		this.tests = Arrays.copyOf(tests, tests.length);
// 	}
// 
// 	public TaskData(TaskData task) {
// 		this(task.name, task.className, task.cppPath, task.input, task.output, task.testType, task.tests);
// 	}
// 
// 	public String getName() {
// 		return name;
// 	}
// 
// 	public String getClassName() {
// 		return className;
// 	}
// 
// 	public String getCppPath() {
// 		return cppPath;
// 	}
// 
// 	public StreamConfiguration getInput() {
// 		return input;
// 	}
// 
// 	public StreamConfiguration getOutput() {
// 		return output;
// 	}
// 
// 	public Test[] getTests() {
// 		return Arrays.copyOf(tests, tests.length);
// 	}
// 
// 	public static TaskData emptyTaskData(Project project) {
// 		return new TaskData(
// 				"",
// 				"",
// 				String.format(defaultCppPathFormat(project), ""),
// 				StreamConfiguration.STANDARD,
// 				StreamConfiguration.STANDARD,
// 				TestType.SINGLE,
// 				new Test[0]
// 		);
// 	}
// 
// 	public static String defaultCppPathFormat(Project project) {
// 		Configurator configurator = project.getService(Configurator.class);
// 		Configurator.State configuration = configurator.getState();
// 		String path = configuration.getTasksDirectory();
// 		return path + "/%s.cpp";
// 	}
// 
// 	public TestType getTestType() {
// 		return testType;
// 	}
// 
// }


import com.intellij.openapi.project.Project;
import com.intellij.openapi.ui.ComboBox;
import com.intellij.openapi.ui.LabeledComponent;
import name.admitriev.jhelper.task.TaskData;
import net.egork.chelper.task.StreamConfiguration;
import net.egork.chelper.task.Test;
import net.egork.chelper.task.TestType;
import org.jdesktop.swingx.VerticalLayout;
import javax.swing.*;
package name.admitriev.jhelper.ui;



/**
 * Panel for task configuration.
 */
public final class TaskSettingsComponent extends JPanel {
	private JTextField name = null;
	private JTextField className = null;
	private FileSelector cppPath = null;
	private StreamConfigurationPanel input = null;
	private StreamConfigurationPanel output = null;
	private ComboBox<TestType> testType = null;
	private final boolean canChangeName;

	private Project project;

	private StreamConfigurationPanel.SizeChangedListener listener;

	public TaskSettingsComponent(Project project, boolean canChangeName) {
		this(project, canChangeName, null);
	}

	public TaskSettingsComponent(Project project, boolean canChangeName, StreamConfigurationPanel.SizeChangedListener listener) {
		super(new VerticalLayout());
		this.project = project;
		this.listener = listener;
		this.canChangeName = canChangeName;

// Path: src/name/admitriev/jhelper/task/TaskData.java
// public class TaskData {
// 	private final String name;
// 	private final String className;
// 	private final String cppPath;
// 	private final StreamConfiguration input;
// 	private final StreamConfiguration output;
// 	private final TestType testType;
// 	private final Test[] tests;
// 
// 	public TaskData(
// 			String name,
// 			String className,
// 			String cppPath,
// 			StreamConfiguration input,
// 			StreamConfiguration output,
// 			TestType testType,
// 			Test[] tests
// 	) {
// 		this.input = input;
// 		this.output = output;
// 		this.name = name;
// 		this.className = className;
// 		this.cppPath = cppPath;
// 		this.testType = testType;
// 		this.tests = Arrays.copyOf(tests, tests.length);
// 	}
// 
// 	public TaskData(TaskData task) {
// 		this(task.name, task.className, task.cppPath, task.input, task.output, task.testType, task.tests);
// 	}
// 
// 	public String getName() {
// 		return name;
// 	}
// 
// 	public String getClassName() {
// 		return className;
// 	}
// 
// 	public String getCppPath() {
// 		return cppPath;
// 	}
// 
// 	public StreamConfiguration getInput() {
// 		return input;
// 	}
// 
// 	public StreamConfiguration getOutput() {
// 		return output;
// 	}
// 
// 	public Test[] getTests() {
// 		return Arrays.copyOf(tests, tests.length);
// 	}
// 
// 	public static TaskData emptyTaskData(Project project) {
// 		return new TaskData(
// 				"",
// 				"",
// 				String.format(defaultCppPathFormat(project), ""),
// 				StreamConfiguration.STANDARD,
// 				StreamConfiguration.STANDARD,
// 				TestType.SINGLE,
// 				new Test[0]
// 		);
// 	}
// 
// 	public static String defaultCppPathFormat(Project project) {
// 		Configurator configurator = project.getService(Configurator.class);
// 		Configurator.State configuration = configurator.getState();
// 		String path = configuration.getTasksDirectory();
// 		return path + "/%s.cpp";
// 	}
// 
// 	public TestType getTestType() {
// 		return testType;
// 	}
// 
// }


// Path: src/name/admitriev/jhelper/ui/TaskSettingsComponent.java
import com.intellij.openapi.project.Project;
import com.intellij.openapi.ui.ComboBox;
import com.intellij.openapi.ui.LabeledComponent;
import name.admitriev.jhelper.task.TaskData;
import net.egork.chelper.task.StreamConfiguration;
import net.egork.chelper.task.Test;
import net.egork.chelper.task.TestType;
import org.jdesktop.swingx.VerticalLayout;
import javax.swing.*;

package name.admitriev.jhelper.ui;



/**
 * Panel for task configuration.
 */
public final class TaskSettingsComponent extends JPanel {
	private JTextField name = null;
	private JTextField className = null;
	private FileSelector cppPath = null;
	private StreamConfigurationPanel input = null;
	private StreamConfigurationPanel output = null;
	private ComboBox<TestType> testType = null;
	private final boolean canChangeName;

	private Project project;

	private StreamConfigurationPanel.SizeChangedListener listener;

	public TaskSettingsComponent(Project project, boolean canChangeName) {
		this(project, canChangeName, null);
	}

	public TaskSettingsComponent(Project project, boolean canChangeName, StreamConfigurationPanel.SizeChangedListener listener) {
		super(new VerticalLayout());
		this.project = project;
		this.listener = listener;
		this.canChangeName = canChangeName;

		setTaskData(TaskData.emptyTaskData(project));