PropertyChangeListener验证

时间:2015-08-25 20:45:12

标签: eclipse propertychangelistener

我尝试从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 */

                    }

    }

0 个答案:

没有答案