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

Bug 316122

Summary: [api] AbstractCharacterPairInserter should allow extenders to override the used IExitPolicy
Product: [WebTools] WTP Source Editing Reporter: Ian Tewksbury <itewksbu>
Component: wst.sseAssignee: Ian Tewksbury <itewksbu>
Status: RESOLVED FIXED QA Contact: Nitin Dahyabhai <thatnitind>
Severity: normal    
Priority: P3 CC: nsand.dev
Version: 3.2Flags: nsand.dev: review+
thatnitind: review+
Target Milestone: 3.2.1   
Hardware: PC   
OS: Windows XP   
Whiteboard: WI 49025
Bug Depends on:    
Bug Blocks: 241363, 276702    
Attachments:
Description Flags
Patch nsand.dev: iplog+

Description Ian Tewksbury CLA 2010-06-08 09:09:56 EDT
While implementing AbstractCharacterPairInserter for script regions in HTML and JSP documents for Bug 276702 I have discovered a need to change the IExitPolicy that is used.

The specific case is for the {|} case where the user after entering { then presses enter.  With the provided exit policy the cursor then moves to the exit point so the end result is {}| but really the user wanted
{
|
}

This can easily be accomplished if the exit policy can be changed by extenders of the AbstractCharacterPairInserter.

Suggested patch to follow.
Comment 1 Ian Tewksbury CLA 2010-06-08 09:11:19 EDT
Created attachment 171399 [details]
Patch

Patch adds a protected getExitPolicy method to AbstractCharacterPairInserter allowing extenders to implement their own exit policy if they so choose.
Comment 2 Nick Sandonato CLA 2010-06-08 11:50:51 EDT
Patch looks good.
Comment 3 Nick Sandonato CLA 2010-06-15 16:28:59 EDT
Nitin, could you please review for 3.2.1?
Comment 4 Nick Sandonato CLA 2010-06-29 11:41:22 EDT
Released to Maintenance and HEAD.