PL-7438 Rename UploadComponentSupport to UploadField

This commit is contained in:
Yuriy Artamonov 2016-06-27 19:07:25 +04:00
parent 5a8f5169c4
commit b37f256a99
11 changed files with 27 additions and 29 deletions

View File

@ -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;

View File

@ -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

View File

@ -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"))

View File

@ -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";

View File

@ -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

View File

@ -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;

View File

@ -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()));
}

View File

@ -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
}

View File

@ -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));
}
}

View File

@ -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));
}
}

View File

@ -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;