Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[rap-dev] Re: PropertySheetEntries Sorting Order?

Hi Everyone!

I've finally introduced sorting of TreeItems in Tree's in order to temporary resolve this problem as I asked about in my previous message.
To get TreeItems sorted by label (text) you need to add code for sorting inside TreeItem.js in setTexts() function. This is because you need texts set before sorting by them. Hence I do sorting of this newly created TreeItem and all its siblings and then apply sorted array of items to their parent.

This is kind of hack to get done what I need here. And what would be great is to have some mechanism of sorting tree items inside of Tree itself as part of API. Thus we can predict in which order items are placed in tree and work with it.

I am very concerned to help with tree items sorting and celleditors (especially for trees) and can contribute some of the code I have here to RAP project. Its very imprortant to me (and to others too, I am sure) to have those things included in very close future releases of RAP. And this way I don't need to re-merge my changes with new releases of RAP anymore ;)

Thank you,
Alex.


On Dec 26, 2007 1:23 PM, Alexey wrote:
Hi!

I've faced with a problem of sorting order of PropertySheetEntries in PropertySheet (EMF implementation with Tree object as a Viewer control).

I am implementing CellEditors and they work fine for me in whole.
The ploblem is that I can't control and get the correct order of entries which will occure in PropertySheet.
I need the order of entries to get index of selected element in tree (2 column tree) to know where to place my cell editor. Because of my PropertySheetViewer control is Tree - I can't just get selected index but only selected object.

In most cases order of how entries are displayed by RAP in HTML is equal to what we have in Java in "selectedPropertySheetEntry.getChildEntries()".
But in some cases they don't and only for some elements - and this finaly result with incorrect cell editor placement when I am activating it for selected item.

Here is an screenshot of what I am talking about:

http://img205.imageshack.us/my.php?image=propertysheetexamplebz1.gif

You can see that in this particular case when I try to edit one property - it opens correct celleditor but in not correct location - because of the differences in order of element I have in Java code (selectedPropertySheetEntry.getChildEntries ()) and the way RAP renders them in HTML.

Can you suggest something how to avoid this problem?
Any links to source code where and how RAP makes this sorting and why it is different from what I see in Java?

Thank you in advance.



Back to the top