How to programly add things to splitpane?

My project has hundreds of screens, and now there is a requirement to change the layout. It is required to add a split pane, and then add original content to left side, and add new content to right side.
I know how to achive this by modify the screen xml file, but manually changing hundreds of files costs time. I want to implement this by modify the Java file, the hundreds of old screen base on same ancestor class.

But I didnot find how to add spltpane programly even for a simple case.

Could you share how to?


If you want to add components to SplitPanel programmatically, you can use the add method. SplitPanel can contain only two components and if you add more than two, you will see an exception. The first ‘add’ will set component on the left side (if the orientation is horizontal) or on the top side (if the orientation is vertical) and second ‘add’ will set to the other side.

Code example:

private SplitPanel split;

private ComponentsFactory factory;

public void init(Map<String, Object> params) {
    Label firstLabel = factory.createComponent(Label.class);

    VBoxLayout firstComponent = factory.createComponent(VBoxLayout.class);


    Label secondLabel = factory.createComponent(Label.class);

    VBoxLayout secondComponent = factory.createComponent(VBoxLayout.class);