Search in sources :

Example 1 with BoxLayout

use of com.haulmont.cuba.gui.components.BoxLayout in project cuba by cuba-platform.

the class CustomOperationEditor method createComponent.

@Override
protected Component createComponent() {
    ComponentsFactory componentsFactory = AppBeans.get(ComponentsFactory.class);
    BoxLayout layout = componentsFactory.createComponent(VBoxLayout.class);
    return layout;
}
Also used : ComponentsFactory(com.haulmont.cuba.gui.xml.layout.ComponentsFactory) VBoxLayout(com.haulmont.cuba.gui.components.VBoxLayout) BoxLayout(com.haulmont.cuba.gui.components.BoxLayout)

Example 2 with BoxLayout

use of com.haulmont.cuba.gui.components.BoxLayout in project cuba by cuba-platform.

the class AbstractUploadFieldLoader method loadDropZone.

protected void loadDropZone(UploadField uploadField, Element element) {
    String dropZoneId = element.attributeValue("dropZone");
    if (StringUtils.isNotEmpty(dropZoneId)) {
        Component dropZone = findComponent(dropZoneId);
        if (dropZone instanceof BoxLayout) {
            uploadField.setDropZone(new UploadField.DropZone((BoxLayout) dropZone));
        } else if (dropZone != null) {
            throw new GuiDevelopmentException("Unsupported dropZone class " + dropZone.getClass().getName(), context);
        } else {
            throw new GuiDevelopmentException("Unable to find dropZone component with id: " + dropZoneId, context);
        }
    }
    String dropZonePrompt = element.attributeValue("dropZonePrompt");
    if (StringUtils.isNotEmpty(dropZonePrompt)) {
        uploadField.setDropZonePrompt(loadResourceString(dropZonePrompt));
    }
}
Also used : BoxLayout(com.haulmont.cuba.gui.components.BoxLayout) UploadField(com.haulmont.cuba.gui.components.UploadField) GuiDevelopmentException(com.haulmont.cuba.gui.GuiDevelopmentException) Component(com.haulmont.cuba.gui.components.Component)

Aggregations

BoxLayout (com.haulmont.cuba.gui.components.BoxLayout)2 GuiDevelopmentException (com.haulmont.cuba.gui.GuiDevelopmentException)1 Component (com.haulmont.cuba.gui.components.Component)1 UploadField (com.haulmont.cuba.gui.components.UploadField)1 VBoxLayout (com.haulmont.cuba.gui.components.VBoxLayout)1 ComponentsFactory (com.haulmont.cuba.gui.xml.layout.ComponentsFactory)1