Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pattern based file selection and deletion in Eclipse IDE

What I'm trying to is tag a batch of files for deletion within Eclipse, prior to issuing a commit via the Subversive integration to "delete" these files from the repository.

In a trivial case, you can of course do this by selecting multiple files in the explorer, alt-clicking and selecting delete, prior to doing a commit.

However, I need to do this on ~500 files that are spread across a directory hierarchy six+ levels deep.

As such, I'm wondering if there's any way to select and perform the standard alt-click operations on a group of files matching a given pattern, or indeed whether this is the best approach in the first instance.

like image 227
John Parker Avatar asked Dec 22 '22 11:12

John Parker


1 Answers

From the Eclipse main menu bar, select Search > File. Leave the "Containing Text" field blank, and enter the file name pattern you want.

This will display the files you're interested in in the Search view. To delete them:

  • In the view menu of the Search view (icon is a downward-pointing triangle, just to the left of the minimise/maximise buttons), select "show as list" instead of "show as tree". This hides directories from the Search view, and shows only the files which matched the pattern.
  • Select all files in the Search view with Ctrl-A
  • Right-click the selected files and choose Show In > Navigator from the popup menu. All matched files are now selected in the Navigator view.
  • Right-click one of the selected files in the Navigator, and choose Delete.
like image 154
OpenSauce Avatar answered Dec 29 '22 12:12

OpenSauce