use of io.jmix.ui.component.TabSheet in project jmix by jmix-framework.
the class EntityCombinedScreen method initEditComponents.
/**
* Initializes edit controls, depending on if they should be enabled or disabled.
* @param enabled if true - enables edit controls and disables controls on the left side of the splitter
* if false - vice versa
*/
protected void initEditComponents(boolean enabled) {
TabSheet tabSheet = getTabSheet();
if (tabSheet != null) {
ComponentsHelper.walkComponents(tabSheet, (component, name) -> {
if (component instanceof FieldGroup) {
((FieldGroup) component).setEditable(enabled);
} else if (component instanceof Table) {
((Table) component).getActions().forEach(action -> action.setEnabled(enabled));
} else if (!(component instanceof HasComponents)) {
component.setEnabled(enabled);
}
});
}
getFieldGroup().setEditable(enabled);
getActionsPane().setVisible(enabled);
getLookupBox().setEnabled(!enabled);
}
use of io.jmix.ui.component.TabSheet in project jmix-sneferu by mariodavid.
the class OpenTabInteractionTest method when_interactionIsPerformed_then_tabIsSelected.
@Test
void when_interactionIsPerformed_then_tabIsSelected(UiTestAPI uiTestAPI) {
// given:
final StandardLookupTestAPI<Visit, VisitBrowse> openedScreen = uiTestAPI.openStandardLookup(Visit.class, VisitBrowse.class);
final TabsheetComponentDescriptor tabSheet = tabSheet("contentTabSheet");
assertThat(openedScreen.rawComponent(tabSheet)).isNotNull();
assertThat(openedScreen.rawComponent(tabSheet).getTab("tableTab")).isNotNull();
// when:
openedScreen.interact(openTab(tabSheet, "tableTab"));
// then:
final TabSheet.Tab selectedTab = openedScreen.rawComponent(tabSheet).getSelectedTab();
// and:
assertThat(selectedTab.getName()).isEqualTo("tableTab");
}
Aggregations