Bug 166792 - [api] Make DefaultCharacterPairMatcher.findPeer public
Summary: [api] Make DefaultCharacterPairMatcher.findPeer public
Status: RESOLVED WONTFIX
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 3.3   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Platform-Text-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: api, helpwanted
Depends on:
Blocks:
 
Reported: 2006-12-05 10:43 EST by Christian Plesner Hansen CLA
Modified: 2010-10-21 01:23 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Christian Plesner Hansen CLA 2006-12-05 10:43:21 EST
The usual character matching method, DefaultCharacterPairMatcher.performMatch, allows you to find the matching peer for the character at a particular position.  findPeer generalizes this by finding the matching peer for a user-specified character, starting from a particular position.  This can be useful in situations such as auto edit where you're considering changes to a document that haven't actually been applied yet, so the character to find a peer for has not yet been inserted into the document.
Comment 1 Dani Megert CLA 2006-12-11 02:32:06 EST
There's no findPeer(...) method. Did you mean findMatchingPeer(...)? If so, this can't be made public since it needs the private DocumentPartitionAccessor which we don't want to make public.
Comment 2 Christian Plesner Hansen CLA 2006-12-11 16:16:57 EST
It turns out that I had refactored the class and then forgotten about it.  So let me rephrase the feature request.

I suggest that performMatch be refactored so that all code except for the first line is made into a new method (which could be called findPeer) that takes the document, offset and prevChar as arguments.  This new method should be public for the reasons described in the original request.
Comment 3 Dani Megert CLA 2006-12-12 02:45:54 EST
I'd accept a good quality patch with some tests.
Comment 4 Dani Megert CLA 2010-10-21 01:23:45 EDT
No plans to do this.