mirror of
https://github.com/developersu/ns-usbloader.git
synced 2025-05-14 15:15:05 -04:00
v0.2-development intermediate results of friday codings
This commit is contained in:
parent
f7e2ae9771
commit
49bd078bc5
11 changed files with 684 additions and 339 deletions
55
src/main/java/nsusbloader/Controllers/NSLRowModel.java
Normal file
55
src/main/java/nsusbloader/Controllers/NSLRowModel.java
Normal file
|
@ -0,0 +1,55 @@
|
|||
package nsusbloader.Controllers;
|
||||
|
||||
import nsusbloader.NSLDataTypes.FileStatus;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
public class NSLRowModel {
|
||||
|
||||
private String status; // 0 = unknown, 1 = uploaded, 2 = bad file
|
||||
private File nspFile;
|
||||
private String nspFileName;
|
||||
private boolean markForUpload;
|
||||
|
||||
NSLRowModel(File nspFile, boolean checkBoxValue){
|
||||
this.nspFile = nspFile;
|
||||
this.markForUpload = checkBoxValue;
|
||||
this.nspFileName = nspFile.getName();
|
||||
this.status = "";
|
||||
}
|
||||
// Model methods start
|
||||
public String getStatus(){
|
||||
return status;
|
||||
}
|
||||
public String getNspFileName(){
|
||||
return nspFileName;
|
||||
}
|
||||
public boolean isMarkForUpload() {
|
||||
return markForUpload;
|
||||
}
|
||||
// Model methods end
|
||||
|
||||
public void setMarkForUpload(boolean value){
|
||||
markForUpload = value;
|
||||
}
|
||||
|
||||
public void setStatus(FileStatus status){ // TODO: Localization
|
||||
switch (status){
|
||||
case FAILED:
|
||||
this.status = "Upload failed";
|
||||
break;
|
||||
case UPLOADED:
|
||||
this.status = "Uploaded";
|
||||
markForUpload = false;
|
||||
break;
|
||||
case INCORRECT:
|
||||
this.status = "File incorrect";
|
||||
markForUpload = false;
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
public File getNspFile(){
|
||||
return nspFile;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue