package _VisualDVM.Passes.All; import Common.MainModule_; import Common.Passes.Pass; import _VisualDVM.Global; import _VisualDVM.GlobalData.SapforProfile.SapforProfile; import _VisualDVM.GlobalData.SapforProfileSetting.SapforProfileSetting; import _VisualDVM.Passes.PassCode; import java.util.Vector; public class ApplyProfile extends Pass { @Override public String getIconPath() { return "/Common/icons/Apply.png"; } @Override public String getButtonText() { return ""; } @Override public boolean needsConfirmations() { return true; } @Override protected boolean canStart(Object... args) throws Exception { if (MainModule_.instance.getDb().getTable(SapforProfile.class).getUI().CheckCurrent(Log)) { target = MainModule_.instance.getDb().getTable(SapforProfile.class).getUI().getCurrent(); return true; } return false; } @Override protected void body() throws Exception { Vector settings = new Vector<>(); for (SapforProfileSetting sapforProfileSetting : Global.mainModule.getDb().sapforProfilesSettings.Data.values()) if (sapforProfileSetting.sapforprofile_id == target.id) settings.add(sapforProfileSetting); //-- for (SapforProfileSetting setting : settings) if (Global.mainModule.getDb().settings.containsKey(setting.name)) Global.mainModule.getPass(PassCode.UpdateSetting).Do(setting.name, setting.value); //-- } }