use of io.jmix.ui.component.CssLayout in project jmix by jmix-framework.
the class TestProgrammaticCommentaryPanel method createComponent.
protected void createComponent() {
VBoxLayout rootPanel = uiComponents.create(VBoxLayout.class);
rootPanel.setId("rootPanel");
rootPanel.setMargin(true);
rootPanel.setSpacing(true);
rootPanel.setStyleName("commentary-panel card");
rootPanel.setWidthFull();
DataGrid<CommentObject> commentsDataGrid = uiComponents.create(DataGrid.of(CommentObject.class));
commentsDataGrid.setId("commentsDataGrid");
commentsDataGrid.setBodyRowHeight(100);
commentsDataGrid.setColumnReorderingAllowed(false);
commentsDataGrid.setColumnsCollapsingAllowed(false);
commentsDataGrid.setHeaderVisible(false);
commentsDataGrid.setSelectionMode(DataGrid.SelectionMode.NONE);
commentsDataGrid.setWidthFull();
CssLayout sendMessageBox = uiComponents.create(CssLayout.class);
sendMessageBox.setId("sendMessageBox");
sendMessageBox.setStyleName("v-component-group message-box");
sendMessageBox.setWidthFull();
TextField<String> messageField = uiComponents.create(TextField.TYPE_STRING);
messageField.setId("messageField");
messageField.setInputPrompt("Enter your message");
messageField.setWidthFull();
Button sendBtn = uiComponents.create(Button.class);
sendBtn.setId("sendBtn");
sendBtn.setCaption("Send");
sendMessageBox.add(messageField, sendBtn);
rootPanel.add(commentsDataGrid, sendMessageBox);
rootPanel.expand(commentsDataGrid);
setComposition(rootPanel);
}
Aggregations