use of com.vaadin.ui.Component in project cuba by cuba-platform.
the class WebFileMultiUploadField method setDropZone.
@Override
public void setDropZone(DropZone dropZone) {
super.setDropZone(dropZone);
if (dropZone == null) {
component.setDropZone(null);
} else {
com.haulmont.cuba.gui.components.Component target = dropZone.getTarget();
if (target instanceof Window.Wrapper) {
target = ((Window.Wrapper) target).getWrappedWindow();
}
Component vComponent = target.unwrapComposition(Component.class);
this.component.setDropZone(vComponent);
}
}
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.unwrapOrNull(CubaFieldGroupLayout.class);
if (vaadinSource == null) {
return null;
}
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 ComponentContainer) {
ComponentContainer container = (ComponentContainer) 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 WebAbstractTable method showCustomPopup.
@Override
public void showCustomPopup(com.haulmont.cuba.gui.components.Component popupComponent) {
Component vComponent = popupComponent.unwrap(com.vaadin.ui.Component.class);
component.showCustomPopup(vComponent);
component.setCustomPopupAutoClose(false);
}
use of com.vaadin.ui.Component in project cuba by cuba-platform.
the class WebAbstractTable method setButtonsPanel.
@Override
public void setButtonsPanel(ButtonsPanel panel) {
if (buttonsPanel != null && topPanel != null) {
topPanel.removeComponent(buttonsPanel.unwrap(Component.class));
buttonsPanel.setParent(null);
}
buttonsPanel = panel;
if (panel != null) {
if (panel.getParent() != null && panel.getParent() != this) {
throw new IllegalStateException("Component already has parent");
}
if (topPanel == null) {
topPanel = createTopPanel();
topPanel.setWidth(100, Sizeable.Unit.PERCENTAGE);
componentComposition.addComponentAsFirst(topPanel);
}
Component bp = panel.unwrap(Component.class);
topPanel.addComponent(bp);
topPanel.setExpandRatio(bp, 1);
if (panel instanceof VisibilityChangeNotifier) {
((VisibilityChangeNotifier) panel).addVisibilityChangeListener(event -> updateCompositionStylesTopPanelVisible());
}
panel.setParent(this);
}
updateCompositionStylesTopPanelVisible();
}
Aggregations