GridTreeViewer - ad-hoc setting columns and column groups visible/not visible [message #854506] |
Mon, 23 April 2012 22:24  |
Eclipse User |
|
|
|
I have a GridTreeViewer and I allow the users to customize the display of the grid - they can use a preferences page to add/remove and reorder the columns.
Note that if a column is inside of a column group - all columns within that group stay under that group - they are moved/added/removed as a whole through the preferences page.
If the grid is being displayed, I reorder the columnns, set the visible state, set the colunn width, and refresh the gridviewer as appropriate.
I am finding a couple of strange things - and I believe it's related to the header renderer, but I'm not sure how to fix this as of yet.
1. When I remove the columns in a column group - I do a setVisible(false) and I set the width to 0 - just to be sure. This seems to remove the group, but it seems that the toggle renderer wants to display on a header somewhere - so it moves to the left - even if this column it isn't a group.
2. When not displaying the grid, if I remove enough columns from the display the header gets really tall the next time I draw the grid - widths are good, just the height is ridiculous!
My snippet of creating the grid is as follows:
Composite composite = new Composite(sashForm, SWT.NONE);
composite.setLayout(new GridLayout(1, false));
GridTreeViewer gtv = new GridTreeViewer(composite);
Grid grid = gtv.getGrid();
grid.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
grid.setHeaderVisible(true);
grid.setFooterVisible(true);
grid.setTreeLinesVisible(true);
grid.setVisible(true);
The sashForm is not being moved, so that is not affecting the resize of the header, it's purely just removing columns and drawing the grid (or re-ordering columns).
I'll be happy to provide more information if needed.
Any thoughts/assistance would be greatly appreciated.
Thanks,
Sharon
|
|
|
Re: GridTreeViewer - ad-hoc setting columns and column groups visible/not visible [message #854864 is a reply to message #854506] |
Tue, 24 April 2012 05:55   |
Eclipse User |
|
|
|
Could you please provide a runnable test case so that I can debug the
problem.
Tom
Am 24.04.12 04:24, schrieb Sharon Snyder:
> I have a GridTreeViewer and I allow the users to customize the display
> of the grid - they can use a preferences page to add/remove and reorder
> the columns.
> Note that if a column is inside of a column group - all columns within
> that group stay under that group - they are moved/added/removed as a
> whole through the preferences page.
> If the grid is being displayed, I reorder the columnns, set the visible
> state, set the colunn width, and refresh the gridviewer as appropriate.
>
> I am finding a couple of strange things - and I believe it's related to
> the header renderer, but I'm not sure how to fix this as of yet.
>
> 1. When I remove the columns in a column group - I do a
> setVisible(false) and I set the width to 0 - just to be sure. This
> seems to remove the group, but it seems that the toggle renderer wants
> to display on a header somewhere - so it moves to the left - even if
> this column it isn't a group.
> 2. When not displaying the grid, if I remove enough columns from the
> display the header gets really tall the next time I draw the grid -
> widths are good, just the height is ridiculous!
>
> My snippet of creating the grid is as follows:
> Composite composite = new Composite(sashForm, SWT.NONE);
> composite.setLayout(new GridLayout(1, false));
>
> GridTreeViewer gtv = new GridTreeViewer(composite);
> Grid grid = gtv.getGrid();
> grid.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true,
> 1, 1));
> grid.setHeaderVisible(true);
> grid.setFooterVisible(true);
> grid.setTreeLinesVisible(true);
> grid.setVisible(true);
> The sashForm is not being moved, so that is not affecting the
> resize of the header, it's purely just removing columns and drawing the
> grid (or re-ordering columns).
>
> I'll be happy to provide more information if needed.
>
> Any thoughts/assistance would be greatly appreciated.
>
> Thanks,
> Sharon
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.07453 seconds