| Summary: | New Java class wizard "Interfaces" table displays junk | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Jared Burns <jared_burns> | ||||||||
| Component: | SWT | Assignee: | Ian Pun <ipun> | ||||||||
| Status: | RESOLVED FIXED | QA Contact: | |||||||||
| Severity: | normal | ||||||||||
| Priority: | P3 | CC: | billy.biggs, cocoakevin, eclipse, ericwill, markus.kell.r, snorthov | ||||||||
| Version: | 4.7 | ||||||||||
| Target Milestone: | 4.7 M2 | ||||||||||
| Hardware: | PC | ||||||||||
| OS: | Linux-GTK | ||||||||||
| See Also: |
https://git.eclipse.org/r/78969 https://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=93cbea04d4686273697e48e72ea5b7546547f7c0 https://bugs.eclipse.org/bugs/show_bug.cgi?id=542621 |
||||||||||
| Whiteboard: | |||||||||||
| Attachments: |
|
||||||||||
|
Description
Jared Burns
Created attachment 20915 [details]
interfaces.png - a screenshot of the problem
Markus, can you have a look? Is this platform or us? Fixed in HEAD. Hmm, does not work in N20050525. Moving to SWT. I can reproduce like this: 2.1 click the "Add" button 2.2 write an interface name 2.3 click "OK" But I cannot reproduce it when I move the top dialog away after step 2.1, so that the table becomes visible. Seems to be a problem with bounds calculation of table items that are not drawn yet. Billy, can you reproduce this? Reproducable using N20050523-0010. BB, want to have a go at fixing this? When an interface is selected and the dialog closes, chooseSuperInterfaces() in o.e.jdt.ui.wizards.NewTypeWizardPage is being called. This calls tableViewer.editElement(element, 0) which brings up a cell editor even though the table doesn't have focus. The cell editor is what you see above the Table. I think there are two bugs here: 1. Why is JDT activating the cell editor when I add an interface? 2. The cell editor does not have the correct bounds. I can look into fixing problem 2, unless there's something I'm missing. Does it happen on Windows? We can look into it more tomorrow. Re comment 10: No, works fine on Windows. Re comment 9: 1. The cell editor is activated to allow users to add generic type parameters to the newly added interface (e.g. Comparable<MyClass>) 2. Yes, that's the problem. However, I think we could also ship without this fix, since there's an easy workaround (deactivate the cell editor, then start again). Created attachment 21866 [details] Patch It seems like there are two problems, both of which are races. Sometimes I can reproduce consistently, and then sometimes it goes away. I see it with GTK+ 2.6.4, which version is used in the screenshot? The problems I see: 1. Sometimes the item height only reflects the image height, and is too short for the text. This is shown in the screenshot from comment #1. The attached patch works around the problem for me, but I am not sure yet why it is required. 2. Sometimes the width returned for the image is 0, and so the cell editor obscures the icon. This seems to be a problem with the function gtk_tree_view_column_cell_get_position(), but it is hard to debug since I cannot reliably reproduce this bug. Created attachment 64637 [details]
new screenshot
I tested this on GTK 2.8.10.
The tableitem is no longer drawn as incorrectly as before... but it still doesn't seem right? It looks as though the entire item should be highlighted, but instead the area around the text is covering the background color, leaving a border on the top and side edges of a selection. See screenshot (the middle item is selected).
*** Bug 33283 has been marked as a duplicate of this bug. *** I can reproduce this issue on my machine. After adding an interface, the text editing area is wrong (as the screenshots in this bug display). After a few seconds, the text jumps back into its spot. Assigning to Ian. New Gerrit change created: https://git.eclipse.org/r/78969 Billy Biggs' patch fixes the issue in the interface. I don't see a huge problem with the highlighting, as technically the item is correctly highlighted, its just that the editing area widget covers over it. Closing as fixed. Gerrit change https://git.eclipse.org/r/78969 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=93cbea04d4686273697e48e72ea5b7546547f7c0 (In reply to Eclipse Genie from comment #18) > Gerrit change https://git.eclipse.org/r/78969 was merged to [master]. > Commit: > http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/ > ?id=93cbea04d4686273697e48e72ea5b7546547f7c0 Merged Billy's patch, seems to work fine. In master now. |