Lines 212-217
Link Here
|
212 |
if (NotifyDescriptor.YES_OPTION.equals(notifyResult)) { |
212 |
if (NotifyDescriptor.YES_OPTION.equals(notifyResult)) { |
213 |
showDiffs(appliedFiles, backups); |
213 |
showDiffs(appliedFiles, backups); |
214 |
} |
214 |
} |
|
|
215 |
removeBackups(appliedFiles, backups); |
215 |
} |
216 |
} |
216 |
} |
217 |
} |
217 |
|
218 |
|
Lines 317-323
Link Here
|
317 |
public HelpCtx getHelpCtx() { |
318 |
public HelpCtx getHelpCtx() { |
318 |
return new HelpCtx(PatchAction.class); |
319 |
return new HelpCtx(PatchAction.class); |
319 |
} |
320 |
} |
320 |
|
321 |
|
|
|
322 |
/** Removes the backup copies of files upon the successful application |
323 |
* of a patch (.orig files). |
324 |
* @param files a list of files, to which the patch was successfully applied |
325 |
* @param backups a map of a form original file -> backup file |
326 |
*/ |
327 |
private static void removeBackups(ArrayList files, HashMap backups) { |
328 |
for (int i = 0; i < files.size(); i++) { |
329 |
try { |
330 |
((FileObject) backups.get(files.get(i))).delete(); |
331 |
} |
332 |
catch (IOException ioex) { |
333 |
ErrorManager.getDefault().notify( |
334 |
ErrorManager.getDefault().annotate(ioex, |
335 |
NbBundle.getMessage(PatchAction.class, "EXC_CannotRemoveBackup", |
336 |
ioex.getLocalizedMessage()))); |
337 |
} |
338 |
} |
339 |
} |
340 |
|
321 |
class ChooserListener implements ActionListener{ |
341 |
class ChooserListener implements ActionListener{ |
322 |
private JDialog dialog; |
342 |
private JDialog dialog; |
323 |
private JFileChooser chooser; |
343 |
private JFileChooser chooser; |