use of com.haulmont.cuba.gui.components.UploadField in project cuba by cuba-platform.
the class FileUploadFieldLoader method loadDropZone.
protected void loadDropZone(UploadField uploadField, Element element) {
String dropZoneId = element.attributeValue("dropZone");
if (StringUtils.isNotEmpty(dropZoneId)) {
Component dropZone = context.getFrame().getComponent(dropZoneId);
if (dropZone instanceof BoxLayout) {
uploadField.setDropZone(new UploadField.DropZone((BoxLayout) dropZone));
} else if (dropZone != null) {
log.warn("Unsupported dropZone class {}", dropZone.getClass().getName());
} else {
log.warn("Unable to find dropZone component with id: {}", dropZoneId);
}
}
String dropZonePrompt = element.attributeValue("dropZonePrompt");
if (StringUtils.isNotEmpty(dropZonePrompt)) {
uploadField.setDropZonePrompt(loadResourceString(dropZonePrompt));
}
}
use of com.haulmont.cuba.gui.components.UploadField 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 = context.getFrame().getComponent(dropZoneId);
if (dropZone instanceof BoxLayout) {
uploadField.setDropZone(new UploadField.DropZone((BoxLayout) dropZone));
} else if (dropZone != null) {
log.warn("Unsupported dropZone class {}", dropZone.getClass().getName());
} else {
log.warn("Unable to find dropZone component with id: {}", dropZoneId);
}
}
String dropZonePrompt = element.attributeValue("dropZonePrompt");
if (StringUtils.isNotEmpty(dropZonePrompt)) {
uploadField.setDropZonePrompt(loadResourceString(dropZonePrompt));
}
}
Aggregations