我正在尝试从 Eclipse 首选项页面实现一个视图,并且在某些字段中,此方法(performStringSubstitution)不起作用,因为 StringFieldEditor 之前进行了验证并且不授予 label.setText()的权限,我将不胜感激. `
public void propertyChange(PropertyChangeEvent event)
{
/*Solve Eclipse variable method (${workspace_loc},${project_loc},...)*/
String dir = Activator.getDefault().getPreferenceStore()
.getString(event.getNewValue().toString());
IStringVariableManager manager = VariablesPlugin.getDefault()
.getStringVariableManager();
try {
String solvePathUpdate = manager.performStringSubstitution(dir);
label.setText(solvePathUpdate);
}
catch (CoreException e)
{
// TODO Auto-generated catch block
/* Creating the method print console */
}
}