/*
 * Copyright 2014-2016 See AUTHORS file.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.kotcrab.vis.ui.test.manual;

import com.badlogic.gdx.scenes.scene2d.Actor;
import com.badlogic.gdx.scenes.scene2d.utils.ChangeListener;
import com.kotcrab.vis.ui.widget.VisTextButton;
import com.kotcrab.vis.ui.widget.VisWindow;
import com.kotcrab.vis.ui.widget.file.FileChooser;
import com.kotcrab.vis.ui.widget.file.FileChooser.Mode;

public class TestFileChooser extends VisWindow {

	public TestFileChooser () {
		super("filechooser");

		FileChooser.setFavoritesPrefsName("com.kotcrab.vis.ui.test.manual");
		final FileChooser chooser = new FileChooser(Mode.OPEN);

		VisTextButton show = new VisTextButton("show");

		show.addListener(new ChangeListener() {
			@Override
			public void changed (ChangeEvent event, Actor actor) {
				getStage().addActor(chooser.fadeIn());
			}
		});

		add(show);

		pack();
		setPosition(1038, 66);
	}

}

@@ -637,16 +637,58 @@
 anual;%0A%0A
+import com.badlogic.gdx.files.FileHandle;%0A
 import c
@@ -725,16 +725,16 @@
 .Actor;%0A
-
 import c
@@ -984,16 +984,84 @@
 er.Mode;
+%0Aimport com.kotcrab.vis.ui.widget.file.StreamingFileChooserListener;
 %0A%0Apublic
@@ -1229,16 +1229,16 @@
 nual%22);%0A
-
 %09%09final 
@@ -1286,16 +1286,180 @@
 e.OPEN);
+%0A%09%09chooser.setListener(new StreamingFileChooserListener() %7B%0A%09%09%09@Override%0A%09%09%09public void selected (FileHandle file) %7B%0A%09%09%09%09System.out.println(file.path());%0A%09%09%09%7D%0A%09%09%7D);
 %0A%0A%09%09VisT

Update FileChooser test