удаление мусорного кода с настройками

This commit is contained in:
2025-01-13 22:41:11 +03:00
parent 6e28bfa809
commit 3decbe5212
10 changed files with 62 additions and 70 deletions

View File

@@ -307,35 +307,10 @@ public class GlobalProperties {
}
return false;
}
//выкинуть(?)
public void switchAndUpdateFlag(String name) {
try {
Field field = getClass().getField(name);
boolean oldValue = (boolean) field.get(this);
boolean newValue = !oldValue;
//---
field.set(this, newValue);
this.Update();
//--
} catch (Exception exception) {
exception.printStackTrace();
}
}
public File getFile() {
return Paths.get(System.getProperty("user.dir"), "properties").toFile();
}
//-----------------
//выкинуть.
public void addFlagMenuItem(JMenu menu, String fieldName) {
JMenuItem menu_item = new StableMenuItem(getFieldDescription(fieldName),
getFlag(fieldName) ? "/Common/icons/Pick.png" : "/Common/icons/NotPick.png");
//-
menu_item.addActionListener(e -> {
if (Global.mainModule.getPass(PassCode.UpdateProperty).Do(fieldName, !getFlag(fieldName)))
menu_item.setIcon(Utils_.getIcon(getFlag(fieldName) ? "/Common/icons/Pick.png" : "/Common/icons/NotPick.png"));
});
menu.add(menu_item);
}
public Object getValue(String fieldName){
Object res=null;
try {