Revert "упорядочил папки с кодом."

This reverts commit 44c6daffa3.
This commit is contained in:
2023-11-19 02:12:44 +03:00
parent 44c6daffa3
commit 28908bcfac
596 changed files with 1569 additions and 2140 deletions

View File

@@ -0,0 +1,63 @@
package Visual_DVM_2021.Passes.All;
import Common.Global;
import Common.UI.Menus_2023.PassMenuItem;
import Common.Utils.Files.VFileChooser;
import Visual_DVM_2021.Passes.CurrentComponentPass;
import javax.swing.*;
import javax.swing.filechooser.FileFilter;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.StandardCopyOption;
public class ResurrectComponent extends CurrentComponentPass {
@Override
public JMenuItem createMenuItem() {
if (menuItem == null)
menuItem = new PassMenuItem(this);
return menuItem;
}
@Override
public String getButtonText() {
return "";
}
File file;
VFileChooser fileChooser;
@Override
protected boolean canStart(Object... args) throws Exception {
if (super.canStart(args)) {
//тут таргет меняется, поэтому меняется и условие выбора файлов.
fileChooser = new VFileChooser(
"Выбор версии компонента для восстановления",
new FileFilter() {
@Override
public boolean accept(File f) {
return f.isFile() &&
f.getName().startsWith(target.getComponentType().toString());
}
@Override
public String getDescription() {
return target.getComponentType().toString() + "*";
}
}
);
fileChooser.SetCurrentDirectory(Global.BackUpsDirectory);
return (file = fileChooser.ShowDialog()) != null;
}
return false;
}
@Override
protected void body() throws Exception {
Files.copy(file.toPath(), target.getNewFile().toPath(), StandardCopyOption.REPLACE_EXISTING);
target.Update();
}
@Override
protected void performDone() throws Exception {
target.InitialVersionCheck();
if (target.CanBeUpdated())
target.CheckIfNeedsUpdateOrPublish();
}
@Override
protected void showDone() throws Exception {
Global.RefreshUpdatesStatus();
}
}