use of com.vaadin.ui.Component in project cuba by cuba-platform.
the class WebAbstractTable method showCustomPopup.
@Override
public void showCustomPopup(com.haulmont.cuba.gui.components.Component popupComponent) {
Component vComponent = WebComponentsHelper.unwrap(popupComponent);
component.showCustomPopup(vComponent);
component.setCustomPopupAutoClose(false);
}
use of com.vaadin.ui.Component in project cuba by cuba-platform.
the class WebComponentsHelper method findChildComponent.
@Nullable
protected static com.haulmont.cuba.gui.components.Component findChildComponent(FieldGroup fieldGroup, Component target) {
Component vaadinSource = fieldGroup.unwrap(CubaFieldGroupLayout.class);
Collection<com.haulmont.cuba.gui.components.Component> components = fieldGroup.getFields().stream().map(FieldGroup.FieldConfig::getComponentNN).collect(Collectors.toList());
return findChildComponent(components, vaadinSource, target);
}
use of com.vaadin.ui.Component in project cuba by cuba-platform.
the class WebComponentsHelper method getShortcutEvent.
public static ShortcutTriggeredEvent getShortcutEvent(com.haulmont.cuba.gui.components.Component source, Component target) {
Component vaadinSource = getVaadinSource(source);
if (vaadinSource == target) {
return new ShortcutTriggeredEvent(source, source);
}
if (source instanceof Container) {
Container container = (Container) source;
com.haulmont.cuba.gui.components.Component childComponent = findChildComponent(container, target);
return new ShortcutTriggeredEvent(source, childComponent);
}
return new ShortcutTriggeredEvent(source, null);
}
use of com.vaadin.ui.Component in project cuba by cuba-platform.
the class WebDataGrid method updateCompositionStylesTopPanelVisible.
// if buttons panel becomes hidden we need to set top panel height to 0
protected void updateCompositionStylesTopPanelVisible() {
if (topPanel != null) {
boolean hasChildren = topPanel.getComponentCount() > 0;
boolean anyChildVisible = false;
for (Component childComponent : topPanel) {
if (childComponent.isVisible()) {
anyChildVisible = true;
break;
}
}
boolean topPanelVisible = hasChildren && anyChildVisible;
if (!topPanelVisible) {
componentComposition.removeStyleName(HAS_TOP_PANEL_STYLE_NAME);
internalStyles.remove(HAS_TOP_PANEL_STYLE_NAME);
} else {
componentComposition.addStyleName(HAS_TOP_PANEL_STYLE_NAME);
if (!internalStyles.contains(HAS_TOP_PANEL_STYLE_NAME)) {
internalStyles.add(HAS_TOP_PANEL_STYLE_NAME);
}
}
}
}
use of com.vaadin.ui.Component in project cuba by cuba-platform.
the class WebFileMultiUploadField method setPasteZone.
@Override
public void setPasteZone(Container pasteZone) {
super.setPasteZone(pasteZone);
if (component instanceof CubaFileUpload) {
if (pasteZone == null) {
((CubaFileUpload) component).setPasteZone(null);
} else {
Component vComponent = pasteZone.unwrapComposition(Component.class);
((CubaFileUpload) component).setPasteZone(vComponent);
}
}
}
Aggregations