2024-10-14 12:14:01 +03:00
|
|
|
package _VisualDVM.Passes.All;
|
2024-10-24 23:40:24 +03:00
|
|
|
import Common.MainModule_;
|
2024-10-14 15:19:13 +03:00
|
|
|
import Common.Passes.Pass;
|
2024-10-09 22:01:19 +03:00
|
|
|
import _VisualDVM.Current;
|
2024-10-12 00:17:51 +03:00
|
|
|
import _VisualDVM.Global;
|
2024-10-09 22:21:57 +03:00
|
|
|
import _VisualDVM.GlobalData.SapforProfile.SapforProfile;
|
|
|
|
|
import _VisualDVM.GlobalData.SapforProfileSetting.SapforProfileSetting;
|
2024-10-14 12:14:01 +03:00
|
|
|
import _VisualDVM.Passes.PassCode;
|
2023-09-17 22:13:42 +03:00
|
|
|
|
|
|
|
|
import java.util.Vector;
|
2024-10-09 23:37:58 +03:00
|
|
|
public class ApplyProfile extends Pass<SapforProfile> {
|
2023-09-17 22:13:42 +03:00
|
|
|
@Override
|
|
|
|
|
public String getIconPath() {
|
2024-10-15 16:58:20 +03:00
|
|
|
return "/Common/icons/Apply.png";
|
2023-09-17 22:13:42 +03:00
|
|
|
}
|
|
|
|
|
@Override
|
|
|
|
|
public String getButtonText() {
|
|
|
|
|
return "";
|
|
|
|
|
}
|
|
|
|
|
@Override
|
|
|
|
|
public boolean needsConfirmations() {
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
@Override
|
|
|
|
|
protected boolean canStart(Object... args) throws Exception {
|
2024-10-24 23:40:24 +03:00
|
|
|
if (MainModule_.instance.getDb().getTable(SapforProfile.class).getUI().Check(Log)) {
|
|
|
|
|
target = MainModule_.instance.getDb().getTable(SapforProfile.class).getUI().getCurrent();
|
2023-09-17 22:13:42 +03:00
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
@Override
|
|
|
|
|
protected void body() throws Exception {
|
|
|
|
|
Vector<SapforProfileSetting> settings = new Vector<>();
|
2024-10-12 00:17:51 +03:00
|
|
|
for (SapforProfileSetting sapforProfileSetting : Global.mainModule.getDb().sapforProfilesSettings.Data.values())
|
2023-09-17 22:13:42 +03:00
|
|
|
if (sapforProfileSetting.sapforprofile_id == target.id)
|
|
|
|
|
settings.add(sapforProfileSetting);
|
|
|
|
|
//--
|
|
|
|
|
for (SapforProfileSetting setting : settings)
|
2024-10-12 00:17:51 +03:00
|
|
|
if (Global.mainModule.getDb().settings.containsKey(setting.name))
|
2024-10-13 23:55:03 +03:00
|
|
|
Global.mainModule.getPass(PassCode.UpdateSetting).Do(setting.name, setting.value);
|
2023-09-17 22:13:42 +03:00
|
|
|
//--
|
|
|
|
|
}
|
|
|
|
|
}
|