use of com.haulmont.cuba.gui.components.Component.HasButtonsPanel in project cuba by cuba-platform.
the class DataGridLoader method createButtonsPanel.
protected void createButtonsPanel(HasButtonsPanel dataGrid, Element element) {
panelElement = element.element("buttonsPanel");
if (panelElement != null) {
ButtonsPanelLoader loader = (ButtonsPanelLoader) getLoader(panelElement, ButtonsPanel.NAME);
loader.createComponent();
ButtonsPanel panel = loader.getResultComponent();
dataGrid.setButtonsPanel(panel);
buttonsPanelLoader = loader;
}
}
use of com.haulmont.cuba.gui.components.Component.HasButtonsPanel in project cuba by cuba-platform.
the class WebComponentsHelper method findChildComponent.
protected static com.haulmont.cuba.gui.components.Component findChildComponent(Collection<com.haulmont.cuba.gui.components.Component> components, Component vaadinSource, Component target) {
Component targetComponent = getDirectChildComponent(target, vaadinSource);
for (com.haulmont.cuba.gui.components.Component component : components) {
Component unwrapped = component.unwrapComposition(Component.class);
if (unwrapped == targetComponent) {
com.haulmont.cuba.gui.components.Component child = null;
if (component instanceof Container) {
child = findChildComponent((Container) component, target);
}
if (component instanceof HasButtonsPanel) {
ButtonsPanel buttonsPanel = ((HasButtonsPanel) component).getButtonsPanel();
if (getVaadinSource(buttonsPanel) == target) {
return buttonsPanel;
} else {
child = findChildComponent(buttonsPanel, target);
}
}
if (component instanceof FieldGroup) {
FieldGroup fieldGroup = (FieldGroup) component;
child = findChildComponent(fieldGroup, target);
}
return child != null ? child : component;
}
}
return null;
}
Aggregations