0

I am creating a view in which there are two static part PartSashContainer. I am creating a dynamic part which is called from the menu handler. Whenever the dynamic part is called from the handler the dynamic part is arranged at the end of the two static part. I should create in such way that dynamic part should come in the first place followed by two static part.

Can anyone please provide me the solution for arranging the parts?

greg-449
  • 109,219
  • 232
  • 102
  • 145
Acjb
  • 505
  • 1
  • 6
  • 21

1 Answers1

0

If you get the MPartStack containing the three parts you can rearrange the order of the children.

MPartStack stack;
// TODO inject the stack or find in the model

List<MStackElement> children = stack.getChildren();

// Copy the list - don't try and update the original list

List<MStackElement> sorted = new ArrayList<>(children);

// TODO order the list

// Update the stack children

children.clear();
children.addAll(sorted);
greg-449
  • 109,219
  • 232
  • 102
  • 145
  • I have added the three parts in partsashcontainer. After finding the specific partsashcontainer I tried to get the getchildren of it in the following way : List s = sashContainer.getChildren(); But it shows "The type List is not generic; " so I cant add partsashcontianer as type to List. – Acjb Feb 12 '14 at 15:57
  • Sounds like you have imported the wrong `List`, should be `java.util.List`. – greg-449 Feb 12 '14 at 15:59