Skip to main content



      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 18:06 Go to next message
Eclipse UserFriend
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 05:17 Go to previous messageGo to next message
Eclipse UserFriend
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 05:31 Go to previous messageGo to next message
Eclipse UserFriend
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 10:34 Go to previous messageGo to next message
Eclipse UserFriend
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 12:11 Go to previous messageGo to next message
Eclipse UserFriend
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 12:20 Go to previous message
Eclipse UserFriend
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:IE Job Queue Error with RAP 1.4.2
Next Topic:Demos
Goto Forum:
  


Current Time: Wed Jul 23 03:02:30 EDT 2025

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

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

Back to the top