@Nonnull @Override public List<LayoutTip> analyze(Component component, String path) { if (component instanceof ExpandingLayout) { ExpandingLayout container = (ExpandingLayout) component; List<LayoutTip> tips = null; Collection<Component> components = container.getOwnComponents(); Component expanded = getExpandedComponent(container); if (components.size() > 1 && expanded != null) { tips = new ArrayList<>(); String expandedId = expanded.getId() != null ? expanded.getId() : expanded.getClass().getSimpleName(); for (Component innerComponent : components) { if (innerComponent != expanded && innerComponent.isVisibleRecursive() && isSizeIgnored(container, innerComponent)) { String id = innerComponent.getId() != null ? innerComponent.getId() : innerComponent.getClass().getSimpleName(); tips.add(warn("Container '" + path + "', nested component '" + id + "'", "Relative size of nested component was ignored because of '%s' expanded inside container", expandedId)); } } } return tips != null ? tips : Collections.<LayoutTip>emptyList(); } return Collections.emptyList(); }
@Override public void focusFirstField() { for (FieldConfig fc : getColumnOrderedFields()) { Component component = fc.getComponent(); if (component != null && component.isEnabledRecursive() && component.isVisibleRecursive() && component instanceof Focusable && ((Focusable) component).isFocusable()) { ((Focusable) component).focus(); break; } } }
protected void moveFocus(TabSheetBehaviour tabSheet, String tabId) { TabWindowContainer windowContainer = (TabWindowContainer) tabSheet.getTabComponent(tabId); Window window = windowContainer.getBreadCrumbs().getCurrentWindow(); if (window != null) { boolean focused = false; String focusComponentId = window.getFocusComponent(); if (focusComponentId != null) { com.haulmont.cuba.gui.components.Component focusComponent = window.getComponent(focusComponentId); if (focusComponent instanceof com.haulmont.cuba.gui.components.Component.Focusable && focusComponent.isEnabledRecursive() && focusComponent.isVisibleRecursive()) { ((com.haulmont.cuba.gui.components.Component.Focusable) focusComponent).focus(); focused = true; } } if (!focused && window instanceof Window.Wrapper) { Window.Wrapper wrapper = (Window.Wrapper) window; focused = ((WebWindow) wrapper.getWrappedWindow()).findAndFocusChildComponent(); if (!focused) { tabSheet.focus(); } } } }
if (componentState.required && ((Field) component).isEditable() && component.isVisibleRecursive()) { ((Field) component).setRequired(true);