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

This commit is contained in:
2023-11-19 01:53:56 +03:00
parent 4883b4af51
commit 44c6daffa3
596 changed files with 2140 additions and 1569 deletions

View File

@@ -0,0 +1,37 @@
package Common.Passes.All;
import Common.Database.Database;
import Common.Global;
import Common.Utils.Utils;
import GlobalData.SapforProfile.SapforProfile;
import Common.Passes.AddObjectPass;
import java.util.Date;
public class SaveProfile extends AddObjectPass<SapforProfile> {
public SaveProfile() {
super(SapforProfile.class);
}
@Override
public String getIconPath() {
return "/icons/Save.png";
}
@Override
protected Database getDb() {
return Global.db;
}
@Override
protected boolean canStart(Object... args) throws Exception {
//1. проверить нет ли уже такой последовательности настроек.
SapforProfile profile = Global.db.checkProfileForCurrentSettings();
if (profile != null) {
Log.Writeln_("Текущий набор настроек уже сохранён как профиль " + Utils.Brackets(profile.description));
return false;
}
return super.canStart(args);
}
@Override
protected void body() throws Exception {
target.creationDate = new Date().getTime();
super.body();
Global.db.insertProfileSettings(target);
}
}