package authoring.settings;

import java.io.File;
import java.util.Scanner;
import java.util.function.Consumer;

import authoring.ActionButton;
import authoring.Workspace;
import authoring.utils.Direction;
import authoring.views.CollapsibleView;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.scene.control.Button;
import javafx.scene.control.CheckBox;
/**
 * 
 * @author Mina
 *
 */
import javafx.scene.layout.VBox;
import javafx.stage.FileChooser;
import javafx.stage.Stage;
import javafx.stage.FileChooser.ExtensionFilter;
public class Settings extends CollapsibleView {

	private Workspace workspace;
	private VBox settingsContainer;
	
	public Settings(Workspace workspace, int index) {
		super(workspace, workspace.getPane(), workspace.getResources().getString("SettingsTitle"), index, Direction.LEFT, true);
		this.workspace = workspace;
		configureSettings();
	}
	
	private void dummyMethod(){
		int i = 0;
	}
	
	private void chooseFile(Consumer<File> r)
	{
		FileChooser fileChooser = new FileChooser();
				File file = fileChooser.showOpenDialog(new Stage());
				if (file != null){
					r.accept(file);
				}
	}
	
	private void configureSettings(){
		settingsContainer = new VBox();
		settingsContainer.setSpacing(30);
		Button selectMusic = new ActionButton("Select Background Music", event->chooseFile((File f) ->{
			Scanner scan;
		}));
		CheckBox hScrolling = new CheckBox("Horizontal Scrolling");
		CheckBox vScrolling= new CheckBox("Vertical Scrolling");
		Button saveButton = new ActionButton("Save", event->dummyMethod());
		settingsContainer.getChildren().addAll(selectMusic,hScrolling,vScrolling,saveButton);
		setCenter(settingsContainer);
	}

}

@@ -384,39 +384,8 @@
 ox;%0A
-/**%0A * %0A * @author Mina%0A *%0A */%0A
 impo
@@ -522,16 +522,47 @@
 Filter;%0A
+/**%0A * %0A * @author Mina%0A *%0A */%0A
 public c
@@ -583,27 +583,16 @@
 extends 
-Collapsible
 View %7B%0A%0A
@@ -696,19 +696,8 @@
 pace
-, int index
 ) %7B%0A
@@ -708,40 +708,8 @@
 per(
-workspace, workspace.getPane(), 
 work
@@ -759,37 +759,8 @@
 le%22)
-, index, Direction.LEFT, true
 );%0A%09

reconfigure the authoring structure