Community
Participate
Working Groups
Currently we automatically paint a checkbox for boolean values in a Table's column. When using a custom IColumnFormatter one can suppress the image by returning null in the getImage(...) method. This currently has no effect, but should result in no image being painted.
Created attachment 170297 [details] Snippet Snippet to reproduce issue. When run without the fix it will show two images in the last column.
Created attachment 170298 [details] Proposed patch
Committing.
This solutions prevents to suppress only the text of a checkbox. This works with the former implementation of the method TableRidgetLabelProvider.getColumnImage. So I rollback the former implementation. I have no (simple) idea to implement both requests: checkbox without text but image "checkbox" with text but without image Btw. the SnippetTableRidget008 and the solution "without images" is a little confusing, because of the text "Click on a checkbox to toggle that row's the state" at the end of the shell. The checkboxes are suppressed so I can not see them. Also the last column "Active" is always empty - no image, no text.
To clarify comment #4: The patch changes the following: one has to manually add the checkbox image - otherwise just the text is shown. I'm ok with reverting. The best solution in my opinion is to stop adding the checkbox / text automatically and provide helper code to allow the developer to do it. However this would break existing code at this late point so it's propably not feasible. Workaround: I found a way to supress the image using a transparent image. The only drawback is that the transparent image still takes up space, so text in the column (if present) will be slightly more to the right (as if an actual image was used). See Snippet.java for details. So closing as WONTFIX or what is the preference?
Created attachment 170905 [details] Example Snippet Workaround showing how to supress an image in a Table column and/or draw a custom image.
We should postphone this to 2.1.0.
Reassigning to default assignee.