Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Sorting entries in the palette
Sorting entries in the palette [message #191818] Thu, 11 August 2005 17:26 Go to next message
Eclipse UserFriend
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 Go to previous messageGo to next message
Eclipse UserFriend
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.
Re: Sorting entries in the palette [message #191984 is a reply to message #191943] Fri, 12 August 2005 12:36 Go to previous message
Eclipse UserFriend
Originally posted by: harsh.ti.com

Sorry about that. I should have included the stack trace. Anyway, I
found the problem. I was doing an incorrect cast.

Harsh
Previous Topic:Highlighting Edit Parts in Error
Next Topic:connection feedback error
Goto Forum:
  


Current Time: Mon Dec 02 20:25:15 GMT 2024

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

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

Back to the top