Search in sources :

Example 36 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 (component instanceof CubaFileUpload) {
        if (dropZone == null) {
            ((CubaFileUpload) 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);
            ((CubaFileUpload) this.component).setDropZone(vComponent);
        }
    }
}
Also used : Window(com.haulmont.cuba.gui.components.Window) MultiUploadFieldListenerWrapper(com.haulmont.cuba.gui.components.compatibility.MultiUploadFieldListenerWrapper) CubaFileUpload(com.haulmont.cuba.web.toolkit.ui.CubaFileUpload) CubaAbstractUploadComponent(com.haulmont.cuba.web.toolkit.ui.CubaAbstractUploadComponent) Component(com.vaadin.ui.Component)

Example 37 with Component

use of com.vaadin.ui.Component in project cuba by cuba-platform.

the class CubaTable method iterator.

@Override
public Iterator<Component> iterator() {
    List<Component> additionalConnectors = null;
    CubaTableState tableState = getState(false);
    if (tableState.presentations != null) {
        additionalConnectors = new LinkedList<>();
        additionalConnectors.add((Component) tableState.presentations);
    }
    if (tableState.contextMenu != null) {
        if (additionalConnectors == null) {
            additionalConnectors = new LinkedList<>();
        }
        additionalConnectors.add((Component) tableState.contextMenu);
    }
    if (tableState.customPopup != null) {
        if (additionalConnectors == null) {
            additionalConnectors = new LinkedList<>();
        }
        additionalConnectors.add((Component) tableState.customPopup);
    }
    if (additionalConnectors == null) {
        return super.iterator();
    } else if (visibleComponents != null) {
        return Iterables.concat(visibleComponents, additionalConnectors).iterator();
    } else {
        return additionalConnectors.iterator();
    }
}
Also used : CubaTableState(com.haulmont.cuba.web.toolkit.ui.client.table.CubaTableState) AbstractComponent(com.vaadin.ui.AbstractComponent) Component(com.vaadin.ui.Component)

Example 38 with Component

use of com.vaadin.ui.Component in project cuba by cuba-platform.

the class ComponentCustomField method setPropertyDataSource.

@Override
public void setPropertyDataSource(Property newDataSource) {
    super.setPropertyDataSource(newDataSource);
    if (newDataSource != null) {
        layout.removeAllComponents();
        Component value = (Component) newDataSource.getValue();
        if (value != null) {
            layout.addComponent(value);
        }
    }
}
Also used : Component(com.vaadin.ui.Component)

Example 39 with Component

use of com.vaadin.ui.Component in project ANNIS by korpling.

the class IDGenerator method assignIDForEachField.

public static void assignIDForEachField(HasComponents parent) {
    if (parent != null) {
        Iterator<Component> itComponents = parent.iterator();
        while (itComponents.hasNext()) {
            Component c = itComponents.next();
            assignIDForField(parent, c);
        }
    }
}
Also used : Component(com.vaadin.ui.Component)

Example 40 with Component

use of com.vaadin.ui.Component in project ANNIS by korpling.

the class SearchView method selectedTabChange.

@Override
public void selectedTabChange(TabSheet.SelectedTabChangeEvent event) {
    Component tab = event.getTabSheet().getSelectedTab();
    if (tab != null) {
        // first remove the old element to make sure it is added at the end
        selectedTabHistory.remove(tab);
        selectedTabHistory.add(tab);
    }
}
Also used : 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