Expanding SourceCodeEditor Inside a Tab

Hi,

I’m trying to expand vertically a SourceCodeEditor component inside a TAB, but it’s showing only one line.

He is the screen code:

    <layout>
        <vbox id="vbox"
              expand="codeEditor"
              height="100%"
              margin="true"
              spacing="true">
            <buttonsPanel id="btnPanel">
                <button id="btn1"
                        caption="btn1"/>
                <button id="btn2"
                        caption="btn2"/>
            </buttonsPanel>
            <sourceCodeEditor id="codeEditor"
                              width="100%"/>
        </vbox>
    </layout>

The result is a sourceCodeEditor with a single line like the following image:

screen

The tabSheet is also with height 100% and I’m oppening the tab with:

TabSheet.Tab tab = tabSheet.getTab("test-source-code-editor");
VBoxLayout tabContent = componentsFactory.createComponent(VBoxLayout.class);
tab = tabSheet.addTab("test-source-code-editor", tabContent);
tab.setCaption("Editor");
tab.setClosable(true);

WindowManager wm = App.getInstance().getWindowManager();
wm.openFrame(getFrame(), tabContent, windowConfig.getWindowInfo("test-source-code-editor"), null);

How can I do it without setting a fixed height to the “vbox” or the “codeEditor”?

Thank you,

Hi!

I tried your case and it seems that opened frame cut height of your content. The opened frame has “AUTO” height and will occupy as much space as its content needs (but the content has relative height).
Try to add height “100%” to opened frame and it should work.

Frame openedFrame = wm.openFrame(getFrame(), tabContent, windowConfig.getWindowInfo("test-source-code-editor"),null);
openedFrame.setHeightFull(); // or setHeight("100%");
1 Like

Hi Roman,

That worked!!

Thanks a lot!

Claudio