Files
VisualSapfor/src/_VisualDVM/Passes/All/CreateTestsFromFiles.java

34 lines
1.3 KiB
Java
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
package _VisualDVM.Passes.All;
import Common.Visual.Windows.Dialog.VFileChooser;
import _VisualDVM.Global;
import _VisualDVM.Passes.PassCode;
import _VisualDVM.Utils;
import java.io.File;
import java.util.Vector;
public class CreateTestsFromFiles extends PublishTests {
VFileChooser fileChooser = new VFileChooser("Выберите файлы для создания тестов");
@Override
protected PassCode getCreateTestCode() {
return PassCode.CreateTestFromFile;
}
@Override
protected String getNoFilesMessage() {
return "ни одного файла";
}
@Override
protected boolean canStart(Object... args) throws Exception {
if (Global.testingServer.db.groups.getUI().CheckCurrent(Log)) {
Utils.RestoreSelectedDirectory(fileChooser);
Vector<File> files = fileChooser.ShowMultiDialog();
if (files.isEmpty()) {
Log.Writeln_("Не выбрано ни одного файла.");
return false;
}
Global.mainModule.getPass(PassCode.UpdateProperty).Do("ProjectsSearchDirectory", fileChooser.getCurrentDirectory().getAbsolutePath());
return super.canStart(files, Global.testingServer.db.groups.getUI().getCurrent());
}
return false;
}
}