Search in sources :

Example 31 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 = WebComponentsHelper.unwrap(popupComponent);
    component.showCustomPopup(vComponent);
    component.setCustomPopupAutoClose(false);
}
Also used : Component(com.vaadin.ui.Component)

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

Example 33 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 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);
}
Also used : AggregationContainer(com.haulmont.cuba.web.toolkit.data.AggregationContainer) Container(com.haulmont.cuba.gui.components.Component.Container) com.haulmont.cuba.gui.components(com.haulmont.cuba.gui.components) ShortcutTriggeredEvent(com.haulmont.cuba.gui.components.Component.ShortcutTriggeredEvent) Component(com.vaadin.ui.Component)

Example 34 with Component

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

Example 35 with Component

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);
        }
    }
}
Also used : CubaFileUpload(com.haulmont.cuba.web.toolkit.ui.CubaFileUpload) CubaAbstractUploadComponent(com.haulmont.cuba.web.toolkit.ui.CubaAbstractUploadComponent) Component(com.vaadin.ui.Component)

Aggregations

Component (com.vaadin.ui.Component)96 HorizontalLayout (com.vaadin.ui.HorizontalLayout)11 WebAbstractComponent (com.haulmont.cuba.web.gui.components.WebAbstractComponent)10 VerticalLayout (com.vaadin.ui.VerticalLayout)10 Button (com.vaadin.ui.Button)9 Label (com.vaadin.ui.Label)9 Test (org.junit.Test)8 Window (com.haulmont.cuba.gui.components.Window)6 CssLayout (com.vaadin.ui.CssLayout)6 List (java.util.List)6 WebWindow (com.haulmont.cuba.web.gui.WebWindow)5 Item (com.vaadin.data.Item)5 ClickEvent (com.vaadin.ui.Button.ClickEvent)5 ClickListener (com.vaadin.ui.Button.ClickListener)5 com.haulmont.cuba.gui.components (com.haulmont.cuba.gui.components)4 WebAppWorkArea (com.haulmont.cuba.web.gui.components.mainwindow.WebAppWorkArea)4 WindowBreadCrumbs (com.haulmont.cuba.web.sys.WindowBreadCrumbs)4 CubaFileUpload (com.haulmont.cuba.web.toolkit.ui.CubaFileUpload)4 com.vaadin.ui (com.vaadin.ui)4 com.haulmont.cuba.web.toolkit.ui (com.haulmont.cuba.web.toolkit.ui)3