Is it possible to arrange two static and one dynamically created parts in Eclipse e4 application?

StackOverflow https://stackoverflow.com/questions/21712768

  •  10-10-2022
  •  | 
  •  

문제

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?

도움이 되었습니까?

해결책

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);
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top