Files
VisualSapfor/src/Common/Passes/All/IncludeSelectedFiles.java

35 lines
1.1 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 Common.Passes.All;
import Common.Current;
import Common.Global;
import ProjectData.Files.DBProjectFile;
import Common.Passes.PassCode_2021;
import Common.Passes.Pass_2021;
import java.util.Vector;
public class IncludeSelectedFiles extends Pass_2021<Vector<DBProjectFile>> {
@Override
public String getIconPath() {
return "/icons/Include.png";
}
@Override
protected boolean canStart(Object... args) {
if (!Global.files_multiselection) {
Log.Writeln_("Нажмите правую клавишу мыши, и перейдите в режим выбора файлов.");
return false;
}
target = new Vector<>();
for (DBProjectFile file : Current.getProject().db.files.Data.values())
if (file.isSelected()) target.add(file);
if (target.isEmpty()) {
Log.Writeln_("Не отмечено ни одного файла.");
return false;
}
return true;
}
@Override
protected void body() throws Exception {
for (DBProjectFile file : target)
passes.get(PassCode_2021.IncludeFile).Do(file);
}
}