Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Set Custom Variant for TableColumn not working.(want to hide sort indicator for unsortable columns by setting custom variant)
Set Custom Variant for TableColumn not working. [message #931047] Tue, 02 October 2012 22:06 Go to next message
George R Malary is currently offline George R MalaryFriend
Messages: 36
Registered: March 2012
Location: New Jersey
Member
I have a stylesheet with the following variants:

TableColumn-SortIndicator, TreeColumn-SortIndicator {
  background-image: url( icons/sort_indicator.png );
}

TableColumn-SortIndicator.nonSortableColumn, TreeColumn-SortIndicator.nonSortableColumn {
  background-image: none;
}



I have all columns showing a sort indicator with an up/down arrow shaded gray. Some columns are not sortable, and I would like to hide the sort indicator. So the styling in the css file above works to show the sort indicator. And on the column that is not sortable, I set the custom variant as follows:


  TableViewerColumn col = new TableViewerColumn(this,SWT.NONE, columnIndex);

  col.getColumn().setData(WidgetUtil.CUSTOM_VARIANT, "nosSortableColumn");


The column still shows the sort indicator. I am setting other custom variants this way, and the styling is respected, is there a reason this is not the case here?
Re: Set Custom Variant for TableColumn not working. [message #931511 is a reply to message #931047] Wed, 03 October 2012 09:17 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2153
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
Hi,
the customVariant set on the column is not applied to the SortIndicator.
If you need this functionality, please file an enhancement request.
Thanks,
Ivan

On 10/3/2012 1:06 AM, George R Malary wrote:
> I have a stylesheet with the following variants:
>
>
> TableColumn-SortIndicator, TreeColumn-SortIndicator {
> background-image: url( icons/sort_indicator.png );
> }
>
> TableColumn-SortIndicator.nonSortableColumn,
> TreeColumn-SortIndicator.nonSortableColumn {
> background-image: none;
> }
>
>
>
> I have all columns showing a sort indicator with an up/down arrow
> shaded gray. Some columns are not sortable, and I would like to hide
> the sort indicator. So the styling in the css file above works to
> show the sort indicator. And on the column that is not sortable, I
> set the custom variant as follows:
>
>
>
> TableViewerColumn col = new TableViewerColumn(this,SWT.NONE,
> columnIndex);
>
> col.getColumn().setData(WidgetUtil.CUSTOM_VARIANT, "nosSortableColumn");
>
>
> The column still shows the sort indicator. I am setting other custom
> variants this way, and the styling is respected, is there a reason
> this is not the case here?

--
Ivan Furnadjiev

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: Set Custom Variant for TableColumn not working. [message #931528 is a reply to message #931047] Wed, 03 October 2012 09:31 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2153
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
BTW... here is the bug about this issue:
362166: [Theming] Let sub-widgets inherit styles and custom variants
https://bugs.eclipse.org/bugs/show_bug.cgi?id=362166

On 10/3/2012 1:06 AM, George R Malary wrote:
> I have a stylesheet with the following variants:
>
>
> TableColumn-SortIndicator, TreeColumn-SortIndicator {
> background-image: url( icons/sort_indicator.png );
> }
>
> TableColumn-SortIndicator.nonSortableColumn,
> TreeColumn-SortIndicator.nonSortableColumn {
> background-image: none;
> }
>
>
>
> I have all columns showing a sort indicator with an up/down arrow
> shaded gray. Some columns are not sortable, and I would like to hide
> the sort indicator. So the styling in the css file above works to
> show the sort indicator. And on the column that is not sortable, I
> set the custom variant as follows:
>
>
>
> TableViewerColumn col = new TableViewerColumn(this,SWT.NONE,
> columnIndex);
>
> col.getColumn().setData(WidgetUtil.CUSTOM_VARIANT, "nosSortableColumn");
>
>
> The column still shows the sort indicator. I am setting other custom
> variants this way, and the styling is respected, is there a reason
> this is not the case here?

--
Ivan Furnadjiev

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: Set Custom Variant for TableColumn not working. [message #931796 is a reply to message #931528] Wed, 03 October 2012 14:34 Go to previous messageGo to next message
George R Malary is currently offline George R MalaryFriend
Messages: 36
Registered: March 2012
Location: New Jersey
Member
Thank Ivan.

Is there a workaround anyone can recommend to remove the visual indicator for a column, or hide it? I would like to not show the indicator for some columns.
Re: Set Custom Variant for TableColumn not working. [message #931893 is a reply to message #931796] Wed, 03 October 2012 16:11 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2153
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
George,
what I don't understand is how did you make sort indicator visible in
multiple columns in the same time. In Table widget only one column could
be sortable - set by Table#setSortColumn and Table#setSortDirection.
Based on column selection listener you could change the sortable column
- see Controls Demo -> Table tab. Could you provide a snippet to
demonstrate the issue?
Best,
Ivan

On 10/3/2012 5:34 PM, George R Malary wrote:
> Thank Ivan.
>
> Is there a workaround anyone can recommend to remove the visual
> indicator for a column, or hide it? I would like to not show the
> indicator for some columns.

--
Ivan Furnadjiev

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: Set Custom Variant for TableColumn not working. [message #931898 is a reply to message #931893] Wed, 03 October 2012 16:20 Go to previous message
George R Malary is currently offline George R MalaryFriend
Messages: 36
Registered: March 2012
Location: New Jersey
Member
The following snippet makes the neutral sort indicator appear for all columns:
TableColumn-SortIndicator, TreeColumn-SortIndicator {
  background-image: url( icons/sort_indicator.png );
}


If change the previous code to the following, it works as you describe, only showing the sort indicator for the sorted column:

TableColumn-SortIndicator, TreeColumn-SortIndicator {
  background-image: none;
}


Sorting works as expected, and the column that is sorted shows the correct up or down image as described in the stylesheet.
Previous Topic:Filter Combobox List
Next Topic:[ANN] RAP 2.0 M2 is available
Goto Forum:
  


Current Time: Sun Sep 25 15:52:08 GMT 2016

Powered by FUDForum. Page generated in 0.05218 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software