Sorting entries in the palette [message #191818] |
Thu, 11 August 2005 17:26 |
Eclipse User |
|
|
|
Originally posted by: harsh.ti.com
All,
Not sure if this has already been answered but I need to add sorting
capabilities in the context menu of the Palette. The user shall be able
to right-click on each Drawer and sort. Here is my code
List children = _drawer.getChildren();
Collections.sort(children, new Comparator<ToolEntryEditPart>() {
public int compare(ToolEntryEditPart o1, ToolEntryEditPart o2) {
// TODO Auto-generated method stub
return o1.toString().compareTo(o2.toString());
}
});
isSorted = true;
_drawer.getDrawer().setChildren(children);
However, it is crashing at the last line setChildren(children).
Not sure why.
Any help would be greatly appreciated.
Thank you,
Harsh
|
|
|
Re: Sorting entries in the palette [message #191943 is a reply to message #191818] |
Fri, 12 August 2005 03:13 |
Eclipse User |
|
|
|
Originally posted by: none.unknown.com
> Not sure why.
That is why the debugger exists. At least provide a stack trace. "Crashing
at the last line" is not a problem statement. A quick look at your code
tells me you're setting editparts as children of the model or committing
some such faux pas.
|
|
|
|
Powered by
FUDForum. Page generated in 0.02183 seconds