| Summary: | [Text] ModifyListeners are ignored when widget initially READ_ONLY | ||
|---|---|---|---|
| Product: | [RT] RAP | Reporter: | RĂ¼diger Herrmann <ruediger.herrmann> |
| Component: | RWT | Assignee: | Project Inbox <rap-inbox> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | b.fischer |
| Version: | unspecified | ||
| Target Milestone: | 1.4 M6 | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
The problem was in TextUtilLCA#writeVerifyAndModifyListener, where the property "hasVerifyOrModifyListener" was not written on the client in case of READ_ONLY style flag. Fixed in CVS HEAD. |
The text widget does not fire modify events if it was created with the READ_ONLY style flag and made editable later on. To reproduce, * run the code below * click on the "Make editable" button * then type into the text widget => no modify events are sent public int createUI() { Display display = new Display(); Shell shell = new Shell(); shell.setLayout(new RowLayout()); final Text text = new Text( shell, SWT.BORDER | SWT.READ_ONLY ); text.addModifyListener(new ModifyListener() { public void modifyText(ModifyEvent event) { System.out.println( "ModifyEvent: " + event ); } }); Button button = new Button( shell, SWT.PUSH); button.setText("Make editable"); button.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent event) { text.setEditable(true); } }); shell.pack(); shell.open(); while(!shell.isDisposed()){ if( !display.readAndDispatch()){ display.sleep(); } } return 0; }