public void actionPerformed(ActionEvent e) { String root = ModelSupport.getResourceRoot(testStep); File file = UISupport.getFileDialogs() .saveAs( this, "Set properties target", "properties", "Properties Files (*.properties)", new File(root)); if (file != null) { updatingTarget = true; testStep.setTarget(file.getAbsolutePath()); targetField.setText(testStep.getTarget()); updatingTarget = false; try { int cnt = testStep.saveProperties(); UISupport.showInfoMessage( "Saved " + cnt + " properties to [" + testStep.getTarget() + "]"); } catch (IOException e1) { UISupport.showErrorMessage( "Failed to save properties to [" + testStep.getTarget() + "]; " + e1); } } }
public void actionPerformed(ActionEvent e) { String root = ModelSupport.getResourceRoot(testStep); File file = UISupport.getFileDialogs() .open( this, "Set properties source", "properties", "Properties Files (*.properties)", root); if (file != null) { updatingSource = true; testStep.setSource(file.getAbsolutePath()); sourceField.setText(testStep.getSource()); updatingSource = false; try { boolean createMissing = UISupport.confirm("Create missing properties?", "Set Properties Source"); int cnt = testStep.loadProperties(createMissing); UISupport.showInfoMessage( "Loaded " + cnt + " properties from [" + testStep.getSource() + "]"); } catch (IOException e1) { UISupport.showErrorMessage( "Failed to load properties from [" + testStep.getSource() + "]; " + e1); } } }