no message
This commit is contained in:
@@ -3,6 +3,7 @@ import Common.Database.Tables.DataSet;
|
||||
import Common.MainModule_;
|
||||
import Common.Visual.DataSetControlForm;
|
||||
import Common.Visual.Tables.ColumnInfo;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.GlobalData.SapforProfile.SapforProfile;
|
||||
import _VisualDVM.GlobalData.SapforProfileSetting.SapforProfileSetting;
|
||||
|
||||
@@ -17,7 +18,7 @@ public class SapforProfileSettingsForm extends DataSetControlForm<SapforProfileS
|
||||
new ColumnInfo<SapforProfileSetting>("имя") {
|
||||
@Override
|
||||
public Object getFieldAt(SapforProfileSetting object) {
|
||||
return "?"; // object.name.getDescription();
|
||||
return Global.mainModule.getProject().sapforProperties.getFieldDescription(object.name);
|
||||
}
|
||||
},
|
||||
new ColumnInfo<SapforProfileSetting>("значение") {
|
||||
|
||||
@@ -35,11 +35,6 @@ public class ApplyProfile extends Pass<SapforProfile> {
|
||||
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);
|
||||
//--
|
||||
*/
|
||||
Global.mainModule.getProject().sapforProperties.applyProfile(settings);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ import Common.Properties;
|
||||
import Common.Utils.Utils_;
|
||||
import Common.Utils.Vector_;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.GlobalData.SapforProfileSetting.SapforProfileSetting;
|
||||
import _VisualDVM.Passes.PassCode;
|
||||
import _VisualDVM.Repository.BugReport.Json.VisualiserSettingJson;
|
||||
import _VisualDVM.Repository.BugReport.Json.VisualiserSettingsJson;
|
||||
@@ -224,4 +225,51 @@ public class SapforProperties extends Properties {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
}
|
||||
public void applyProfile(Vector<SapforProfileSetting> settings){
|
||||
Vector<String> changedFields = new Vector<>();
|
||||
try {
|
||||
for (SapforProfileSetting setting : settings) {
|
||||
System.out.println(setting.name+"="+ Utils_.Brackets(setting.value));
|
||||
Field field = null;
|
||||
try {
|
||||
field = getClass().getField(setting.name);
|
||||
}
|
||||
catch (Exception ex){
|
||||
ex.printStackTrace();
|
||||
}
|
||||
if (field!=null) {
|
||||
if (field.getName().equals(setting.name)) {
|
||||
changedFields.add(setting.name);
|
||||
switch (setting.name) {
|
||||
case "GCOVLimit":
|
||||
GCOVLimit = Integer.parseInt(setting.value);
|
||||
break;
|
||||
case "MAX_SHADOW_WIDTH":
|
||||
MAX_SHADOW_WIDTH = Integer.parseInt(setting.value);
|
||||
break;
|
||||
case "ANALYSIS_OPTIONS":
|
||||
ANALYSIS_OPTIONS = setting.value;
|
||||
break;
|
||||
case "DVMConvertationOptions":
|
||||
DVMConvertationOptions = setting.value;
|
||||
break;
|
||||
default:
|
||||
int value_ = Integer.parseInt(setting.value);
|
||||
field.set(this, value_ != 0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!changedFields.isEmpty()) {
|
||||
this.Update();
|
||||
for (String fieldName: changedFields){
|
||||
Mark(fieldName, getMenuItem(fieldName));
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user