| Summary: | [ccp] Don't select extension when asking for new file name on paste | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Markus Keller <markus.kell.r> | ||||
| Component: | UI | Assignee: | Noopur Gupta <noopur_gupta> | ||||
| Status: | RESOLVED FIXED | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | jerome.cambon, markus.kell.r, noopur_gupta | ||||
| Version: | 4.4 | Flags: | markus.kell.r:
review+
|
||||
| Target Milestone: | 4.5 M1 | ||||||
| Hardware: | All | ||||||
| OS: | All | ||||||
| Whiteboard: | |||||||
| Bug Depends on: | 391389 | ||||||
| Bug Blocks: | |||||||
| Attachments: |
|
||||||
|
Description
Markus Keller
Please think about other cases where should add this as well for consistency. I didn't find anything right away, but maybe you do. I couldn't find any place other than comment #0 where file name is pre-filled with extension. For copy/paste, the selection of the text to change is done from org.eclipse.jface.dialogs.InputDialog class. The selectAll() call on the text field is hardcoded on this dialog. So it seems an important refactoring would be needed to fix this one (for instance define a specific wizard, as done with RenameResourceWizard). No sure I want to jump into this now, so unless there is a simple solution, perhaps it is better to assign to somebody else. Created attachment 244547 [details] Patch (In reply to Jerome Cambon from comment #3) > For copy/paste, the selection of the text to change is done from > org.eclipse.jface.dialogs.InputDialog class. > The selectAll() call on the text field is hardcoded on this dialog. We can override InputDialog#createButtonsForButtonBar which calls Text.selectAll() and set the selection as required. Markus, please have a look at the attached patch. (In reply to Noopur Gupta from comment #4) > We can override InputDialog#createButtonsForButtonBar which calls > Text.selectAll() and set the selection as required. Yes, that works. But the choice of InputDialog to set/select the text in #createButtonsForButtonBar(Composite) is questionable. We better override #createContents(Composite). Fixed with http://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/commit/?id=e3acadde6670cb99e73585d381037e12bf2af2cd Applied the same fix to org.eclipse.ui.actions.CopyFilesAndFoldersOperation#getNewNameFor(..): http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=5420fb1b4fc1a364dee872c2f469c8712e2b5e5e Resurrected bug 200444 to make it follow the behavior from bug 151668. |