Skip to content
This repository was archived by the owner on Apr 8, 2019. It is now read-only.

Commit 98f952c

Browse files
author
aki
committed
add filenameandtext
1 parent 971e623 commit 98f952c

File tree

2 files changed

+48
-0
lines changed

2 files changed

+48
-0
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
package com.akjava.gwt.html5.client.file.ui;
2+
3+
import com.akjava.gwt.html5.client.download.HTML5Download;
4+
import com.google.gwt.user.client.ui.Anchor;
5+
6+
public class FileNameAndText {
7+
private String name;
8+
private String text;
9+
public FileNameAndText(){}
10+
public FileNameAndText(String name,String text){
11+
this.name=name;
12+
this.text=text;
13+
}
14+
public String getName() {
15+
return name;
16+
}
17+
public void setName(String name) {
18+
this.name = name;
19+
}
20+
public String getText() {
21+
return text;
22+
}
23+
public void setText(String text) {
24+
this.text = text;
25+
}
26+
27+
public Anchor createDownloadLink(String linkText){
28+
return new HTML5Download().generateTextDownloadLink(text, name, linkText);
29+
}
30+
31+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package com.akjava.gwt.html5.client.file.ui;
2+
3+
import com.google.gwt.cell.client.AbstractCell;
4+
import com.google.gwt.safehtml.shared.SafeHtmlBuilder;
5+
6+
public class FileNameAndTextCell extends AbstractCell<FileNameAndText>{
7+
8+
@Override
9+
public void render(com.google.gwt.cell.client.Cell.Context context,
10+
FileNameAndText value, SafeHtmlBuilder sb) {
11+
if(value == null){
12+
return;
13+
}
14+
sb.appendHtmlConstant(value.getName());
15+
}
16+
17+
}

0 commit comments

Comments
 (0)