no message
This commit is contained in:
@@ -299,17 +299,8 @@ public class GlobalProperties {
|
||||
menuItem.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
switch (fieldName){
|
||||
case "BugReportsAgeLimit":
|
||||
SliderNumberForm f = new SliderNumberForm();
|
||||
if (f.ShowDialog(getFieldDescription(fieldName), getValue(fieldName), 1, 12)) {
|
||||
int newValue = f.Result;
|
||||
if (Global.mainModule.getPass(PassCode.UpdateProperty).Do(fieldName, newValue)) {
|
||||
Mark(fieldName, menuItem);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (Global.mainModule.getPass(PassCode.UpdateProperty).Do(fieldName))
|
||||
Mark(fieldName, menuItem);
|
||||
}
|
||||
});
|
||||
controls.put(fieldName,menuItem);
|
||||
@@ -333,32 +324,4 @@ public class GlobalProperties {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
}
|
||||
/*
|
||||
public ActionListener getChangeAction(String fieldName){
|
||||
try {
|
||||
String description = getFieldDescription(fieldName);
|
||||
Object oldValue = this.getClass().getField(fieldName).get(this);
|
||||
return new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
switch (fieldName) {
|
||||
case "BugReportsAgeLimit":
|
||||
SliderNumberForm f = new SliderNumberForm();
|
||||
if (f.ShowDialog(description, oldValue, 1, 12)) {
|
||||
int newValue = f.Result;
|
||||
if (Global.mainModule.getPass(PassCode.UpdateProperty).Do(fieldName, newValue)) {
|
||||
menu_item.setText(description + " : " + newValue);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
catch (Exception ex){
|
||||
ex.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
*/
|
||||
}
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
package _VisualDVM.Passes.All;
|
||||
import Common.Passes.Pass;
|
||||
import Common.Visual.Windows.Dialog.SliderNumberForm;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.GlobalProperties;
|
||||
import _VisualDVM.Passes.PassCode;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
public class UpdateProperty extends Pass<Object> {
|
||||
@@ -13,12 +15,23 @@ public class UpdateProperty extends Pass<Object> {
|
||||
@Override
|
||||
protected boolean canStart(Object... args) throws Exception {
|
||||
name = (String) args[0];
|
||||
newValue = args[1];
|
||||
//--
|
||||
String description = Global.properties.getFieldDescription(name);
|
||||
field = GlobalProperties.class.getField(name);
|
||||
oldValue = field.get(Global.properties);
|
||||
//---
|
||||
return !newValue.equals(oldValue);
|
||||
newValue = null;
|
||||
SliderNumberForm sliderNumberForm = new SliderNumberForm();
|
||||
//-
|
||||
if (args.length==1){
|
||||
switch (name){
|
||||
case "BugReportsAgeLimit":
|
||||
if (sliderNumberForm.ShowDialog(description, oldValue, 1, 12))
|
||||
newValue=sliderNumberForm.Result;
|
||||
break;
|
||||
}
|
||||
}else
|
||||
newValue = args[1];
|
||||
//--
|
||||
return newValue!=null&&!newValue.equals(oldValue);
|
||||
}
|
||||
@Override
|
||||
protected void body() throws Exception {
|
||||
|
||||
Reference in New Issue
Block a user