Bug 329370 - [nls tooling] Auto-encoding of unsupported characters in .properties files should also work on Find/Replace
Summary: [nls tooling] Auto-encoding of unsupported characters in .properties files sh...
Status: ASSIGNED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 3.7   Edit
Hardware: All All
: P4 enhancement (vote)
Target Milestone: ---   Edit
Assignee: JDT-Text-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-03 12:23 EDT by Markus Keller CLA
Modified: 2010-11-18 02:51 EST (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 Markus Keller CLA 2010-11-03 12:23:09 EDT
N20101102-2000

The auto-encoding of unsupported characters in .properties files should also work on Find/Replace. This happens when the real character is pasted into the Replace field, and it also happens when I enable regex and e.g. replace with \u2603.
Comment 1 Deepak Azad CLA 2010-11-04 01:32:21 EDT
For typing or pasting you get this call stack

Thread [main] (Suspended (breakpoint at line 63 in PropertiesFileAutoEditStrategy))	
	PropertiesFileAutoEditStrategy.customizeDocumentCommand(IDocument, DocumentCommand) line: 63	
	SourceViewer(TextViewer).customizeDocumentCommand(DocumentCommand) line: 3749	
	SourceViewer(TextViewer).handleVerifyEvent(VerifyEvent) line: 3779	
	TextViewer$TextVerifyListener.verifyText(VerifyEvent) line: 434	
	TypedListener.handleEvent(Event) line: 255	
	EventTable.sendEvent(Event) line: 84	
	StyledText(Widget).sendEvent(Event) line: 1053	
	StyledText(Widget).sendEvent(int, Event, boolean) line: 1077	
	
But in case of Find/replace TypedListener does not get an event. Investigating...
Comment 2 Deepak Azad CLA 2010-11-04 02:45:52 EDT
(In reply to comment #1)
> But in case of Find/replace TypedListener does not get an event.
TypedListener needs to get a SWT.Verify event but it does not. (It gets only SWT.Selection and SWT.Paint event)

The Find/Replace dialog modifies the IDocument (see FindReplaceDocumentAdapter.findReplace(...) line 213), which should modify the underlying StyledText and which should result in a call to StyledText.modifyContent(Event, boolean) - but it does not.
Comment 3 Markus Keller CLA 2010-11-17 10:43:59 EST
(In reply to comment #2)
> > But in case of Find/replace TypedListener does not get an event.
> TypedListener needs to get a SWT.Verify event but it does not. (It gets only
> SWT.Selection and SWT.Paint event)

The current policy is that StyledText only sends Verify events when the modification is initiated by the StyledText. We can't extends this and send events in all cases the underlying content changes externally (that would break many clients that don't expect these events and would e.g. not be complete if the modification occurs in a folded area that is not shown in the StyledText).

The problem is even broader than Find/Replace. E.g. File Search is also affected. Lowering severity and priority, since this has not been an issue in practice so far.