2023-11-19 02:12:44 +03:00
|
|
|
package Visual_DVM_2021.Passes.All;
|
2024-10-08 00:39:13 +03:00
|
|
|
import Common.CurrentAnchestor;
|
2024-10-07 00:58:29 +03:00
|
|
|
import Common_old.Current;
|
|
|
|
|
import _VisualDVM.Global;
|
2023-09-17 22:13:42 +03:00
|
|
|
import GlobalData.SapforProfile.SapforProfile;
|
|
|
|
|
import GlobalData.SapforProfileSetting.SapforProfileSetting;
|
2023-11-19 02:12:44 +03:00
|
|
|
import Visual_DVM_2021.Passes.PassCode_2021;
|
|
|
|
|
import Visual_DVM_2021.Passes.Pass_2021;
|
2023-09-17 22:13:42 +03:00
|
|
|
|
|
|
|
|
import java.util.Vector;
|
|
|
|
|
public class ApplyProfile extends Pass_2021<SapforProfile> {
|
|
|
|
|
@Override
|
|
|
|
|
public String getIconPath() {
|
|
|
|
|
return "/icons/Apply.png";
|
|
|
|
|
}
|
|
|
|
|
@Override
|
|
|
|
|
public String getButtonText() {
|
|
|
|
|
return "";
|
|
|
|
|
}
|
|
|
|
|
@Override
|
|
|
|
|
public boolean needsConfirmations() {
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
@Override
|
|
|
|
|
protected boolean canStart(Object... args) throws Exception {
|
2024-10-08 00:39:13 +03:00
|
|
|
if (CurrentAnchestor.Check(Log, Current.SapforProfile)) {
|
|
|
|
|
target = (SapforProfile) CurrentAnchestor.get(Current.SapforProfile);
|
2023-09-17 22:13:42 +03:00
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
@Override
|
|
|
|
|
protected void body() throws Exception {
|
|
|
|
|
Vector<SapforProfileSetting> settings = new Vector<>();
|
|
|
|
|
for (SapforProfileSetting sapforProfileSetting : Global.db.sapforProfilesSettings.Data.values())
|
|
|
|
|
if (sapforProfileSetting.sapforprofile_id == target.id)
|
|
|
|
|
settings.add(sapforProfileSetting);
|
|
|
|
|
//--
|
|
|
|
|
for (SapforProfileSetting setting : settings)
|
|
|
|
|
if (Global.db.settings.containsKey(setting.name))
|
|
|
|
|
passes.get(PassCode_2021.UpdateSetting).Do(setting.name, setting.value);
|
|
|
|
|
//--
|
|
|
|
|
}
|
|
|
|
|
}
|