Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 339704 - SortArrowRenderer paints chevron in opposite direction than standard TableColumn
Summary: SortArrowRenderer paints chevron in opposite direction than standard TableColumn
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Nebula (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Laurent CARON CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-11 10:14 EST by Peer Törngren CLA
Modified: 2021-07-05 11:40 EDT (History)
3 users (show)

See Also:


Attachments
Screenshot SWT Snippet002 (5.29 KB, image/png)
2011-03-11 10:19 EST, Peer Törngren CLA
no flags Details
Screenshot Nebula GridSnippet002 (6.63 KB, image/png)
2011-03-11 10:20 EST, Peer Törngren CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Peer Törngren CLA 2011-03-11 10:14:43 EST
Build Identifier: 20100617-1415

When setting org.eclipse.nebula.widgets.grid.GridColumn.setSort(SWT.UP), the SortArrowRenderer paints an arrow/chevron pointing down. Default Eclipse tables render an arrow/chevron pointing in the opposite direction (i.e. upwards).

Reproducible: Always

Steps to Reproduce:
1. Run SWT Snippet002, observe the direction of the chevron in column header 1
2. Modify Nebula GridSnippet2 and insert "column.setSort(SWT.UP)" at line 40 or later
3. Run GridSnippet2, observe the direction of the chevron in column header 1

They point in different directions for the same sort order setting (SWT.UP)
Comment 1 Peer Törngren CLA 2011-03-11 10:19:28 EST
Created attachment 190992 [details]
Screenshot SWT Snippet002
Comment 2 Peer Törngren CLA 2011-03-11 10:20:45 EST
Created attachment 190993 [details]
Screenshot Nebula GridSnippet002
Comment 3 Peer Törngren CLA 2011-03-11 10:29:58 EST
A fix is extremely simple. 

Alternative 1: org.eclipse.nebula.widgets.grid.internal.DefaultColumnHeaderRenderer.paint(GC, Object)

On line 225 (in the version I have):
          arrowRenderer.setSelected(column.getSort() == SWT.UP);
change to:
          arrowRenderer.setSelected(column.getSort() == SWT.DOWN);
 
Alternative 2:
org.eclipse.nebula.widgets.grid.internal.SortArrowRenderer.paint(GC, Object)

On line 43 (in the version I have):
        if (isSelected())
change to:
        if (!isSelected())

For bonus points, expose the SortArrowRender in the API to let me assign my own arrow renderer:
gridColumn.getHeaderRenderer().setArrowRenderer(myArrowRenderer)
Comment 4 Laurent CARON CLA 2019-09-25 12:12:20 EDT
Bug fixed in Nebula 2.3.0