Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 362782

Summary: [templates][preferences] No multi Undo action in EditTemplateDialog
Product: [Eclipse Project] JDT Reporter: Wojciech Trocki <wtrocki>
Component: TextAssignee: JDT-Text-Inbox <jdt-text-inbox>
Status: CLOSED DUPLICATE QA Contact:
Severity: minor    
Priority: P3 CC: deepakazad
Version: 3.8   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
Proposed path none

Description Wojciech Trocki CLA 2011-11-03 07:54:56 EDT
Build Identifier: Official Eclipse 3.7.1 

When using dialog from Java >> Editor >> Templates >> Edit. Undo seems to work improperly. We can revert to only one element from history. After that undo will be disabled in contex menu and shortcut.


Reproducible: Always
Comment 1 Wojciech Trocki CLA 2011-11-03 07:56:30 EDT
Created attachment 206401 [details]
Proposed path

Proposed workaround

See line 136:
if (fOperationCode == ITextOperationTarget.REDO || fOperationCode == ITextOperationTarget.UNDO){
  return;
}
Comment 2 Deepak Azad CLA 2011-11-03 08:21:30 EDT
Thanks Wojciech! 

(In reply to comment #1)
> Created attachment 206401 [details]
> Proposed path
> 
> Proposed workaround
> 
> See line 136:
> if (fOperationCode == ITextOperationTarget.REDO || fOperationCode ==
> ITextOperationTarget.UNDO){
>   return;
> }
That makes sense to me, and I verified that undo works multiple times after this change.

Dani, assigning to you as you will anyway have to commit the change in org.eclipse.ui.texteditor.templates.TemplatePreferencePage.EditTemplateDialog :)
Comment 3 Dani Megert CLA 2011-11-04 07:23:45 EDT
Fix also needs to go into org.eclipse.ui.texteditor.templates.TemplatePreferencePage.

*** This bug has been marked as a duplicate of bug 206111 ***