Get ALL Items (also filtered) of TreeTable and Order of TreeTable

Hello i have to do some normal things with the treetable. But i don’t know how i can do it:

  1. My TreeTable represents some questions with text. The user can filter the questions and bring them to order (with drag & drop). So if he save the questions, for sure, you have to save them all. But i don’t know how to get them all, also the filtered. I am extending HierarchicalContainer and make the getAllItems public. That works but…
  2. Now my second problem. The allItems is a List and not ordered. I don’t know how i can get a list with all items and exactly the order of the current tree. For example:
    [list=1]
  3. I am adding with drag & drop or with a button a question with id 1
  4. Then a second question with id 2
  5. And the third question with id 3 between them
    [list]
  6. My expecation of the index for id 1 - index:1, id 2 - index:3, id 3 - index:2
  7. But they are not in the order which i can see them in the tree: id 1 - index:1, id 2 - index:2, id 3 - index:3

    [/list]

    [/list]

That’s simply wrong. How can i get the items in exactly the way i can see them in the treetable and how can i get all my questions?
There is a method in the treetable getVisibleItemIds() which returns only the visible ones. But why the hell returns getItemIds() also only the visible ones and not in the right order? Is my use case so rarely?