Search in sources :

Example 51 with Component

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);
    }
}
Also used : Window(com.haulmont.cuba.gui.components.Window) Component(com.vaadin.ui.Component)

Example 52 with Component

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);
}
Also used : Component(com.vaadin.ui.Component) Nullable(javax.annotation.Nullable)

Example 53 with Component

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);
}
Also used : com.haulmont.cuba.gui.components(com.haulmont.cuba.gui.components) ComponentContainer(com.haulmont.cuba.gui.components.ComponentContainer) Component(com.vaadin.ui.Component)

Example 54 with Component

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);
}
Also used : com.vaadin.ui(com.vaadin.ui) Component(com.vaadin.ui.Component)

Example 55 with Component

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();
}
Also used : Component(com.vaadin.ui.Component)

Aggregations

Component (com.vaadin.ui.Component)146 LayoutBoundTransferable (com.haulmont.cuba.web.widgets.addons.dragdroplayouts.events.LayoutBoundTransferable)23 VerticalDropLocation (com.vaadin.shared.ui.dd.VerticalDropLocation)13 ComponentContainer (com.vaadin.ui.ComponentContainer)12 SingleComponentContainer (com.vaadin.ui.SingleComponentContainer)12 WebAbstractComponent (com.haulmont.cuba.web.gui.components.WebAbstractComponent)11 HorizontalLayout (com.vaadin.ui.HorizontalLayout)11 VerticalLayout (com.vaadin.ui.VerticalLayout)11 Button (com.vaadin.ui.Button)9 Window (com.haulmont.cuba.gui.components.Window)8 Label (com.vaadin.ui.Label)8 Test (org.junit.Test)8 WebWindow (com.haulmont.cuba.web.gui.WebWindow)7 AbstractOrderedLayout (com.vaadin.ui.AbstractOrderedLayout)6 CssLayout (com.vaadin.ui.CssLayout)6 List (java.util.List)6 com.haulmont.cuba.gui.components (com.haulmont.cuba.gui.components)5 CubaUI (com.haulmont.cuba.web.widgets.CubaUI)5 DDAbsoluteLayout (com.haulmont.cuba.web.widgets.addons.dragdroplayouts.DDAbsoluteLayout)5 Item (com.vaadin.data.Item)5