no message
This commit is contained in:
43
src/_VisualDVM/Passes/All/ApplyProfile.java
Normal file
43
src/_VisualDVM/Passes/All/ApplyProfile.java
Normal file
@@ -0,0 +1,43 @@
|
||||
package _VisualDVM.Passes.All;
|
||||
import _VisualDVM.Current;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.GlobalData.SapforProfile.SapforProfile;
|
||||
import _VisualDVM.GlobalData.SapforProfileSetting.SapforProfileSetting;
|
||||
import _VisualDVM.Passes.PassCode;
|
||||
import Common.Passes.Pass;
|
||||
|
||||
import java.util.Vector;
|
||||
public class ApplyProfile extends Pass<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 {
|
||||
if (Global.mainModule.Check(Log, Current.SapforProfile)) {
|
||||
target = (SapforProfile) Global.mainModule.get(Current.SapforProfile);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
protected void body() throws Exception {
|
||||
Vector<SapforProfileSetting> 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);
|
||||
//--
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user