-
Notifications
You must be signed in to change notification settings - Fork 31
Expand file tree
/
Copy pathCSVExporter.java
More file actions
49 lines (39 loc) · 1.12 KB
/
CSVExporter.java
File metadata and controls
49 lines (39 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
package org.vaadin.haijian;
import org.vaadin.haijian.filegenerator.CSVFileBuilder;
import org.vaadin.haijian.filegenerator.FileBuilder;
import com.vaadin.data.Container;
import com.vaadin.ui.Table;
public class CSVExporter extends Exporter {
public CSVExporter() {
super();
}
public CSVExporter(Table table) {
super(table);
}
public CSVExporter(Container container, Object[] visibleColumns) {
super(container, visibleColumns);
}
public CSVExporter(Container container) {
super(container);
}
@Override
protected FileBuilder createFileBuilder(Container container) {
// TODO Auto-generated method stub
return new CSVFileBuilder(container);
}
@Override
protected FileBuilder createFileBuilder(Table table) {
return new CSVFileBuilder(table);
}
@Override
protected String getDownloadFileName() {
if(downloadFileName == null){
return "exported-csv.csv";
}
if(downloadFileName.endsWith(".csv")){
return downloadFileName;
}else{
return downloadFileName + ".csv";
}
}
}