Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 314803

Summary: TableRidget - Allow ColumnFormater to supress image
Product: [RT] Riena Reporter: Elias Volanakis <elias>
Component: ridgetAssignee: Project Inbox <riena.core-inbox>
Status: REOPENED --- QA Contact:
Severity: normal    
Priority: P3 CC: christian.campo
Version: unspecified   
Target Milestone: 2.1.0   
Hardware: PC   
OS: Windows Vista   
Whiteboard:
Attachments:
Description Flags
Snippet
none
Proposed patch
none
Example Snippet none

Description Elias Volanakis CLA 2010-05-28 01:18:07 EDT
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.
Comment 1 Elias Volanakis CLA 2010-05-28 01:19:04 EDT
Created attachment 170297 [details]
Snippet

Snippet to reproduce issue. When run without the fix it will show two images in the last column.
Comment 2 Elias Volanakis CLA 2010-05-28 01:24:19 EDT
Created attachment 170298 [details]
Proposed patch
Comment 3 Elias Volanakis CLA 2010-05-28 01:24:39 EDT
Committing.
Comment 4 Thorsten Schenkel CLA 2010-06-02 03:23:52 EDT
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.
Comment 5 Elias Volanakis CLA 2010-06-02 22:10:55 EDT
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?
Comment 6 Elias Volanakis CLA 2010-06-02 22:12:17 EDT
Created attachment 170905 [details]
Example Snippet

Workaround showing how to supress an image in a Table column and/or draw a custom image.
Comment 7 Christian Campo CLA 2010-06-03 13:31:12 EDT
We should postphone this to 2.1.0.
Comment 8 Elias Volanakis CLA 2011-08-03 14:37:00 EDT
Reassigning to default assignee.