Community
Participate
Working Groups
Provide utility method for interpreting escaped characters. Extenders of the org.eclipse.jface.text.IFindReplaceTargetExtension3 interface must interpret escaped characters from their implementation of the org.eclipse.jface.text.IFindReplaceTargetExtension3.replaceSelection(String, boolean) method. The code to interpret escaped characters is quite involved so it would be helpful to all extenders to have public access to the org.eclipse.jface.text.FindReplaceDocumentAdapter.interpretReplaceEscapes(String, String) method.
Any update on this enhancement for Eclipse 3.6?
interpretReplaceEscapes(String, String) is tightly coupled to the concrete implementation of regular expressions in FindReplaceDocumentAdapter, which is only implicitly specified through the FindReplaceDocumentAdapterContentProposalProvider. The implementation may change in incompatible ways in the future if we add new features (like e.g. the addition of Retain Case in 3.4). Is there a special reason why you can't use FindReplaceDocumentAdapter#replace(..) directly? interpretReplaceEscapes(String, String) is in fact just a wrapper around the java.util.regex.Pattern API. It would be strange if we made this helper API, but not the other tweaks we add in findReplace(..), e.g. substituteLinebreak(..).
(In reply to comment #2) > interpretReplaceEscapes(String, String) is tightly coupled to the concrete > implementation of regular expressions in FindReplaceDocumentAdapter, which is > only implicitly specified through the > FindReplaceDocumentAdapterContentProposalProvider. The implementation may > change in incompatible ways in the future if we add new features (like e.g. the > addition of Retain Case in 3.4). > > Is there a special reason why you can't use > FindReplaceDocumentAdapter#replace(..) directly? No, this may work. Once the current maintenance release ships, we will investigate using this API. > interpretReplaceEscapes(String, String) is in fact just a wrapper around the > java.util.regex.Pattern API. It would be strange if we made this helper API, > but not the other tweaks we add in findReplace(..), e.g. > substituteLinebreak(..).
Thanks, closing for now. Please reopen if it turns out you need anything.
(In reply to comment #3) > (In reply to comment #2) > > interpretReplaceEscapes(String, String) is tightly coupled to the concrete > > implementation of regular expressions in FindReplaceDocumentAdapter, which is > > only implicitly specified through the > > FindReplaceDocumentAdapterContentProposalProvider. The implementation may > > change in incompatible ways in the future if we add new features (like e.g. the > > addition of Retain Case in 3.4). > > > > Is there a special reason why you can't use > > FindReplaceDocumentAdapter#replace(..) directly? > > No, this may work. Once the current maintenance release ships, we will > investigate using this API. After reviewing our code, this may not work. Our implementation the of the org.eclipse.jface.text.IFindReplaceTargetExtension3 interface is providing search/replace function for a SWT table. Is there a 'table document' that could be used to map the text in cells to a region of a document or are you proposing to use a org.eclipse.jface.text.Document for each table cell?
Paul, the support is in the JFace Text package and designed for the JFace Text widgets and components. If you need support for SWT then you have to do one of this: - wrap the text in a document - place your request at another component (e.g. SWT)
(In reply to comment #6) > Paul, > > the support is in the JFace Text package and designed for the JFace Text > widgets and components. If you need support for SWT then you have to do one of > this: > - wrap the text in a document > - place your request at another component (e.g. SWT) Thanks Dani for your suggestions. We have opted for wrapping the text in a document.
Actually, for your use case it would be better to simply copy the following three methods: FindReplaceDocumentAdapter.interpretRetainCase(*) FindReplaceDocumentAdapter.interpretReplaceEscape(*) FindReplaceDocumentAdapter.interpretReplaceEscapes(*)
(In reply to comment #8) > Actually, for your use case it would be better to simply copy the following > three methods: > > FindReplaceDocumentAdapter.interpretRetainCase(*) > FindReplaceDocumentAdapter.interpretReplaceEscape(*) > FindReplaceDocumentAdapter.interpretReplaceEscapes(*) Thanks Dani. We will copy these methods.