mirror of
https://gitee.com/jmix/cuba.git
synced 2024-12-04 04:07:42 +08:00
PL-7438 Rename UploadComponentSupport to UploadField
This commit is contained in:
parent
5a8f5169c4
commit
b37f256a99
@ -22,14 +22,14 @@ import com.haulmont.chile.core.datatypes.Datatypes;
|
||||
import com.haulmont.cuba.client.ClientConfig;
|
||||
import com.haulmont.cuba.core.global.AppBeans;
|
||||
import com.haulmont.cuba.core.global.Configuration;
|
||||
import com.haulmont.cuba.gui.components.UploadComponentSupport;
|
||||
import com.haulmont.cuba.gui.components.UploadField;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.util.Set;
|
||||
|
||||
public abstract class DesktopAbstractUploadComponent<T extends JComponent>
|
||||
extends DesktopAbstractComponent<T>
|
||||
implements UploadComponentSupport {
|
||||
implements UploadField {
|
||||
|
||||
protected static final int BYTES_IN_MEGABYTE = 1048576;
|
||||
|
||||
|
@ -71,7 +71,7 @@ public class FileEditor extends AbstractEditor<FileDescriptor> {
|
||||
|
||||
getDialogOptions().setWidthAuto();
|
||||
|
||||
uploadField.setDropZone(new UploadComponentSupport.DropZone(this));
|
||||
uploadField.setDropZone(new UploadField.DropZone(this));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -22,7 +22,7 @@ import com.haulmont.cuba.core.global.FileStorageException;
|
||||
import com.haulmont.cuba.gui.components.AbstractWindow;
|
||||
import com.haulmont.cuba.gui.components.Button;
|
||||
import com.haulmont.cuba.gui.components.FileMultiUploadField;
|
||||
import com.haulmont.cuba.gui.components.UploadComponentSupport;
|
||||
import com.haulmont.cuba.gui.components.UploadField;
|
||||
import com.haulmont.cuba.gui.data.CollectionDatasource;
|
||||
import com.haulmont.cuba.gui.theme.ThemeConstants;
|
||||
import com.haulmont.cuba.gui.upload.FileUploadingAPI;
|
||||
@ -54,7 +54,7 @@ public class MultiUploader extends AbstractWindow {
|
||||
public void init(Map<String, Object> params) {
|
||||
super.init(params);
|
||||
|
||||
multiUpload.setDropZone(new UploadComponentSupport.DropZone(this));
|
||||
multiUpload.setDropZone(new UploadField.DropZone(this));
|
||||
|
||||
getDialogOptions()
|
||||
.setHeight(themeConstants.getInt("cuba.gui.multiupload.height"))
|
||||
|
@ -17,10 +17,9 @@
|
||||
package com.haulmont.cuba.gui.components;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
|
||||
public interface FileMultiUploadField extends UploadComponentSupport {
|
||||
public interface FileMultiUploadField extends UploadField {
|
||||
|
||||
String NAME = "multiUpload";
|
||||
|
||||
|
@ -18,10 +18,9 @@ package com.haulmont.cuba.gui.components;
|
||||
|
||||
import com.haulmont.cuba.core.entity.FileDescriptor;
|
||||
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
|
||||
public interface FileUploadField extends UploadComponentSupport {
|
||||
public interface FileUploadField extends UploadField {
|
||||
String NAME = "upload";
|
||||
|
||||
@Deprecated
|
||||
|
@ -19,7 +19,7 @@ package com.haulmont.cuba.gui.components;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
public interface UploadComponentSupport extends Component, Component.HasCaption, Component.BelongToFrame, Component.HasIcon {
|
||||
public interface UploadField extends Component, Component.HasCaption, Component.BelongToFrame, Component.HasIcon {
|
||||
|
||||
abstract class FileUploadEvent {
|
||||
private final String fileName;
|
@ -18,12 +18,12 @@
|
||||
package com.haulmont.cuba.gui.components.compatibility;
|
||||
|
||||
import com.haulmont.cuba.gui.components.FileUploadField;
|
||||
import com.haulmont.cuba.gui.components.UploadComponentSupport;
|
||||
import com.haulmont.cuba.gui.components.UploadField;
|
||||
|
||||
@Deprecated
|
||||
public class FileUploadFieldListenerWrapper implements UploadComponentSupport.FileUploadStartListener,
|
||||
UploadComponentSupport.FileUploadFinishListener,
|
||||
UploadComponentSupport.FileUploadErrorListener,
|
||||
public class FileUploadFieldListenerWrapper implements UploadField.FileUploadStartListener,
|
||||
UploadField.FileUploadFinishListener,
|
||||
UploadField.FileUploadErrorListener,
|
||||
FileUploadField.FileUploadSucceedListener {
|
||||
private final FileUploadField.Listener listener;
|
||||
|
||||
@ -32,17 +32,17 @@ public class FileUploadFieldListenerWrapper implements UploadComponentSupport.Fi
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fileUploadError(UploadComponentSupport.FileUploadErrorEvent e) {
|
||||
public void fileUploadError(UploadField.FileUploadErrorEvent e) {
|
||||
listener.uploadFailed(new FileUploadField.Listener.Event(e.getFileName(), e.getCause()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fileUploadFinish(UploadComponentSupport.FileUploadFinishEvent e) {
|
||||
public void fileUploadFinish(UploadField.FileUploadFinishEvent e) {
|
||||
listener.uploadFinished(new FileUploadField.Listener.Event(e.getFileName()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fileUploadStart(UploadComponentSupport.FileUploadStartEvent e) {
|
||||
public void fileUploadStart(UploadField.FileUploadStartEvent e) {
|
||||
listener.uploadStarted(new FileUploadField.Listener.Event(e.getFileName()));
|
||||
}
|
||||
|
||||
|
@ -18,12 +18,12 @@
|
||||
package com.haulmont.cuba.gui.components.compatibility;
|
||||
|
||||
import com.haulmont.cuba.gui.components.FileMultiUploadField;
|
||||
import com.haulmont.cuba.gui.components.UploadComponentSupport;
|
||||
import com.haulmont.cuba.gui.components.UploadField;
|
||||
|
||||
@Deprecated
|
||||
public class MultiUploadFieldListenerWrapper implements UploadComponentSupport.FileUploadStartListener,
|
||||
UploadComponentSupport.FileUploadErrorListener,
|
||||
UploadComponentSupport.FileUploadFinishListener,
|
||||
public class MultiUploadFieldListenerWrapper implements UploadField.FileUploadStartListener,
|
||||
UploadField.FileUploadErrorListener,
|
||||
UploadField.FileUploadFinishListener,
|
||||
FileMultiUploadField.QueueUploadCompleteListener {
|
||||
|
||||
private final FileMultiUploadField.UploadListener listener;
|
||||
@ -33,17 +33,17 @@ public class MultiUploadFieldListenerWrapper implements UploadComponentSupport.F
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fileUploadError(UploadComponentSupport.FileUploadErrorEvent e) {
|
||||
public void fileUploadError(UploadField.FileUploadErrorEvent e) {
|
||||
//todo rewrite generated body
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fileUploadFinish(UploadComponentSupport.FileUploadFinishEvent e) {
|
||||
public void fileUploadFinish(UploadField.FileUploadFinishEvent e) {
|
||||
//todo rewrite generated body
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fileUploadStart(UploadComponentSupport.FileUploadStartEvent e) {
|
||||
public void fileUploadStart(UploadField.FileUploadStartEvent e) {
|
||||
//todo rewrite generated body
|
||||
}
|
||||
|
||||
|
@ -78,7 +78,7 @@ public class FileMultiUploadFieldLoader extends AbstractComponentLoader<FileMult
|
||||
if (StringUtils.isNotEmpty(dropZoneId)) {
|
||||
Component dropZone = context.getFrame().getComponent(dropZoneId);
|
||||
if (dropZone instanceof BoxLayout) {
|
||||
uploadField.setDropZone(new UploadComponentSupport.DropZone((BoxLayout) dropZone));
|
||||
uploadField.setDropZone(new UploadField.DropZone((BoxLayout) dropZone));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -19,7 +19,7 @@ package com.haulmont.cuba.gui.xml.layout.loaders;
|
||||
import com.haulmont.cuba.gui.components.BoxLayout;
|
||||
import com.haulmont.cuba.gui.components.Component;
|
||||
import com.haulmont.cuba.gui.components.FileUploadField;
|
||||
import com.haulmont.cuba.gui.components.UploadComponentSupport;
|
||||
import com.haulmont.cuba.gui.components.UploadField;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.dom4j.Element;
|
||||
|
||||
@ -81,7 +81,7 @@ public class FileUploadFieldLoader extends AbstractComponentLoader<FileUploadFie
|
||||
if (StringUtils.isNotEmpty(dropZoneId)) {
|
||||
Component dropZone = context.getFrame().getComponent(dropZoneId);
|
||||
if (dropZone instanceof BoxLayout) {
|
||||
uploadField.setDropZone(new UploadComponentSupport.DropZone((BoxLayout) dropZone));
|
||||
uploadField.setDropZone(new UploadField.DropZone((BoxLayout) dropZone));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -22,13 +22,13 @@ import com.haulmont.chile.core.datatypes.Datatypes;
|
||||
import com.haulmont.cuba.client.ClientConfig;
|
||||
import com.haulmont.cuba.core.global.AppBeans;
|
||||
import com.haulmont.cuba.core.global.Configuration;
|
||||
import com.haulmont.cuba.gui.components.UploadComponentSupport;
|
||||
import com.haulmont.cuba.gui.components.UploadField;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
public abstract class WebAbstractUploadComponent<T extends com.vaadin.ui.Component>
|
||||
extends WebAbstractComponent<T>
|
||||
implements UploadComponentSupport {
|
||||
implements UploadField {
|
||||
|
||||
protected static final int BYTES_IN_MEGABYTE = 1048576;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user