summaryrefslogtreecommitdiffstats
path: root/idrop-lite
diff options
context:
space:
mode:
authorLISA STILLWELL <lisa@simon.local>2011-08-17 13:56:55 (GMT)
committer LISA STILLWELL <lisa@simon.local>2011-08-17 13:56:55 (GMT)
commit0ec1e5ab7ce1ffdc3fb2d27d9d3737802935e9c7 (patch)
treeea0bd782e7042f874c0a1a9ebce9c72d25caacb0 /idrop-lite
parent33df19e82d77d84b7ad7593a673c4ac165b3b5a5 (diff)
downloadQCG-Data-0ec1e5ab7ce1ffdc3fb2d27d9d3737802935e9c7.zip
QCG-Data-0ec1e5ab7ce1ffdc3fb2d27d9d3737802935e9c7.tar.gz
QCG-Data-0ec1e5ab7ce1ffdc3fb2d27d9d3737802935e9c7.tar.bz2
[#427] Add Local Tree to main mode and add functionality for Upload mode
Diffstat (limited to 'idrop-lite')
-rw-r--r--idrop-lite/src/main/java/org/irods/jargon/idrop/lite/RenameIRODSDirectoryDialog.java490
-rw-r--r--idrop-lite/src/main/java/org/irods/jargon/idrop/lite/iDropLiteApplet.form114
-rw-r--r--idrop-lite/src/main/java/org/irods/jargon/idrop/lite/iDropLiteApplet.java296
-rw-r--r--idrop-lite/src/main/resources/org/irods/jargon/idrop/lite/Bundle.properties1
4 files changed, 691 insertions, 210 deletions
diff --git a/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/RenameIRODSDirectoryDialog.java b/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/RenameIRODSDirectoryDialog.java
index 8563399..d283413 100644
--- a/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/RenameIRODSDirectoryDialog.java
+++ b/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/RenameIRODSDirectoryDialog.java
@@ -16,6 +16,9 @@ import javax.swing.Action;
import javax.swing.JComponent;
import javax.swing.KeyStroke;
import javax.swing.tree.TreePath;
+
+import org.irods.jargon.core.pub.io.IRODSFile;
+import org.irods.jargon.core.query.CollectionAndDataObjectListingEntry;
import org.slf4j.LoggerFactory;
/**
@@ -24,16 +27,18 @@ import org.slf4j.LoggerFactory;
*/
public class RenameIRODSDirectoryDialog extends javax.swing.JDialog {
- private final iDropLiteApplet idrop;
+ private final iDropLiteApplet idrop;
private final String currentAbsolutePath;
private final IRODSTree stagingViewTree;
private final IRODSNode currentNode;
public static org.slf4j.Logger log = LoggerFactory.getLogger(RenameIRODSDirectoryDialog.class);
/** Creates new form NewIRODSDirectoryDialog */
- public RenameIRODSDirectoryDialog(final iDropLiteApplet parent, final boolean modal, final String currentAbsolutePath, final IRODSTree stagingViewTree, final IRODSNode currentNode) {
- //super(parent, modal); FIX THIS???
- super((Frame)null, modal);
+ public RenameIRODSDirectoryDialog(final iDropLiteApplet parent, final boolean modal,
+ final String currentAbsolutePath, final IRODSTree stagingViewTree,
+ final IRODSNode currentNode) {
+ //super(parent, modal);
+ super((java.awt.Frame)null, modal);
this.idrop = parent;
this.currentAbsolutePath = currentAbsolutePath;
this.stagingViewTree = stagingViewTree;
@@ -41,7 +46,8 @@ public class RenameIRODSDirectoryDialog extends javax.swing.JDialog {
initComponents();
int lastPathPartIdx = currentAbsolutePath.lastIndexOf("/");
if (lastPathPartIdx == -1) {
- String msg = "could not find last path component of absolute path:" + currentAbsolutePath;
+ String msg = "could not find last path component of absolute path:"
+ + currentAbsolutePath;
log.error(msg);
idrop.showIdropException(new IdropException(msg));
return;
@@ -51,179 +57,267 @@ public class RenameIRODSDirectoryDialog extends javax.swing.JDialog {
String currentCollectionOrFileName = currentAbsolutePath.substring(lastPathPartIdx + 1);
log.debug("computed parent abs path as:{}", parentAbsPath);
- log.debug("computed current file or collection name as:{}", currentCollectionOrFileName);
+ log.debug("computed current file or collection name as:{}",
+ currentCollectionOrFileName);
txtCurrentFolder.setText(currentCollectionOrFileName);
registerKeystrokeListener();
}
- /** This method is called from within the constructor to
- * initialize the form.
- * WARNING: Do NOT modify this code. The content of this method is
- * always regenerated by the Form Editor.
+ /**
+ * This method is called from within the constructor to initialize the form.
+ * WARNING: Do NOT modify this code. The content of this method is always
+ * regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
- // <editor-fold defaultstate="collapsed" desc="Generated Code">
- private void initComponents() {
-
- lblTitle = new javax.swing.JLabel();
- pnlFolderData = new javax.swing.JPanel();
- pnlCurrentParent = new javax.swing.JPanel();
- lblCurrentParent = new java.awt.Label();
- lblNewDiretoryName = new java.awt.Label();
- txtCurrentFolder = new javax.swing.JTextField();
- txtNewFolder = new javax.swing.JTextField();
- pnlBottom = new javax.swing.JPanel();
- btnCancel = new javax.swing.JButton();
- btnOK = new javax.swing.JButton();
-
- setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
- setTitle("Rename iRODS File or Folder");
- setName("NewParentDialog"); // NOI18N
-
- lblTitle.setText("Please enter a new name for the file or collection");
-
- lblCurrentParent.setText("Current name:");
-
- lblNewDiretoryName.setText("New name:");
-
- txtCurrentFolder.setColumns(50);
- txtCurrentFolder.setEditable(false);
- txtCurrentFolder.setToolTipText("A name for the new folder underneath the displayed parent");
- txtCurrentFolder.setFocusable(false);
-
- txtNewFolder.setColumns(50);
- txtNewFolder.setToolTipText("A name for the new folder underneath the displayed parent");
-
- btnCancel.setText("Cancel");
- btnCancel.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent evt) {
- btnCancelActionPerformed(evt);
- }
- });
-
- btnOK.setText("OK");
- btnOK.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent evt) {
- btnOKActionPerformed(evt);
- }
- });
-
- org.jdesktop.layout.GroupLayout pnlBottomLayout = new org.jdesktop.layout.GroupLayout(pnlBottom);
- pnlBottom.setLayout(pnlBottomLayout);
- pnlBottomLayout.setHorizontalGroup(
- pnlBottomLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
- .add(pnlBottomLayout.createSequentialGroup()
- .add(576, 576, 576)
- .add(btnCancel)
- .add(5, 5, 5)
- .add(btnOK))
- );
- pnlBottomLayout.setVerticalGroup(
- pnlBottomLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
- .add(pnlBottomLayout.createSequentialGroup()
- .add(5, 5, 5)
- .add(btnCancel))
- .add(pnlBottomLayout.createSequentialGroup()
- .add(5, 5, 5)
- .add(btnOK))
- );
-
- org.jdesktop.layout.GroupLayout pnlCurrentParentLayout = new org.jdesktop.layout.GroupLayout(pnlCurrentParent);
- pnlCurrentParent.setLayout(pnlCurrentParentLayout);
- pnlCurrentParentLayout.setHorizontalGroup(
- pnlCurrentParentLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
- .add(org.jdesktop.layout.GroupLayout.TRAILING, pnlCurrentParentLayout.createSequentialGroup()
- .addContainerGap(30, Short.MAX_VALUE)
- .add(pnlCurrentParentLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
- .add(lblCurrentParent, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
- .add(lblNewDiretoryName, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
- .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
- .add(pnlCurrentParentLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING, false)
- .add(txtNewFolder, 0, 0, Short.MAX_VALUE)
- .add(txtCurrentFolder, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 421, Short.MAX_VALUE))
- .add(213, 213, 213))
- .add(pnlCurrentParentLayout.createSequentialGroup()
- .add(pnlBottom, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 747, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
- .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
- );
- pnlCurrentParentLayout.setVerticalGroup(
- pnlCurrentParentLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
- .add(pnlCurrentParentLayout.createSequentialGroup()
- .add(58, 58, 58)
- .add(pnlCurrentParentLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
- .add(lblCurrentParent, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
- .add(txtCurrentFolder, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
- .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
- .add(pnlCurrentParentLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
- .add(txtNewFolder, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
- .add(lblNewDiretoryName, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
- .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 22, Short.MAX_VALUE)
- .add(pnlBottom, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
- );
-
- lblNewDiretoryName.getAccessibleContext().setAccessibleName("New directory name:");
-
- org.jdesktop.layout.GroupLayout pnlFolderDataLayout = new org.jdesktop.layout.GroupLayout(pnlFolderData);
- pnlFolderData.setLayout(pnlFolderDataLayout);
- pnlFolderDataLayout.setHorizontalGroup(
- pnlFolderDataLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
- .add(pnlFolderDataLayout.createSequentialGroup()
- .add(pnlCurrentParent, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 757, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
- .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
- );
- pnlFolderDataLayout.setVerticalGroup(
- pnlFolderDataLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
- .add(pnlFolderDataLayout.createSequentialGroup()
- .add(pnlCurrentParent, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
- .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
- );
-
- org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane());
- getContentPane().setLayout(layout);
- layout.setHorizontalGroup(
- layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
- .add(layout.createSequentialGroup()
- .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
- .add(lblTitle, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 747, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
- .add(pnlFolderData, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
- .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
- );
- layout.setVerticalGroup(
- layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
- .add(layout.createSequentialGroup()
- .add(lblTitle)
- .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
- .add(pnlFolderData, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
- );
-
- getAccessibleContext().setAccessibleName("Rename file or folder dialog");
-
- pack();
- }// </editor-fold>
-
- private void btnCancelActionPerformed(java.awt.event.ActionEvent evt) {
+ // <editor-fold defaultstate="collapsed"
+ // desc="Generated Code">//GEN-BEGIN:initComponents
+ private void initComponents() {
+
+ lblTitle = new javax.swing.JLabel();
+ pnlFolderData = new javax.swing.JPanel();
+ pnlCurrentParent = new javax.swing.JPanel();
+ lblCurrentParent = new java.awt.Label();
+ lblNewDiretoryName = new java.awt.Label();
+ txtCurrentFolder = new javax.swing.JTextField();
+ txtNewFolder = new javax.swing.JTextField();
+ pnlBottom = new javax.swing.JPanel();
+ btnCancel = new javax.swing.JButton();
+ btnOK = new javax.swing.JButton();
+
+ setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
+ setTitle("Rename iRODS File or Folder");
+ setName("NewParentDialog"); // NOI18N
+
+ lblTitle.setText("Please enter a new name for the file or collection");
+
+ lblCurrentParent.setText("Current name:");
+
+ lblNewDiretoryName.setText("New name:");
+
+ txtCurrentFolder.setColumns(50);
+ txtCurrentFolder.setEditable(false);
+ txtCurrentFolder
+ .setToolTipText("A name for the new folder underneath the displayed parent");
+ txtCurrentFolder.setFocusable(false);
+
+ txtNewFolder.setColumns(50);
+ txtNewFolder
+ .setToolTipText("A name for the new folder underneath the displayed parent");
+
+ btnCancel.setText("Cancel");
+ btnCancel.addActionListener(new java.awt.event.ActionListener() {
+ @Override
+ public void actionPerformed(final java.awt.event.ActionEvent evt) {
+ btnCancelActionPerformed(evt);
+ }
+ });
+
+ btnOK.setText("OK");
+ btnOK.addActionListener(new java.awt.event.ActionListener() {
+ @Override
+ public void actionPerformed(final java.awt.event.ActionEvent evt) {
+ btnOKActionPerformed(evt);
+ }
+ });
+
+ org.jdesktop.layout.GroupLayout pnlBottomLayout = new org.jdesktop.layout.GroupLayout(
+ pnlBottom);
+ pnlBottom.setLayout(pnlBottomLayout);
+ pnlBottomLayout.setHorizontalGroup(pnlBottomLayout.createParallelGroup(
+ org.jdesktop.layout.GroupLayout.LEADING).add(
+ pnlBottomLayout.createSequentialGroup().add(576, 576, 576)
+ .add(btnCancel).add(5, 5, 5).add(btnOK)));
+ pnlBottomLayout.setVerticalGroup(pnlBottomLayout
+ .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
+ .add(pnlBottomLayout.createSequentialGroup().add(5, 5, 5)
+ .add(btnCancel))
+ .add(pnlBottomLayout.createSequentialGroup().add(5, 5, 5)
+ .add(btnOK)));
+
+ org.jdesktop.layout.GroupLayout pnlCurrentParentLayout = new org.jdesktop.layout.GroupLayout(
+ pnlCurrentParent);
+ pnlCurrentParent.setLayout(pnlCurrentParentLayout);
+ pnlCurrentParentLayout
+ .setHorizontalGroup(pnlCurrentParentLayout
+ .createParallelGroup(
+ org.jdesktop.layout.GroupLayout.LEADING)
+ .add(org.jdesktop.layout.GroupLayout.TRAILING,
+ pnlCurrentParentLayout
+ .createSequentialGroup()
+ .addContainerGap(30, Short.MAX_VALUE)
+ .add(pnlCurrentParentLayout
+ .createParallelGroup(
+ org.jdesktop.layout.GroupLayout.TRAILING)
+ .add(lblCurrentParent,
+ org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
+ org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
+ org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
+ .add(lblNewDiretoryName,
+ org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
+ org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
+ org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
+ .addPreferredGap(
+ org.jdesktop.layout.LayoutStyle.RELATED)
+ .add(pnlCurrentParentLayout
+ .createParallelGroup(
+ org.jdesktop.layout.GroupLayout.TRAILING,
+ false)
+ .add(txtNewFolder, 0, 0,
+ Short.MAX_VALUE)
+ .add(txtCurrentFolder,
+ org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
+ 421, Short.MAX_VALUE))
+ .add(213, 213, 213))
+ .add(pnlCurrentParentLayout
+ .createSequentialGroup()
+ .add(pnlBottom,
+ org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
+ 747,
+ org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
+ .addContainerGap(
+ org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
+ Short.MAX_VALUE)));
+ pnlCurrentParentLayout
+ .setVerticalGroup(pnlCurrentParentLayout
+ .createParallelGroup(
+ org.jdesktop.layout.GroupLayout.LEADING)
+ .add(pnlCurrentParentLayout
+ .createSequentialGroup()
+ .add(58, 58, 58)
+ .add(pnlCurrentParentLayout
+ .createParallelGroup(
+ org.jdesktop.layout.GroupLayout.LEADING)
+ .add(lblCurrentParent,
+ org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
+ org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
+ org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
+ .add(txtCurrentFolder,
+ org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
+ org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
+ org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
+ .addPreferredGap(
+ org.jdesktop.layout.LayoutStyle.RELATED)
+ .add(pnlCurrentParentLayout
+ .createParallelGroup(
+ org.jdesktop.layout.GroupLayout.LEADING)
+ .add(txtNewFolder,
+ org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
+ org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
+ org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
+ .add(lblNewDiretoryName,
+ org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
+ org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
+ org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
+ .addPreferredGap(
+ org.jdesktop.layout.LayoutStyle.RELATED,
+ 22, Short.MAX_VALUE)
+ .add(pnlBottom,
+ org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
+ org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
+ org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)));
+
+ lblNewDiretoryName.getAccessibleContext().setAccessibleName(
+ "New directory name:");
+
+ org.jdesktop.layout.GroupLayout pnlFolderDataLayout = new org.jdesktop.layout.GroupLayout(
+ pnlFolderData);
+ pnlFolderData.setLayout(pnlFolderDataLayout);
+ pnlFolderDataLayout.setHorizontalGroup(pnlFolderDataLayout
+ .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
+ .add(pnlFolderDataLayout
+ .createSequentialGroup()
+ .add(pnlCurrentParent,
+ org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
+ 757,
+ org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
+ .addContainerGap(
+ org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
+ Short.MAX_VALUE)));
+ pnlFolderDataLayout.setVerticalGroup(pnlFolderDataLayout
+ .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
+ .add(pnlFolderDataLayout
+ .createSequentialGroup()
+ .add(pnlCurrentParent,
+ org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
+ org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
+ org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
+ .addContainerGap(
+ org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
+ Short.MAX_VALUE)));
+
+ org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(
+ getContentPane());
+ getContentPane().setLayout(layout);
+ layout.setHorizontalGroup(layout
+ .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
+ .add(layout
+ .createSequentialGroup()
+ .add(layout
+ .createParallelGroup(
+ org.jdesktop.layout.GroupLayout.LEADING)
+ .add(lblTitle,
+ org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
+ 747,
+ org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
+ .add(pnlFolderData,
+ org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
+ org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
+ org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
+ .addContainerGap(
+ org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
+ Short.MAX_VALUE)));
+ layout.setVerticalGroup(layout
+ .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
+ .add(layout
+ .createSequentialGroup()
+ .add(lblTitle)
+ .addPreferredGap(
+ org.jdesktop.layout.LayoutStyle.RELATED)
+ .add(pnlFolderData,
+ org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
+ org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
+ org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)));
+
+ getAccessibleContext()
+ .setAccessibleName("Rename file or folder dialog");
+
+ pack();
+ }// </editor-fold>//GEN-END:initComponents
+
+ private void btnCancelActionPerformed(final java.awt.event.ActionEvent evt) {// GEN-FIRST:event_btnCancelActionPerformed
this.dispose();
-}
+ }// GEN-LAST:event_btnCancelActionPerformed
- private void btnOKActionPerformed(java.awt.event.ActionEvent evt) {
+ private void btnOKActionPerformed(final java.awt.event.ActionEvent evt) {// GEN-FIRST:event_btnOKActionPerformed
doRename();
- }
- // Variables declaration - do not modify
- private javax.swing.JButton btnCancel;
- private javax.swing.JButton btnOK;
- private java.awt.Label lblCurrentParent;
- private java.awt.Label lblNewDiretoryName;
- private javax.swing.JLabel lblTitle;
- private javax.swing.JPanel pnlBottom;
- private javax.swing.JPanel pnlCurrentParent;
- private javax.swing.JPanel pnlFolderData;
- private javax.swing.JTextField txtCurrentFolder;
- private javax.swing.JTextField txtNewFolder;
- // End of variables declaration
+ }// GEN-LAST:event_btnOKActionPerformed
+ // Variables declaration - do not modify//GEN-BEGIN:variables
+
+ private javax.swing.JButton btnCancel;
+
+ private javax.swing.JButton btnOK;
+
+ private java.awt.Label lblCurrentParent;
+ private java.awt.Label lblNewDiretoryName;
+
+ private javax.swing.JLabel lblTitle;
+
+ private javax.swing.JPanel pnlBottom;
+
+ private javax.swing.JPanel pnlCurrentParent;
+
+ private javax.swing.JPanel pnlFolderData;
+
+ private javax.swing.JTextField txtCurrentFolder;
+
+ private javax.swing.JTextField txtNewFolder;
+
+ // End of variables declaration//GEN-END:variables
private void doRename() {
- // add the new folder to irods, add to the tree, and scroll the tree into view
+ // add the new folder to irods, add to the tree, and scroll the tree
+ // into view
if (txtNewFolder.getText().isEmpty()) {
txtNewFolder.setBackground(Color.red);
@@ -241,14 +335,19 @@ public class RenameIRODSDirectoryDialog extends javax.swing.JDialog {
thisDialog.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
try {
- IRODSFileService irodsFileService = new IRODSFileService(idrop.getiDropCore().getIrodsAccount(), idrop.getiDropCore().getIrodsFileSystem());
- String newPath = irodsFileService.renameIRODSFileOrDirectory(currentAbsolutePath, txtNewFolder.getText());
+ IRODSFileService irodsFileService = new IRODSFileService(
+ idrop.getIrodsAccount(), idrop.getiDropCore().getIrodsFileSystem());
+ String newPath = irodsFileService.renameIRODSFileOrDirectory(currentAbsolutePath,
+ txtNewFolder.getText());
+
log.debug("New path:{}", newPath);
- IRODSFileSystemModel irodsFileSystemModel = (IRODSFileSystemModel) stagingViewTree.getModel();
- // get the parent of the new directory, and force a reload of that parent
+ IRODSOutlineModel irodsOutlineModel = (IRODSOutlineModel) stagingViewTree.getModel();
+ // get the parent of the new directory, and force a reload
+ // of that parent
String[] dirs = newPath.split("/");
if (dirs.length == 0) {
- throw new IdropRuntimeException("unable to find dir components");
+ throw new IdropRuntimeException(
+ "unable to find dir components");
}
StringBuilder sb = new StringBuilder();
@@ -262,16 +361,46 @@ public class RenameIRODSDirectoryDialog extends javax.swing.JDialog {
String parentOfNewDir = sb.toString();
log.info("parent of new dir:{}", parentOfNewDir);
- TreePath pathForNew = TreeUtils.buildTreePathForIrodsAbsolutePath(stagingViewTree, parentOfNewDir);
- log.debug("computed new path:{}", pathForNew);
- IRODSNode targetParentNode = (IRODSNode) pathForNew.getParentPath().getLastPathComponent();
- targetParentNode.forceReloadOfChildrenOfThisNode();
- irodsFileSystemModel.reload(targetParentNode);
- stagingViewTree.expandPath(pathForNew);
+ TreePath pathForOld = TreeUtils.buildTreePathForIrodsAbsolutePath(stagingViewTree,
+ currentAbsolutePath);
+
+ if (pathForOld == null) {
+ log.warn(
+ "could not find old path for node:{}, ignoring",
+ currentAbsolutePath);
+ } else {
+ IRODSFileSystemModel irodsFileSystemModel = irodsOutlineModel.getTreeModel();
+ IRODSNode oldNode = (IRODSNode) pathForOld.getLastPathComponent();
+ CollectionAndDataObjectListingEntry nodesEntry = (CollectionAndDataObjectListingEntry) oldNode.getUserObject();
+ IRODSFile newEntryAsFile = idrop.getiDropCore().getIRODSFileFactoryForLoggedInAccount().instanceIRODSFile(newPath);
+ if (newEntryAsFile.isDirectory()) {
+ nodesEntry.setParentPath(newEntryAsFile.getParent());
+ nodesEntry.setPathOrName(newEntryAsFile.getAbsolutePath());
+ } else {
+ nodesEntry.setParentPath(newEntryAsFile.getParent());
+ nodesEntry.setPathOrName(newEntryAsFile.getName());
+ }
+
+ oldNode.setUserObject(nodesEntry);
+ irodsFileSystemModel.nodeChanged(oldNode);
+
+ }
+
+ // TreePath pathForNew =
+ // TreeUtils.buildTreePathForIrodsAbsolutePath(stagingViewTree,
+ // parentOfNewDir);
+ // log.debug("computed new path:{}", pathForNew);
+ /*
+ * IRODSNode targetParentNode = (IRODSNode)
+ * pathForNew.getParentPath().getLastPathComponent();
+ * targetParentNode.forceReloadOfChildrenOfThisNode();
+ * irodsOutlineModel.reload(targetParentNode);
+ * stagingViewTree.expandPath(pathForNew);
+ */
idrop.showMessageFromOperation("The rename was successful");
- } catch (IdropException ex) {
+ } catch (Exception ex) {
Logger.getLogger(RenameIRODSDirectoryDialog.class.getName()).log(Level.SEVERE, null, ex);
idrop.showIdropException(ex);
} finally {
@@ -288,11 +417,12 @@ public class RenameIRODSDirectoryDialog extends javax.swing.JDialog {
*/
private void registerKeystrokeListener() {
- KeyStroke enter = KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_ENTER, 0);
+ KeyStroke enter = KeyStroke.getKeyStroke(
+ java.awt.event.KeyEvent.VK_ENTER, 0);
Action enterAction = new AbstractAction() {
@Override
- public void actionPerformed(ActionEvent e) {
+ public void actionPerformed(final ActionEvent e) {
doRename();
}
};
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 d2f1ace..caf9a90 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
@@ -250,6 +250,15 @@
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>
<SubComponents>
<Container class="javax.swing.JPanel" name="pnlLocalRoots">
+ <Properties>
+ <Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
+ <Dimension value="[101, 44]"/>
+ </Property>
+ <Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
+ <Dimension value="[292, 44]"/>
+ </Property>
+ <Property name="requestFocusEnabled" type="boolean" value="false"/>
+ </Properties>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
<BorderConstraints direction="North"/>
@@ -561,7 +570,76 @@
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>
<SubComponents>
- <Container class="javax.swing.JScrollPane" name="jScrollPane2">
+ <Container class="javax.swing.JPanel" name="pnlUploadRoots">
+ <Properties>
+ <Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
+ <Dimension value="[100, 44]"/>
+ </Property>
+ <Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
+ <Dimension value="[289, 44]"/>
+ </Property>
+ </Properties>
+ <Constraints>
+ <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
+ <BorderConstraints direction="North"/>
+ </Constraint>
+ </Constraints>
+
+ <Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>
+ <SubComponents>
+ <Container class="javax.swing.JPanel" name="pnlUploadRefreshButton">
+ <Constraints>
+ <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
+ <BorderConstraints direction="North"/>
+ </Constraint>
+ </Constraints>
+
+ <Layout class="org.netbeans.modules.form.compat2.layouts.DesignFlowLayout"/>
+ <SubComponents>
+ <Component class="javax.swing.JButton" name="btnUploadLocalRefresh">
+ <Properties>
+ <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
+ <ResourceString bundle="org/irods/jargon/idrop/lite/Bundle.properties" key="iDropLiteApplet.btnUploadLocalRefresh.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
+ </Property>
+ </Properties>
+ <Events>
+ <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnUploadLocalRefreshActionPerformed"/>
+ </Events>
+ </Component>
+ </SubComponents>
+ </Container>
+ <Container class="javax.swing.JScrollPane" name="scrollUploadLocalDrives">
+ <Constraints>
+ <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
+ <BorderConstraints direction="Center"/>
+ </Constraint>
+ </Constraints>
+
+ <Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
+ </Container>
+ <Container class="javax.swing.JPanel" name="pnlUploadLocalDrivesFiller">
+ <Constraints>
+ <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
+ <BorderConstraints direction="South"/>
+ </Constraint>
+ </Constraints>
+
+ <Layout>
+ <DimensionLayout dim="0">
+ <Group type="103" groupAlignment="0" attributes="0">
+ <EmptySpace min="0" pref="289" max="32767" attributes="0"/>
+ </Group>
+ </DimensionLayout>
+ <DimensionLayout dim="1">
+ <Group type="103" groupAlignment="0" attributes="0">
+ <EmptySpace min="0" pref="100" max="32767" attributes="0"/>
+ </Group>
+ </DimensionLayout>
+ </Layout>
+ </Container>
+ </SubComponents>
+ </Container>
+ <Container class="javax.swing.JScrollPane" name="scrollUploadLocalTree">
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
<BorderConstraints direction="Center"/>
@@ -647,19 +725,21 @@
<Component class="javax.swing.JTable" name="tblUploadTable">
<Properties>
<Property name="model" type="javax.swing.table.TableModel" editor="org.netbeans.modules.form.editors2.TableModelEditor">
- <Table columnCount="4" rowCount="4">
- <Column editable="true" title="Title 1" type="java.lang.Object"/>
- <Column editable="true" title="Title 2" type="java.lang.Object"/>
- <Column editable="true" title="Title 3" type="java.lang.Object"/>
- <Column editable="true" title="Title 4" type="java.lang.Object"/>
+ <Table columnCount="2" rowCount="0">
+ <Column editable="false" title="File Name" type="java.lang.String"/>
+ <Column editable="true" title="Import?" type="java.lang.Boolean"/>
</Table>
</Property>
<Property name="bounds" type="java.awt.Rectangle" editor="org.netbeans.beaninfo.editors.RectangleEditor">
<Rectangle value="[0, 0, 350, 64]"/>
</Property>
+ <Property name="gridColor" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
+ <Color blue="cc" green="cc" red="cc" type="rgb"/>
+ </Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[285, 380]"/>
</Property>
+ <Property name="rowMargin" type="int" value="2"/>
<Property name="showGrid" type="boolean" value="true"/>
</Properties>
</Component>
@@ -692,12 +772,13 @@
<Container class="javax.swing.JPanel" name="pnlUploadToolStatus">
<Properties>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
- <Dimension value="[300, 20]"/>
+ <Dimension value="[500, 34]"/>
</Property>
+ <Property name="requestFocusEnabled" type="boolean" value="false"/>
</Properties>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
- <GridBagConstraints gridX="0" gridY="0" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="5" insetsLeft="10" insetsBottom="0" insetsRight="0" anchor="18" weightX="40.0" weightY="0.0"/>
+ <GridBagConstraints gridX="0" gridY="0" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="5" insetsLeft="10" insetsBottom="0" insetsRight="0" anchor="18" weightX="140.0" weightY="0.0"/>
</Constraint>
</Constraints>
@@ -709,18 +790,19 @@
<ResourceString bundle="org/irods/jargon/idrop/lite/Bundle.properties" key="iDropLiteApplet.lblUploadTransferFileName.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property>
<Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
- <Dimension value="[400, 16]"/>
+ <Dimension value="[4000, 18]"/>
</Property>
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
- <Dimension value="[100, 16]"/>
+ <Dimension value="[100, 18]"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
- <Dimension value="[250, 16]"/>
+ <Dimension value="[250, 18]"/>
</Property>
+ <Property name="requestFocusEnabled" type="boolean" value="false"/>
</Properties>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
- <GridBagConstraints gridX="0" gridY="0" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="10" insetsLeft="10" insetsBottom="5" insetsRight="5" anchor="18" weightX="0.0" weightY="0.0"/>
+ <GridBagConstraints gridX="0" gridY="0" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="10" insetsLeft="10" insetsBottom="5" insetsRight="5" anchor="18" weightX="4.0" weightY="0.0"/>
</Constraint>
</Constraints>
</Component>
@@ -734,7 +816,7 @@
</Properties>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
- <GridBagConstraints gridX="1" gridY="0" gridWidth="1" gridHeight="1" fill="2" ipadX="136" ipadY="0" insetsTop="5" insetsLeft="5" insetsBottom="5" insetsRight="15" anchor="18" weightX="8.0" weightY="0.0"/>
+ <GridBagConstraints gridX="1" gridY="0" gridWidth="1" gridHeight="1" fill="2" ipadX="136" ipadY="0" insetsTop="5" insetsLeft="5" insetsBottom="5" insetsRight="15" anchor="18" weightX="6.0" weightY="0.0"/>
</Constraint>
</Constraints>
</Component>
@@ -746,6 +828,9 @@
<ResourceString bundle="org/irods/jargon/idrop/lite/Bundle.properties" key="iDropLiteApplet.btnUploadBeginImport.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property>
</Properties>
+ <Events>
+ <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnUploadBeginImportActionPerformed"/>
+ </Events>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
<GridBagConstraints gridX="1" gridY="0" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="13" weightX="50.0" weightY="0.0"/>
@@ -758,6 +843,9 @@
<ResourceString bundle="org/irods/jargon/idrop/lite/Bundle.properties" key="iDropLiteApplet.btnUploadCancel.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property>
</Properties>
+ <Events>
+ <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnUploadCancelActionPerformed"/>
+ </Events>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
<GridBagConstraints gridX="2" gridY="0" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="13" weightX="0.6" weightY="0.0"/>
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 b0df95c..b72cd18 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
@@ -12,7 +12,9 @@
package org.irods.jargon.idrop.lite;
import java.awt.Rectangle;
+import java.awt.dnd.DropTarget;
import java.io.File;
+import java.util.ArrayList;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
@@ -22,6 +24,7 @@ import javax.swing.JList;
import javax.swing.JOptionPane;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
+import javax.swing.table.DefaultTableModel;
import javax.swing.tree.TreePath;
import org.irods.jargon.core.pub.domain.DataObject;
@@ -34,6 +37,7 @@ import org.irods.jargon.core.pub.DataTransferOperations;
import org.irods.jargon.core.pub.IRODSFileSystem;
import org.irods.jargon.core.pub.UserAO;
import org.irods.jargon.datautils.datacache.DataCacheServiceImpl;
+import org.irods.jargon.idrop.lite.finder.IRODSFinderDialog;
import org.irods.jargon.core.transfer.TransferStatusCallbackListener;
import org.netbeans.swing.outline.Outline;
@@ -50,6 +54,7 @@ public class iDropLiteApplet extends javax.swing.JApplet implements TransferStat
private iDropLiteCore iDropCore = null;
private IRODSAccount irodsAccount = null;
private LocalFileTree fileTree = null;
+ private LocalFileTree fileUploadTree = null;
private IRODSTree irodsTree = null;
private Integer mode;
private String host;
@@ -61,7 +66,9 @@ public class iDropLiteApplet extends javax.swing.JApplet implements TransferStat
private String absPath;
IRODSFileSystem irodsFileSystem = null;
private LocalFileSystemModel localFileModel = null;
+ private LocalFileSystemModel localUploadFileModel = null;
private JList listLocalDrives;
+ private JList listUploadLocalDrives;
/** Initializes the applet NewJApplet */
public void init() {
@@ -232,6 +239,7 @@ public class iDropLiteApplet extends javax.swing.JApplet implements TransferStat
buildTargetTree();
setUpLocalFileSelectTree();
+ setUpUploadLocalFileSelectTree();
try {
@@ -313,6 +321,8 @@ public class iDropLiteApplet extends javax.swing.JApplet implements TransferStat
});
}
+
+ // NEED T) REFACTOR ALL OF THE FOLLOWING DUPLICATION!!!!!!!!
private void setUpLocalFileSelectTree() {
/*
@@ -363,6 +373,56 @@ public class iDropLiteApplet extends javax.swing.JApplet implements TransferStat
}
+ private void setUpUploadLocalFileSelectTree() {
+
+ /*
+ * build a list of the roots (e.g. drives on windows systems). If there
+ * is only one, use it as the basis for the file model, otherwise,
+ * display an additional panel listing the other roots, and build the
+ * tree for the first drive encountered.
+ */
+
+ if (fileUploadTree != null) {
+ log.info("file upload tree already initialized");
+ return;
+ }
+
+ log.info("building upload tree to look at local file system");
+ final iDropLiteApplet gui = this;
+
+ java.awt.EventQueue.invokeLater(new Runnable() {
+
+ @Override
+ public void run() {
+ listUploadLocalDrives = new JList();
+
+ initializeUploadLocalFileTreeModel(null);
+ fileUploadTree = new LocalFileTree(localUploadFileModel, gui);
+ listUploadLocalDrives.getSelectionModel().addListSelectionListener(
+ new ListSelectionListener() {
+
+ @Override
+ public void valueChanged(final ListSelectionEvent e) {
+ if (e.getValueIsAdjusting()) {
+ return;
+ }
+
+ log.debug("new uload local file system model");
+ log.debug("uload selection event:{}", e);
+ Object selectedItem = listUploadLocalDrives.getSelectedValue();
+ initializeUploadLocalFileTreeModelWhenDriveIsSelected(selectedItem);
+
+ }
+ });
+ scrollUploadLocalTree.setViewportView(fileUploadTree);
+ pnlUploadLocalTree.add(scrollUploadLocalTree,
+ java.awt.BorderLayout.CENTER);
+ pnlUploadLocalTree.setVisible(true);
+ }
+ });
+
+ }
+
private void initializeLocalFileTreeModelWhenDriveIsSelected(
final Object selectedDrive) {
if (selectedDrive == null) {
@@ -412,6 +472,56 @@ public class iDropLiteApplet extends javax.swing.JApplet implements TransferStat
scrollLocalDrives.setVisible(true);
}
}
+
+ private void initializeUploadLocalFileTreeModelWhenDriveIsSelected(
+ final Object selectedDrive) {
+ if (selectedDrive == null) {
+ log.debug("selected drive is null, use the first one");
+ listUploadLocalDrives.setSelectedIndex(0);
+
+ localUploadFileModel = new LocalFileSystemModel(new LocalFileNode(
+ new File((String) listUploadLocalDrives.getSelectedValue())));
+
+ fileUploadTree.setModel(localUploadFileModel);
+ } else {
+ log.debug(
+ "selected drive is not null, create new root based on selection",
+ selectedDrive);
+ listUploadLocalDrives.setSelectedValue(selectedDrive, true);
+ localUploadFileModel = new LocalFileSystemModel(new LocalFileNode(
+ new File((String) selectedDrive)));
+ fileUploadTree.setModel(localUploadFileModel);
+
+ }
+
+ scrollUploadLocalDrives.setVisible(true);
+ }
+
+ private void initializeUploadLocalFileTreeModel(final Object selectedDrive) {
+ List<String> roots = LocalFileUtils.listFileRootsForSystem();
+
+ if (roots.isEmpty()) {
+ IdropException ie = new IdropException(
+ "unable to find any roots on the local file system");
+ log.error("error building roots on local file system", ie);
+ showIdropException(ie);
+ return;
+ } else if (roots.size() == 1) {
+ scrollUploadLocalDrives.setVisible(false);
+ localUploadFileModel = new LocalFileSystemModel(new LocalFileNode(
+ new File(roots.get(0))));
+
+ } else {
+ DefaultListModel listModel = new DefaultListModel();
+ for (String root : roots) {
+ listModel.addElement(root);
+ }
+
+ listUploadLocalDrives.setModel(listModel);
+
+ scrollUploadLocalDrives.setVisible(true);
+ }
+ }
public IRODSAccount getIrodsAccount() {
synchronized (this) {
@@ -443,6 +553,9 @@ public class iDropLiteApplet extends javax.swing.JApplet implements TransferStat
this.pbTransferStatus.setMaximum((int) ts.getTotalSize());
this.pbTransferStatus.setValue((int) ts.getBytesTransfered());
+
+ this.pbUploadTransferStatus.setMaximum((int) ts.getTotalSize());
+ this.pbUploadTransferStatus.setValue((int) ts.getBytesTransfered());
//this.pbTransferStatus.setMaximum((int) ts.getTotalFilesToTransfer());
//this.pbTransferStatus.setValue((int) ts.getTotalFilesTransferredSoFar());
log.info("transfer status callback to iDropLiteApplet:{}", ts);
@@ -458,6 +571,8 @@ public class iDropLiteApplet extends javax.swing.JApplet implements TransferStat
+ (ts.getTotalSize() / 1024));
*/
lblTransferFileName.setText(abbreviateFileName(ts.getSourceFileAbsolutePath()));
+
+ lblUploadTransferFileName.setText(abbreviateFileName(ts.getSourceFileAbsolutePath()));
}
});
@@ -492,6 +607,8 @@ public class iDropLiteApplet extends javax.swing.JApplet implements TransferStat
+ (ts.getTotalSize() / 1024));
*/
lblTransferFileName.setText(abbreviateFileName(ts.getSourceFileAbsolutePath()));
+
+ lblUploadTransferFileName.setText(abbreviateFileName(ts.getSourceFileAbsolutePath()));
}
});
@@ -538,7 +655,6 @@ public class iDropLiteApplet extends javax.swing.JApplet implements TransferStat
// FIX ME: get current view of irods tree and pass to buildTargetTree
buildTargetTree();
}
-
/** This method is called from within the init() method to
@@ -582,7 +698,12 @@ public class iDropLiteApplet extends javax.swing.JApplet implements TransferStat
pnlOperationMode2 = new javax.swing.JPanel();
pnlUploadTrees = new javax.swing.JPanel();
pnlUploadLocalTree = new javax.swing.JPanel();
- jScrollPane2 = new javax.swing.JScrollPane();
+ pnlUploadRoots = new javax.swing.JPanel();
+ pnlUploadRefreshButton = new javax.swing.JPanel();
+ btnUploadLocalRefresh = new javax.swing.JButton();
+ scrollUploadLocalDrives = new javax.swing.JScrollPane();
+ pnlUploadLocalDrivesFiller = new javax.swing.JPanel();
+ scrollUploadLocalTree = new javax.swing.JScrollPane();
pnlUploadCenterTools = new javax.swing.JPanel();
btnUploadMove = new javax.swing.JButton();
pnlUploadTable = new javax.swing.JPanel();
@@ -692,6 +813,9 @@ public class iDropLiteApplet extends javax.swing.JApplet implements TransferStat
pnlLocalTree.setMinimumSize(new java.awt.Dimension(0, 62));
pnlLocalTree.setLayout(new java.awt.BorderLayout());
+ pnlLocalRoots.setMinimumSize(new java.awt.Dimension(101, 44));
+ pnlLocalRoots.setPreferredSize(new java.awt.Dimension(292, 44));
+ pnlLocalRoots.setRequestFocusEnabled(false);
pnlLocalRoots.setLayout(new java.awt.BorderLayout());
btnLocalRefresh.setText(org.openide.util.NbBundle.getMessage(iDropLiteApplet.class, "iDropLiteApplet.btnLocalRefresh.text")); // NOI18N
@@ -816,7 +940,37 @@ public class iDropLiteApplet extends javax.swing.JApplet implements TransferStat
pnlUploadLocalTree.setMinimumSize(new java.awt.Dimension(0, 0));
pnlUploadLocalTree.setPreferredSize(new java.awt.Dimension(285, 380));
pnlUploadLocalTree.setLayout(new java.awt.BorderLayout());
- pnlUploadLocalTree.add(jScrollPane2, java.awt.BorderLayout.CENTER);
+
+ pnlUploadRoots.setMinimumSize(new java.awt.Dimension(100, 44));
+ pnlUploadRoots.setPreferredSize(new java.awt.Dimension(289, 44));
+ pnlUploadRoots.setLayout(new java.awt.BorderLayout());
+
+ btnUploadLocalRefresh.setText(org.openide.util.NbBundle.getMessage(iDropLiteApplet.class, "iDropLiteApplet.btnUploadLocalRefresh.text")); // NOI18N
+ btnUploadLocalRefresh.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ btnUploadLocalRefreshActionPerformed(evt);
+ }
+ });
+ pnlUploadRefreshButton.add(btnUploadLocalRefresh);
+
+ pnlUploadRoots.add(pnlUploadRefreshButton, java.awt.BorderLayout.NORTH);
+ pnlUploadRoots.add(scrollUploadLocalDrives, java.awt.BorderLayout.CENTER);
+
+ org.jdesktop.layout.GroupLayout pnlUploadLocalDrivesFillerLayout = new org.jdesktop.layout.GroupLayout(pnlUploadLocalDrivesFiller);
+ pnlUploadLocalDrivesFiller.setLayout(pnlUploadLocalDrivesFillerLayout);
+ pnlUploadLocalDrivesFillerLayout.setHorizontalGroup(
+ pnlUploadLocalDrivesFillerLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
+ .add(0, 289, Short.MAX_VALUE)
+ );
+ pnlUploadLocalDrivesFillerLayout.setVerticalGroup(
+ pnlUploadLocalDrivesFillerLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
+ .add(0, 100, Short.MAX_VALUE)
+ );
+
+ pnlUploadRoots.add(pnlUploadLocalDrivesFiller, java.awt.BorderLayout.SOUTH);
+
+ pnlUploadLocalTree.add(pnlUploadRoots, java.awt.BorderLayout.NORTH);
+ pnlUploadLocalTree.add(scrollUploadLocalTree, java.awt.BorderLayout.CENTER);
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 0;
@@ -857,17 +1011,31 @@ public class iDropLiteApplet extends javax.swing.JApplet implements TransferStat
tblUploadTable.setModel(new javax.swing.table.DefaultTableModel(
new Object [][] {
- {null, null, null, null},
- {null, null, null, null},
- {null, null, null, null},
- {null, null, null, null}
+
},
new String [] {
- "Title 1", "Title 2", "Title 3", "Title 4"
+ "File Name", "Import?"
}
- ));
+ ) {
+ Class[] types = new Class [] {
+ java.lang.String.class, java.lang.Boolean.class
+ };
+ boolean[] canEdit = new boolean [] {
+ false, true
+ };
+
+ public Class getColumnClass(int columnIndex) {
+ return types [columnIndex];
+ }
+
+ public boolean isCellEditable(int rowIndex, int columnIndex) {
+ return canEdit [columnIndex];
+ }
+ });
tblUploadTable.setBounds(new java.awt.Rectangle(0, 0, 350, 64));
+ tblUploadTable.setGridColor(new java.awt.Color(204, 204, 204));
tblUploadTable.setPreferredSize(new java.awt.Dimension(285, 380));
+ tblUploadTable.setRowMargin(2);
tblUploadTable.setShowGrid(true);
jScrollPane3.setViewportView(tblUploadTable);
@@ -889,17 +1057,21 @@ public class iDropLiteApplet extends javax.swing.JApplet implements TransferStat
pnlUploadToolbar.setPreferredSize(new java.awt.Dimension(700, 40));
pnlUploadToolbar.setLayout(new java.awt.GridBagLayout());
- pnlUploadToolStatus.setPreferredSize(new java.awt.Dimension(300, 20));
+ pnlUploadToolStatus.setPreferredSize(new java.awt.Dimension(500, 34));
+ pnlUploadToolStatus.setRequestFocusEnabled(false);
pnlUploadToolStatus.setLayout(new java.awt.GridBagLayout());
lblUploadTransferFileName.setText(org.openide.util.NbBundle.getMessage(iDropLiteApplet.class, "iDropLiteApplet.lblUploadTransferFileName.text")); // NOI18N
- lblUploadTransferFileName.setMaximumSize(new java.awt.Dimension(400, 16));
- lblUploadTransferFileName.setMinimumSize(new java.awt.Dimension(100, 16));
- lblUploadTransferFileName.setPreferredSize(new java.awt.Dimension(250, 16));
+ lblUploadTransferFileName.setMaximumSize(new java.awt.Dimension(4000, 18));
+ lblUploadTransferFileName.setMinimumSize(new java.awt.Dimension(100, 18));
+ lblUploadTransferFileName.setPreferredSize(new java.awt.Dimension(250, 18));
+ lblUploadTransferFileName.setRequestFocusEnabled(false);
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 0;
gridBagConstraints.gridy = 0;
+ gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
+ gridBagConstraints.weightx = 4.0;
gridBagConstraints.insets = new java.awt.Insets(10, 10, 5, 5);
pnlUploadToolStatus.add(lblUploadTransferFileName, gridBagConstraints);
@@ -910,7 +1082,7 @@ public class iDropLiteApplet extends javax.swing.JApplet implements TransferStat
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
gridBagConstraints.ipadx = 136;
gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
- gridBagConstraints.weightx = 8.0;
+ gridBagConstraints.weightx = 6.0;
gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 15);
pnlUploadToolStatus.add(pbUploadTransferStatus, gridBagConstraints);
@@ -919,11 +1091,16 @@ public class iDropLiteApplet extends javax.swing.JApplet implements TransferStat
gridBagConstraints.gridy = 0;
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
- gridBagConstraints.weightx = 40.0;
+ gridBagConstraints.weightx = 140.0;
gridBagConstraints.insets = new java.awt.Insets(5, 10, 0, 0);
pnlUploadToolbar.add(pnlUploadToolStatus, gridBagConstraints);
btnUploadBeginImport.setText(org.openide.util.NbBundle.getMessage(iDropLiteApplet.class, "iDropLiteApplet.btnUploadBeginImport.text")); // NOI18N
+ btnUploadBeginImport.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ btnUploadBeginImportActionPerformed(evt);
+ }
+ });
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 1;
gridBagConstraints.gridy = 0;
@@ -932,6 +1109,11 @@ public class iDropLiteApplet extends javax.swing.JApplet implements TransferStat
pnlUploadToolbar.add(btnUploadBeginImport, gridBagConstraints);
btnUploadCancel.setText(org.openide.util.NbBundle.getMessage(iDropLiteApplet.class, "iDropLiteApplet.btnUploadCancel.text")); // NOI18N
+ btnUploadCancel.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ btnUploadCancelActionPerformed(evt);
+ }
+ });
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 2;
gridBagConstraints.gridy = 0;
@@ -977,7 +1159,18 @@ public class iDropLiteApplet extends javax.swing.JApplet implements TransferStat
}//GEN-LAST:event_btnIrodsTreeRefreshActionPerformed
private void btnUploadMoveActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnUploadMoveActionPerformed
- // TODO add your handling code here:
+ //int[] rows = fileUploadTree.getSelectionRows();
+ //log.debug("selected rows for delete:{}", rows);
+
+ TreePath [] paths = fileUploadTree.getSelectionPaths();
+ for(TreePath path: paths) {
+ DefaultTableModel tm = (DefaultTableModel)tblUploadTable.getModel();
+ Object [] rowData = new Object[2];
+ rowData[0] = LocalFileUtils.makeLocalFilePath(path);
+ rowData[1] = Boolean.TRUE;
+ tm.addRow(rowData);
+ }
+
}//GEN-LAST:event_btnUploadMoveActionPerformed
private void btnToggleLocalViewActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnToggleLocalViewActionPerformed
@@ -993,6 +1186,70 @@ public class iDropLiteApplet extends javax.swing.JApplet implements TransferStat
});
}//GEN-LAST:event_btnToggleLocalViewActionPerformed
+ private void btnUploadBeginImportActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnUploadBeginImportActionPerformed
+
+ // first collect target IRODS path
+ try {
+ IRODSFinderDialog finderDialog = new IRODSFinderDialog(true, iDropCore);
+ finderDialog.setVisible(true);
+ String targetPath = finderDialog.getSelectedAbsolutePath();
+ if(targetPath != null) {
+ //then do stuff
+ log.info("upload drop target selected:{}", targetPath);
+ }
+ finderDialog.dispose();
+
+ // now go through and process selected import files from table
+ int rows = tblUploadTable.getRowCount();
+ int [] rowsToRemove;
+ rowsToRemove = new int[rows];
+ int idx = 0;
+
+ for(int row=0; row<rows; row++) {
+ if((Boolean)tblUploadTable.getValueAt(row, 1)) {
+ String fileToImport = (String)tblUploadTable.getValueAt(row, 0);
+ log.info("uploading local file:{}", fileToImport);
+ iDropCore.getTransferManager().putOperation(fileToImport,
+ targetPath, iDropCore.getIrodsAccount().getDefaultStorageResource(),
+ this, new TreeTransferControlBlock());
+ rowsToRemove[idx] = row;
+ idx++;
+ }
+ else {
+ rowsToRemove[idx] = -1;
+ idx++;
+ }
+ }
+
+ // now delete all rows that were imported
+ // must do it backwards because table gets updated as rows get removed
+ DefaultTableModel tm = (DefaultTableModel)tblUploadTable.getModel();
+ int total = rowsToRemove.length;
+ for(int i=(total-1); i>=0; i--) {
+ if(rowsToRemove[i] >= 0 ) {
+ tm.removeRow(rowsToRemove[i]);
+ }
+ }
+
+ } catch (Exception e) {
+ log.error("exception choosings iRODS file");
+ throw new IdropRuntimeException("exception choosing irods file", e);
+ } finally {
+ iDropCore.getIrodsFileSystem().closeAndEatExceptions();
+ }
+
+ }//GEN-LAST:event_btnUploadBeginImportActionPerformed
+
+ private void btnUploadCancelActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnUploadCancelActionPerformed
+ DefaultTableModel tm = (DefaultTableModel)tblUploadTable.getModel();
+ tm.getDataVector().removeAllElements();
+ tm.fireTableDataChanged();
+ }//GEN-LAST:event_btnUploadCancelActionPerformed
+
+ private void btnUploadLocalRefreshActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnUploadLocalRefreshActionPerformed
+ // TODO add your handling code here:
+ }//GEN-LAST:event_btnUploadLocalRefreshActionPerformed
+
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton btnIrodsTreeRefresh;
@@ -1000,9 +1257,9 @@ public class iDropLiteApplet extends javax.swing.JApplet implements TransferStat
private javax.swing.JToggleButton btnToggleLocalView;
private javax.swing.JButton btnUploadBeginImport;
private javax.swing.JButton btnUploadCancel;
+ private javax.swing.JButton btnUploadLocalRefresh;
private javax.swing.JButton btnUploadMove;
private javax.swing.JLabel jLabel1;
- private javax.swing.JScrollPane jScrollPane2;
private javax.swing.JScrollPane jScrollPane3;
private javax.swing.JScrollPane jScrollPane4;
private javax.swing.JLabel lblTransferFileName;
@@ -1031,7 +1288,10 @@ public class iDropLiteApplet extends javax.swing.JApplet implements TransferStat
private javax.swing.JTabbedPane pnlTabbedMain;
private javax.swing.JPanel pnlToolBarSizer;
private javax.swing.JPanel pnlUploadCenterTools;
+ private javax.swing.JPanel pnlUploadLocalDrivesFiller;
private javax.swing.JPanel pnlUploadLocalTree;
+ private javax.swing.JPanel pnlUploadRefreshButton;
+ private javax.swing.JPanel pnlUploadRoots;
private javax.swing.JPanel pnlUploadTable;
private javax.swing.JPanel pnlUploadToolStatus;
private javax.swing.JPanel pnlUploadToolbar;
@@ -1039,6 +1299,8 @@ public class iDropLiteApplet extends javax.swing.JApplet implements TransferStat
private javax.swing.JScrollPane scrIrodsTreeView;
private javax.swing.JScrollPane scrollLocalDrives;
private javax.swing.JScrollPane scrollLocalFileTree;
+ private javax.swing.JScrollPane scrollUploadLocalDrives;
+ private javax.swing.JScrollPane scrollUploadLocalTree;
private javax.swing.JTabbedPane tabIrodsViews;
private javax.swing.JTable tblProgress;
private javax.swing.JTable tblUploadTable;
diff --git a/idrop-lite/src/main/resources/org/irods/jargon/idrop/lite/Bundle.properties b/idrop-lite/src/main/resources/org/irods/jargon/idrop/lite/Bundle.properties
index 6735e38..65cef47 100644
--- a/idrop-lite/src/main/resources/org/irods/jargon/idrop/lite/Bundle.properties
+++ b/idrop-lite/src/main/resources/org/irods/jargon/idrop/lite/Bundle.properties
@@ -13,3 +13,4 @@ iDropLiteApplet.btnLocalRefresh.text=Refresh
iDropLiteApplet.pnlOperationMode2.TabConstraints.tabTitle=Upload
iDropLiteApplet.lblUploadTransferFileName.text=
iDropLiteApplet.btnToggleLocalView.text=<<<Local Files
+iDropLiteApplet.btnUploadLocalRefresh.text=Refresh