| Summary: | enable 'organize imports' on source folders and projects [code manipulation] | ||
|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Adam Kiezun <akiezun> |
| Component: | UI | Assignee: | Martin Aeschlimann <martinae> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | enhancement | ||
| Priority: | P3 | CC: | martinae, mccull1, mlq.eclipse, shortcutter |
| Version: | 2.0 | ||
| Target Milestone: | 2.1 M2 | ||
| Hardware: | PC | ||
| OS: | Windows 2000 | ||
| Whiteboard: | |||
| Bug Depends on: | 18697 | ||
| Bug Blocks: | |||
|
Description
Adam Kiezun
defer I originally posted the same request as bug 6665 ... I don't know that it really makes much difference, but I have a plugin that does this if anyone is interested. I defined an abstract object action which searches for compilation units under the selected element(s) (project/package/file/). I then defined actions for Format, Organize Imports, and Insert File Comment. Seems the same approach could be taken. The abstract Action handles the progress bar and creating the workbench runnable, and then asks the subclasses to process a single compilation unit at a time via an abstract method that returns an IStatus. After each is processed the progress bar is updated and it moves to the next compilation unit. Another little feature I am trying to add is popping up the editor of a class where there is an ambiguous reference, and asking the user to choose (like regular organize does). Unfortunately, this tends to cause the progress bar to disappear so I might have to abandon it. I am currently working on integrating Jalopy (since I don't trust the Eclipse formatter to format my whole project, but there are enough bugs on that one), and on figureing out how to hook into VCM to check out files (I use ClearCase at work). Whenever I finish it I will be making it public... but if you care, the code is available via anonymous CVS. -Andrew organize imports now also works on Project & source folders. We should add this also for the formatter. Andrew, it would be nice to take your code. Can you attach it to this bug report or mail it to me? closing this one. |