Files
VisualSapfor/src/Visual_DVM_2021/Passes/All/IncludeSelectedFiles.java
2023-11-19 02:12:44 +03:00

35 lines
1.2 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 Visual_DVM_2021.Passes.All;
import Common.Current;
import Common.Global;
import ProjectData.Files.DBProjectFile;
import Visual_DVM_2021.Passes.PassCode_2021;
import Visual_DVM_2021.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);
}
}