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

Bug 320516

Summary: Table.setHeaderVisible(false) has no effect
Product: [RT] Riena Reporter: Stephan Mann <stephan.mann>
Component: UIAssignee: Elias Volanakis <elias>
Status: RESOLVED WONTFIX QA Contact:
Severity: normal    
Priority: P3    
Version: 2.0.0   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Stephan Mann CLA 2010-07-21 10:38:51 EDT
Contrary to a plain SWT example, setHeaderVisible(false) on a SWT Table has no effect in Riena:

final Table table = UIControlsFactory.createTable(tableComposite, ...);
table.setHeaderVisible(false);

The header is not displayed if the controller does not set a header array. But if such an array is set, the header is displayed no matter what the header visibility flag is.
Comment 1 Elias Volanakis CLA 2010-07-26 17:18:33 EDT
Yep, the design principle is that ridgets override settings in the widgets.

From my POV the solution is to use a null array for the header properties when binding to the model. In that case no header should be shown in the table.

Closing as WONTFIX (feel free to reopen if you disagree).
Comment 2 Stephan Mann CLA 2010-07-27 02:51:49 EDT
It is confusing to a new user (as I am). It also seems strange to me that there is no way of switching the headers visibility other than rebinding the model. However, if this is a design principle of Riena, I can't argue against it. Please consider adding a note to the documentation of createTable() or bindToModel() (or both).
Comment 3 Elias Volanakis CLA 2010-07-27 14:55:08 EDT
Personally, I think there is no reason to show the header, unless header titles are given with bindToModel(...).

Curious: do you have a good use case for needing to toggle the header visibility?
Comment 4 Stephan Mann CLA 2010-07-28 02:24:23 EDT
I thought I did when I opened the bug. It looked like the width of the columns differed between tables with headers and those without. But it turned out to be a SWT layout problem. So no, at the moment, I don't have a use case. One the other hand, I can image that someone might hide the headers to save space but display them on MouseOver or if a button is pressed. But that's hypothetical.

Having said that, I still find it confusing that a method from the SWT API has no effect, contrary to plain SWT code. It should be documented somewhere.