summaryrefslogtreecommitdiffstats
path: root/idrop-lite
diff options
context:
space:
mode:
authorLISA STILLWELL <lisa@dhcp152-54-6-218.wireless.europa.renci.org>2011-12-19 16:35:37 (GMT)
committer LISA STILLWELL <lisa@dhcp152-54-6-218.wireless.europa.renci.org>2011-12-19 16:35:37 (GMT)
commit08d04c67501c45fbad70fe1fcdeda8b3272dc227 (patch)
tree6253e51e6007f0da057749cee34111c0bfd7ff7c /idrop-lite
parenta2c98c74f8f40d4610fdce8720f65828a530c644 (diff)
downloadQCG-Data-08d04c67501c45fbad70fe1fcdeda8b3272dc227.zip
QCG-Data-08d04c67501c45fbad70fe1fcdeda8b3272dc227.tar.gz
QCG-Data-08d04c67501c45fbad70fe1fcdeda8b3272dc227.tar.bz2
[#427] more work on upload/download tables and progress bars
Diffstat (limited to 'idrop-lite')
-rw-r--r--idrop-lite/src/main/java/org/irods/jargon/idrop/lite/TransferProgressInfo.java58
-rw-r--r--idrop-lite/src/main/java/org/irods/jargon/idrop/lite/UploadTableFilenameRenderer.java87
-rw-r--r--idrop-lite/src/main/java/org/irods/jargon/idrop/lite/UploadTableProgressBar.java52
-rw-r--r--idrop-lite/src/main/java/org/irods/jargon/idrop/lite/UploadTableTransferHandler.java28
-rw-r--r--idrop-lite/src/main/java/org/irods/jargon/idrop/lite/iDropLiteApplet.form5
-rw-r--r--idrop-lite/src/main/java/org/irods/jargon/idrop/lite/iDropLiteApplet.java108
6 files changed, 272 insertions, 66 deletions
diff --git a/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/TransferProgressInfo.java b/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/TransferProgressInfo.java
new file mode 100644
index 0000000..ea7ce11
--- /dev/null
+++ b/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/TransferProgressInfo.java
@@ -0,0 +1,58 @@
+package org.irods.jargon.idrop.lite;
+
+public class TransferProgressInfo {
+ int percentDone = 0;
+ int totalFilesToTransfer = 0;
+ int totalFilesTransferredSoFar = 0;
+ int displayMode = -1;
+
+ public TransferProgressInfo() {
+ }
+
+ public TransferProgressInfo(int mode) {
+ this.displayMode = mode;
+ }
+
+ public TransferProgressInfo(long fileSize, long fileSoFar, int toTransfer, int soFar) {
+ this.percentDone = this.calcPercentDone(fileSoFar, fileSize);
+ this.totalFilesToTransfer = toTransfer;
+ this.totalFilesTransferredSoFar = soFar;
+ }
+
+ public int calcPercentDone(long bytesTransfered, long totalSize) {
+
+ float percent = 0;
+
+ float bt = bytesTransfered * 100;
+ float tot = totalSize;
+ if(tot != 0) {
+ percent = bt / tot;
+ }
+
+ return (int)percent;
+ }
+
+ public int getPercentDone() {
+ return this.percentDone;
+ }
+
+ public void setPercentDone(int percent) {
+ this.percentDone = percent;
+ }
+
+ public int getTotalFilesToTransfer() {
+ return this.totalFilesToTransfer;
+ }
+
+ public void setTotalFilesToTransfer(int toTransfer) {
+ this.totalFilesToTransfer = toTransfer;
+ }
+
+ public int getTotalFilesTransferredSoFar() {
+ return this.totalFilesTransferredSoFar;
+ }
+
+ public void setTotalFilesTransferredSoFar(int soFar) {
+ this.totalFilesTransferredSoFar = soFar;
+ }
+}
diff --git a/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/UploadTableFilenameRenderer.java b/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/UploadTableFilenameRenderer.java
new file mode 100644
index 0000000..4c6527e
--- /dev/null
+++ b/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/UploadTableFilenameRenderer.java
@@ -0,0 +1,87 @@
+package org.irods.jargon.idrop.lite;
+
+import java.awt.Component;
+import java.io.File;
+import java.util.Enumeration;
+
+import javax.swing.Icon;
+import javax.swing.ImageIcon;
+import javax.swing.JLabel;
+import javax.swing.JOptionPane;
+import javax.swing.JTable;
+import javax.swing.UIDefaults;
+import javax.swing.UIManager;
+import javax.swing.UnsupportedLookAndFeelException;
+import javax.swing.filechooser.FileSystemView;
+import javax.swing.filechooser.FileView;
+import javax.swing.table.DefaultTableCellRenderer;
+
+import org.irods.jargon.core.pub.IRODSFileSystem;
+import org.irods.jargon.core.pub.io.IRODSFile;
+
+// get filename sent to renderer - determine if this is an irods or local file/folder and
+// set appropriate icon (for folder or file)
+
+public class UploadTableFilenameRenderer extends DefaultTableCellRenderer {
+
+ static final int UPLOAD_MODE = 2;
+ static final int DOWNLOAD_MODE = 3;
+ private int mode = -1;
+
+ public UploadTableFilenameRenderer(int mode) {
+ super();
+ this.mode = mode;
+ }
+
+ public Component getTableCellRendererComponent(JTable table, Object value,
+ boolean isSelected, boolean hasFocus, int row, int column) {
+
+ JLabel label = (JLabel)super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
+
+ if(column == 0) { // filename column in upload/download table
+ String filename = (String)value;
+ Icon icon = null;
+
+ switch(mode) {
+
+ case(UPLOAD_MODE) :
+ File localFile = new File(filename);
+ icon = FileSystemView.getFileSystemView().getSystemIcon(localFile);
+ break;
+
+ case(DOWNLOAD_MODE) :
+ if(isIrodsFolder(table, row)) {
+ icon = UIManager.getIcon("FileView.directoryIcon");
+ }
+ else {
+ icon = UIManager.getIcon("FileView.fileIcon");
+ }
+
+ UIDefaults defs = UIManager.getDefaults();
+ int i = 0;
+ break;
+ }
+
+ if(icon != null) {
+ label.setIcon(icon);
+ }
+ label.setText(filename);
+ }
+
+ return label;
+ }
+
+ private Boolean isIrodsFolder(JTable table, int row) {
+
+ Boolean isFolder = false;
+
+ isFolder = (Boolean) table.getModel().getValueAt(row, 4);
+ return isFolder;
+ }
+
+ private Boolean isLocalFolder(String filename) {
+ return false;
+ }
+
+
+}
diff --git a/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/UploadTableProgressBar.java b/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/UploadTableProgressBar.java
index 7754ec7..44a3a5d 100644
--- a/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/UploadTableProgressBar.java
+++ b/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/UploadTableProgressBar.java
@@ -7,8 +7,11 @@ import javax.swing.JProgressBar;
import javax.swing.JTable;
import javax.swing.border.CompoundBorder;
import javax.swing.border.EmptyBorder;
+import javax.swing.table.DefaultTableModel;
import javax.swing.table.TableCellRenderer;
+import org.irods.jargon.core.transfer.TransferStatus;
+
public class UploadTableProgressBar extends JProgressBar implements TableCellRenderer {
public UploadTableProgressBar(){
@@ -23,14 +26,49 @@ public class UploadTableProgressBar extends JProgressBar implements TableCellRen
@Override
public Component getTableCellRendererComponent(JTable table, Object value,
boolean isSelected, boolean hasFocus, int row, int column) {
-
- if(value != null) {
- Integer ival = (Integer)value;
-// if(ival == 100) {
-// return "Done";
-// }
+// if(value.getClass().getName().equals("TransferStatus")) {
+// TransferStatus ts = (TransferStatus)value;
+// float bt = ts.getBytesTransfered() * 100;
+// float tot = ts.getTotalSize();
+// float percentDone = bt / tot;
+// Integer ival = (int)percentDone;
+//
+// setValue(ival);
+// // find out if this is a file or folder
+// if(!ts.isIntraFileStatusReport()) {
+// String progressString = "File " + ts.getTotalFilesTransferredSoFar() + " of " + ts.getTotalFilesToTransfer() + " complete";
+// setString(progressString);
+// }
+// else {
+// //setString(ival.toString().concat("%"));
+// }
+// }
+// if(value != null) {
+// Integer ival = (Integer)value;
+//
+// setValue(ival);
+// setString(ival.toString().concat("%"));
+// }
+// else {
+// setValue(0);
+// setString("0%");
+// }
+ if((value != null) && (value instanceof TransferProgressInfo)) {
+ TransferProgressInfo tpInfo = (TransferProgressInfo)value;
+ Integer ival = tpInfo.getPercentDone();
setValue(ival);
- setString(ival.toString().concat("%"));
+
+ // check to see if this a folder and if files have already started to be transferred
+ Boolean isFolder = (Boolean) table.getModel().getValueAt(row, 4);
+ int filesToTransfer = tpInfo.getTotalFilesToTransfer();
+ int soFar = tpInfo.getTotalFilesTransferredSoFar();
+ if((isFolder) && (soFar > 0)) {
+ String pbText = "File " + soFar + " of " + filesToTransfer + " complete";
+ setString(pbText);
+ }
+ else {
+ setString(ival.toString().concat("%"));
+ }
}
else {
setValue(0);
diff --git a/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/UploadTableTransferHandler.java b/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/UploadTableTransferHandler.java
index 0ea31c8..66e24cd 100644
--- a/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/UploadTableTransferHandler.java
+++ b/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/UploadTableTransferHandler.java
@@ -136,14 +136,22 @@ public class UploadTableTransferHandler extends TransferHandler {
}
DefaultTableModel tm = (DefaultTableModel)table.getModel();
-
+ Boolean isFolder = false;
for (File transferFile : sourceFiles) {
log.info("put file in upload table: {}", transferFile.getAbsolutePath());
String localSourceAbsolutePath = transferFile.getAbsolutePath();
- Object [] rowData = new Object[2];
+
+ if(transferFile.isDirectory()) {
+ isFolder = true;
+ }
+
+ Object [] rowData = new Object[5];
rowData[0] = localSourceAbsolutePath;
- //rowData[1] = Boolean.TRUE;
+ rowData[1] = 0;
+ rowData[2] = new TransferProgressInfo();
+ rowData[3] = Boolean.TRUE;
+ rowData[4] = isFolder;
tm.addRow(rowData);
}
}
@@ -172,15 +180,23 @@ public class UploadTableTransferHandler extends TransferHandler {
}
DefaultTableModel tm = (DefaultTableModel)table.getModel();
-
+ Boolean isFolder = false;
for (File transferFile : sourceFiles) {
String localSourceAbsolutePath = transferFile.getAbsolutePath();
log.info("put file in upload table: {}", localSourceAbsolutePath);
+
+ if(transferFile.isDirectory()) {
+ isFolder = true;
+ }
- Object [] rowData = new Object[2];
+ Object [] rowData = new Object[5];
rowData[0] = localSourceAbsolutePath;
- //rowData[1] = Boolean.TRUE;
+ rowData[1] = 0;
+ rowData[2] = new TransferProgressInfo();
+ rowData[3] = Boolean.TRUE;
+ rowData[4] = isFolder;
tm.addRow(rowData);
+
}
}
diff --git a/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/iDropLiteApplet.form b/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/iDropLiteApplet.form
index 8c17931..99b1c77 100644
--- a/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/iDropLiteApplet.form
+++ b/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/iDropLiteApplet.form
@@ -1217,11 +1217,12 @@
<Component class="javax.swing.JTable" name="tblUploadTable1">
<Properties>
<Property name="model" type="javax.swing.table.TableModel" editor="org.netbeans.modules.form.editors2.TableModelEditor">
- <Table columnCount="4" rowCount="0">
+ <Table columnCount="5" rowCount="0">
<Column editable="false" title="File Name" type="java.lang.String"/>
- <Column editable="false" title="File Size" type="java.lang.Integer"/>
+ <Column editable="false" title="File/Folder Size" type="java.lang.Integer"/>
<Column editable="false" title="Progress" type="java.lang.Object"/>
<Column editable="true" title="Cancel/Remove" type="java.lang.Boolean"/>
+ <Column editable="false" title="isFolder" type="java.lang.Boolean"/>
</Table>
</Property>
<Property name="bounds" type="java.awt.Rectangle" editor="org.netbeans.beaninfo.editors.RectangleEditor">
diff --git a/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/iDropLiteApplet.java b/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/iDropLiteApplet.java
index d06a8ad..0bd68e8 100644
--- a/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/iDropLiteApplet.java
+++ b/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/iDropLiteApplet.java
@@ -28,6 +28,7 @@ import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
import javax.swing.event.TableModelEvent;
import javax.swing.event.TableModelListener;
+import javax.swing.filechooser.FileSystemView;
import javax.swing.table.DefaultTableModel;
import javax.swing.tree.TreePath;
@@ -79,6 +80,7 @@ public class iDropLiteApplet extends javax.swing.JApplet implements TransferStat
private String tempPswd;
private String absPath;
private String uploadDest;
+ private String key;
IRODSFileSystem irodsFileSystem = null;
private LocalFileSystemModel localFileModel = null;
private LocalFileSystemModel localUploadFileModel = null;
@@ -141,6 +143,16 @@ public class iDropLiteApplet extends javax.swing.JApplet implements TransferStat
this.displayMode = Integer.valueOf(getParameter("displayMode"));
log.info("setting display mode to {}", displayMode);
}
+
+ // param for mode 3 (shopping cart)
+ if (getParameter("key") == null) {
+ log.info("shopping cart key is NOT set");
+ key = "undefined";
+ }
+ else {
+ log.info("shopping cart key IS set");
+ this.key = getParameter("key");
+ }
log.debug("creating account with applet params");
log.info("mode:{}", mode);
@@ -311,7 +323,6 @@ public class iDropLiteApplet extends javax.swing.JApplet implements TransferStat
switch (displayMode) {
case 1:
log.info(">>>>>>>>> local/irods display mode 1");
-
cl.show(testCardPanel, "card2");
break;
case 2:
@@ -319,7 +330,6 @@ public class iDropLiteApplet extends javax.swing.JApplet implements TransferStat
cl.show(testCardPanel, "card3");
populateUploadDestination();
setupProgressTable();
- //setupUploadTable();
break;
case 3:
log.info(">>>>>>>>>shopping cart display mode 3");
@@ -331,8 +341,6 @@ public class iDropLiteApplet extends javax.swing.JApplet implements TransferStat
default:
log.info(">>>>>>>>> no display mode, show local/rods display mode 1");
cl.show(testCardPanel, "card2");
- populateUploadDestination();
- setupUploadTable();
}
@@ -611,38 +619,6 @@ public class iDropLiteApplet extends javax.swing.JApplet implements TransferStat
btnUploadBeginImport.setEnabled(true);
}
}
-
- private void setupUploadTable() {
-
- // load table cancel icon
- java.net.URL imgURL = getClass().getResource("/cancel.gif");
-
- if (imgURL != null) {
- cancelIcon = new ImageIcon(imgURL, "image used to denote cancel or remove table entry");
- } else {
- log.error("cannot find image: cancel.gif for Upload Table");
- }
-
- //set FillsViewportHeight so user can drop onto an empty table
- tblUploadTable1.setFillsViewportHeight(true);
- tblUploadTable1.setShowGrid(true);
- tblUploadTable1.setShowVerticalLines(false);
- tblUploadTable1.getColumnModel().getColumn(1).setPreferredWidth(10);
- tblUploadTable1.getColumnModel().getColumn(3).setPreferredWidth(6);
-
- tblUploadTable1.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
- tblUploadTable1.setDropMode(DropMode.INSERT_ROWS);
- tblUploadTable1.setDragEnabled(true);
- UploadTableTransferHandler tth = new UploadTableTransferHandler();
- tth.setGUI(this);
- tblUploadTable1.getModel().addTableModelListener(applet);
- tblUploadTable1.setTransferHandler(tth);
-
- // add rendered for progress bars in second column
- tblUploadTable1.getColumnModel().getColumn(2).setCellRenderer(new UploadTableProgressBar());
- tblUploadTable1.getColumnModel().getColumn(3).setCellRenderer(new UploadTableCancelRenderer(cancelIcon));
-
- }
private void setupProgressTable() {
@@ -662,7 +638,7 @@ public class iDropLiteApplet extends javax.swing.JApplet implements TransferStat
tblUploadTable1.getColumnModel().getColumn(3).setPreferredWidth(6);
tblUploadTable1.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
- if(displayMode == 2) {
+ if(displayMode == 2) { // do some special stuff for Upload Mode
tblUploadTable1.setDropMode(DropMode.INSERT_ROWS);
tblUploadTable1.setDragEnabled(true);
UploadTableTransferHandler tth = new UploadTableTransferHandler();
@@ -677,10 +653,19 @@ public class iDropLiteApplet extends javax.swing.JApplet implements TransferStat
tblUploadTable1.getColumnModel().getColumn(1).setPreferredWidth(10);
pnlDownloadProgressTable.add(jScrollPane5, java.awt.BorderLayout.CENTER);
}
+ // hide the isFolder indicator column
+ tblUploadTable1.getColumnModel().getColumn(4).setWidth(0);
+ tblUploadTable1.getColumnModel().getColumn(4).setMinWidth(0);
+ tblUploadTable1.getColumnModel().getColumn(4).setMaxWidth(0);
+ tblUploadTable1.getColumnModel().getColumn(4).setPreferredWidth(0);
+
tblUploadTable1.getModel().addTableModelListener(applet);
+ // add renderer for file name in first column
+ tblUploadTable1.getColumnModel().getColumn(0).setCellRenderer(new UploadTableFilenameRenderer(this.displayMode));
// add rendered for progress bars in second column
tblUploadTable1.getColumnModel().getColumn(2).setCellRenderer(new UploadTableProgressBar());
+ // add renderer for cancel icon
tblUploadTable1.getColumnModel().getColumn(3).setCellRenderer(new UploadTableCancelRenderer(cancelIcon));
}
@@ -739,7 +724,9 @@ public class iDropLiteApplet extends javax.swing.JApplet implements TransferStat
float bt = ts.getBytesTransfered() * 100;
float tot = ts.getTotalSize();
float percentDone = bt / tot;
- tblUploadTable1.getModel().setValueAt((int) percentDone, tableRow, 2);
+ //tblUploadTable1.getModel().setValueAt((int) percentDone, tableRow, 2);
+ TransferProgressInfo tpi = new TransferProgressInfo(ts.getTotalSize(), ts.getBytesTransfered(), 0, 0);
+ tblUploadTable1.getModel().setValueAt(tpi, tableRow, 2);
}
} else if (ts.getTransferState() == TransferStatus.TransferState.IN_PROGRESS_START_FILE) {
@@ -755,7 +742,10 @@ public class iDropLiteApplet extends javax.swing.JApplet implements TransferStat
tableRow = getUploadTableProgressRow(currentUploadFile);
}
if ((tableRow >= 0)) {
- tblUploadTable1.getModel().setValueAt(0, tableRow, 2);
+ //tblUploadTable1.getModel().setValueAt(0, tableRow, 2);
+ TransferProgressInfo tpi = new TransferProgressInfo(ts.getTotalSize(), ts.getBytesTransfered(),
+ ts.getTotalFilesToTransfer(), ts.getTotalFilesTransferredSoFar());
+ tblUploadTable1.getModel().setValueAt(tpi, tableRow, 2);
}
@@ -778,7 +768,10 @@ public class iDropLiteApplet extends javax.swing.JApplet implements TransferStat
float bt = ts.getBytesTransfered() * 100;
float tot = ts.getTotalSize();
float percentDone = bt / tot;
- tblUploadTable1.getModel().setValueAt((int) percentDone, tableRow, 2);
+ //tblUploadTable1.getModel().setValueAt((int) percentDone, tableRow, 2);
+ TransferProgressInfo tpi = new TransferProgressInfo(ts.getTotalSize(), ts.getBytesTransfered(),
+ ts.getTotalFilesToTransfer(), ts.getTotalFilesTransferredSoFar());
+ tblUploadTable1.getModel().setValueAt(tpi, tableRow, 2);
}
} else {
@@ -809,6 +802,7 @@ public class iDropLiteApplet extends javax.swing.JApplet implements TransferStat
@Override
public void run() {
+ log.info("in overallStatusCallback thread");
int tableRow = -1;
if (currentUploadFile != null) {
@@ -1096,9 +1090,7 @@ public class iDropLiteApplet extends javax.swing.JApplet implements TransferStat
ShoppingCartService shoppingCartService = new ShoppingCartServiceImpl(
iDropCore.getIrodsFileSystem().getIRODSAccessObjectFactory(), iDropCore.getIrodsAccount(),
dataCacheServiceFactory);
- FileShoppingCart fileShoppingCart = FileShoppingCart.instance();
- shoppingCartService.serializeShoppingCartAsLoggedInUser(fileShoppingCart, tempPswd);
- cart = shoppingCartService.retreiveShoppingCartAsLoggedInUser(tempPswd);
+ cart = shoppingCartService.retreiveShoppingCartAsLoggedInUser(this.key);
} catch (JargonException e) {
log.error("could not create shopping cart");
Logger.getLogger(iDropLiteApplet.class.getName()).log(Level.SEVERE, null, e);
@@ -1108,7 +1100,8 @@ public class iDropLiteApplet extends javax.swing.JApplet implements TransferStat
cartContents = cart.getShoppingCartFileList();
}
- //cartContents.add("/renci/home/rods/lisa/icp.out");
+ // for testing
+ // cartContents.add("/renci/home/rods/lisa/icp.out");
return cartContents;
}
@@ -1116,16 +1109,20 @@ public class iDropLiteApplet extends javax.swing.JApplet implements TransferStat
private void populateDownloadTableWithCartContents()
{
long fileSize = 0;
+ Boolean isFolder = false;
List<String> cartFiles = getCartFiles();
for(String cf: cartFiles) {
DefaultTableModel tm = (DefaultTableModel)tblUploadTable1.getModel();
- Object [] rowData = new Object[4];
+ Object [] rowData = new Object[5];
rowData[0] = cf;
try {
IRODSFileService irodsFS = new IRODSFileService(iDropCore.getIrodsAccount(), IRODSFileSystem.instance());
IRODSFile ifile = irodsFS.getIRODSFileForPath(cf);
+ if(ifile.isDirectory()) {
+ isFolder = true;
+ }
fileSize = ifile.length();
}
catch(Exception ex) {
@@ -1136,6 +1133,7 @@ public class iDropLiteApplet extends javax.swing.JApplet implements TransferStat
rowData[1] = (int)fileSize;
rowData[2] = 0;
rowData[3] = Boolean.TRUE;
+ rowData[4] = isFolder;
tm.addRow(rowData);
}
}
@@ -1789,14 +1787,14 @@ public class iDropLiteApplet extends javax.swing.JApplet implements TransferStat
},
new String [] {
- "File Name", "File Size", "Progress", "Cancel/Remove"
+ "File Name", "File/Folder Size", "Progress", "Cancel/Remove", "isFolder"
}
) {
Class[] types = new Class [] {
- java.lang.String.class, java.lang.Integer.class, java.lang.Object.class, java.lang.Boolean.class
+ java.lang.String.class, java.lang.Integer.class, java.lang.Object.class, java.lang.Boolean.class, java.lang.Boolean.class
};
boolean[] canEdit = new boolean [] {
- false, false, false, true
+ false, false, false, true, false
};
public Class getColumnClass(int columnIndex) {
@@ -2038,14 +2036,22 @@ public class iDropLiteApplet extends javax.swing.JApplet implements TransferStat
private void btnUploadMoveActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnUploadMoveActionPerformed
+ Boolean isFolder = false;
TreePath [] paths = fileUploadTree.getSelectionPaths();
for(TreePath path: paths) {
DefaultTableModel tm = (DefaultTableModel)tblUploadTable1.getModel();
- Object [] rowData = new Object[4];
- rowData[0] = LocalFileUtils.makeLocalFilePath(path);
+ String filePath = LocalFileUtils.makeLocalFilePath(path);
+ File localFile = new File(filePath);
+ if(localFile.isDirectory()) {
+ isFolder = true;
+ }
+ Object [] rowData = new Object[5];
+ rowData[0] = filePath;
rowData[1] = 0;
- rowData[2] = 0;
+ //rowData[2] = 0;
+ rowData[2] = new TransferProgressInfo(this.displayMode);
rowData[3] = Boolean.TRUE;
+ rowData[4] = isFolder;
tm.addRow(rowData);
}