Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 138136 - [JFace] StructuredViewer.setComparator() has no effect
Summary: [JFace] StructuredViewer.setComparator() has no effect
Status: RESOLVED DUPLICATE of bug 137849
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Karice McIntyre CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-04-23 09:48 EDT by Benjamin Pasero CLA
Modified: 2006-04-24 11:35 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Benjamin Pasero CLA 2006-04-23 09:48:48 EDT
Version: 3.2.0
Build id: I20060413-1718

Due to a wrong comparision (at least it looks so), setting a Comparator, which is recommended in 3.2 over setting a Sorter, is not working at all:

public void setComparator(ViewerComparator comparator){
    if (this.sorter != sorter){ // <-- Will always be FALSE
        this.sorter = comparator;
        refresh();
    }
}

I think the Method should look like:

public void setComparator(ViewerComparator comparator){
    if (this.sorter != comparator){
        this.sorter = comparator;
        refresh();
    }
}

Ben
Comment 1 Karice McIntyre CLA 2006-04-24 11:35:44 EDT

*** This bug has been marked as a duplicate of 137849 ***