summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLISA STILLWELL <lisa@dhcp152-54-6-218.wireless.europa.renci.org>2011-08-19 16:09:23 (GMT)
committer LISA STILLWELL <lisa@dhcp152-54-6-218.wireless.europa.renci.org>2011-08-19 16:09:23 (GMT)
commit21e2905478a64de0f65a3f19681eaf9376c9090d (patch)
tree23f505f2833aca1c2a20d9068a2e695cd75e7dfa
parent892bd3eb37b87b1104899ccd4986c82283c6588a (diff)
parent1595ae3a8d54bacf5dca28976228952282b87bc6 (diff)
downloadQCG-Data-21e2905478a64de0f65a3f19681eaf9376c9090d.zip
QCG-Data-21e2905478a64de0f65a3f19681eaf9376c9090d.tar.gz
QCG-Data-21e2905478a64de0f65a3f19681eaf9376c9090d.tar.bz2
Merge remote-tracking branch 'origin/idrop-lite'
-rw-r--r--idrop-lite/pom.xml5
-rw-r--r--idrop-lite/src/main/java/org/irods/jargon/idrop/lite/DeleteIRODSDialog.java352
-rw-r--r--idrop-lite/src/main/java/org/irods/jargon/idrop/lite/IRODSFileSystemModel.java33
-rw-r--r--idrop-lite/src/main/java/org/irods/jargon/idrop/lite/IRODSNode.java74
-rw-r--r--idrop-lite/src/main/java/org/irods/jargon/idrop/lite/IRODSOutlineModel.java71
-rw-r--r--idrop-lite/src/main/java/org/irods/jargon/idrop/lite/IRODSTree.java119
-rw-r--r--idrop-lite/src/main/java/org/irods/jargon/idrop/lite/IRODSTreeTransferHandler.java2
-rw-r--r--idrop-lite/src/main/java/org/irods/jargon/idrop/lite/LocalFileUtils.java38
-rw-r--r--idrop-lite/src/main/java/org/irods/jargon/idrop/lite/LocalTreeTransferHandler.java17
-rw-r--r--idrop-lite/src/main/java/org/irods/jargon/idrop/lite/NewIRODSDirectoryDialog.java368
-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/finder/FinderDeleteIRODSDialog.form136
-rw-r--r--idrop-lite/src/main/java/org/irods/jargon/idrop/lite/finder/FinderDeleteIRODSDialog.java325
-rw-r--r--idrop-lite/src/main/java/org/irods/jargon/idrop/lite/finder/FinderNewIRODSDirectoryDialog.form158
-rw-r--r--idrop-lite/src/main/java/org/irods/jargon/idrop/lite/finder/FinderNewIRODSDirectoryDialog.java290
-rw-r--r--idrop-lite/src/main/java/org/irods/jargon/idrop/lite/finder/FinderRenameIRODSDirectoryDialog.form196
-rw-r--r--idrop-lite/src/main/java/org/irods/jargon/idrop/lite/finder/FinderRenameIRODSDirectoryDialog.java338
-rw-r--r--idrop-lite/src/main/java/org/irods/jargon/idrop/lite/finder/FinderUtils.java186
-rw-r--r--idrop-lite/src/main/java/org/irods/jargon/idrop/lite/finder/IRODSFinderDialog.form147
-rw-r--r--idrop-lite/src/main/java/org/irods/jargon/idrop/lite/finder/IRODSFinderDialog.java252
-rw-r--r--idrop-lite/src/main/java/org/irods/jargon/idrop/lite/finder/IRODSFinderOutlineModel.java185
-rw-r--r--idrop-lite/src/main/java/org/irods/jargon/idrop/lite/finder/IRODSFinderTree.java312
-rw-r--r--idrop-lite/src/main/java/org/irods/jargon/idrop/lite/finder/IRODSTreeContainingComponent.java23
-rw-r--r--idrop-lite/src/main/java/org/irods/jargon/idrop/lite/finder/IrodsSelectionListenerForBuildingInfoPanel.java59
-rw-r--r--idrop-lite/src/main/java/org/irods/jargon/idrop/lite/finder/MessageManager.java33
-rw-r--r--idrop-lite/src/main/java/org/irods/jargon/idrop/lite/iDropLiteApplet.form964
-rw-r--r--idrop-lite/src/main/java/org/irods/jargon/idrop/lite/iDropLiteApplet.java1044
-rw-r--r--idrop-lite/src/main/resources/org/irods/jargon/idrop/lite/Bundle.properties16
-rw-r--r--idrop-lite/src/main/resources/org/irods/jargon/idrop/lite/finder/Bundle.properties6
-rw-r--r--idrop-web/grails-app/views/idropLite/appletLoader.gsp1
30 files changed, 5285 insertions, 955 deletions
diff --git a/idrop-lite/pom.xml b/idrop-lite/pom.xml
index 55bdd1c..2ef032b 100644
--- a/idrop-lite/pom.xml
+++ b/idrop-lite/pom.xml
@@ -35,6 +35,11 @@
<artifactId>org-netbeans-swing-outline</artifactId>
<type>jar</type>
</dependency>
+ <dependency>
+ <groupId>commons-io</groupId>
+ <artifactId>commons-io</artifactId>
+ <scope>compile</scope>
+ </dependency>
</dependencies>
<build>
<plugins>
diff --git a/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/DeleteIRODSDialog.java b/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/DeleteIRODSDialog.java
index 82cff43..083c3f0 100644
--- a/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/DeleteIRODSDialog.java
+++ b/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/DeleteIRODSDialog.java
@@ -32,12 +32,13 @@ public class DeleteIRODSDialog extends javax.swing.JDialog {
private final IRODSTree irodsTree;
private final IRODSNode deletedNode;
private final List<IRODSNode> deletedNodes;
- public static org.slf4j.Logger log = LoggerFactory.getLogger(NewIRODSDirectoryDialog.class);
+ public static org.slf4j.Logger log = LoggerFactory.getLogger(DeleteIRODSDialog.class);
/** Creates new form NewIRODSDirectoryDialog */
- public DeleteIRODSDialog(final iDropLiteApplet parent, final boolean modal, final IRODSTree irodsTree, final IRODSNode deletedNode) {
- //super(parent, modal); FIX THIS???
- super((Frame)null, modal);
+ public DeleteIRODSDialog(final iDropLiteApplet parent, final boolean modal,
+ final IRODSTree irodsTree, final IRODSNode deletedNode) {
+ //super(parent, modal);
+ super((java.awt.Frame)null, modal);
this.idrop = parent;
this.irodsTree = irodsTree;
this.deletedNode = deletedNode;
@@ -53,13 +54,14 @@ public class DeleteIRODSDialog extends javax.swing.JDialog {
}
initialize();
- txtAreaFileToDelete.setText(sb.toString());
+ txtAreaFileToDelete.setText(sb.toString());
}
/** Creates new form NewIRODSDirectoryDialog */
- public DeleteIRODSDialog(final iDropLiteApplet parent, final boolean modal, final IRODSTree irodsTree, final List<IRODSNode> deletedNodes) {
- // super(parent, modal); FIX THIS???
- super((Frame)null, modal);
+ public DeleteIRODSDialog(final iDropLiteApplet parent, final boolean modal,
+ final IRODSTree irodsTree, final List<IRODSNode> deletedNodes) {
+ //super(parent, modal);
+ super((java.awt.Frame)null, modal);
this.idrop = parent;
this.irodsTree = irodsTree;
this.deletedNodes = deletedNodes;
@@ -78,15 +80,17 @@ public class DeleteIRODSDialog 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) {
try {
processDelete();
} catch (IdropException ex) {
- Logger.getLogger(DeleteIRODSDialog.class.getName()).log(Level.SEVERE, null, ex);
+ Logger.getLogger(DeleteIRODSDialog.class.getName()).log(
+ Level.SEVERE, null, ex);
throw new IdropRuntimeException(ex);
}
}
@@ -97,118 +101,154 @@ public class DeleteIRODSDialog extends javax.swing.JDialog {
}
- /** 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();
- lblCurrentFolder = new java.awt.Label();
- scrollFileToDelete = new javax.swing.JScrollPane();
- txtAreaFileToDelete = new javax.swing.JTextArea();
- pnlBottom = new javax.swing.JPanel();
- btnCancel = new javax.swing.JButton();
- btnOK = new javax.swing.JButton();
-
- setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
-
- lblTitle.setText("Please hit OK to delete the following file/folder from iRODS");
- getContentPane().add(lblTitle, java.awt.BorderLayout.NORTH);
-
- pnlFolderData.setLayout(new java.awt.GridLayout(0, 1));
-
- lblCurrentFolder.setText("File/folder to delete:");
-
- txtAreaFileToDelete.setColumns(20);
- txtAreaFileToDelete.setEditable(false);
- txtAreaFileToDelete.setLineWrap(true);
- txtAreaFileToDelete.setRows(5);
- scrollFileToDelete.setViewportView(txtAreaFileToDelete);
-
- 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(40, Short.MAX_VALUE)
- .add(lblCurrentFolder, 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(scrollFileToDelete, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 413, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
- .addContainerGap())
- );
- pnlCurrentParentLayout.setVerticalGroup(
- pnlCurrentParentLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
- .add(pnlCurrentParentLayout.createSequentialGroup()
- .add(pnlCurrentParentLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
- .add(pnlCurrentParentLayout.createSequentialGroup()
- .add(35, 35, 35)
- .add(lblCurrentFolder, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
- .add(pnlCurrentParentLayout.createSequentialGroup()
- .add(22, 22, 22)
- .add(scrollFileToDelete, 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))
- );
-
- pnlFolderData.add(pnlCurrentParent);
-
- getContentPane().add(pnlFolderData, java.awt.BorderLayout.CENTER);
-
- pnlBottom.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.RIGHT));
-
- btnCancel.setText("Cancel");
- btnCancel.addActionListener(new java.awt.event.ActionListener() {
- @Override
- public void actionPerformed(java.awt.event.ActionEvent evt) {
- btnCancelActionPerformed(evt);
- }
- });
- pnlBottom.add(btnCancel);
-
- btnOK.setText("OK");
- btnOK.addActionListener(new java.awt.event.ActionListener() {
- @Override
- public void actionPerformed(java.awt.event.ActionEvent evt) {
- btnOKActionPerformed(evt);
- }
- });
- pnlBottom.add(btnOK);
-
- getContentPane().add(pnlBottom, java.awt.BorderLayout.SOUTH);
-
- 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();
+ lblCurrentFolder = new java.awt.Label();
+ scrollFileToDelete = new javax.swing.JScrollPane();
+ txtAreaFileToDelete = new javax.swing.JTextArea();
+ pnlBottom = new javax.swing.JPanel();
+ btnCancel = new javax.swing.JButton();
+ btnOK = new javax.swing.JButton();
+
+ setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
+
+ lblTitle.setText("Please hit OK to delete the following file/folder from iRODS");
+ getContentPane().add(lblTitle, java.awt.BorderLayout.NORTH);
+
+ pnlFolderData.setLayout(new java.awt.GridLayout(0, 1));
+
+ lblCurrentFolder.setText("File/folder to delete:");
+
+ txtAreaFileToDelete.setColumns(20);
+ txtAreaFileToDelete.setEditable(false);
+ txtAreaFileToDelete.setLineWrap(true);
+ txtAreaFileToDelete.setRows(5);
+ scrollFileToDelete.setViewportView(txtAreaFileToDelete);
+
+ 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(40, Short.MAX_VALUE)
+ .add(lblCurrentFolder,
+ 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(scrollFileToDelete,
+ org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
+ 413,
+ org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
+ .addContainerGap()));
+ pnlCurrentParentLayout
+ .setVerticalGroup(pnlCurrentParentLayout
+ .createParallelGroup(
+ org.jdesktop.layout.GroupLayout.LEADING)
+ .add(pnlCurrentParentLayout
+ .createSequentialGroup()
+ .add(pnlCurrentParentLayout
+ .createParallelGroup(
+ org.jdesktop.layout.GroupLayout.LEADING)
+ .add(pnlCurrentParentLayout
+ .createSequentialGroup()
+ .add(35, 35, 35)
+ .add(lblCurrentFolder,
+ org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
+ org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
+ org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
+ .add(pnlCurrentParentLayout
+ .createSequentialGroup()
+ .add(22, 22, 22)
+ .add(scrollFileToDelete,
+ 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)));
+
+ pnlFolderData.add(pnlCurrentParent);
+
+ getContentPane().add(pnlFolderData, java.awt.BorderLayout.CENTER);
+
+ pnlBottom.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.RIGHT));
+
+ btnCancel.setText("Cancel");
+ btnCancel.addActionListener(new java.awt.event.ActionListener() {
+ @Override
+ public void actionPerformed(final java.awt.event.ActionEvent evt) {
+ btnCancelActionPerformed(evt);
+ }
+ });
+ pnlBottom.add(btnCancel);
+
+ btnOK.setText("OK");
+ btnOK.addActionListener(new java.awt.event.ActionListener() {
+ @Override
+ public void actionPerformed(final java.awt.event.ActionEvent evt) {
+ btnOKActionPerformed(evt);
+ }
+ });
+ pnlBottom.add(btnOK);
+
+ getContentPane().add(pnlBottom, java.awt.BorderLayout.SOUTH);
+
+ 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
try {
processDelete();
} catch (IdropException ex) {
- Logger.getLogger(DeleteIRODSDialog.class.getName()).log(Level.SEVERE, null, ex);
+ Logger.getLogger(DeleteIRODSDialog.class.getName()).log(
+ Level.SEVERE, null, ex);
throw new IdropRuntimeException(ex);
}
-}
- // Variables declaration - do not modify
- private javax.swing.JButton btnCancel;
- private javax.swing.JButton btnOK;
- private java.awt.Label lblCurrentFolder;
- private javax.swing.JLabel lblTitle;
- private javax.swing.JPanel pnlBottom;
- private javax.swing.JPanel pnlCurrentParent;
- private javax.swing.JPanel pnlFolderData;
- private javax.swing.JScrollPane scrollFileToDelete;
- private javax.swing.JTextArea txtAreaFileToDelete;
- // 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 lblCurrentFolder;
+ private javax.swing.JLabel lblTitle;
+
+ private javax.swing.JPanel pnlBottom;
+
+ private javax.swing.JPanel pnlCurrentParent;
+
+ private javax.swing.JPanel pnlFolderData;
+
+ private javax.swing.JScrollPane scrollFileToDelete;
+
+ private javax.swing.JTextArea txtAreaFileToDelete;
+
+ // End of variables declaration//GEN-END:variables
private void processDelete() throws IdropException {
log.info("delete folder named:{}", txtAreaFileToDelete.getText());
final DeleteIRODSDialog thisDialog = this;
@@ -223,12 +263,13 @@ public class DeleteIRODSDialog extends javax.swing.JDialog {
});
}
- private void deleteASingleFile(final IRODSFileFactory irodsFileFactory, final IRODSNode deletedNode) throws IdropException {
+ private void deleteASingleFile(final IRODSFileFactory irodsFileFactory,
+ final IRODSNode deletedNode) throws IdropException {
log.info("node to delete is: {}", deletedNode);
CollectionAndDataObjectListingEntry dataEntry = (CollectionAndDataObjectListingEntry) deletedNode.getUserObject();
- //dialog uses absolute path, so munge it for files
+ // dialog uses absolute path, so munge it for files
StringBuilder sb = new StringBuilder();
if (dataEntry.getObjectType() == CollectionAndDataObjectListingEntry.ObjectType.COLLECTION) {
sb.append(dataEntry.getPathOrName());
@@ -242,65 +283,82 @@ public class DeleteIRODSDialog extends javax.swing.JDialog {
try {
fileToDelete = irodsFileFactory.instanceIRODSFile(sb.toString());
fileToDelete.delete();
- final IRODSFileSystemModel irodsFileSystemModel = (IRODSFileSystemModel) irodsTree.getModel();
- irodsFileSystemModel.removeNodeFromParent(deletedNode);
+
} catch (JargonException ex) {
- Logger.getLogger(DeleteIRODSDialog.class.getName()).log(Level.SEVERE, null, ex);
+ Logger.getLogger(DeleteIRODSDialog.class.getName()).log(
+ Level.SEVERE, null, ex);
throw new IdropException(ex);
+ } finally {
+ idrop.getiDropCore().closeIRODSConnectionForLoggedInAccount();
}
}
class DeleteWorker extends SwingWorker<String, Object> {
- public static final String DELETE_SUCCESSFUL = "Deletion complete";
+ public static final String DELETE_SUCCESSFUL = "Deletion complete";
public static final String DELETE_ERRORS = "The deletion was not successful";
private DeleteIRODSDialog dialog;
private String message = "";
- DeleteWorker(DeleteIRODSDialog dialog) {
+ DeleteWorker(final DeleteIRODSDialog dialog) {
if (dialog == null) {
throw new IllegalArgumentException("null dialog");
}
- this.dialog=dialog;
+ this.dialog = dialog;
}
- @Override
- public String doInBackground() {
+ @Override
+ public String doInBackground() {
- try {
+ try {
- IRODSFileFactory irodsFileFactory = idrop.getiDropCore().getIRODSFileFactoryForLoggedInAccount();
- if (deletedNode != null) {
- log.info("deleting a single node");
- deleteASingleFile(irodsFileFactory, deletedNode);
- } else if (deletedNodes != null) {
- log.info("deleting multiple nodes");
- for (IRODSNode deletedNodeEntry : deletedNodes) {
- deleteASingleFile(irodsFileFactory, deletedNodeEntry);
- }
+ IRODSFileFactory irodsFileFactory = idrop.getiDropCore().getIRODSFileFactoryForLoggedInAccount();
+ if (deletedNode != null) {
+ log.info("deleting a single node");
+ deleteASingleFile(irodsFileFactory, deletedNode);
+ } else if (deletedNodes != null) {
+ log.info("deleting multiple nodes");
+ for (IRODSNode deletedNodeEntry : deletedNodes) {
+ deleteASingleFile(irodsFileFactory, deletedNodeEntry);
}
- message = DELETE_SUCCESSFUL;
- } catch (Exception ex) {
- Logger.getLogger(NewIRODSDirectoryDialog.class.getName()).log(Level.SEVERE, null, ex);
- idrop.showIdropException(ex);
- message = DELETE_ERRORS;
- } finally {
- idrop.getiDropCore().closeAllIRODSConnections();
}
+ message = DELETE_SUCCESSFUL;
+ } catch (Exception ex) {
+ Logger.getLogger(NewIRODSDirectoryDialog.class.getName()).log(
+ Level.SEVERE, null, ex);
+ idrop.showIdropException(ex);
+ message = DELETE_ERRORS;
+ } finally {
+ idrop.getiDropCore().closeAllIRODSConnections();
+ }
- return null;
- }
+ return null;
+ }
- @Override
- protected void done() {
- dialog.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
- dialog.dispose();
- idrop.showMessageFromOperation(message);
+ @Override
+ protected void done() {
+ dialog.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
+ final IRODSOutlineModel irodsFileSystemModel = (IRODSOutlineModel) irodsTree.getModel();
+ try {
+ if (deletedNode != null) {
+ irodsFileSystemModel.notifyFileShouldBeRemoved(deletedNode);
+ } else if (deletedNodes != null) {
+ for (IRODSNode deletedNode : deletedNodes) {
+ irodsFileSystemModel.notifyFileShouldBeRemoved(deletedNode);
+ }
+ }
+ } catch (IdropException ex) {
+ Logger.getLogger(DeleteIRODSDialog.class.getName()).log(
+ Level.SEVERE, null, ex);
+ throw new IdropRuntimeException(ex);
}
- }
+ dialog.dispose();
+
+ }
+ }
}
diff --git a/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/IRODSFileSystemModel.java b/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/IRODSFileSystemModel.java
index e31ff3a..c671d0f 100644
--- a/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/IRODSFileSystemModel.java
+++ b/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/IRODSFileSystemModel.java
@@ -22,61 +22,63 @@ import org.slf4j.LoggerFactory;
*/
public class IRODSFileSystemModel extends DefaultTreeModel {
- @Override
- public void removeNodeFromParent(MutableTreeNode mtn) {
+ @Override
+ public void removeNodeFromParent(final MutableTreeNode mtn) {
super.removeNodeFromParent(mtn);
}
-
public static org.slf4j.Logger log = LoggerFactory.getLogger(IRODSFileSystemModel.class);
- private static class TreeModelListener implements javax.swing.event.TreeModelListener {
+ private static class TreeModelListener implements
+ javax.swing.event.TreeModelListener {
public TreeModelListener() {
}
@Override
- public void treeNodesChanged(TreeModelEvent tme) {
+ public void treeNodesChanged(final TreeModelEvent tme) {
}
@Override
- public void treeNodesInserted(TreeModelEvent tme) {
+ public void treeNodesInserted(final TreeModelEvent tme) {
}
@Override
- public void treeNodesRemoved(TreeModelEvent tme) {
+ public void treeNodesRemoved(final TreeModelEvent tme) {
}
@Override
- public void treeStructureChanged(TreeModelEvent tme) {
+ public void treeStructureChanged(final TreeModelEvent tme) {
}
}
@Override
- public Object getChild(Object parent, int index) {
+ public Object getChild(final Object parent, final int index) {
triggerLazyLoading(parent);
return super.getChild(parent, index);
}
@Override
- public int getChildCount(Object parent) {
+ public int getChildCount(final Object parent) {
triggerLazyLoading(parent);
return super.getChildCount(parent);
}
- private void triggerLazyLoading(Object parent) throws IdropRuntimeException {
+ private void triggerLazyLoading(final Object parent)
+ throws IdropRuntimeException {
// make sure children are loaded before counting
IRODSNode parentAsNode = (IRODSNode) parent;
try {
parentAsNode.lazyLoadOfChildrenOfThisNode();
} catch (IdropException ex) {
- Logger.getLogger(IRODSFileSystemModel.class.getName()).log(Level.SEVERE, null, ex);
+ Logger.getLogger(IRODSFileSystemModel.class.getName()).log(
+ Level.SEVERE, null, ex);
throw new IdropRuntimeException(ex);
}
}
-
private final IRODSAccount irodsAccount;
- public IRODSFileSystemModel(final IRODSNode rootNode, final IRODSAccount irodsAccount) throws IdropException {
+ public IRODSFileSystemModel(final IRODSNode rootNode,
+ final IRODSAccount irodsAccount) throws IdropException {
super(rootNode);
if (irodsAccount == null) {
@@ -92,7 +94,8 @@ public class IRODSFileSystemModel extends DefaultTreeModel {
}
- public IRODSFileSystemModel(final IRODSAccount irodsAccount) throws IdropException {
+ public IRODSFileSystemModel(final IRODSAccount irodsAccount)
+ throws IdropException {
super(null);
if (irodsAccount == null) {
throw new IdropRuntimeException("null irodsAccount");
diff --git a/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/IRODSNode.java b/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/IRODSNode.java
index 53f4e1c..33ab135 100644
--- a/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/IRODSNode.java
+++ b/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/IRODSNode.java
@@ -5,6 +5,7 @@
package org.irods.jargon.idrop.lite;
+import java.awt.Cursor;
import java.util.List;
import java.util.Vector;
import java.util.logging.Level;
@@ -16,6 +17,8 @@ import org.irods.jargon.core.connection.IRODSAccount;
import org.irods.jargon.core.pub.CollectionAndDataObjectListAndSearchAO;
import org.irods.jargon.core.pub.IRODSFileSystem;
import org.irods.jargon.core.query.CollectionAndDataObjectListingEntry;
+import org.irods.jargon.idrop.lite.finder.IRODSTreeContainingComponent;
+
import org.slf4j.LoggerFactory;
/**
@@ -24,23 +27,18 @@ import org.slf4j.LoggerFactory;
* @author Mike Conway - DICE (www.irods.org)
*/
public class IRODSNode extends DefaultMutableTreeNode {
-
- private boolean cached = false;
-
+
+ private boolean cached = false;
public static org.slf4j.Logger log = LoggerFactory.getLogger(IRODSNode.class);
-
public final IRODSAccount irodsAccount;
-
public final IRODSFileSystem irodsFileSystem;
-
public boolean hasMore = true;
-
public boolean continuation = false;
+ private final IRODSTreeContainingComponent irodsTree;
- private final IRODSTree irodsTree;
-
- public IRODSNode(final CollectionAndDataObjectListingEntry entry, final IRODSAccount irodsAccount,
- final IRODSFileSystem irodsFileSystem, final IRODSTree irodsTree) {
+ public IRODSNode(final CollectionAndDataObjectListingEntry entry,
+ final IRODSAccount irodsAccount,
+ final IRODSFileSystem irodsFileSystem, final IRODSTreeContainingComponent irodsTree) {
super(entry);
if (irodsAccount == null) {
throw new IdropRuntimeException("null irodsAccount");
@@ -57,8 +55,9 @@ public class IRODSNode extends DefaultMutableTreeNode {
}
/**
- * Load children of this node, and then close the connection (appropriate for the user expanding a node).
- *
+ * Load children of this node, and then close the connection (appropriate
+ * for the user expanding a node).
+ *
* @throws IdropException
*/
public void lazyLoadOfChildrenOfThisNode() throws IdropException {
@@ -71,34 +70,38 @@ public class IRODSNode extends DefaultMutableTreeNode {
}
/**
- * Load children of this node by accessing iRODS. Note that in a refresh situation, you do not want to continuously
- * open and close the connection, so there is an option to defer closing the connection to the caller.
- *
+ * Load children of this node by accessing iRODS. Note that in a refresh
+ * situation, you do not want to continuously open and close the connection,
+ * so there is an option to defer closing the connection to the caller.
+ *
* @param closeTheConnectionAfterLoad
- * <code>boolean</code> that indicates that the connection will be closed by this method. If
- * <code>true</code> is passed, then this method will close the connection. If <code>false</code> is
- * passed, then the caller must close the connection.
+ * <code>boolean</code> that indicates that the connection will
+ * be closed by this method. If <code>true</code> is passed, then
+ * this method will close the connection. If <code>false</code>
+ * is passed, then the caller must close the connection.
* @throws IdropException
*/
- public void lazyLoadOfChildrenOfThisNode(final boolean closeTheConnectionAfterLoad) throws IdropException {
+ public void lazyLoadOfChildrenOfThisNode(
+ final boolean closeTheConnectionAfterLoad) throws IdropException {
if (cached) {
return;
}
log.debug("lazily loading children of:{}", this);
- log.debug("will I close this connection:{}", closeTheConnectionAfterLoad);
+ log.debug("will I close this connection:{}",
+ closeTheConnectionAfterLoad);
CollectionAndDataObjectListingEntry parentObject = (CollectionAndDataObjectListingEntry) this.getUserObject();
try {
+ irodsTree.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
- CollectionAndDataObjectListAndSearchAO collectionAO = irodsFileSystem.getIRODSAccessObjectFactory()
- .getCollectionAndDataObjectListAndSearchAO(irodsAccount);
- List<CollectionAndDataObjectListingEntry> childCache = collectionAO
- .listDataObjectsAndCollectionsUnderPath(parentObject.getPathOrName());
+ CollectionAndDataObjectListAndSearchAO collectionAO = irodsFileSystem.getIRODSAccessObjectFactory().getCollectionAndDataObjectListAndSearchAO(irodsAccount);
+ List<CollectionAndDataObjectListingEntry> childCache = collectionAO.listDataObjectsAndCollectionsUnderPath(parentObject.getPathOrName());
for (CollectionAndDataObjectListingEntry childEntry : childCache) {
- insert(new IRODSNode(childEntry, irodsAccount, irodsFileSystem, irodsTree), getChildCount());
+ insert(new IRODSNode(childEntry, irodsAccount, irodsFileSystem,
+ irodsTree), getChildCount());
}
if (children == null) {
@@ -108,12 +111,15 @@ public class IRODSNode extends DefaultMutableTreeNode {
cached = true;
} catch (Exception ex) {
- Logger.getLogger(IRODSNode.class.getName()).log(Level.SEVERE, null, ex);
- throw new IdropException("error occurred accessing collection data", ex);
+ Logger.getLogger(IRODSNode.class.getName()).log(Level.SEVERE, null,
+ ex);
+ throw new IdropException(
+ "error occurred accessing collection data", ex);
} finally {
if (closeTheConnectionAfterLoad) {
irodsFileSystem.closeAndEatExceptions(irodsAccount);
}
+ irodsTree.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
}
}
@@ -141,7 +147,7 @@ public class IRODSNode extends DefaultMutableTreeNode {
}
@Override
- public boolean equals(Object obj) {
+ public boolean equals(final Object obj) {
if (!(obj instanceof IRODSNode)) {
return false;
@@ -150,8 +156,7 @@ public class IRODSNode extends DefaultMutableTreeNode {
IRODSNode comparableAsNode = (IRODSNode) obj;
CollectionAndDataObjectListingEntry thisFile = (CollectionAndDataObjectListingEntry) getUserObject();
- CollectionAndDataObjectListingEntry thatFile = (CollectionAndDataObjectListingEntry) comparableAsNode
- .getUserObject();
+ CollectionAndDataObjectListingEntry thatFile = (CollectionAndDataObjectListingEntry) comparableAsNode.getUserObject();
return thisFile.equals(thatFile);
}
@@ -162,7 +167,7 @@ public class IRODSNode extends DefaultMutableTreeNode {
/**
* Have the children nodes been cached?
- *
+ *
* @return <code>boolean</code> if children nodes have been cached.
*/
public boolean isCached() {
@@ -171,7 +176,7 @@ public class IRODSNode extends DefaultMutableTreeNode {
/**
* Is this node a continuation of a previous query
- *
+ *
* @return <code>boolean<code>
*/
public boolean isContinuation() {
@@ -180,11 +185,12 @@ public class IRODSNode extends DefaultMutableTreeNode {
/**
* Are there more records (children) to be retrieved from iRODS?
- *
+ *
* @return <code>boolean</code> if more records are available.
*/
public boolean isHasMore() {
return hasMore;
}
+
}
diff --git a/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/IRODSOutlineModel.java b/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/IRODSOutlineModel.java
index 3e24be2..0da117c 100644
--- a/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/IRODSOutlineModel.java
+++ b/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/IRODSOutlineModel.java
@@ -27,26 +27,32 @@ import org.slf4j.LoggerFactory;
*/
public class IRODSOutlineModel extends DefaultOutlineModel {
- public static final org.slf4j.Logger log = LoggerFactory.getLogger(IRODSOutlineModel.class);
-
+ public static final org.slf4j.Logger log = LoggerFactory.getLogger(IRODSOutlineModel.class);
private final IRODSFileSystemModel treeModel;
+ public IRODSFileSystemModel getTreeModel() {
+ return treeModel;
+ }
private iDropLiteApplet idrop;
- public IRODSOutlineModel(iDropLiteApplet idrop, TreeModel tm, TableModel tm1, boolean bln, String string) {
+ public IRODSOutlineModel(final iDropLiteApplet idrop, final TreeModel tm,
+ final TableModel tm1, final boolean bln, final String string) {
super(tm, tm1, bln, string);
this.treeModel = (IRODSFileSystemModel) tm;
this.idrop = idrop;
+
}
- public IRODSOutlineModel(iDropLiteApplet idrop, TreeModel tm, RowModel rm, boolean bln, String string) {
+ public IRODSOutlineModel(final iDropLiteApplet idrop, final TreeModel tm,
+ final RowModel rm, final boolean bln, final String string) {
super(tm, rm, bln, string);
this.treeModel = (IRODSFileSystemModel) tm;
this.idrop = idrop;
}
- public void notifyFileShouldBeRemoved(final IRODSNode deletedNode) throws IdropException {
+ public void notifyFileShouldBeRemoved(final IRODSNode deletedNode)
+ throws IdropException {
if (deletedNode == null) {
return;
@@ -64,35 +70,27 @@ public class IRODSOutlineModel extends DefaultOutlineModel {
@Override
public void run() {
- CollectionAndDataObjectListingEntry entry = (CollectionAndDataObjectListingEntry) ((IRODSNode) parent)
- .getUserObject();
+ deletedNode.getUserObject();
+ CollectionAndDataObjectListingEntry entry = (CollectionAndDataObjectListingEntry) (parent).getUserObject();
IRODSTree stagingViewTree = idrop.getIrodsTree();
- TreePath path;
try {
- path = TreeUtils.buildTreePathForIrodsAbsolutePath(stagingViewTree,
- entry.getFormattedAbsolutePath());
+ TreeUtils.buildTreePathForIrodsAbsolutePath(
+ stagingViewTree, entry.getFormattedAbsolutePath());
+
} catch (IdropException ex) {
- Logger.getLogger(IRODSOutlineModel.class.getName()).log(Level.SEVERE, null, ex);
+ Logger.getLogger(IRODSOutlineModel.class.getName()).log(
+ Level.SEVERE, null, ex);
throw new IdropRuntimeException(ex);
}
- // thisModel.getTreePathSupport().removePath(path);
- parent.remove(deletedNode);
-
- // parent.forceReloadOfChildrenOfThisNode();
- // treeModel.nodeChanged(deletedNode);
- // treeModel.nodeChanged(parent);
-
- // treeModel.nodeChanged(parent);
-
- // stagingViewTree.highlightPath(path);
+ thisModel.treeModel.removeNodeFromParent(deletedNode);
}
});
}
- public void notifyCompletionOfOperation(final IRODSTree irodsTree, final TransferStatus transferStatus)
- throws IdropException {
+ public void notifyCompletionOfOperation(final IRODSTree irodsTree,
+ final TransferStatus transferStatus) throws IdropException {
log.info("tree model notified of status:{}", transferStatus);
if (transferStatus.getTransferState() != TransferState.OVERALL_COMPLETION) {
@@ -103,12 +101,14 @@ public class IRODSOutlineModel extends DefaultOutlineModel {
if (transferStatus.getTransferType() == TransferStatus.TransferType.PUT
|| transferStatus.getTransferType() == TransferStatus.TransferType.COPY) {
log.info("successful put transfer, find the parent tree node, and clear the children");
- notifyFileShouldBeAdded(irodsTree, transferStatus.getTargetFileAbsolutePath());
+ notifyFileShouldBeAdded(irodsTree,
+ transferStatus.getTargetFileAbsolutePath());
}
}
- public void notifyFileShouldBeAdded(final IRODSTree irodsTree, final String irodsFileAbsolutePath) {
+ public void notifyFileShouldBeAdded(final IRODSTree irodsTree,
+ final String irodsFileAbsolutePath) {
log.info("notifyFileShouldBeAdded() for node:{}", irodsFileAbsolutePath);
java.awt.EventQueue.invokeLater(new Runnable() {
@@ -119,19 +119,20 @@ public class IRODSOutlineModel extends DefaultOutlineModel {
IRODSFileFactory irodsFileFactory = idrop.getiDropCore().getIRODSFileFactoryForLoggedInAccount();
try {
try {
- // if the node already exists (e.g. an overwrite, don' add it
+ // if the node already exists (e.g. an overwrite, don'
+ // add it
TreePath currentPath = TreeUtils.buildTreePathForIrodsAbsolutePath(irodsTree,
irodsFileAbsolutePath);
// build treePath will return parent if child not found
if (currentPath == null) {
- log.warn("null tree path found for:{} logged and ignored as a warning",
+ log.warn(
+ "null tree path found for:{} logged and ignored as a warning",
irodsFileAbsolutePath);
return;
}
IRODSNode irodsNode = (IRODSNode) currentPath.getLastPathComponent();
- CollectionAndDataObjectListingEntry lastPathNodeEntry = (CollectionAndDataObjectListingEntry) irodsNode
- .getUserObject();
+ CollectionAndDataObjectListingEntry lastPathNodeEntry = (CollectionAndDataObjectListingEntry) irodsNode.getUserObject();
if (irodsFileAbsolutePath.equals(lastPathNodeEntry.getFormattedAbsolutePath())) {
log.info("path already exists, do not double-add");
return;
@@ -144,13 +145,15 @@ public class IRODSOutlineModel extends DefaultOutlineModel {
IRODSFile addedFile = irodsFileFactory.instanceIRODSFile(irodsFileAbsolutePath);
if (!addedFile.exists()) {
- log.info("looking for file that was added, I don't find it, so just move on: {}",
+ log.info(
+ "looking for file that was added, I don't find it, so just move on: {}",
irodsFileAbsolutePath);
return;
}
TreePath parentPath;
try {
- parentPath = TreeUtils.buildTreePathForIrodsAbsolutePath(irodsTree, addedFile.getParent());
+ parentPath = TreeUtils.buildTreePathForIrodsAbsolutePath(irodsTree,
+ addedFile.getParent());
} catch (IdropException ex) {
Logger.getLogger(IRODSOutlineModel.class.getName()).log(Level.SEVERE, null, ex);
throw new IdropRuntimeException(ex);
@@ -176,12 +179,12 @@ public class IRODSOutlineModel extends DefaultOutlineModel {
newEntry.setPathOrName(addedFile.getName());
}
- IRODSNode newNode = new IRODSNode(newEntry, idrop.getiDropCore().getIrodsAccount(), idrop
- .getiDropCore().getIrodsFileSystem(), irodsTree);
+ IRODSNode newNode = new IRODSNode(newEntry, idrop.getiDropCore().getIrodsAccount(), idrop.getiDropCore().getIrodsFileSystem(), irodsTree);
((IRODSNode) parentPath.getLastPathComponent()).add(newNode);
irodsTree.highlightPath(parentPath);
} catch (JargonException ex) {
- Logger.getLogger(IRODSOutlineModel.class.getName()).log(Level.SEVERE, null, ex);
+ Logger.getLogger(IRODSOutlineModel.class.getName()).log(
+ Level.SEVERE, null, ex);
} finally {
idrop.getiDropCore().closeIRODSConnectionForLoggedInAccount();
}
diff --git a/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/IRODSTree.java b/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/IRODSTree.java
index 13bc7c9..be814c4 100644
--- a/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/IRODSTree.java
+++ b/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/IRODSTree.java
@@ -26,6 +26,8 @@ import javax.swing.tree.TreeModel;
import javax.swing.tree.TreePath;
import org.irods.jargon.core.query.CollectionAndDataObjectListingEntry;
+import org.irods.jargon.idrop.lite.finder.IRODSTreeContainingComponent;
+import org.irods.jargon.idrop.lite.finder.IrodsSelectionListenerForBuildingInfoPanel;
import org.netbeans.swing.outline.DefaultOutlineModel;
import org.netbeans.swing.outline.Outline;
import org.netbeans.swing.outline.OutlineModel;
@@ -34,48 +36,41 @@ import org.slf4j.LoggerFactory;
/**
* Swing JTree component for viewing iRODS server file system
- *
+ *
* @author Mike Conway - DICE (www.irods.org)
*/
-public class IRODSTree extends Outline implements TreeWillExpandListener, TreeExpansionListener {
+public class IRODSTree extends Outline implements TreeWillExpandListener,
+ TreeExpansionListener, IRODSTreeContainingComponent {
public static org.slf4j.Logger log = LoggerFactory.getLogger(IRODSTree.class);
-
protected iDropLiteApplet idropParentGui = null;
-
protected JPopupMenu m_popup = null;
-
protected Action m_action;
-
protected TreePath m_clickedPath;
-
protected IRODSTree thisTree;
-
private boolean refreshingTree = false;
-
TreePathSupport tps;
+ @Override
public boolean isRefreshingTree() {
synchronized (this) {
return refreshingTree;
}
}
- public void setRefreshingTree(boolean refreshingTree) {
+ public void setRefreshingTree(final boolean refreshingTree) {
synchronized (this) {
this.refreshingTree = refreshingTree;
}
}
- public IRODSTree(TreeModel newModel, iDropLiteApplet idropParentGui) {
+ public IRODSTree(final TreeModel newModel, final iDropLiteApplet idropParentGui) {
super();
- OutlineModel mdl = DefaultOutlineModel.createOutlineModel(newModel, new IRODSRowModel(), true, "File System");
+ OutlineModel mdl = DefaultOutlineModel.createOutlineModel(newModel,
+ new IRODSRowModel(), true, "File System");
this.idropParentGui = idropParentGui;
- tps = new TreePathSupport(mdl, this.getLayoutCache());
- tps.addTreeExpansionListener(this);
- tps.addTreeWillExpandListener(this);
initializeMenusAndListeners();
}
@@ -83,27 +78,34 @@ public class IRODSTree extends Outline implements TreeWillExpandListener, TreeEx
super();
}
- public IRODSTree(iDropLiteApplet idropParentGui) {
+ public IRODSTree(final iDropLiteApplet idropParentGui) {
super();
this.idropParentGui = idropParentGui;
initializeMenusAndListeners();
}
private void initializeMenusAndListeners() {
+ tps = new TreePathSupport(this.getOutlineModel(), this.getLayoutCache());
+ tps.addTreeExpansionListener(this);
+ tps.addTreeWillExpandListener(this);
setDragEnabled(true);
+ setTransferHandler(new IRODSTreeTransferHandler(idropParentGui,
+ "selectionModel"));
setDropMode(javax.swing.DropMode.ON);
- setTransferHandler(new IRODSTreeTransferHandler(idropParentGui, "selectionModel"));
+
setUpTreeMenu();
- /*
IrodsSelectionListenerForBuildingInfoPanel treeListener;
try {
- treeListener = new IrodsSelectionListenerForBuildingInfoPanel(idropParentGui);
+ treeListener = new IrodsSelectionListenerForBuildingInfoPanel(
+ idropParentGui);
} catch (IdropException ex) {
- Logger.getLogger(IRODSTree.class.getName()).log(Level.SEVERE, null, ex);
- throw new IdropRuntimeException("error initializing selection listener", ex);
+ Logger.getLogger(IRODSTree.class.getName()).log(Level.SEVERE, null,
+ ex);
+ throw new IdropRuntimeException(
+ "error initializing selection listener", ex);
}
+
this.getSelectionModel().addListSelectionListener(treeListener);
- */
}
@@ -116,7 +118,7 @@ public class IRODSTree extends Outline implements TreeWillExpandListener, TreeEx
m_action = new AbstractAction() {
@Override
- public void actionPerformed(ActionEvent e) {
+ public void actionPerformed(final ActionEvent e) {
if (m_clickedPath == null) {
return;
}
@@ -134,27 +136,27 @@ public class IRODSTree extends Outline implements TreeWillExpandListener, TreeEx
Action newAction = new AbstractAction("New Folder") {
@Override
- public void actionPerformed(ActionEvent e) {
+ public void actionPerformed(final ActionEvent e) {
log.info("adding new node");
IRODSNode parent = (IRODSNode) m_clickedPath.getLastPathComponent();
log.info("parent of new node is: {}", parent);
- CollectionAndDataObjectListingEntry dataEntry = (CollectionAndDataObjectListingEntry) parent
- .getUserObject();
+ CollectionAndDataObjectListingEntry dataEntry = (CollectionAndDataObjectListingEntry) parent.getUserObject();
if (dataEntry.getObjectType() == CollectionAndDataObjectListingEntry.ObjectType.DATA_OBJECT) {
- JOptionPane.showMessageDialog(thisTree,
- "The selected item is not a folder, cannot create a new directory", "Info",
- JOptionPane.INFORMATION_MESSAGE);
+ JOptionPane.showMessageDialog(
+ thisTree,
+ "The selected item is not a folder, cannot create a new directory",
+ "Info", JOptionPane.INFORMATION_MESSAGE);
log.info("new folder not created, the selected parent is not a collection");
return;
}
// show a dialog asking for the new directory name...
- NewIRODSDirectoryDialog newDirectoryDialog = new NewIRODSDirectoryDialog(idropParentGui, true,
- dataEntry.getPathOrName(), thisTree, parent);
+ NewIRODSDirectoryDialog newDirectoryDialog = new NewIRODSDirectoryDialog(
+ idropParentGui, true, dataEntry.getPathOrName(),
+ thisTree, parent);
newDirectoryDialog.setLocation(
- (int) (idropParentGui.getLocation().getX() + idropParentGui.getWidth() / 2),
- (int) (idropParentGui.getLocation().getY() + idropParentGui.getHeight() / 2));
+ (int) (idropParentGui.getLocation().getX() + idropParentGui.getWidth() / 2), (int) (idropParentGui.getLocation().getY() + idropParentGui.getHeight() / 2));
newDirectoryDialog.setVisible(true);
}
};
@@ -165,7 +167,7 @@ public class IRODSTree extends Outline implements TreeWillExpandListener, TreeEx
Action a1 = new AbstractAction("Delete") {
@Override
- public void actionPerformed(ActionEvent e) {
+ public void actionPerformed(final ActionEvent e) {
log.info("deleting a node");
int[] rows = thisTree.getSelectedRows();
log.debug("selected rows for delete:{}", rows);
@@ -174,21 +176,25 @@ public class IRODSTree extends Outline implements TreeWillExpandListener, TreeEx
if (rows.length == 1) {
- IRODSNode toDelete = (IRODSNode) thisTree.getValueAt(rows[0], 0);
+ IRODSNode toDelete = (IRODSNode) thisTree.getValueAt(
+ rows[0], 0);
log.info("deleting a single node: {}", toDelete);
- deleteDialog = new DeleteIRODSDialog(idropParentGui, true, thisTree, toDelete);
+ deleteDialog = new DeleteIRODSDialog(idropParentGui, true,
+ thisTree, toDelete);
} else {
List<IRODSNode> nodesToDelete = new ArrayList<IRODSNode>();
for (int row : rows) {
- nodesToDelete.add((IRODSNode) thisTree.getValueAt(row, 0));
+ nodesToDelete.add((IRODSNode) thisTree.getValueAt(row,
+ 0));
}
- deleteDialog = new DeleteIRODSDialog(idropParentGui, true, thisTree, nodesToDelete);
+ deleteDialog = new DeleteIRODSDialog(idropParentGui, true,
+ thisTree, nodesToDelete);
}
- deleteDialog.setLocation((int) (idropParentGui.getLocation().getX() + idropParentGui.getWidth() / 2),
- (int) (idropParentGui.getLocation().getY() + idropParentGui.getHeight() / 2));
+ deleteDialog.setLocation(
+ (int) (idropParentGui.getLocation().getX() + idropParentGui.getWidth() / 2), (int) (idropParentGui.getLocation().getY() + idropParentGui.getHeight() / 2));
deleteDialog.setVisible(true);
}
};
@@ -197,13 +203,12 @@ public class IRODSTree extends Outline implements TreeWillExpandListener, TreeEx
Action a2 = new AbstractAction("Rename") {
@Override
- public void actionPerformed(ActionEvent e) {
+ public void actionPerformed(final ActionEvent e) {
log.info("renaming node");
IRODSNode toRename = (IRODSNode) m_clickedPath.getLastPathComponent();
log.info("node to rename is: {}", toRename);
- CollectionAndDataObjectListingEntry dataEntry = (CollectionAndDataObjectListingEntry) toRename
- .getUserObject();
+ CollectionAndDataObjectListingEntry dataEntry = (CollectionAndDataObjectListingEntry) toRename.getUserObject();
// dialog uses absolute path, so munge it for files
StringBuilder sb = new StringBuilder();
@@ -216,10 +221,10 @@ public class IRODSTree extends Outline implements TreeWillExpandListener, TreeEx
}
// show a dialog asking for the new directory name...
- RenameIRODSDirectoryDialog renameDialog = new RenameIRODSDirectoryDialog(idropParentGui, true,
- sb.toString(), thisTree, toRename);
- renameDialog.setLocation((int) (idropParentGui.getLocation().getX() + idropParentGui.getWidth() / 2),
- (int) (idropParentGui.getLocation().getY() + idropParentGui.getHeight() / 2));
+ RenameIRODSDirectoryDialog renameDialog = new RenameIRODSDirectoryDialog(
+ idropParentGui, true, sb.toString(), thisTree, toRename);
+ renameDialog.setLocation(
+ (int) (idropParentGui.getLocation().getX() + idropParentGui.getWidth() / 2), (int) (idropParentGui.getLocation().getY() + idropParentGui.getHeight() / 2));
renameDialog.setVisible(true);
}
};
@@ -230,17 +235,17 @@ public class IRODSTree extends Outline implements TreeWillExpandListener, TreeEx
}
@Override
- public void treeExpanded(TreeExpansionEvent event) {
+ public void treeExpanded(final TreeExpansionEvent event) {
}
@Override
- public void treeCollapsed(TreeExpansionEvent event) {
+ public void treeCollapsed(final TreeExpansionEvent event) {
}
class PopupTrigger extends MouseAdapter {
@Override
- public void mouseReleased(MouseEvent e) {
+ public void mouseReleased(final MouseEvent e) {
if (e.isPopupTrigger()) {
int x = e.getX();
int y = e.getY();
@@ -259,7 +264,7 @@ public class IRODSTree extends Outline implements TreeWillExpandListener, TreeEx
}
@Override
- public void mousePressed(MouseEvent e) {
+ public void mousePressed(final MouseEvent e) {
if (e.isPopupTrigger()) {
int x = e.getX();
int y = e.getY();
@@ -278,20 +283,24 @@ public class IRODSTree extends Outline implements TreeWillExpandListener, TreeEx
}
@Override
- public void treeWillCollapse(TreeExpansionEvent event) throws ExpandVetoException {
+ public void treeWillCollapse(final TreeExpansionEvent event)
+ throws ExpandVetoException {
}
@Override
- public void treeWillExpand(TreeExpansionEvent event) throws ExpandVetoException {
+ public void treeWillExpand(final TreeExpansionEvent event)
+ throws ExpandVetoException {
setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
log.debug("tree expansion event:{}", event);
IRODSNode expandingNode = (IRODSNode) event.getPath().getLastPathComponent();
- // If I am refreshing the tree, then do not close the connection after each load. It will be closed in the thing
+ // If I am refreshing the tree, then do not close the connection after
+ // each load. It will be closed in the thing
// doing the refreshing
try {
expandingNode.lazyLoadOfChildrenOfThisNode(!isRefreshingTree());
} catch (IdropException ex) {
- Logger.getLogger(IRODSTree.class.getName()).log(Level.SEVERE, null, ex);
+ Logger.getLogger(IRODSTree.class.getName()).log(Level.SEVERE, null,
+ ex);
idropParentGui.showIdropException(ex);
throw new IdropRuntimeException("error expanding irodsNode");
} finally {
diff --git a/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/IRODSTreeTransferHandler.java b/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/IRODSTreeTransferHandler.java
index 71a34a8..5e9a6ed 100644
--- a/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/IRODSTreeTransferHandler.java
+++ b/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/IRODSTreeTransferHandler.java
@@ -300,7 +300,7 @@ public class IRODSTreeTransferHandler extends TransferHandler {
idropGui.getIrodsAccount());
*/
idropGui.getiDropCore().getTransferManager().putOperation(localSourceAbsolutePath,
- targetIrodsFileAbsolutePath, sourceResource, idropGui, new TreeTransferControlBlock());
+ targetIrodsFileAbsolutePath, sourceResource, idropGui, null);
} catch (JargonException ex) {
java.util.logging.Logger.getLogger(LocalFileTree.class.getName()).log(
java.util.logging.Level.SEVERE, null, ex);
diff --git a/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/LocalFileUtils.java b/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/LocalFileUtils.java
new file mode 100644
index 0000000..557dec7
--- /dev/null
+++ b/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/LocalFileUtils.java
@@ -0,0 +1,38 @@
+package org.irods.jargon.idrop.lite;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.swing.tree.TreePath;
+
+/**
+ * Utilities for working with local file systems
+ *
+ * @author Mike Conway - DICE (www.irods.org)
+ */
+public class LocalFileUtils {
+
+ public static List<String> listFileRootsForSystem() {
+ List<String> fileRoots = new ArrayList<String>();
+ File[] roots = File.listRoots();
+ for (File root : roots) {
+ fileRoots.add(root.getPath());
+ }
+
+ return fileRoots;
+
+ }
+
+ public static String makeLocalFilePath(TreePath treePath) {
+
+ String filePath = "";
+
+ for(Object node: treePath.getPath()) {
+ if(node.toString().equals("/")) continue;
+ filePath += System.getProperty("file.separator") + node.toString();
+ }
+
+ return filePath;
+ }
+}
diff --git a/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/LocalTreeTransferHandler.java b/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/LocalTreeTransferHandler.java
index 84072b0..27e6f17 100644
--- a/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/LocalTreeTransferHandler.java
+++ b/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/LocalTreeTransferHandler.java
@@ -24,9 +24,10 @@ import javax.swing.TransferHandler;
import javax.swing.tree.DefaultTreeModel;
import javax.swing.tree.DefaultTreeSelectionModel;
import javax.swing.tree.TreePath;
-//import org.apache.commons.io.FileUtils;
+import org.apache.commons.io.FileUtils;
import org.irods.jargon.core.exception.JargonException;
+import org.irods.jargon.core.pub.DataTransferOperations;
import org.irods.jargon.core.pub.io.IRODSFile;
import org.openide.util.Exceptions;
import org.slf4j.LoggerFactory;
@@ -189,15 +190,16 @@ public class LocalTreeTransferHandler extends TransferHandler {
@Override
public void run() {
- /*
try {
for (File transferFile : sourceFiles) {
if (transferFile instanceof IRODSFile) {
log.info("initiating a transfer of iRODS file:{}", transferFile.getAbsolutePath());
log.info("transfer to local file:{}", tempTargetLocalFileAbsolutePath);
- idropGui.getiDropCore().getTransferManager().enqueueAGet(transferFile.getAbsolutePath(), tempTargetLocalFileAbsolutePath,
- "", idropGui.getIrodsAccount());
+ DataTransferOperations dto = idropGui.getiDropCore().getIRODSAccessObjectFactory().getDataTransferOperations(
+ idropGui.getIrodsAccount());
+ dto.getOperation(transferFile.getAbsolutePath(), tempTargetLocalFileAbsolutePath, idropGui.getIrodsAccount().getDefaultStorageResource(), idropGui, null);
+
} else {
log.info("process a local to local move with source...not yet implemented : {}",
transferFile.getAbsolutePath());
@@ -208,8 +210,9 @@ public class LocalTreeTransferHandler extends TransferHandler {
java.util.logging.Level.SEVERE, null, ex);
idropGui.showIdropException(ex);
throw new IdropRuntimeException(ex);
+ } finally {
+ idropGui.getiDropCore().closeAllIRODSConnections();
}
- */
}
});
@@ -224,7 +227,7 @@ public class LocalTreeTransferHandler extends TransferHandler {
private void processDropFromSerializedObjectType(Transferable transferable, File parent, DataFlavor flavor, int userDropAction) {
log.info("process as drop of file list to target:{}", parent.getAbsolutePath());
-/*
+///*
File effectiveTarget;
if (parent.isDirectory()) {
effectiveTarget = parent;
@@ -292,7 +295,7 @@ public class LocalTreeTransferHandler extends TransferHandler {
log.error("error updating local file tree after add", ex);
throw new IdropRuntimeException(ex);
}
- */
+ //*/
}
diff --git a/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/NewIRODSDirectoryDialog.java b/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/NewIRODSDirectoryDialog.java
index 2267b49..08e6169 100644
--- a/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/NewIRODSDirectoryDialog.java
+++ b/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/NewIRODSDirectoryDialog.java
@@ -15,6 +15,8 @@ import javax.swing.AbstractAction;
import javax.swing.Action;
import javax.swing.JComponent;
import javax.swing.KeyStroke;
+import javax.swing.tree.TreePath;
+
import org.irods.jargon.core.query.CollectionAndDataObjectListingEntry;
import org.slf4j.LoggerFactory;
@@ -24,7 +26,7 @@ import org.slf4j.LoggerFactory;
*/
public class NewIRODSDirectoryDialog extends javax.swing.JDialog {
- private final iDropLiteApplet idrop;
+ private final iDropLiteApplet idrop;
private String parentDirectory = "";
private final IRODSTree stagingViewTree;
private final IRODSNode parentNode;
@@ -34,14 +36,16 @@ public class NewIRODSDirectoryDialog extends javax.swing.JDialog {
return parentDirectory;
}
- public void setParentDirectory(String parentDirectory) {
+ public void setParentDirectory(final String parentDirectory) {
this.parentDirectory = parentDirectory;
}
/** Creates new form NewIRODSDirectoryDialog */
- public NewIRODSDirectoryDialog(final iDropLiteApplet parent, final boolean modal, final String parentDirectory, final IRODSTree stagingViewTree, final IRODSNode parentNode) {
- //super(parent, modal); FIX THIS???
- super((Frame)null, modal);
+ public NewIRODSDirectoryDialog(final iDropLiteApplet parent, final boolean modal,
+ final String parentDirectory, final IRODSTree stagingViewTree,
+ final IRODSNode parentNode) {
+ //super(parent, modal);
+ super((java.awt.Frame)null, modal);
this.idrop = parent;
this.parentDirectory = parentDirectory;
this.stagingViewTree = stagingViewTree;
@@ -52,130 +56,184 @@ public class NewIRODSDirectoryDialog extends javax.swing.JDialog {
}
- /** 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();
- scrollCurrentParent = new javax.swing.JScrollPane();
- txtAreaCurrentParent = new javax.swing.JTextArea();
- lblNewDiretoryName = new java.awt.Label();
- 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("Create New Folder Dialog");
- setName("NewParentDialog"); // NOI18N
-
- lblTitle.setText("Please enter a name for the new folder");
- getContentPane().add(lblTitle, java.awt.BorderLayout.NORTH);
-
- pnlFolderData.setLayout(new java.awt.GridLayout(0, 1));
-
- lblCurrentParent.setText("Current parent directory:");
-
- txtAreaCurrentParent.setColumns(20);
- txtAreaCurrentParent.setEditable(false);
- txtAreaCurrentParent.setLineWrap(true);
- txtAreaCurrentParent.setRows(5);
- txtAreaCurrentParent.setFocusable(false);
- scrollCurrentParent.setViewportView(txtAreaCurrentParent);
-
- lblNewDiretoryName.setText("New folder name:");
-
- txtNewFolder.setToolTipText("A name for the new folder underneath the displayed parent");
-
- 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(20, 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.LEADING, false)
- .add(txtNewFolder)
- .add(scrollCurrentParent, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 413, Short.MAX_VALUE))
- .addContainerGap())
- );
- 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(scrollCurrentParent, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
- .add(lblCurrentParent, 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))
- .addContainerGap(68, Short.MAX_VALUE))
- );
-
- lblNewDiretoryName.getAccessibleContext().setAccessibleName("New directory name:");
-
- pnlFolderData.add(pnlCurrentParent);
-
- getContentPane().add(pnlFolderData, java.awt.BorderLayout.CENTER);
-
- pnlBottom.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.RIGHT));
-
- btnCancel.setText("Cancel");
- btnCancel.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent evt) {
- btnCancelActionPerformed(evt);
- }
- });
- pnlBottom.add(btnCancel);
+ // <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();
+ scrollCurrentParent = new javax.swing.JScrollPane();
+ txtAreaCurrentParent = new javax.swing.JTextArea();
+ lblNewDiretoryName = new java.awt.Label();
+ 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("Create New Folder Dialog");
+ setName("NewParentDialog"); // NOI18N
+
+ lblTitle.setText("Please enter a name for the new folder");
+ getContentPane().add(lblTitle, java.awt.BorderLayout.NORTH);
+
+ pnlFolderData.setLayout(new java.awt.GridLayout(0, 1));
+
+ lblCurrentParent.setText("Current parent directory:");
+
+ txtAreaCurrentParent.setColumns(20);
+ txtAreaCurrentParent.setEditable(false);
+ txtAreaCurrentParent.setLineWrap(true);
+ txtAreaCurrentParent.setRows(5);
+ txtAreaCurrentParent.setFocusable(false);
+ scrollCurrentParent.setViewportView(txtAreaCurrentParent);
+
+ lblNewDiretoryName.setText("New folder name:");
+
+ txtNewFolder
+ .setToolTipText("A name for the new folder underneath the displayed parent");
+
+ 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(20, 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.LEADING,
+ false)
+ .add(txtNewFolder)
+ .add(scrollCurrentParent,
+ org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
+ 413, Short.MAX_VALUE))
+ .addContainerGap()));
+ 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(scrollCurrentParent,
+ org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
+ org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
+ org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
+ .add(lblCurrentParent,
+ 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))
+ .addContainerGap(68, Short.MAX_VALUE)));
+
+ lblNewDiretoryName.getAccessibleContext().setAccessibleName(
+ "New directory name:");
+
+ pnlFolderData.add(pnlCurrentParent);
+
+ getContentPane().add(pnlFolderData, java.awt.BorderLayout.CENTER);
+
+ pnlBottom.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.RIGHT));
+
+ btnCancel.setText("Cancel");
+ btnCancel.addActionListener(new java.awt.event.ActionListener() {
+ @Override
+ public void actionPerformed(final java.awt.event.ActionEvent evt) {
+ btnCancelActionPerformed(evt);
+ }
+ });
+ pnlBottom.add(btnCancel);
+
+ btnOK.setText("OK");
+ btnOK.addActionListener(new java.awt.event.ActionListener() {
+ @Override
+ public void actionPerformed(final java.awt.event.ActionEvent evt) {
+ btnOKActionPerformed(evt);
+ }
+ });
+ pnlBottom.add(btnOK);
+
+ getContentPane().add(pnlBottom, java.awt.BorderLayout.SOUTH);
+
+ 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
- btnOK.setText("OK");
- btnOK.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent evt) {
- btnOKActionPerformed(evt);
- }
- });
- pnlBottom.add(btnOK);
+ private void btnOKActionPerformed(final java.awt.event.ActionEvent evt) {// GEN-FIRST:event_btnOKActionPerformed
+ processNew();
+ }// GEN-LAST:event_btnOKActionPerformed
+ // Variables declaration - do not modify//GEN-BEGIN:variables
- getContentPane().add(pnlBottom, java.awt.BorderLayout.SOUTH);
+ private javax.swing.JButton btnCancel;
- pack();
- }// </editor-fold>
+ private javax.swing.JButton btnOK;
- private void btnCancelActionPerformed(java.awt.event.ActionEvent evt) {
- this.dispose();
-}
+ private java.awt.Label lblCurrentParent;
- private void btnOKActionPerformed(java.awt.event.ActionEvent evt) {
- processNew();
- }
- // 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.JScrollPane scrollCurrentParent;
- private javax.swing.JTextArea txtAreaCurrentParent;
- private javax.swing.JTextField txtNewFolder;
- // End of variables declaration
-
- private void processNew() {
- // add the new folder to irods, add to the tree, and scroll the tree into view
+ 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.JScrollPane scrollCurrentParent;
+
+ private javax.swing.JTextArea txtAreaCurrentParent;
+
+ private javax.swing.JTextField txtNewFolder;
+
+ // End of variables declaration//GEN-END:variables
+ private void processNew() {
+ // add the new folder to irods, add to the tree, and scroll the tree
+ // into view
if (txtNewFolder.getText().isEmpty()) {
txtNewFolder.setBackground(Color.red);
@@ -189,10 +247,23 @@ public class NewIRODSDirectoryDialog extends javax.swing.JDialog {
@Override
public void run() {
- log.info("adding new folder named:{}", txtNewFolder.getText());
- thisDialog.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
try {
- IRODSFileService irodsFileService = new IRODSFileService(idrop.getiDropCore().getIrodsAccount(),idrop.getiDropCore().getIrodsFileSystem());
+ log.info("adding new folder named:{}",
+ txtNewFolder.getText());
+ thisDialog.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
+
+ IRODSFileService irodsFileService;
+ try {
+ irodsFileService = new IRODSFileService(idrop.getIrodsAccount(), idrop.getiDropCore().getIrodsFileSystem());
+ } catch (IdropException ex) {
+ Logger.getLogger(
+ NewIRODSDirectoryDialog.class.getName()).log(
+ Level.SEVERE, null, ex);
+ throw new IdropRuntimeException(ex);
+ } finally {
+ thisDialog.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
+
+ }
StringBuilder sb = new StringBuilder();
sb.append(parentDirectory);
@@ -202,13 +273,13 @@ public class NewIRODSDirectoryDialog extends javax.swing.JDialog {
boolean created = irodsFileService.createNewFolder(newDirPath);
- IRODSFileSystemModel irodsFileSystemModel = (IRODSFileSystemModel) stagingViewTree.getModel();
+ stagingViewTree.getModel();
if (!created) {
- log.info("could not create new folder in:{}", newDirPath);
+ log.info("could not create new folder in:{}",
+ newDirPath);
idrop.showMessageFromOperation("directory could not be created");
thisDialog.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
-
return;
}
@@ -217,43 +288,50 @@ public class NewIRODSDirectoryDialog extends javax.swing.JDialog {
entry.setObjectType(CollectionAndDataObjectListingEntry.ObjectType.COLLECTION);
entry.setParentPath(parentDirectory);
entry.setPathOrName(newDirPath);
- IRODSNode newNode = new IRODSNode(entry, idrop.getiDropCore().getIrodsAccount(),idrop.getiDropCore().getIrodsFileSystem() , idrop.getIrodsTree());
- //newNode.setParent(parentNode);
+ IRODSNode newNode = new IRODSNode(entry, idrop.getIrodsAccount(), idrop.getiDropCore().getIrodsFileSystem(), idrop.getIrodsTree());
log.info("inserting node at 0");
- //parentNode.insertChildAt(0, newNode);
if (parentNode.isCached()) {
- irodsFileSystemModel.insertNodeInto(newNode, parentNode, 0);
+ parentNode.insert(newNode, parentNode.getChildCount());
} else {
parentNode.forceReloadOfChildrenOfThisNode();
- irodsFileSystemModel.reload(parentNode);
- stagingViewTree.expandPath(TreeUtils.buildTreePathForIrodsAbsolutePath(stagingViewTree, entry.getParentPath()));
}
- thisDialog.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
+ try {
+ TreePath path = TreeUtils.buildTreePathForIrodsAbsolutePath(
+ stagingViewTree, entry.getParentPath());
+ stagingViewTree.collapsePath(path);
+ stagingViewTree.expandPath(path);
+ } catch (IdropException ex) {
+ Logger.getLogger(
+ NewIRODSDirectoryDialog.class.getName()).log(
+ Level.SEVERE, null, ex);
+ idrop.showIdropException(ex);
+ } finally {
+ thisDialog.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
+ }
+
idrop.showMessageFromOperation("new folder created");
- }
- catch (IdropException ex) {
+ thisDialog.dispose();
+ } catch (IdropException ex) {
Logger.getLogger(NewIRODSDirectoryDialog.class.getName()).log(Level.SEVERE, null, ex);
- idrop.showIdropException(ex);
+ throw new IdropRuntimeException(ex);
}
-
- thisDialog.dispose();
}
});
- }
-
+ }
- /**
+ /**
* Register a listener for the enter event, so login can occur.
*/
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) {
processNew();
}
};
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/finder/FinderDeleteIRODSDialog.form b/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/finder/FinderDeleteIRODSDialog.form
new file mode 100644
index 0000000..c843416
--- /dev/null
+++ b/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/finder/FinderDeleteIRODSDialog.form
@@ -0,0 +1,136 @@
+<?xml version="1.1" encoding="UTF-8" ?>
+
+<Form version="1.3" maxVersion="1.7" type="org.netbeans.modules.form.forminfo.JDialogFormInfo">
+ <Properties>
+ <Property name="defaultCloseOperation" type="int" value="2"/>
+ </Properties>
+ <SyntheticProperties>
+ <SyntheticProperty name="formSizePolicy" type="int" value="1"/>
+ </SyntheticProperties>
+ <AuxValues>
+ <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
+ <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
+ <AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
+ <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
+ <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
+ <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="2"/>
+ <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
+ <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
+ <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
+ <AuxValue name="designerSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,0,-75,0,0,2,104"/>
+ </AuxValues>
+
+ <Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>
+ <SubComponents>
+ <Component class="javax.swing.JLabel" name="lblTitle">
+ <Properties>
+ <Property name="text" type="java.lang.String" value="Please hit OK to delete the following file/folder from iRODS"/>
+ </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>
+ </Component>
+ <Container class="javax.swing.JPanel" name="pnlFolderData">
+ <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.DesignGridLayout">
+ <Property name="columns" type="int" value="1"/>
+ <Property name="rows" type="int" value="0"/>
+ </Layout>
+ <SubComponents>
+ <Container class="javax.swing.JPanel" name="pnlCurrentParent">
+
+ <Layout>
+ <DimensionLayout dim="0">
+ <Group type="103" groupAlignment="0" attributes="0">
+ <Group type="102" alignment="1" attributes="0">
+ <EmptySpace pref="40" max="32767" attributes="0"/>
+ <Component id="lblCurrentFolder" min="-2" max="-2" attributes="0"/>
+ <EmptySpace max="-2" attributes="0"/>
+ <Component id="scrollFileToDelete" min="-2" pref="413" max="-2" attributes="1"/>
+ <EmptySpace max="-2" attributes="0"/>
+ </Group>
+ </Group>
+ </DimensionLayout>
+ <DimensionLayout dim="1">
+ <Group type="103" groupAlignment="0" attributes="0">
+ <Group type="102" attributes="0">
+ <Group type="103" groupAlignment="0" attributes="0">
+ <Group type="102" alignment="0" attributes="0">
+ <EmptySpace min="-2" pref="35" max="-2" attributes="0"/>
+ <Component id="lblCurrentFolder" min="-2" max="-2" attributes="0"/>
+ </Group>
+ <Group type="102" alignment="0" attributes="0">
+ <EmptySpace min="-2" pref="22" max="-2" attributes="0"/>
+ <Component id="scrollFileToDelete" min="-2" max="-2" attributes="0"/>
+ </Group>
+ </Group>
+ <EmptySpace max="32767" attributes="0"/>
+ </Group>
+ </Group>
+ </DimensionLayout>
+ </Layout>
+ <SubComponents>
+ <Component class="java.awt.Label" name="lblCurrentFolder">
+ <Properties>
+ <Property name="text" type="java.lang.String" value="File/folder to delete:"/>
+ </Properties>
+ </Component>
+ <Container class="javax.swing.JScrollPane" name="scrollFileToDelete">
+ <AuxValues>
+ <AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
+ </AuxValues>
+
+ <Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
+ <SubComponents>
+ <Component class="javax.swing.JTextArea" name="txtAreaFileToDelete">
+ <Properties>
+ <Property name="columns" type="int" value="20"/>
+ <Property name="editable" type="boolean" value="false"/>
+ <Property name="lineWrap" type="boolean" value="true"/>
+ <Property name="rows" type="int" value="5"/>
+ </Properties>
+ </Component>
+ </SubComponents>
+ </Container>
+ </SubComponents>
+ </Container>
+ </SubComponents>
+ </Container>
+ <Container class="javax.swing.JPanel" name="pnlBottom">
+ <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 class="org.netbeans.modules.form.compat2.layouts.DesignFlowLayout">
+ <Property name="alignment" type="int" value="2"/>
+ </Layout>
+ <SubComponents>
+ <Component class="javax.swing.JButton" name="btnCancel">
+ <Properties>
+ <Property name="text" type="java.lang.String" value="Cancel"/>
+ </Properties>
+ <Events>
+ <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnCancelActionPerformed"/>
+ </Events>
+ </Component>
+ <Component class="javax.swing.JButton" name="btnOK">
+ <Properties>
+ <Property name="text" type="java.lang.String" value="OK"/>
+ </Properties>
+ <Events>
+ <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnOKActionPerformed"/>
+ </Events>
+ </Component>
+ </SubComponents>
+ </Container>
+ </SubComponents>
+</Form>
diff --git a/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/finder/FinderDeleteIRODSDialog.java b/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/finder/FinderDeleteIRODSDialog.java
new file mode 100644
index 0000000..fd68f94
--- /dev/null
+++ b/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/finder/FinderDeleteIRODSDialog.java
@@ -0,0 +1,325 @@
+package org.irods.jargon.idrop.lite.finder;
+
+import java.awt.Cursor;
+import java.awt.event.ActionEvent;
+import java.util.List;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import javax.swing.AbstractAction;
+import javax.swing.Action;
+import javax.swing.JComponent;
+import javax.swing.KeyStroke;
+import javax.swing.SwingWorker;
+
+import org.irods.jargon.core.exception.JargonException;
+import org.irods.jargon.core.pub.io.IRODSFile;
+import org.irods.jargon.core.pub.io.IRODSFileFactory;
+import org.irods.jargon.core.query.CollectionAndDataObjectListingEntry;
+import org.irods.jargon.idrop.lite.IRODSNode;
+import org.irods.jargon.idrop.lite.IRODSOutlineModel;
+import org.irods.jargon.idrop.lite.IRODSTree;
+import org.irods.jargon.idrop.lite.IdropException;
+import org.irods.jargon.idrop.lite.IdropRuntimeException;
+import org.slf4j.LoggerFactory;
+
+/**
+ *
+ * @author mikeconway
+ */
+public class FinderDeleteIRODSDialog extends javax.swing.JDialog {
+
+
+ private final IRODSFinderTree irodsTree;
+ private final IRODSNode deletedNode;
+ private final List<IRODSNode> deletedNodes;
+ private final IRODSFinderDialog irodsFinderDialog;
+ public static org.slf4j.Logger log = LoggerFactory.getLogger(FinderDeleteIRODSDialog.class);
+
+ /** Creates new form NewIRODSDirectoryDialog */
+ public FinderDeleteIRODSDialog(final IRODSFinderDialog parent, final boolean modal,
+ final IRODSFinderTree irodsTree, final IRODSNode deletedNode) {
+ super(parent, modal);
+ this.irodsFinderDialog = parent;
+ this.irodsTree = irodsTree;
+ this.deletedNode = deletedNode;
+ this.deletedNodes = null;
+ StringBuilder sb = new StringBuilder();
+ CollectionAndDataObjectListingEntry entry = (CollectionAndDataObjectListingEntry) deletedNode.getUserObject();
+ if (entry.getObjectType() == CollectionAndDataObjectListingEntry.ObjectType.COLLECTION) {
+ sb.append(entry.getPathOrName());
+ } else {
+ sb.append(entry.getParentPath());
+ sb.append('/');
+ sb.append(entry.getPathOrName());
+ }
+
+ initialize();
+ txtAreaFileToDelete.setText(sb.toString());
+ }
+
+ /** Creates new form NewIRODSDirectoryDialog */
+ public FinderDeleteIRODSDialog(final IRODSFinderDialog parent, final boolean modal,
+ final IRODSFinderTree irodsTree, final List<IRODSNode> deletedNodes) {
+ super(parent, modal);
+ this.irodsFinderDialog = parent;
+ this.irodsTree = irodsTree;
+ this.deletedNodes = deletedNodes;
+ this.deletedNode = null;
+ initialize();
+ txtAreaFileToDelete.setText("multiple selections");
+ }
+
+ private void initialize() {
+ initComponents();
+ registerKeystrokeListener();
+ }
+
+ /**
+ * Register a listener for the enter event, so login can occur.
+ */
+ private void registerKeystrokeListener() {
+
+ KeyStroke enter = KeyStroke.getKeyStroke(
+ java.awt.event.KeyEvent.VK_ENTER, 0);
+ Action enterAction = new AbstractAction() {
+
+ @Override
+ public void actionPerformed(final ActionEvent e) {
+ try {
+ processDelete();
+ } catch (IdropException ex) {
+ Logger.getLogger(FinderDeleteIRODSDialog.class.getName()).log(
+ Level.SEVERE, null, ex);
+ throw new IdropRuntimeException(ex);
+ }
+ }
+ };
+
+ btnOK.registerKeyboardAction(enterAction, enter,
+ JComponent.WHEN_IN_FOCUSED_WINDOW);
+
+ }
+
+ /**
+ * 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"
+ // <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();
+ lblCurrentFolder = new java.awt.Label();
+ scrollFileToDelete = new javax.swing.JScrollPane();
+ txtAreaFileToDelete = new javax.swing.JTextArea();
+ pnlBottom = new javax.swing.JPanel();
+ btnCancel = new javax.swing.JButton();
+ btnOK = new javax.swing.JButton();
+
+ setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
+
+ lblTitle.setText("Please hit OK to delete the following file/folder from iRODS");
+ getContentPane().add(lblTitle, java.awt.BorderLayout.NORTH);
+
+ pnlFolderData.setLayout(new java.awt.GridLayout(0, 1));
+
+ lblCurrentFolder.setText("File/folder to delete:");
+
+ txtAreaFileToDelete.setColumns(20);
+ txtAreaFileToDelete.setEditable(false);
+ txtAreaFileToDelete.setLineWrap(true);
+ txtAreaFileToDelete.setRows(5);
+ scrollFileToDelete.setViewportView(txtAreaFileToDelete);
+
+ 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(40, Short.MAX_VALUE)
+ .add(lblCurrentFolder, 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(scrollFileToDelete, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 413, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
+ .addContainerGap())
+ );
+ pnlCurrentParentLayout.setVerticalGroup(
+ pnlCurrentParentLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
+ .add(pnlCurrentParentLayout.createSequentialGroup()
+ .add(pnlCurrentParentLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
+ .add(pnlCurrentParentLayout.createSequentialGroup()
+ .add(35, 35, 35)
+ .add(lblCurrentFolder, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
+ .add(pnlCurrentParentLayout.createSequentialGroup()
+ .add(22, 22, 22)
+ .add(scrollFileToDelete, 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))
+ );
+
+ pnlFolderData.add(pnlCurrentParent);
+
+ getContentPane().add(pnlFolderData, java.awt.BorderLayout.CENTER);
+
+ pnlBottom.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.RIGHT));
+
+ btnCancel.setText("Cancel");
+ btnCancel.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ btnCancelActionPerformed(evt);
+ }
+ });
+ pnlBottom.add(btnCancel);
+
+ btnOK.setText("OK");
+ btnOK.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ btnOKActionPerformed(evt);
+ }
+ });
+ pnlBottom.add(btnOK);
+
+ getContentPane().add(pnlBottom, java.awt.BorderLayout.SOUTH);
+
+ 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(final java.awt.event.ActionEvent evt) {// GEN-FIRST:event_btnOKActionPerformed
+ try {
+ processDelete();
+ } catch (IdropException ex) {
+ Logger.getLogger(FinderDeleteIRODSDialog.class.getName()).log(
+ Level.SEVERE, null, ex);
+ throw new IdropRuntimeException(ex);
+ }
+
+ }// 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 lblCurrentFolder;
+ private javax.swing.JLabel lblTitle;
+ private javax.swing.JPanel pnlBottom;
+ private javax.swing.JPanel pnlCurrentParent;
+ private javax.swing.JPanel pnlFolderData;
+ private javax.swing.JScrollPane scrollFileToDelete;
+ private javax.swing.JTextArea txtAreaFileToDelete;
+ // End of variables declaration//GEN-END:variables
+ private void processDelete() throws IdropException {
+ log.info("delete folder named:{}", txtAreaFileToDelete.getText());
+ final FinderDeleteIRODSDialog thisDialog = this;
+
+ java.awt.EventQueue.invokeLater(new Runnable() {
+
+ @Override
+ public void run() {
+ thisDialog.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
+ (new DeleteWorker(thisDialog)).execute();
+ }
+ });
+ }
+
+ private void deleteASingleFile(final IRODSFileFactory irodsFileFactory,
+ final IRODSNode deletedNode) throws IdropException {
+
+ log.info("node to delete is: {}", deletedNode);
+ CollectionAndDataObjectListingEntry dataEntry = (CollectionAndDataObjectListingEntry) deletedNode.getUserObject();
+
+ // dialog uses absolute path, so munge it for files
+ StringBuilder sb = new StringBuilder();
+ if (dataEntry.getObjectType() == CollectionAndDataObjectListingEntry.ObjectType.COLLECTION) {
+ sb.append(dataEntry.getPathOrName());
+ } else {
+ sb.append(dataEntry.getParentPath());
+ sb.append('/');
+ sb.append(dataEntry.getPathOrName());
+ }
+
+ IRODSFile fileToDelete;
+ try {
+ fileToDelete = irodsFileFactory.instanceIRODSFile(sb.toString());
+ fileToDelete.delete();
+
+ } catch (JargonException ex) {
+ Logger.getLogger(FinderDeleteIRODSDialog.class.getName()).log(
+ Level.SEVERE, null, ex);
+ throw new IdropException(ex);
+ } finally {
+ irodsFinderDialog.getIdropCore().closeIRODSConnectionForLoggedInAccount();
+ }
+
+ }
+
+ class DeleteWorker extends SwingWorker<String, Object> {
+
+ public static final String DELETE_SUCCESSFUL = "Deletion complete";
+ public static final String DELETE_ERRORS = "The deletion was not successful";
+ private FinderDeleteIRODSDialog dialog;
+ private String message = "";
+
+ DeleteWorker(final FinderDeleteIRODSDialog dialog) {
+ if (dialog == null) {
+ throw new IllegalArgumentException("null dialog");
+ }
+
+ this.dialog = dialog;
+
+ }
+
+ @Override
+ public String doInBackground() {
+
+ try {
+
+ IRODSFileFactory irodsFileFactory = irodsFinderDialog.getIdropCore().getIRODSFileFactoryForLoggedInAccount();
+ if (deletedNode != null) {
+ log.info("deleting a single node");
+ deleteASingleFile(irodsFileFactory, deletedNode);
+ } else if (deletedNodes != null) {
+ log.info("deleting multiple nodes");
+ for (IRODSNode deletedNodeEntry : deletedNodes) {
+ deleteASingleFile(irodsFileFactory, deletedNodeEntry);
+ }
+ }
+ message = DELETE_SUCCESSFUL;
+ } catch (Exception ex) {
+ Logger.getLogger(FinderDeleteIRODSDialog.class.getName()).log(
+ Level.SEVERE, null, ex);
+
+ throw new IdropRuntimeException(ex);
+ } finally {
+ irodsFinderDialog.getIdropCore().closeAllIRODSConnections();
+ }
+
+ return null;
+ }
+
+ @Override
+ protected void done() {
+ dialog.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
+ final IRODSFinderOutlineModel irodsFileSystemModel = (IRODSFinderOutlineModel) irodsTree.getModel();
+ try {
+ if (deletedNode != null) {
+ irodsFileSystemModel.notifyFileShouldBeRemoved(deletedNode);
+ } else if (deletedNodes != null) {
+ for (IRODSNode deletedNode : deletedNodes) {
+ irodsFileSystemModel.notifyFileShouldBeRemoved(deletedNode);
+ }
+ }
+ } catch (IdropException ex) {
+ Logger.getLogger(FinderDeleteIRODSDialog.class.getName()).log(
+ Level.SEVERE, null, ex);
+ throw new IdropRuntimeException(ex);
+ }
+ dialog.dispose();
+
+ }
+ }
+}
diff --git a/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/finder/FinderNewIRODSDirectoryDialog.form b/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/finder/FinderNewIRODSDirectoryDialog.form
new file mode 100644
index 0000000..c9a2786
--- /dev/null
+++ b/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/finder/FinderNewIRODSDirectoryDialog.form
@@ -0,0 +1,158 @@
+<?xml version="1.1" encoding="UTF-8" ?>
+
+<Form version="1.3" maxVersion="1.7" type="org.netbeans.modules.form.forminfo.JDialogFormInfo">
+ <Properties>
+ <Property name="defaultCloseOperation" type="int" value="2"/>
+ <Property name="title" type="java.lang.String" value="Create New Folder Dialog"/>
+ <Property name="name" type="java.lang.String" value="NewParentDialog" noResource="true"/>
+ </Properties>
+ <SyntheticProperties>
+ <SyntheticProperty name="formSizePolicy" type="int" value="1"/>
+ </SyntheticProperties>
+ <AuxValues>
+ <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
+ <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
+ <AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
+ <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
+ <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
+ <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="2"/>
+ <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
+ <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
+ <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
+ <AuxValue name="designerSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,1,47,0,0,2,110"/>
+ </AuxValues>
+
+ <Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>
+ <SubComponents>
+ <Component class="javax.swing.JLabel" name="lblTitle">
+ <Properties>
+ <Property name="text" type="java.lang.String" value="Please enter a name for the new folder"/>
+ </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>
+ </Component>
+ <Container class="javax.swing.JPanel" name="pnlFolderData">
+ <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.DesignGridLayout">
+ <Property name="columns" type="int" value="1"/>
+ <Property name="rows" type="int" value="0"/>
+ </Layout>
+ <SubComponents>
+ <Container class="javax.swing.JPanel" name="pnlCurrentParent">
+
+ <Layout>
+ <DimensionLayout dim="0">
+ <Group type="103" groupAlignment="0" attributes="0">
+ <Group type="102" alignment="1" attributes="0">
+ <EmptySpace pref="20" max="32767" attributes="0"/>
+ <Group type="103" groupAlignment="1" attributes="0">
+ <Component id="lblCurrentParent" min="-2" max="-2" attributes="0"/>
+ <Component id="lblNewDiretoryName" min="-2" max="-2" attributes="0"/>
+ </Group>
+ <EmptySpace max="-2" attributes="0"/>
+ <Group type="103" groupAlignment="0" max="-2" attributes="0">
+ <Component id="txtNewFolder" max="32767" attributes="1"/>
+ <Component id="scrollCurrentParent" alignment="0" pref="413" max="32767" attributes="1"/>
+ </Group>
+ <EmptySpace max="-2" attributes="0"/>
+ </Group>
+ </Group>
+ </DimensionLayout>
+ <DimensionLayout dim="1">
+ <Group type="103" groupAlignment="0" attributes="0">
+ <Group type="102" alignment="0" attributes="0">
+ <EmptySpace min="-2" pref="58" max="-2" attributes="0"/>
+ <Group type="103" groupAlignment="0" attributes="0">
+ <Component id="scrollCurrentParent" alignment="0" min="-2" max="-2" attributes="0"/>
+ <Component id="lblCurrentParent" alignment="0" min="-2" max="-2" attributes="0"/>
+ </Group>
+ <EmptySpace max="-2" attributes="0"/>
+ <Group type="103" groupAlignment="0" attributes="0">
+ <Component id="txtNewFolder" min="-2" max="-2" attributes="0"/>
+ <Component id="lblNewDiretoryName" min="-2" max="-2" attributes="0"/>
+ </Group>
+ <EmptySpace pref="68" max="32767" attributes="0"/>
+ </Group>
+ </Group>
+ </DimensionLayout>
+ </Layout>
+ <SubComponents>
+ <Component class="java.awt.Label" name="lblCurrentParent">
+ <Properties>
+ <Property name="text" type="java.lang.String" value="Current parent directory:"/>
+ </Properties>
+ </Component>
+ <Container class="javax.swing.JScrollPane" name="scrollCurrentParent">
+ <AuxValues>
+ <AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
+ </AuxValues>
+
+ <Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
+ <SubComponents>
+ <Component class="javax.swing.JTextArea" name="txtAreaCurrentParent">
+ <Properties>
+ <Property name="columns" type="int" value="20"/>
+ <Property name="editable" type="boolean" value="false"/>
+ <Property name="lineWrap" type="boolean" value="true"/>
+ <Property name="rows" type="int" value="5"/>
+ <Property name="focusable" type="boolean" value="false"/>
+ </Properties>
+ </Component>
+ </SubComponents>
+ </Container>
+ <Component class="java.awt.Label" name="lblNewDiretoryName">
+ <Properties>
+ <Property name="text" type="java.lang.String" value="New folder name:"/>
+ </Properties>
+ <AccessibilityProperties>
+ <Property name="AccessibleContext.accessibleName" type="java.lang.String" value="New directory name:"/>
+ </AccessibilityProperties>
+ </Component>
+ <Component class="javax.swing.JTextField" name="txtNewFolder">
+ <Properties>
+ <Property name="toolTipText" type="java.lang.String" value="A name for the new folder underneath the displayed parent"/>
+ </Properties>
+ </Component>
+ </SubComponents>
+ </Container>
+ </SubComponents>
+ </Container>
+ <Container class="javax.swing.JPanel" name="pnlBottom">
+ <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 class="org.netbeans.modules.form.compat2.layouts.DesignFlowLayout">
+ <Property name="alignment" type="int" value="2"/>
+ </Layout>
+ <SubComponents>
+ <Component class="javax.swing.JButton" name="btnCancel">
+ <Properties>
+ <Property name="text" type="java.lang.String" value="Cancel"/>
+ </Properties>
+ <Events>
+ <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnCancelActionPerformed"/>
+ </Events>
+ </Component>
+ <Component class="javax.swing.JButton" name="btnOK">
+ <Properties>
+ <Property name="text" type="java.lang.String" value="OK"/>
+ </Properties>
+ <Events>
+ <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnOKActionPerformed"/>
+ </Events>
+ </Component>
+ </SubComponents>
+ </Container>
+ </SubComponents>
+</Form>
diff --git a/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/finder/FinderNewIRODSDirectoryDialog.java b/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/finder/FinderNewIRODSDirectoryDialog.java
new file mode 100644
index 0000000..ef9cc86
--- /dev/null
+++ b/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/finder/FinderNewIRODSDirectoryDialog.java
@@ -0,0 +1,290 @@
+package org.irods.jargon.idrop.lite.finder;
+
+import java.awt.Color;
+import java.awt.Cursor;
+import java.awt.event.ActionEvent;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import javax.swing.AbstractAction;
+import javax.swing.Action;
+import javax.swing.JComponent;
+import javax.swing.KeyStroke;
+import javax.swing.tree.TreePath;
+
+import org.irods.jargon.core.query.CollectionAndDataObjectListingEntry;
+import org.irods.jargon.idrop.lite.IRODSFileService;
+import org.irods.jargon.idrop.lite.TreeUtils;
+import org.irods.jargon.idrop.lite.IRODSNode;
+import org.irods.jargon.idrop.lite.IRODSTree;
+import org.irods.jargon.idrop.lite.IdropException;
+import org.irods.jargon.idrop.lite.IdropRuntimeException;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Dialog to gather a new directory name
+ *
+ * @author mikeconway
+ */
+public class FinderNewIRODSDirectoryDialog extends javax.swing.JDialog {
+
+ private final IRODSFinderDialog irodsFinderDialog;
+ private String parentDirectory = "";
+ private final IRODSFinderTree irodsTree;
+ private final IRODSNode parentNode;
+ public static org.slf4j.Logger log = LoggerFactory.getLogger(FinderNewIRODSDirectoryDialog.class);
+
+ public String getParentDirectory() {
+ return parentDirectory;
+ }
+
+ public void setParentDirectory(final String parentDirectory) {
+ this.parentDirectory = parentDirectory;
+ }
+
+ /** Creates new form NewIRODSDirectoryDialog */
+ public FinderNewIRODSDirectoryDialog(final IRODSFinderDialog parent, final boolean modal,
+ final String parentDirectory, final IRODSFinderTree stagingViewTree,
+ final IRODSNode parentNode) {
+ super(parent, modal);
+ this.irodsFinderDialog = parent;
+ this.parentDirectory = parentDirectory;
+ this.irodsTree = stagingViewTree;
+ this.parentNode = parentNode;
+ initComponents();
+ txtAreaCurrentParent.setText(this.parentDirectory);
+ 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.
+ */
+ @SuppressWarnings("unchecked")
+ // <editor-fold defaultstate="collapsed"
+ // <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();
+ scrollCurrentParent = new javax.swing.JScrollPane();
+ txtAreaCurrentParent = new javax.swing.JTextArea();
+ lblNewDiretoryName = new java.awt.Label();
+ 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("Create New Folder Dialog");
+ setName("NewParentDialog"); // NOI18N
+
+ lblTitle.setText("Please enter a name for the new folder");
+ getContentPane().add(lblTitle, java.awt.BorderLayout.NORTH);
+
+ pnlFolderData.setLayout(new java.awt.GridLayout(0, 1));
+
+ lblCurrentParent.setText("Current parent directory:");
+
+ txtAreaCurrentParent.setColumns(20);
+ txtAreaCurrentParent.setEditable(false);
+ txtAreaCurrentParent.setLineWrap(true);
+ txtAreaCurrentParent.setRows(5);
+ txtAreaCurrentParent.setFocusable(false);
+ scrollCurrentParent.setViewportView(txtAreaCurrentParent);
+
+ lblNewDiretoryName.setText("New folder name:");
+
+ txtNewFolder.setToolTipText("A name for the new folder underneath the displayed parent");
+
+ 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(20, 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.LEADING, false)
+ .add(txtNewFolder)
+ .add(scrollCurrentParent, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 413, Short.MAX_VALUE))
+ .addContainerGap())
+ );
+ 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(scrollCurrentParent, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
+ .add(lblCurrentParent, 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))
+ .addContainerGap(68, Short.MAX_VALUE))
+ );
+
+ lblNewDiretoryName.getAccessibleContext().setAccessibleName("New directory name:");
+
+ pnlFolderData.add(pnlCurrentParent);
+
+ getContentPane().add(pnlFolderData, java.awt.BorderLayout.CENTER);
+
+ pnlBottom.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.RIGHT));
+
+ btnCancel.setText("Cancel");
+ btnCancel.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ btnCancelActionPerformed(evt);
+ }
+ });
+ pnlBottom.add(btnCancel);
+
+ btnOK.setText("OK");
+ btnOK.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ btnOKActionPerformed(evt);
+ }
+ });
+ pnlBottom.add(btnOK);
+
+ getContentPane().add(pnlBottom, java.awt.BorderLayout.SOUTH);
+
+ 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(final java.awt.event.ActionEvent evt) {// GEN-FIRST:event_btnOKActionPerformed
+ processNew();
+ }// 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.JScrollPane scrollCurrentParent;
+ private javax.swing.JTextArea txtAreaCurrentParent;
+ private javax.swing.JTextField txtNewFolder;
+ // End of variables declaration//GEN-END:variables
+ private void processNew() {
+ // add the new folder to irods, add to the tree, and scroll the tree
+ // into view
+
+ if (txtNewFolder.getText().isEmpty()) {
+ txtNewFolder.setBackground(Color.red);
+ MessageManager.showError(this, "please enter a new folder name", MessageManager.TITLE_MESSAGE);
+ return;
+ }
+
+ final FinderNewIRODSDirectoryDialog thisDialog = this;
+
+ java.awt.EventQueue.invokeLater(new Runnable() {
+
+ @Override
+ public void run() {
+ try {
+ log.info("adding new folder named:{}",
+ txtNewFolder.getText());
+ thisDialog.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
+
+ IRODSFileService irodsFileService;
+ try {
+ irodsFileService = new IRODSFileService(irodsFinderDialog.getIdropCore().getIrodsAccount(), irodsFinderDialog.getIdropCore().getIrodsFileSystem());
+ } catch (IdropException ex) {
+ Logger.getLogger(
+ FinderNewIRODSDirectoryDialog.class.getName()).log(
+ Level.SEVERE, null, ex);
+ throw new IdropRuntimeException(ex);
+ } finally {
+ thisDialog.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
+
+ }
+
+ StringBuilder sb = new StringBuilder();
+ sb.append(parentDirectory);
+ sb.append('/');
+ sb.append(txtNewFolder.getText());
+ String newDirPath = sb.toString();
+
+ boolean created = irodsFileService.createNewFolder(newDirPath);
+
+ irodsTree.getModel();
+
+ if (!created) {
+ log.info("could not create new folder in:{}",
+ newDirPath);
+ MessageManager.showError(thisDialog, "directory could not be created", MessageManager.TITLE_MESSAGE);
+ thisDialog.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
+ return;
+ }
+
+ // directory created, add to tree and show as first node
+ CollectionAndDataObjectListingEntry entry = new CollectionAndDataObjectListingEntry();
+ entry.setObjectType(CollectionAndDataObjectListingEntry.ObjectType.COLLECTION);
+ entry.setParentPath(parentDirectory);
+ entry.setPathOrName(newDirPath);
+ IRODSNode newNode = new IRODSNode(entry, irodsFinderDialog.getIdropCore().getIrodsAccount(), irodsFinderDialog.getIdropCore().getIrodsFileSystem(), irodsFinderDialog.getIrodsTree());
+ log.info("inserting node at 0");
+ if (parentNode.isCached()) {
+ parentNode.insert(newNode, parentNode.getChildCount());
+ } else {
+ parentNode.forceReloadOfChildrenOfThisNode();
+ }
+
+ try {
+ TreePath path = FinderUtils.buildTreePathForIrodsAbsolutePath(
+ irodsFinderDialog.getIrodsTree(), entry.getParentPath());
+ irodsFinderDialog.getIrodsTree().collapsePath(path);
+ irodsFinderDialog.getIrodsTree().expandPath(path);
+ } catch (IdropException ex) {
+ Logger.getLogger(
+ FinderNewIRODSDirectoryDialog.class.getName()).log(
+ Level.SEVERE, null, ex);
+ throw new IdropRuntimeException(ex);
+ } finally {
+ thisDialog.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
+ }
+
+ MessageManager.showMessage(thisDialog, "new folder created", MessageManager.TITLE_MESSAGE);
+
+ thisDialog.dispose();
+ } catch (IdropException ex) {
+ Logger.getLogger(FinderNewIRODSDirectoryDialog.class.getName()).log(Level.SEVERE, null, ex);
+ throw new IdropRuntimeException(ex);
+ }
+ }
+ });
+ }
+
+ /**
+ * Register a listener for the enter event, so login can occur.
+ */
+ private void registerKeystrokeListener() {
+
+ KeyStroke enter = KeyStroke.getKeyStroke(
+ java.awt.event.KeyEvent.VK_ENTER, 0);
+ Action enterAction = new AbstractAction() {
+
+ @Override
+ public void actionPerformed(final ActionEvent e) {
+ processNew();
+ }
+ };
+ btnOK.registerKeyboardAction(enterAction, enter,
+ JComponent.WHEN_IN_FOCUSED_WINDOW);
+
+ }
+}
diff --git a/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/finder/FinderRenameIRODSDirectoryDialog.form b/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/finder/FinderRenameIRODSDirectoryDialog.form
new file mode 100644
index 0000000..7a2ceda
--- /dev/null
+++ b/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/finder/FinderRenameIRODSDirectoryDialog.form
@@ -0,0 +1,196 @@
+<?xml version="1.1" encoding="UTF-8" ?>
+
+<Form version="1.3" maxVersion="1.7" type="org.netbeans.modules.form.forminfo.JDialogFormInfo">
+ <Properties>
+ <Property name="defaultCloseOperation" type="int" value="2"/>
+ <Property name="title" type="java.lang.String" value="Rename iRODS File or Folder"/>
+ <Property name="name" type="java.lang.String" value="NewParentDialog" noResource="true"/>
+ </Properties>
+ <AccessibilityProperties>
+ <Property name="AccessibleContext.accessibleName" type="java.lang.String" value="Rename file or folder dialog"/>
+ </AccessibilityProperties>
+ <SyntheticProperties>
+ <SyntheticProperty name="formSizePolicy" type="int" value="1"/>
+ </SyntheticProperties>
+ <AuxValues>
+ <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
+ <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
+ <AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
+ <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
+ <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
+ <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="2"/>
+ <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
+ <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
+ <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
+ </AuxValues>
+
+ <Layout>
+ <DimensionLayout dim="0">
+ <Group type="103" groupAlignment="0" attributes="0">
+ <Group type="102" attributes="0">
+ <Group type="103" groupAlignment="0" attributes="0">
+ <Component id="lblTitle" min="-2" pref="747" max="-2" attributes="0"/>
+ <Component id="pnlFolderData" alignment="0" min="-2" max="-2" attributes="0"/>
+ </Group>
+ <EmptySpace max="32767" attributes="0"/>
+ </Group>
+ </Group>
+ </DimensionLayout>
+ <DimensionLayout dim="1">
+ <Group type="103" groupAlignment="0" attributes="0">
+ <Group type="102" attributes="0">
+ <Component id="lblTitle" min="-2" max="-2" attributes="0"/>
+ <EmptySpace max="-2" attributes="0"/>
+ <Component id="pnlFolderData" min="-2" max="-2" attributes="0"/>
+ </Group>
+ </Group>
+ </DimensionLayout>
+ </Layout>
+ <SubComponents>
+ <Component class="javax.swing.JLabel" name="lblTitle">
+ <Properties>
+ <Property name="text" type="java.lang.String" value="Please enter a new name for the file or collection"/>
+ </Properties>
+ </Component>
+ <Container class="javax.swing.JPanel" name="pnlFolderData">
+
+ <Layout>
+ <DimensionLayout dim="0">
+ <Group type="103" groupAlignment="0" attributes="0">
+ <Group type="102" alignment="0" attributes="0">
+ <Component id="pnlCurrentParent" min="-2" pref="757" max="-2" attributes="0"/>
+ <EmptySpace max="32767" attributes="0"/>
+ </Group>
+ </Group>
+ </DimensionLayout>
+ <DimensionLayout dim="1">
+ <Group type="103" groupAlignment="0" attributes="0">
+ <Group type="102" alignment="0" attributes="0">
+ <Component id="pnlCurrentParent" min="-2" max="-2" attributes="0"/>
+ <EmptySpace max="32767" attributes="0"/>
+ </Group>
+ </Group>
+ </DimensionLayout>
+ </Layout>
+ <SubComponents>
+ <Container class="javax.swing.JPanel" name="pnlCurrentParent">
+
+ <Layout>
+ <DimensionLayout dim="0">
+ <Group type="103" groupAlignment="0" attributes="0">
+ <Group type="102" alignment="1" attributes="0">
+ <EmptySpace pref="30" max="32767" attributes="0"/>
+ <Group type="103" groupAlignment="1" attributes="0">
+ <Component id="lblCurrentParent" min="-2" max="-2" attributes="0"/>
+ <Component id="lblNewDiretoryName" min="-2" max="-2" attributes="0"/>
+ </Group>
+ <EmptySpace max="-2" attributes="0"/>
+ <Group type="103" groupAlignment="1" max="-2" attributes="0">
+ <Component id="txtNewFolder" min="0" pref="0" max="32767" attributes="1"/>
+ <Component id="txtCurrentFolder" alignment="1" pref="421" max="32767" attributes="1"/>
+ </Group>
+ <EmptySpace min="-2" pref="213" max="-2" attributes="0"/>
+ </Group>
+ <Group type="102" alignment="0" attributes="0">
+ <Component id="pnlBottom" min="-2" pref="747" max="-2" attributes="0"/>
+ <EmptySpace max="32767" attributes="0"/>
+ </Group>
+ </Group>
+ </DimensionLayout>
+ <DimensionLayout dim="1">
+ <Group type="103" groupAlignment="0" attributes="0">
+ <Group type="102" alignment="0" attributes="0">
+ <EmptySpace min="-2" pref="58" max="-2" attributes="0"/>
+ <Group type="103" groupAlignment="0" attributes="0">
+ <Component id="lblCurrentParent" min="-2" max="-2" attributes="0"/>
+ <Component id="txtCurrentFolder" min="-2" max="-2" attributes="0"/>
+ </Group>
+ <EmptySpace max="-2" attributes="0"/>
+ <Group type="103" groupAlignment="0" attributes="0">
+ <Component id="txtNewFolder" min="-2" max="-2" attributes="0"/>
+ <Component id="lblNewDiretoryName" min="-2" max="-2" attributes="0"/>
+ </Group>
+ <EmptySpace pref="22" max="32767" attributes="0"/>
+ <Component id="pnlBottom" min="-2" max="-2" attributes="0"/>
+ </Group>
+ </Group>
+ </DimensionLayout>
+ </Layout>
+ <SubComponents>
+ <Component class="java.awt.Label" name="lblCurrentParent">
+ <Properties>
+ <Property name="text" type="java.lang.String" value="Current name:"/>
+ </Properties>
+ </Component>
+ <Component class="java.awt.Label" name="lblNewDiretoryName">
+ <Properties>
+ <Property name="text" type="java.lang.String" value="New name:"/>
+ </Properties>
+ <AccessibilityProperties>
+ <Property name="AccessibleContext.accessibleName" type="java.lang.String" value="New directory name:"/>
+ </AccessibilityProperties>
+ </Component>
+ <Component class="javax.swing.JTextField" name="txtCurrentFolder">
+ <Properties>
+ <Property name="columns" type="int" value="50"/>
+ <Property name="editable" type="boolean" value="false"/>
+ <Property name="toolTipText" type="java.lang.String" value="A name for the new folder underneath the displayed parent"/>
+ <Property name="focusable" type="boolean" value="false"/>
+ </Properties>
+ </Component>
+ <Component class="javax.swing.JTextField" name="txtNewFolder">
+ <Properties>
+ <Property name="columns" type="int" value="50"/>
+ <Property name="toolTipText" type="java.lang.String" value="A name for the new folder underneath the displayed parent"/>
+ </Properties>
+ </Component>
+ <Container class="javax.swing.JPanel" name="pnlBottom">
+
+ <Layout>
+ <DimensionLayout dim="0">
+ <Group type="103" groupAlignment="0" attributes="0">
+ <Group type="102" attributes="0">
+ <EmptySpace min="576" pref="576" max="576" attributes="0"/>
+ <Component id="btnCancel" min="-2" max="-2" attributes="0"/>
+ <EmptySpace min="5" pref="5" max="5" attributes="0"/>
+ <Component id="btnOK" min="-2" max="-2" attributes="0"/>
+ </Group>
+ </Group>
+ </DimensionLayout>
+ <DimensionLayout dim="1">
+ <Group type="103" groupAlignment="0" attributes="0">
+ <Group type="102" attributes="0">
+ <EmptySpace min="5" pref="5" max="-2" attributes="0"/>
+ <Group type="103" groupAlignment="0" attributes="0">
+ <Component id="btnCancel" min="-2" max="-2" attributes="0"/>
+ <Component id="btnOK" min="-2" max="-2" attributes="0"/>
+ </Group>
+ </Group>
+ </Group>
+ </DimensionLayout>
+ </Layout>
+ <SubComponents>
+ <Component class="javax.swing.JButton" name="btnCancel">
+ <Properties>
+ <Property name="text" type="java.lang.String" value="Cancel"/>
+ </Properties>
+ <Events>
+ <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnCancelActionPerformed"/>
+ </Events>
+ </Component>
+ <Component class="javax.swing.JButton" name="btnOK">
+ <Properties>
+ <Property name="text" type="java.lang.String" value="OK"/>
+ </Properties>
+ <Events>
+ <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnOKActionPerformed"/>
+ </Events>
+ </Component>
+ </SubComponents>
+ </Container>
+ </SubComponents>
+ </Container>
+ </SubComponents>
+ </Container>
+ </SubComponents>
+</Form>
diff --git a/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/finder/FinderRenameIRODSDirectoryDialog.java b/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/finder/FinderRenameIRODSDirectoryDialog.java
new file mode 100644
index 0000000..dfecc59
--- /dev/null
+++ b/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/finder/FinderRenameIRODSDirectoryDialog.java
@@ -0,0 +1,338 @@
+package org.irods.jargon.idrop.lite.finder;
+
+import java.awt.Color;
+import java.awt.Cursor;
+import java.awt.event.ActionEvent;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import javax.swing.AbstractAction;
+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.irods.jargon.idrop.lite.IRODSFileService;
+import org.irods.jargon.idrop.lite.TreeUtils;
+import org.irods.jargon.idrop.lite.IRODSFileSystemModel;
+import org.irods.jargon.idrop.lite.IRODSNode;
+import org.irods.jargon.idrop.lite.IRODSOutlineModel;
+import org.irods.jargon.idrop.lite.IRODSTree;
+import org.irods.jargon.idrop.lite.IdropException;
+import org.irods.jargon.idrop.lite.IdropRuntimeException;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Dialog to gather a new directory name
+ *
+ * @author mikeconway
+ */
+public class FinderRenameIRODSDirectoryDialog extends javax.swing.JDialog {
+
+ private final IRODSFinderDialog irodsFinderDialog;
+ private final String currentAbsolutePath;
+ private final IRODSFinderTree irodsTree;
+ private final IRODSNode currentNode;
+ public static org.slf4j.Logger log = LoggerFactory.getLogger(FinderRenameIRODSDirectoryDialog.class);
+
+ /** Creates new form NewIRODSDirectoryDialog */
+ public FinderRenameIRODSDirectoryDialog(final IRODSFinderDialog parent, final boolean modal,
+ final String currentAbsolutePath, final IRODSFinderTree irodsTree,
+ final IRODSNode currentNode) {
+ super(parent, modal);
+ this.irodsFinderDialog = parent;
+ this.currentAbsolutePath = currentAbsolutePath;
+ this.irodsTree = irodsTree;
+ this.currentNode = currentNode;
+ initComponents();
+ int lastPathPartIdx = currentAbsolutePath.lastIndexOf("/");
+ if (lastPathPartIdx == -1) {
+ String msg = "could not find last path component of absolute path:"
+ + currentAbsolutePath;
+ throw new IdropRuntimeException("could not find last path component of absolute path");
+ }
+
+ String parentAbsPath = currentAbsolutePath.substring(0, lastPathPartIdx);
+ String currentCollectionOrFileName = currentAbsolutePath.substring(lastPathPartIdx + 1);
+
+ log.debug("computed parent abs path as:{}", parentAbsPath);
+ 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.
+ */
+ @SuppressWarnings("unchecked")
+ // <editor-fold defaultstate="collapsed"
+ // <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() {
+ 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(pnlBottomLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
+ .add(btnCancel)
+ .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(final java.awt.event.ActionEvent evt) {// GEN-FIRST:event_btnOKActionPerformed
+ doRename();
+ }// 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
+
+ if (txtNewFolder.getText().isEmpty()) {
+ txtNewFolder.setBackground(Color.red);
+ MessageManager.showError(this, "please enter a new file or collection name", MessageManager.TITLE_MESSAGE);
+ return;
+ }
+
+ final FinderRenameIRODSDirectoryDialog thisDialog = this;
+
+ java.awt.EventQueue.invokeLater(new Runnable() {
+
+ @Override
+ public void run() {
+ log.info("renaming a file named:{}", txtCurrentFolder.getText());
+ thisDialog.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
+ try {
+
+ IRODSFileService irodsFileService = new IRODSFileService(
+ irodsFinderDialog.getIdropCore().getIrodsAccount(), irodsFinderDialog.getIdropCore().getIrodsFileSystem());
+ String newPath = irodsFileService.renameIRODSFileOrDirectory(currentAbsolutePath,
+ txtNewFolder.getText());
+
+ log.debug("New path:{}", newPath);
+ IRODSFinderOutlineModel irodsOutlineModel = (IRODSFinderOutlineModel) irodsTree.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");
+ }
+
+ StringBuilder sb = new StringBuilder();
+ for (int i = 0; i < dirs.length - 1; i++) {
+ if (i > 0) {
+ sb.append("/");
+ }
+ sb.append(dirs[i]);
+ }
+
+ String parentOfNewDir = sb.toString();
+ log.info("parent of new dir:{}", parentOfNewDir);
+
+ TreePath pathForOld = FinderUtils.buildTreePathForIrodsAbsolutePath(irodsTree,
+ 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 = irodsFinderDialog.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);
+
+ }
+
+
+
+ MessageManager.showMessage(irodsFinderDialog, "The rename was successful", MessageManager.TITLE_MESSAGE);
+
+ } catch (Exception ex) {
+ Logger.getLogger(FinderRenameIRODSDirectoryDialog.class.getName()).log(Level.SEVERE, null, ex);
+ throw new IdropRuntimeException(ex);
+ } finally {
+ thisDialog.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
+ irodsFinderDialog.getIdropCore().closeIRODSConnectionForLoggedInAccount();
+ }
+
+ thisDialog.dispose();
+ }
+ });
+ }
+
+ /**
+ * Register a listener for the enter event, so login can occur.
+ */
+ private void registerKeystrokeListener() {
+
+ KeyStroke enter = KeyStroke.getKeyStroke(
+ java.awt.event.KeyEvent.VK_ENTER, 0);
+ Action enterAction = new AbstractAction() {
+
+ @Override
+ public void actionPerformed(final ActionEvent e) {
+ doRename();
+ }
+ };
+ btnOK.registerKeyboardAction(enterAction, enter,
+ JComponent.WHEN_IN_FOCUSED_WINDOW);
+
+ }
+}
diff --git a/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/finder/FinderUtils.java b/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/finder/FinderUtils.java
new file mode 100644
index 0000000..66a00f8
--- /dev/null
+++ b/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/finder/FinderUtils.java
@@ -0,0 +1,186 @@
+package org.irods.jargon.idrop.lite.finder;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.Enumeration;
+import java.util.List;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import javax.swing.JTree;
+import javax.swing.tree.TreeNode;
+import javax.swing.tree.TreePath;
+
+import org.irods.jargon.core.query.CollectionAndDataObjectListingEntry;
+import org.irods.jargon.idrop.lite.IRODSFileSystemModel;
+import org.irods.jargon.idrop.lite.IRODSNode;
+import org.irods.jargon.idrop.lite.IRODSOutlineModel;
+import org.irods.jargon.idrop.lite.LocalFileNode;
+import org.irods.jargon.idrop.lite.LocalFileSystemModel;
+import org.irods.jargon.idrop.lite.IdropException;
+import org.netbeans.swing.outline.Outline;
+import org.slf4j.LoggerFactory;
+
+/**
+ * This is a set of utilities for manipulating a swing Jtree
+ *
+ * @author Mike Conway - DICE (www.irods.org)
+ */
+public class FinderUtils {
+
+ public static org.slf4j.Logger log = LoggerFactory.getLogger(FinderUtils.class);
+
+ public static IRODSNode findChild(final IRODSNode parent,
+ final String userObject) throws IdropException {
+ log.debug("finding child of parent:{}", parent);
+ log.debug("user object:{}", userObject);
+ parent.getUserObject();
+ CollectionAndDataObjectListingEntry childEntry = null;
+
+ IRODSNode foundNode = null;
+ try {
+ parent.lazyLoadOfChildrenOfThisNode();
+ } catch (IdropException ex) {
+ Logger.getLogger(FinderUtils.class.getName()).log(Level.SEVERE, null,
+ ex);
+ throw new IdropException("unable to load children of node");
+ }
+
+ for (int i = 0; i < parent.getChildCount(); i++) {
+ childEntry = (CollectionAndDataObjectListingEntry) ((IRODSNode) parent.getChildAt(i)).getUserObject();
+
+ if (childEntry.getObjectType() == CollectionAndDataObjectListingEntry.ObjectType.COLLECTION) {
+ log.debug("child entry is a collection");
+ if (userObject.equals(childEntry.getPathOrName())) {
+ foundNode = (IRODSNode) parent.getChildAt(i);
+ break;
+ }
+ } else {
+ log.debug("child entry is a data object");
+ StringBuilder sb = new StringBuilder();
+ sb.append(childEntry.getParentPath());
+ sb.append('/');
+ sb.append(childEntry.getPathOrName());
+ log.debug(
+ "looking for match when child entry is a file with abs path:{}",
+ sb.toString());
+ if (userObject.equals(sb.toString())) {
+ foundNode = (IRODSNode) parent.getChildAt(i);
+ break;
+ }
+ }
+ }
+ return foundNode;
+ }
+
+ public static TreePath buildTreePathForIrodsAbsolutePath(
+ final Outline tree, final String irodsAbsolutePath)
+ throws IdropException {
+
+ IRODSFinderOutlineModel irodsFileSystemModel = (IRODSFinderOutlineModel) tree.getModel();
+ // the root of the model, which may not be a path underneath the root of
+ // the irods resource
+ IRODSNode rootNode = (IRODSNode) irodsFileSystemModel.getRoot();
+ TreePath calculatedTreePath = new TreePath(rootNode);
+ CollectionAndDataObjectListingEntry rootEntry = (CollectionAndDataObjectListingEntry) rootNode.getUserObject();
+ String[] irodsPathComponents = irodsAbsolutePath.split("/");
+
+ /*
+ * get an array that has the path components that descend from the root
+ * of the iRODS file system to the subdirectory which the tree model
+ * considers the root of the tree
+ */
+ String[] irodsRootNodePathComponents = rootEntry.getPathOrName().split(
+ "/");
+
+ /*
+ * determine the relative calculatedTreePath of the given iRODS file
+ * underneath the root. There are cases where the root is not '/'.
+ */
+
+ StringBuilder searchRoot = new StringBuilder();
+ IRODSNode currentNode = (IRODSNode) irodsFileSystemModel.getRoot();
+ CollectionAndDataObjectListingEntry entry = (CollectionAndDataObjectListingEntry) currentNode.getUserObject();
+ searchRoot.append(entry.getPathOrName());
+
+ /*
+ * calculatedTreePath now holds the path from the root of iRODS to the
+ * root of the tree, now accumulate any TreePath entries that represent
+ * the path below the root of the tree contained in the absolute path.
+ * The relative path starts at the path component in the position after
+ * the length of the root path.
+ */
+
+ int relativePathStartsAfter = irodsRootNodePathComponents.length - 1;
+ String nextPathComponent;
+
+ for (int i = (relativePathStartsAfter + 1); i < irodsPathComponents.length; i++) {
+ // next element from userObjects is the child of the current node,
+ // note that for the first node (typically
+ // '/') a delimiting slash is not needed
+ if (searchRoot.length() > 1) {
+ searchRoot.append('/');
+ }
+
+ nextPathComponent = irodsPathComponents[i];
+ searchRoot.append(nextPathComponent);
+ if (i > 0) {
+ currentNode = findChild(currentNode, searchRoot.toString());
+ }
+
+ if (currentNode == null) {
+ log.warn(
+ "cannot find node for path, will attempt to return parent {}:",
+ searchRoot.toString());
+ break;
+ } else {
+ // root node is already part of the calculcated tree path
+ if (currentNode.getUserObject().toString().equals("/")) {
+ // ignore this node
+ } else {
+ calculatedTreePath = calculatedTreePath.pathByAddingChild(currentNode);
+ }
+ }
+ }
+ if (calculatedTreePath == null) {
+ throw new IdropException("cannot find path to node:"
+ + irodsAbsolutePath);
+ }
+ return calculatedTreePath;
+ }
+
+
+ public static TreePath[] getPaths(final Outline tree, final boolean expanded) {
+ TreeNode root = (TreeNode) tree.getOutlineModel().getRoot();
+
+ // Create array to hold the treepaths
+ List list = new ArrayList();
+
+ // Traverse tree from root adding treepaths for all nodes to list
+ getPaths(tree, new TreePath(root), expanded, list);
+
+ // Convert list to array
+ return (TreePath[]) list.toArray(new TreePath[list.size()]);
+ }
+
+ private static void getPaths(final Outline tree, final TreePath parent,
+ final boolean expanded, final List list) {
+ // Return if node is not expanded
+ if (expanded && !tree.isVisible(parent)) {
+ return;
+ }
+
+ // Add node to list
+ list.add(parent);
+
+ // Create paths for all children
+ TreeNode node = (TreeNode) parent.getLastPathComponent();
+ if (node.getChildCount() >= 0) {
+ for (Enumeration e = node.children(); e.hasMoreElements();) {
+ TreeNode n = (TreeNode) e.nextElement();
+ TreePath path = parent.pathByAddingChild(n);
+ getPaths(tree, path, expanded, list);
+ }
+ }
+ }
+}
diff --git a/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/finder/IRODSFinderDialog.form b/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/finder/IRODSFinderDialog.form
new file mode 100644
index 0000000..14359d1
--- /dev/null
+++ b/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/finder/IRODSFinderDialog.form
@@ -0,0 +1,147 @@
+<?xml version="1.1" encoding="UTF-8" ?>
+
+<Form version="1.5" maxVersion="1.7" type="org.netbeans.modules.form.forminfo.JDialogFormInfo">
+ <Properties>
+ <Property name="defaultCloseOperation" type="int" value="2"/>
+ <Property name="modal" type="boolean" value="true"/>
+ </Properties>
+ <SyntheticProperties>
+ <SyntheticProperty name="formSizePolicy" type="int" value="1"/>
+ </SyntheticProperties>
+ <AuxValues>
+ <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="1"/>
+ <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
+ <AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
+ <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
+ <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="true"/>
+ <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="2"/>
+ <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
+ <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
+ <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
+ <AuxValue name="designerSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,2,54,0,0,2,81"/>
+ </AuxValues>
+
+ <Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>
+ <SubComponents>
+ <Container class="javax.swing.JPanel" name="topPanel">
+ <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>
+ <DimensionLayout dim="0">
+ <Group type="103" groupAlignment="0" attributes="0">
+ <EmptySpace min="0" pref="593" max="32767" attributes="0"/>
+ </Group>
+ </DimensionLayout>
+ <DimensionLayout dim="1">
+ <Group type="103" groupAlignment="0" attributes="0">
+ <EmptySpace min="0" pref="484" max="32767" attributes="0"/>
+ </Group>
+ </DimensionLayout>
+ </Layout>
+ </Container>
+ <Container class="javax.swing.JPanel" name="treePanel">
+ <Constraints>
+ <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
+ <BorderConstraints direction="First"/>
+ </Constraint>
+ </Constraints>
+
+ <Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>
+ <SubComponents>
+ <Container class="javax.swing.JPanel" name="pnlIrodsTreeToolbar">
+ <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="btnRefreshTargetTree">
+ <Properties>
+ <Property name="mnemonic" type="int" value="114"/>
+ <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
+ <ResourceString bundle="org/irods/jargon/idrop/finder/Bundle.properties" key="IRODSFinderDialog.btnRefreshTargetTree.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
+ </Property>
+ <Property name="toolTipText" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
+ <ResourceString bundle="org/irods/jargon/idrop/finder/Bundle.properties" key="IRODSFinderDialog.btnRefreshTargetTree.toolTipText" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
+ </Property>
+ <Property name="focusable" type="boolean" value="false"/>
+ <Property name="horizontalTextPosition" type="int" value="0"/>
+ <Property name="verticalTextPosition" type="int" value="3"/>
+ </Properties>
+ <Events>
+ <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnRefreshTargetTreeActionPerformed"/>
+ </Events>
+ </Component>
+ </SubComponents>
+ </Container>
+ <Container class="javax.swing.JPanel" name="pnlIrodsTreeMaster">
+ <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.DesignBorderLayout"/>
+ <SubComponents>
+ <Container class="javax.swing.JScrollPane" name="scrollIrodsTree">
+ <Properties>
+ <Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
+ <Dimension value="null"/>
+ </Property>
+ <Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
+ <Dimension value="null"/>
+ </Property>
+ </Properties>
+ <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>
+ </SubComponents>
+ </Container>
+ </SubComponents>
+ </Container>
+ <Container class="javax.swing.JPanel" name="bottomPanel">
+ <Constraints>
+ <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
+ <BorderConstraints direction="Last"/>
+ </Constraint>
+ </Constraints>
+
+ <Layout class="org.netbeans.modules.form.compat2.layouts.DesignFlowLayout"/>
+ <SubComponents>
+ <Component class="javax.swing.JButton" name="btnCancel">
+ <Properties>
+ <Property name="mnemonic" type="int" value="99"/>
+ <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
+ <ResourceString bundle="org/irods/jargon/idrop/finder/Bundle.properties" key="IRODSFinderDialog.btnCancel.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="btnCancelActionPerformed"/>
+ </Events>
+ </Component>
+ <Component class="javax.swing.JButton" name="btnSelectFolder">
+ <Properties>
+ <Property name="mnemonic" type="int" value="115"/>
+ <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
+ <ResourceString bundle="org/irods/jargon/idrop/finder/Bundle.properties" key="IRODSFinderDialog.btnSelectFolder.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="btnSelectFolderActionPerformed"/>
+ </Events>
+ </Component>
+ </SubComponents>
+ </Container>
+ </SubComponents>
+</Form>
diff --git a/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/finder/IRODSFinderDialog.java b/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/finder/IRODSFinderDialog.java
new file mode 100644
index 0000000..c3de81c
--- /dev/null
+++ b/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/finder/IRODSFinderDialog.java
@@ -0,0 +1,252 @@
+package org.irods.jargon.idrop.lite.finder;
+
+import javax.swing.ListSelectionModel;
+import org.irods.jargon.core.query.CollectionAndDataObjectListingEntry;
+import org.irods.jargon.idrop.lite.IdropRuntimeException;
+import org.irods.jargon.idrop.lite.iDropLiteCore;
+import org.irods.jargon.idrop.lite.IRODSFileSystemModel;
+import org.irods.jargon.idrop.lite.IRODSNode;
+import org.irods.jargon.idrop.lite.IRODSRowModel;
+import org.slf4j.LoggerFactory;
+
+/**
+ *
+ * @author mikeconway
+ */
+public class IRODSFinderDialog extends javax.swing.JDialog {
+
+ private final iDropLiteCore idropCore;
+ private String selectedAbsolutePath = null;
+
+ public String getSelectedAbsolutePath() {
+ return selectedAbsolutePath;
+ }
+
+ public iDropLiteCore getIdropCore() {
+ return idropCore;
+ }
+
+ public IRODSFinderTree getIrodsTree() {
+ return irodsTree;
+ }
+ private static final org.slf4j.Logger log = LoggerFactory.getLogger(IRODSFinderDialog.class);
+ private IRODSFinderTree irodsTree = null;
+
+ /** Creates new form IRODSFinderDialog */
+ public IRODSFinderDialog(boolean modal, iDropLiteCore idropCore) {
+ //super(parent, modal);
+ super((java.awt.Frame)null, modal);
+
+ if (idropCore == null) {
+ throw new IllegalArgumentException("null idropCore");
+ }
+
+ this.idropCore = idropCore;
+ initComponents();
+ buildTargetTree();
+ }
+
+ /**
+ * build the JTree that will depict the iRODS resource
+ */
+ public void buildTargetTree() {
+ log.info("building tree to look at staging resource");
+ final IRODSFinderDialog gui = this;
+
+ java.awt.EventQueue.invokeLater(new Runnable() {
+
+ @Override
+ public void run() {
+
+
+ CollectionAndDataObjectListingEntry root = new CollectionAndDataObjectListingEntry();
+
+ //if (idropCore.getIdropConfig().isLoginPreset()) {
+ log.info("using policy preset home directory");
+ StringBuilder sb = new StringBuilder();
+ sb.append("/");
+ sb.append(idropCore.getIrodsAccount().getZone());
+ sb.append("/");
+ sb.append("home");
+ root.setParentPath(sb.toString());
+ root.setPathOrName(idropCore.getIrodsAccount().getHomeDirectory());
+ //} else {
+ //log.info("using root path, no login preset");
+ //root.setPathOrName("/");
+ //}
+
+ log.info("building new iRODS tree");
+ try {
+ if (irodsTree == null) {
+ irodsTree = new IRODSFinderTree(gui);
+ IRODSNode rootNode = new IRODSNode(root,
+ idropCore.getIrodsAccount(), idropCore.getIrodsFileSystem(), irodsTree);
+ irodsTree.setRefreshingTree(true);
+ // irodsTree.getSelectionModel().setSelectionMode(TreeSelectionModel.DISCONTIGUOUS_TREE_SELECTION);
+ }
+ IRODSNode rootNode = new IRODSNode(root, idropCore.getIrodsAccount(),
+ idropCore.getIrodsFileSystem(), irodsTree);
+
+ IRODSFileSystemModel irodsFileSystemModel = new IRODSFileSystemModel(
+ rootNode, idropCore.getIrodsAccount());
+ IRODSFinderOutlineModel mdl = new IRODSFinderOutlineModel(idropCore, irodsTree,
+ irodsFileSystemModel, new IRODSRowModel(), true,
+ "File System");
+ irodsTree.setModel(mdl);
+
+
+ } catch (Exception ex) {
+ log.error("exception building finder tree", ex);
+ throw new IdropRuntimeException(ex);
+ } finally {
+ idropCore.getIrodsFileSystem().closeAndEatExceptions(
+ idropCore.getIrodsAccount());
+ }
+
+ scrollIrodsTree.setViewportView(irodsTree);
+ scrollIrodsTree.validate();
+ gui.validate();
+
+ irodsTree.setRefreshingTree(false);
+
+ }
+ });
+ }
+
+
+ /** 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">//GEN-BEGIN:initComponents
+ private void initComponents() {
+
+ topPanel = new javax.swing.JPanel();
+ treePanel = new javax.swing.JPanel();
+ pnlIrodsTreeToolbar = new javax.swing.JPanel();
+ btnRefreshTargetTree = new javax.swing.JButton();
+ pnlIrodsTreeMaster = new javax.swing.JPanel();
+ scrollIrodsTree = new javax.swing.JScrollPane();
+ bottomPanel = new javax.swing.JPanel();
+ btnCancel = new javax.swing.JButton();
+ btnSelectFolder = new javax.swing.JButton();
+
+ setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
+ setModal(true);
+
+ org.jdesktop.layout.GroupLayout topPanelLayout = new org.jdesktop.layout.GroupLayout(topPanel);
+ topPanel.setLayout(topPanelLayout);
+ topPanelLayout.setHorizontalGroup(
+ topPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
+ .add(0, 593, Short.MAX_VALUE)
+ );
+ topPanelLayout.setVerticalGroup(
+ topPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
+ .add(0, 484, Short.MAX_VALUE)
+ );
+
+ getContentPane().add(topPanel, java.awt.BorderLayout.CENTER);
+
+ treePanel.setLayout(new java.awt.BorderLayout());
+
+ btnRefreshTargetTree.setMnemonic('r');
+ btnRefreshTargetTree.setText(org.openide.util.NbBundle.getMessage(IRODSFinderDialog.class, "IRODSFinderDialog.btnRefreshTargetTree.text")); // NOI18N
+ btnRefreshTargetTree.setToolTipText(org.openide.util.NbBundle.getMessage(IRODSFinderDialog.class, "IRODSFinderDialog.btnRefreshTargetTree.toolTipText")); // NOI18N
+ btnRefreshTargetTree.setFocusable(false);
+ btnRefreshTargetTree.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
+ btnRefreshTargetTree.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
+ btnRefreshTargetTree.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ btnRefreshTargetTreeActionPerformed(evt);
+ }
+ });
+ pnlIrodsTreeToolbar.add(btnRefreshTargetTree);
+
+ treePanel.add(pnlIrodsTreeToolbar, java.awt.BorderLayout.NORTH);
+
+ pnlIrodsTreeMaster.setLayout(new java.awt.BorderLayout());
+
+ scrollIrodsTree.setMinimumSize(null);
+ scrollIrodsTree.setPreferredSize(null);
+ pnlIrodsTreeMaster.add(scrollIrodsTree, java.awt.BorderLayout.CENTER);
+
+ treePanel.add(pnlIrodsTreeMaster, java.awt.BorderLayout.CENTER);
+
+ getContentPane().add(treePanel, java.awt.BorderLayout.PAGE_START);
+
+ btnCancel.setMnemonic('c');
+ btnCancel.setText(org.openide.util.NbBundle.getMessage(IRODSFinderDialog.class, "IRODSFinderDialog.btnCancel.text")); // NOI18N
+ btnCancel.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ btnCancelActionPerformed(evt);
+ }
+ });
+ bottomPanel.add(btnCancel);
+
+ btnSelectFolder.setMnemonic('s');
+ btnSelectFolder.setText(org.openide.util.NbBundle.getMessage(IRODSFinderDialog.class, "IRODSFinderDialog.btnSelectFolder.text")); // NOI18N
+ btnSelectFolder.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ btnSelectFolderActionPerformed(evt);
+ }
+ });
+ bottomPanel.add(btnSelectFolder);
+
+ getContentPane().add(bottomPanel, java.awt.BorderLayout.PAGE_END);
+
+ pack();
+ }// </editor-fold>//GEN-END:initComponents
+
+ private void btnRefreshTargetTreeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnRefreshTargetTreeActionPerformed
+ buildTargetTree();
+ }//GEN-LAST:event_btnRefreshTargetTreeActionPerformed
+
+ private void btnCancelActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCancelActionPerformed
+ this.selectedAbsolutePath = null;
+ this.setVisible(false);
+ }//GEN-LAST:event_btnCancelActionPerformed
+
+ private void btnSelectFolderActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSelectFolderActionPerformed
+
+ IRODSFinderOutlineModel irodsFileSystemModel = (IRODSFinderOutlineModel) irodsTree.getModel();
+
+
+ ListSelectionModel selectionModel = irodsTree.getSelectionModel();
+ int idx = selectionModel.getLeadSelectionIndex();
+
+ if (idx == -1) {
+ MessageManager.showWarning(this, "Please select a directory", MessageManager.TITLE_MESSAGE);
+ return;
+
+}
+
+ // use first selection for info
+ IRODSNode selectedNode = (IRODSNode) irodsFileSystemModel.getValueAt(
+ idx, 0);
+ log.info("selected node:{}", selectedNode);
+ CollectionAndDataObjectListingEntry entry = (CollectionAndDataObjectListingEntry) selectedNode.getUserObject();
+ if (entry.getObjectType() == CollectionAndDataObjectListingEntry.ObjectType.DATA_OBJECT) {
+ MessageManager.showWarning(this, "Please select a directory", MessageManager.TITLE_MESSAGE);
+ return;
+ }
+
+ this.selectedAbsolutePath = entry.getFormattedAbsolutePath();
+ this.setVisible(false);
+
+ }//GEN-LAST:event_btnSelectFolderActionPerformed
+
+ // Variables declaration - do not modify//GEN-BEGIN:variables
+ private javax.swing.JPanel bottomPanel;
+ private javax.swing.JButton btnCancel;
+ private javax.swing.JButton btnRefreshTargetTree;
+ private javax.swing.JButton btnSelectFolder;
+ private javax.swing.JPanel pnlIrodsTreeMaster;
+ private javax.swing.JPanel pnlIrodsTreeToolbar;
+ private javax.swing.JScrollPane scrollIrodsTree;
+ private javax.swing.JPanel topPanel;
+ private javax.swing.JPanel treePanel;
+ // End of variables declaration//GEN-END:variables
+
+}
diff --git a/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/finder/IRODSFinderOutlineModel.java b/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/finder/IRODSFinderOutlineModel.java
new file mode 100644
index 0000000..6942b13
--- /dev/null
+++ b/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/finder/IRODSFinderOutlineModel.java
@@ -0,0 +1,185 @@
+package org.irods.jargon.idrop.lite.finder;
+
+import java.util.Date;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import javax.swing.table.TableModel;
+import javax.swing.tree.TreeModel;
+import javax.swing.tree.TreePath;
+
+import org.irods.jargon.core.exception.JargonException;
+import org.irods.jargon.core.pub.io.IRODSFile;
+import org.irods.jargon.core.pub.io.IRODSFileFactory;
+import org.irods.jargon.core.query.CollectionAndDataObjectListingEntry;
+import org.irods.jargon.core.transfer.TransferStatus;
+import org.irods.jargon.core.transfer.TransferStatus.TransferState;
+import org.irods.jargon.idrop.lite.IRODSFileSystemModel;
+import org.irods.jargon.idrop.lite.IRODSNode;
+import org.irods.jargon.idrop.lite.IRODSOutlineModel;
+import org.irods.jargon.idrop.lite.IRODSTree;
+import org.irods.jargon.idrop.lite.iDropLiteCore;
+import org.irods.jargon.idrop.lite.iDropLiteApplet;
+import org.irods.jargon.idrop.lite.TreeUtils;
+import org.irods.jargon.idrop.lite.IdropException;
+import org.irods.jargon.idrop.lite.IdropRuntimeException;
+import org.netbeans.swing.outline.DefaultOutlineModel;
+import org.netbeans.swing.outline.RowModel;
+import org.slf4j.LoggerFactory;
+
+/**
+ * @author Mike Conway - DICE (www.irods.org)
+ */
+public class IRODSFinderOutlineModel extends DefaultOutlineModel {
+
+ public static final org.slf4j.Logger log = LoggerFactory.getLogger(IRODSFinderOutlineModel.class);
+ private final IRODSFileSystemModel treeModel;
+ private final IRODSFinderTree irodsFinderTree;
+ private final iDropLiteCore idropCore;
+
+ public IRODSFileSystemModel getTreeModel() {
+ return treeModel;
+ }
+
+ public IRODSFinderOutlineModel(final iDropLiteCore idropCore, final IRODSFinderTree irodsFinderTree, final TreeModel tm,
+ final TableModel tm1, final boolean bln, final String string) {
+ super(tm, tm1, bln, string);
+ this.treeModel = (IRODSFileSystemModel) tm;
+ this.irodsFinderTree = irodsFinderTree;
+ this.idropCore = idropCore;
+ }
+
+ public IRODSFinderOutlineModel(final iDropLiteCore idropCore,final IRODSFinderTree irodsFinderTree,final TreeModel tm,
+ final RowModel rm, final boolean bln, final String string) {
+ super(tm, rm, bln, string);
+ this.treeModel = (IRODSFileSystemModel) tm;
+ this.irodsFinderTree = irodsFinderTree;
+ this.idropCore = idropCore;
+ }
+
+ public void notifyFileShouldBeRemoved(final IRODSNode deletedNode)
+ throws IdropException {
+
+ if (deletedNode == null) {
+ return;
+ }
+ log.info("deleting node from parent:{}", deletedNode);
+ final IRODSNode parent = (IRODSNode) deletedNode.getParent();
+
+ if (parent == null) {
+ return;
+ }
+
+ final IRODSFinderOutlineModel thisModel = this;
+
+ java.awt.EventQueue.invokeLater(new Runnable() {
+
+ @Override
+ public void run() {
+ deletedNode.getUserObject();
+ CollectionAndDataObjectListingEntry entry = (CollectionAndDataObjectListingEntry) (parent).getUserObject();
+
+ try {
+ FinderUtils.buildTreePathForIrodsAbsolutePath(
+ irodsFinderTree, entry.getFormattedAbsolutePath());
+
+ } catch (IdropException ex) {
+ Logger.getLogger(IRODSOutlineModel.class.getName()).log(
+ Level.SEVERE, null, ex);
+ throw new IdropRuntimeException(ex);
+ }
+
+ treeModel.removeNodeFromParent(deletedNode);
+
+ }
+ });
+ }
+
+
+ public void notifyFileShouldBeAdded(final IRODSTree irodsTree,
+ final String irodsFileAbsolutePath) {
+ log.info("notifyFileShouldBeAdded() for node:{}", irodsFileAbsolutePath);
+
+ java.awt.EventQueue.invokeLater(new Runnable() {
+
+ @Override
+ public void run() {
+
+ IRODSFileFactory irodsFileFactory = idropCore.getIRODSFileFactoryForLoggedInAccount();
+ try {
+ try {
+ // if the node already exists (e.g. an overwrite, don'
+ // add it
+
+ TreePath currentPath = TreeUtils.buildTreePathForIrodsAbsolutePath(irodsTree,
+ irodsFileAbsolutePath);
+ // build treePath will return parent if child not found
+ if (currentPath == null) {
+ log.warn(
+ "null tree path found for:{} logged and ignored as a warning",
+ irodsFileAbsolutePath);
+ return;
+ }
+ IRODSNode irodsNode = (IRODSNode) currentPath.getLastPathComponent();
+ CollectionAndDataObjectListingEntry lastPathNodeEntry = (CollectionAndDataObjectListingEntry) irodsNode.getUserObject();
+ if (irodsFileAbsolutePath.equals(lastPathNodeEntry.getFormattedAbsolutePath())) {
+ log.info("path already exists, do not double-add");
+ return;
+ }
+
+ } catch (IdropException ex) {
+ Logger.getLogger(IRODSOutlineModel.class.getName()).log(Level.SEVERE, null, ex);
+ throw new IdropRuntimeException(ex);
+ }
+
+ IRODSFile addedFile = irodsFileFactory.instanceIRODSFile(irodsFileAbsolutePath);
+ if (!addedFile.exists()) {
+ log.info(
+ "looking for file that was added, I don't find it, so just move on: {}",
+ irodsFileAbsolutePath);
+ return;
+ }
+ TreePath parentPath;
+ try {
+ parentPath = TreeUtils.buildTreePathForIrodsAbsolutePath(irodsTree,
+ addedFile.getParent());
+ } catch (IdropException ex) {
+ Logger.getLogger(IRODSOutlineModel.class.getName()).log(Level.SEVERE, null, ex);
+ throw new IdropRuntimeException(ex);
+ }
+
+ if (parentPath == null) {
+ log.info("null path for lookup, just move on");
+ return;
+ }
+ log.info("building a new node");
+ CollectionAndDataObjectListingEntry newEntry = new CollectionAndDataObjectListingEntry();
+ newEntry.setCreatedAt(new Date(addedFile.lastModified()));
+ newEntry.setDataSize(addedFile.length());
+ newEntry.setModifiedAt(new Date(addedFile.lastModified()));
+
+ if (addedFile.isDirectory()) {
+ newEntry.setObjectType(CollectionAndDataObjectListingEntry.ObjectType.COLLECTION);
+ newEntry.setParentPath(addedFile.getParent());
+ newEntry.setPathOrName(addedFile.getAbsolutePath());
+ } else {
+ newEntry.setObjectType(CollectionAndDataObjectListingEntry.ObjectType.DATA_OBJECT);
+ newEntry.setParentPath(addedFile.getParent());
+ newEntry.setPathOrName(addedFile.getName());
+ }
+
+ IRODSNode newNode = new IRODSNode(newEntry, idropCore.getIrodsAccount(), idropCore.getIrodsFileSystem(), irodsTree);
+ ((IRODSNode) parentPath.getLastPathComponent()).add(newNode);
+ irodsTree.highlightPath(parentPath);
+ } catch (JargonException ex) {
+ Logger.getLogger(IRODSOutlineModel.class.getName()).log(
+ Level.SEVERE, null, ex);
+ } finally {
+ idropCore.closeIRODSConnectionForLoggedInAccount();
+ }
+ }
+ });
+ }
+
+}
+
diff --git a/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/finder/IRODSFinderTree.java b/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/finder/IRODSFinderTree.java
new file mode 100644
index 0000000..85a1621
--- /dev/null
+++ b/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/finder/IRODSFinderTree.java
@@ -0,0 +1,312 @@
+package org.irods.jargon.idrop.lite.finder;
+
+import java.awt.Cursor;
+import java.awt.event.ActionEvent;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import javax.swing.AbstractAction;
+import javax.swing.Action;
+import javax.swing.JOptionPane;
+import javax.swing.JPopupMenu;
+import javax.swing.event.TreeExpansionEvent;
+import javax.swing.event.TreeExpansionListener;
+import javax.swing.event.TreeWillExpandListener;
+import javax.swing.tree.ExpandVetoException;
+import javax.swing.tree.TreeModel;
+import javax.swing.tree.TreePath;
+
+import org.irods.jargon.core.query.CollectionAndDataObjectListingEntry;
+import org.irods.jargon.idrop.lite.DeleteIRODSDialog;
+import org.irods.jargon.idrop.lite.NewIRODSDirectoryDialog;
+import org.irods.jargon.idrop.lite.RenameIRODSDirectoryDialog;
+import org.irods.jargon.idrop.lite.iDropLiteApplet;
+import org.irods.jargon.idrop.lite.IRODSNode;
+import org.irods.jargon.idrop.lite.IRODSRowModel;
+import org.irods.jargon.idrop.lite.IdropException;
+import org.irods.jargon.idrop.lite.IdropRuntimeException;
+import org.netbeans.swing.outline.DefaultOutlineModel;
+import org.netbeans.swing.outline.Outline;
+import org.netbeans.swing.outline.OutlineModel;
+import org.netbeans.swing.outline.TreePathSupport;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Swing JTree component for viewing iRODS server file system
+ *
+ * @author Mike Conway - DICE (www.irods.org)
+ */
+public class IRODSFinderTree extends Outline implements TreeWillExpandListener,
+ TreeExpansionListener, IRODSTreeContainingComponent {
+
+ public IRODSFinderDialog irodsFinderDialog = null;
+ public static org.slf4j.Logger log = LoggerFactory.getLogger(IRODSFinderTree.class);
+ protected JPopupMenu m_popup = null;
+ protected Action m_action;
+ protected TreePath m_clickedPath;
+ protected IRODSFinderTree thisTree;
+ private boolean refreshingTree = false;
+ TreePathSupport tps;
+
+ public boolean isRefreshingTree() {
+ synchronized (this) {
+ return refreshingTree;
+ }
+ }
+
+ public void setRefreshingTree(final boolean refreshingTree) {
+ synchronized (this) {
+ this.refreshingTree = refreshingTree;
+ }
+ }
+
+ public IRODSFinderTree(final TreeModel newModel,final IRODSFinderDialog irodsFinderDialog) {
+ super();
+
+ OutlineModel mdl = DefaultOutlineModel.createOutlineModel(newModel,
+ new IRODSRowModel(), true, "File System");
+ this.irodsFinderDialog = irodsFinderDialog;
+ tps = new TreePathSupport(mdl, this.getLayoutCache());
+
+ tps.addTreeExpansionListener(this);
+ tps.addTreeWillExpandListener(this);
+ initializeMenusAndListeners();
+ }
+
+ public IRODSFinderTree() {
+ super();
+ }
+
+ public IRODSFinderTree(final IRODSFinderDialog irodsFinderDialog) {
+ super();
+ this.irodsFinderDialog = irodsFinderDialog;
+ initializeMenusAndListeners();
+ }
+
+ private void initializeMenusAndListeners() {
+ setDragEnabled(false);
+ setUpTreeMenu();
+ }
+
+ /**
+ * Set up context sensitive tree menu
+ */
+ private void setUpTreeMenu() {
+ thisTree = this;
+
+ m_popup = new JPopupMenu();
+ m_action = new AbstractAction() {
+
+ @Override
+ public void actionPerformed(final ActionEvent e) {
+ if (m_clickedPath == null) {
+ return;
+ }
+
+ if (thisTree.isExpanded(m_clickedPath)) {
+ thisTree.collapsePath(m_clickedPath);
+ } else {
+ thisTree.expandPath(m_clickedPath);
+ }
+ }
+ };
+
+ m_popup.add(m_action);
+
+ Action newAction = new AbstractAction("New Folder") {
+
+ @Override
+ public void actionPerformed(final ActionEvent e) {
+
+ log.info("adding new node");
+
+ IRODSNode parent = (IRODSNode) m_clickedPath.getLastPathComponent();
+ log.info("parent of new node is: {}", parent);
+ CollectionAndDataObjectListingEntry dataEntry = (CollectionAndDataObjectListingEntry) parent.getUserObject();
+ if (dataEntry.getObjectType() == CollectionAndDataObjectListingEntry.ObjectType.DATA_OBJECT) {
+ JOptionPane.showMessageDialog(
+ thisTree,
+ "The selected item is not a folder, cannot create a new directory",
+ "Info", JOptionPane.INFORMATION_MESSAGE);
+ log.info("new folder not created, the selected parent is not a collection");
+ return;
+ }
+ // show a dialog asking for the new directory name...
+
+ FinderNewIRODSDirectoryDialog newDirectoryDialog = new FinderNewIRODSDirectoryDialog(
+ irodsFinderDialog, true, dataEntry.getPathOrName(),
+ thisTree, parent);
+ newDirectoryDialog.setLocation(
+ (int) (irodsFinderDialog.getLocation().getX() + irodsFinderDialog.getWidth() / 2), (int) (irodsFinderDialog.getLocation().getY() + irodsFinderDialog.getHeight() / 2));
+ newDirectoryDialog.setVisible(true);
+
+ }
+ };
+ m_popup.add(newAction);
+
+ m_popup.addSeparator();
+
+ Action a1 = new AbstractAction("Delete") {
+
+ @Override
+ public void actionPerformed(final ActionEvent e) {
+ log.info("deleting a node");
+ int[] rows = thisTree.getSelectedRows();
+ log.debug("selected rows for delete:{}", rows);
+
+
+ FinderDeleteIRODSDialog deleteDialog;
+
+ if (rows.length == 1) {
+
+ IRODSNode toDelete = (IRODSNode) thisTree.getValueAt(
+ rows[0], 0);
+ log.info("deleting a single node: {}", toDelete);
+
+ deleteDialog = new FinderDeleteIRODSDialog(irodsFinderDialog, true,
+ thisTree, toDelete);
+ } else {
+ List<IRODSNode> nodesToDelete = new ArrayList<IRODSNode>();
+ for (int row : rows) {
+ nodesToDelete.add((IRODSNode) thisTree.getValueAt(row,
+ 0));
+
+ }
+
+ deleteDialog = new FinderDeleteIRODSDialog(irodsFinderDialog, true,
+ thisTree, nodesToDelete);
+ }
+
+ deleteDialog.setLocation(
+ (int) (irodsFinderDialog.getLocation().getX() + irodsFinderDialog.getWidth() / 2), (int) (irodsFinderDialog.getLocation().getY() + irodsFinderDialog.getHeight() / 2));
+ deleteDialog.setVisible(true);
+
+ }
+ };
+
+ m_popup.add(a1);
+ Action a2 = new AbstractAction("Rename") {
+
+ @Override
+ public void actionPerformed(final ActionEvent e) {
+ log.info("renaming node");
+
+ IRODSNode toRename = (IRODSNode) m_clickedPath.getLastPathComponent();
+ log.info("node to rename is: {}", toRename);
+ CollectionAndDataObjectListingEntry dataEntry = (CollectionAndDataObjectListingEntry) toRename.getUserObject();
+
+ // dialog uses absolute path, so munge it for files
+ StringBuilder sb = new StringBuilder();
+ if (dataEntry.getObjectType() == CollectionAndDataObjectListingEntry.ObjectType.COLLECTION) {
+ sb.append(dataEntry.getPathOrName());
+ } else {
+ sb.append(dataEntry.getParentPath());
+ sb.append('/');
+ sb.append(dataEntry.getPathOrName());
+ }
+
+ // show a dialog asking for the new directory name...
+ FinderRenameIRODSDirectoryDialog renameDialog = new FinderRenameIRODSDirectoryDialog(
+ irodsFinderDialog, true, sb.toString(), thisTree, toRename);
+ renameDialog.setLocation(
+ (int) (irodsFinderDialog.getLocation().getX() + irodsFinderDialog.getWidth() / 2), (int) (irodsFinderDialog.getLocation().getY() + irodsFinderDialog.getHeight() / 2));
+ renameDialog.setVisible(true);
+ }
+ };
+ m_popup.add(a2);
+ thisTree.add(m_popup);
+ thisTree.addMouseListener(new PopupTrigger());
+
+ }
+
+ @Override
+ public void treeExpanded(final TreeExpansionEvent event) {
+ }
+
+ @Override
+ public void treeCollapsed(final TreeExpansionEvent event) {
+ }
+
+ class PopupTrigger extends MouseAdapter {
+
+ @Override
+ public void mouseReleased(final MouseEvent e) {
+ if (e.isPopupTrigger()) {
+ int x = e.getX();
+ int y = e.getY();
+
+ TreePath path = thisTree.getClosestPathForLocation(x, y);
+ if (path != null) {
+ if (thisTree.isExpanded(path)) {
+ m_action.putValue(Action.NAME, "Collapse");
+ } else {
+ m_action.putValue(Action.NAME, "Expand");
+ }
+ m_popup.show(thisTree, x, y);
+ m_clickedPath = path;
+ }
+ }
+ }
+
+ @Override
+ public void mousePressed(final MouseEvent e) {
+ if (e.isPopupTrigger()) {
+ int x = e.getX();
+ int y = e.getY();
+ TreePath path = thisTree.getClosestPathForLocation(x, y);
+ if (path != null) {
+ if (thisTree.isExpanded(path)) {
+ m_action.putValue(Action.NAME, "Collapse");
+ } else {
+ m_action.putValue(Action.NAME, "Expand");
+ }
+ m_popup.show(thisTree, x, y);
+ m_clickedPath = path;
+ }
+ }
+ }
+ }
+
+ @Override
+ public void treeWillCollapse(final TreeExpansionEvent event)
+ throws ExpandVetoException {
+ }
+
+ @Override
+ public void treeWillExpand(final TreeExpansionEvent event)
+ throws ExpandVetoException {
+ setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
+ log.debug("tree expansion event:{}", event);
+ IRODSNode expandingNode = (IRODSNode) event.getPath().getLastPathComponent();
+ // If I am refreshing the tree, then do not close the connection after
+ // each load. It will be closed in the thing
+ // doing the refreshing
+ try {
+ expandingNode.lazyLoadOfChildrenOfThisNode(!isRefreshingTree());
+ } catch (IdropException ex) {
+ Logger.getLogger(IRODSFinderTree.class.getName()).log(Level.SEVERE, null,
+ ex);
+ throw new IdropRuntimeException("error expanding irodsNode");
+ } finally {
+ setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
+ }
+ }
+
+ public void highlightPath(final TreePath pathToHighlight) {
+ final IRODSFinderTree highlightTree = this;
+ java.awt.EventQueue.invokeLater(new Runnable() {
+
+ @Override
+ public void run() {
+ highlightTree.collapsePath(pathToHighlight);
+ highlightTree.expandPath(pathToHighlight);
+ // highlightTree.sc
+ // highlightTree.scrollPathToVisible(pathToHighlight);
+ }
+ });
+ }
+}
diff --git a/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/finder/IRODSTreeContainingComponent.java b/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/finder/IRODSTreeContainingComponent.java
new file mode 100644
index 0000000..f2bcadc
--- /dev/null
+++ b/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/finder/IRODSTreeContainingComponent.java
@@ -0,0 +1,23 @@
+package org.irods.jargon.idrop.lite.finder;
+
+import java.awt.Cursor;
+
+/**
+ *
+ * @author mikeconway
+ */
+public interface IRODSTreeContainingComponent {
+
+ /**
+ * Indicates a refresh action, this causes connections to be held open across node refreshes
+ * @return
+ */
+ boolean isRefreshingTree();
+
+ /**
+ * allows proper setting of cursor for tree node operations
+ * @param cursor
+ */
+ void setCursor(Cursor cursor);
+
+}
diff --git a/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/finder/IrodsSelectionListenerForBuildingInfoPanel.java b/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/finder/IrodsSelectionListenerForBuildingInfoPanel.java
new file mode 100644
index 0000000..3dbe017
--- /dev/null
+++ b/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/finder/IrodsSelectionListenerForBuildingInfoPanel.java
@@ -0,0 +1,59 @@
+package org.irods.jargon.idrop.lite.finder;
+
+import javax.swing.event.ListSelectionEvent;
+import javax.swing.event.ListSelectionListener;
+import javax.swing.event.TreeExpansionEvent;
+
+
+import org.irods.jargon.idrop.lite.iDropLiteApplet;
+import org.irods.jargon.idrop.lite.IdropException;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Class to encapsulate handling of info panel. This object will listen to tree
+ * selection events in the iDROP iRODS tree, and initialize the info panel.
+ *
+ *
+ *
+ * @author Mike Conway - DICE (www.irods.org)
+ */
+public class IrodsSelectionListenerForBuildingInfoPanel implements
+ ListSelectionListener {
+
+ public static org.slf4j.Logger log = LoggerFactory.getLogger(IrodsSelectionListenerForBuildingInfoPanel.class);
+ public IrodsSelectionListenerForBuildingInfoPanel(final iDropLiteApplet idrop)
+ throws IdropException {
+ if (idrop == null) {
+ throw new IdropException("null iDrop");
+ }
+
+ }
+
+ public void treeExpanded(final TreeExpansionEvent event) {
+ /*
+ * TreePath expandedTreePath = event.getPath(); IRODSNode expandedNode =
+ * (IRODSNode) expandedTreePath.getLastPathComponent(); try {
+ * identifyNodeTypeAndInitializeInfoPanel(expandedNode); } catch
+ * (IdropException ex) {
+ * Logger.getLogger(IrodsTreeListenerForBuildingInfoPanel
+ * .class.getName()).log(Level.SEVERE, null, ex); throw new
+ * IdropRuntimeException
+ * ("exception processing treeExpanded() event for IRODSNode selection"
+ * ); }
+ */
+ }
+
+ public void treeCollapsed(final TreeExpansionEvent event) {
+ // operation not needed, left for interface contract
+ }
+
+
+ @Override
+ public void valueChanged(final ListSelectionEvent lse) {
+ if (lse.getValueIsAdjusting()) {
+ return;
+ }
+ log.info("lse: {}", lse);
+ //idrop.triggerInfoPanelUpdate();
+ }
+}
diff --git a/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/finder/MessageManager.java b/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/finder/MessageManager.java
new file mode 100644
index 0000000..41abcef
--- /dev/null
+++ b/idrop-lite/src/main/java/org/irods/jargon/idrop/lite/finder/MessageManager.java
@@ -0,0 +1,33 @@
+package org.irods.jargon.idrop.lite.finder;
+
+import java.awt.Component;
+
+import javax.swing.JOptionPane;
+
+/**
+ *
+ * @author jdr0887
+ *
+ */
+public class MessageManager {
+
+ public static final String TITLE_MESSAGE = "iDrop Message";
+
+ public static void showError(final Component rootComponent,
+ final String message, final String title) {
+ JOptionPane.showMessageDialog(rootComponent, message, title,
+ JOptionPane.ERROR_MESSAGE);
+ }
+
+ public static void showWarning(final Component rootComponent,
+ final String message, final String title) {
+ JOptionPane.showMessageDialog(rootComponent, message, title,
+ JOptionPane.WARNING_MESSAGE);
+ }
+
+ public static void showMessage(final Component rootComponent,
+ final String message, final String title) {
+ JOptionPane.showMessageDialog(rootComponent, message, title,
+ JOptionPane.INFORMATION_MESSAGE);
+ }
+}
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 41e46a6..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
@@ -1,248 +1,920 @@
<?xml version="1.1" encoding="UTF-8" ?>
-<Form version="1.3" maxVersion="1.7" type="org.netbeans.modules.form.forminfo.JAppletFormInfo">
+<Form version="1.5" maxVersion="1.7" type="org.netbeans.modules.form.forminfo.JAppletFormInfo">
<Properties>
+ <Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
+ <Dimension value="[250, 200]"/>
+ </Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
- <Dimension value="[600, 400]"/>
+ <Dimension value="[700, 450]"/>
</Property>
</Properties>
<AuxValues>
- <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
+ <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="1"/>
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
<AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
- <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
+ <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="true"/>
<AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="2"/>
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
+ <AuxValue name="designerSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,1,-62,0,0,2,-68"/>
</AuxValues>
- <Layout>
- <DimensionLayout dim="0">
- <Group type="103" groupAlignment="0" attributes="0">
- <Component id="pnlMain" alignment="0" max="32767" attributes="0"/>
- </Group>
- </DimensionLayout>
- <DimensionLayout dim="1">
- <Group type="103" groupAlignment="0" attributes="0">
- <Component id="pnlMain" alignment="0" max="32767" attributes="0"/>
- </Group>
- </DimensionLayout>
- </Layout>
+ <Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>
<SubComponents>
- <Container class="javax.swing.JPanel" name="pnlMain">
+ <Container class="javax.swing.JTabbedPane" name="pnlTabbedMain">
<Properties>
- <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
- <Border info="org.netbeans.modules.form.compat2.border.EtchedBorderInfo">
- <EtchetBorder/>
- </Border>
- </Property>
+ <Property name="tabPlacement" type="int" value="4"/>
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
- <Dimension value="[200, 200]"/>
+ <Dimension value="[250, 200]"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
- <Dimension value="[600, 400]"/>
+ <Dimension value="[700, 450]"/>
</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="Center"/>
+ </Constraint>
+ </Constraints>
- <Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>
+ <Layout class="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout"/>
<SubComponents>
- <Container class="javax.swing.JPanel" name="pnlTools">
+ <Container class="javax.swing.JPanel" name="pnlMain">
<Properties>
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
- <Border info="org.netbeans.modules.form.compat2.border.BevelBorderInfo">
- <BevelBorder/>
+ <Border info="org.netbeans.modules.form.compat2.border.EtchedBorderInfo">
+ <EtchetBorder/>
</Border>
</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>
- <DimensionLayout dim="0">
- <Group type="103" groupAlignment="0" attributes="0">
- <EmptySpace min="0" pref="592" max="32767" attributes="0"/>
- </Group>
- </DimensionLayout>
- <DimensionLayout dim="1">
- <Group type="103" groupAlignment="0" attributes="0">
- <EmptySpace min="0" pref="0" max="32767" attributes="0"/>
- </Group>
- </DimensionLayout>
- </Layout>
- </Container>
- <Container class="javax.swing.JTabbedPane" name="tabIrodsViews">
- <Properties>
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
- <Dimension value="[300, 300]"/>
+ <Dimension value="[250, 200]"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
- <Dimension value="[600, 400]"/>
+ <Dimension value="[700, 450]"/>
</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="Center"/>
+ <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout$JTabbedPaneConstraintsDescription">
+ <JTabbedPaneConstraints tabName="Main">
+ <Property name="tabTitle" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
+ <ResourceString bundle="org/irods/jargon/idrop/lite/Bundle.properties" key="iDropLiteApplet.pnlMain.TabConstraints.tabTitle" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
+ </Property>
+ </JTabbedPaneConstraints>
</Constraint>
</Constraints>
- <Layout class="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout"/>
+ <Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>
<SubComponents>
- <Container class="javax.swing.JPanel" name="pnlIrodsTreeView">
+ <Container class="javax.swing.JPanel" name="pnlMainToolBar">
+ <Properties>
+ <Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
+ <Dimension value="[250, 30]"/>
+ </Property>
+ <Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
+ <Dimension value="[700, 40]"/>
+ </Property>
+ </Properties>
<Constraints>
- <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout$JTabbedPaneConstraintsDescription">
- <JTabbedPaneConstraints tabName="iRODS Tree View">
- <Property name="tabTitle" type="java.lang.String" value="iRODS Tree View"/>
- </JTabbedPaneConstraints>
+ <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="pnlIrodsTreeToolbar">
+ <Container class="javax.swing.JPanel" name="pnlToolBarSizer">
+ <Properties>
+ <Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
+ <Dimension value="[632, 50]"/>
+ </Property>
+ <Property name="size" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
+ <Dimension value="[100, 50]"/>
+ </Property>
+ </Properties>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
- <BorderConstraints direction="North"/>
+ <BorderConstraints direction="Center"/>
</Constraint>
</Constraints>
- <Layout class="org.netbeans.modules.form.compat2.layouts.DesignFlowLayout"/>
+ <Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>
<SubComponents>
- <Component class="javax.swing.JButton" name="bntRefreshIrodsTree">
+ <Container class="javax.swing.JPanel" name="pnlLocalToggleSizer">
<Properties>
- <Property name="horizontalTextPosition" type="int" value="0"/>
- <Property name="label" type="java.lang.String" value="Refresh"/>
+ <Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
+ <Dimension value="[150, 50]"/>
+ </Property>
</Properties>
- </Component>
+ <Constraints>
+ <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
+ <BorderConstraints direction="West"/>
+ </Constraint>
+ </Constraints>
+
+ <Layout>
+ <DimensionLayout dim="0">
+ <Group type="103" groupAlignment="0" attributes="0">
+ <Group type="102" alignment="0" attributes="0">
+ <EmptySpace max="-2" attributes="0"/>
+ <Component id="btnToggleLocalView" min="-2" max="-2" attributes="0"/>
+ <EmptySpace max="32767" attributes="0"/>
+ </Group>
+ </Group>
+ </DimensionLayout>
+ <DimensionLayout dim="1">
+ <Group type="103" groupAlignment="0" attributes="0">
+ <Group type="102" alignment="0" attributes="0">
+ <Component id="btnToggleLocalView" min="-2" max="-2" attributes="0"/>
+ <EmptySpace pref="11" max="32767" attributes="0"/>
+ </Group>
+ </Group>
+ </DimensionLayout>
+ </Layout>
+ <SubComponents>
+ <Component class="javax.swing.JToggleButton" name="btnToggleLocalView">
+ <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.btnToggleLocalView.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="btnToggleLocalViewActionPerformed"/>
+ </Events>
+ </Component>
+ </SubComponents>
+ </Container>
+ <Container class="javax.swing.JPanel" name="pnlSearchSizer">
+ <Properties>
+ <Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
+ <Dimension value="[300, 50]"/>
+ </Property>
+ </Properties>
+ <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>
+ <DimensionLayout dim="0">
+ <Group type="103" groupAlignment="0" attributes="0">
+ <EmptySpace min="0" pref="350" max="32767" attributes="0"/>
+ </Group>
+ </DimensionLayout>
+ <DimensionLayout dim="1">
+ <Group type="103" groupAlignment="0" attributes="0">
+ <EmptySpace min="0" pref="40" max="32767" attributes="0"/>
+ </Group>
+ </DimensionLayout>
+ </Layout>
+ </Container>
+ <Container class="javax.swing.JPanel" name="pnlPlaceholder">
+ <Properties>
+ <Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
+ <Dimension value="[150, 50]"/>
+ </Property>
+ </Properties>
+ <Constraints>
+ <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
+ <BorderConstraints direction="East"/>
+ </Constraint>
+ </Constraints>
+
+ <Layout>
+ <DimensionLayout dim="0">
+ <Group type="103" groupAlignment="0" attributes="0">
+ <EmptySpace min="0" pref="150" max="32767" attributes="0"/>
+ </Group>
+ </DimensionLayout>
+ <DimensionLayout dim="1">
+ <Group type="103" groupAlignment="0" attributes="0">
+ <EmptySpace min="0" pref="40" max="32767" attributes="0"/>
+ </Group>
+ </DimensionLayout>
+ </Layout>
+ </Container>
</SubComponents>
</Container>
- <Container class="javax.swing.JPanel" name="pnlTreeMaster">
- <Constraints>
- <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
- <BorderConstraints direction="South"/>
- </Constraint>
- </Constraints>
+ </SubComponents>
+ </Container>
+ <Container class="javax.swing.JPanel" name="pnlMainTrees">
+ <Properties>
+ <Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
+ <Dimension value="[250, 150]"/>
+ </Property>
+ <Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
+ <Dimension value="[700, 375]"/>
+ </Property>
+ </Properties>
+ <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.DesignBorderLayout"/>
- </Container>
- <Container class="javax.swing.JScrollPane" name="scrollIrodsTree">
- <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.DesignBoxLayout"/>
+ <SubComponents>
+ <Container class="javax.swing.JSplitPane" name="pnlSplitPaneLocalRemote">
+ <Properties>
+ <Property name="dividerLocation" type="int" value="300"/>
+ <Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
+ <Dimension value="[250, 150]"/>
+ </Property>
+ <Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
+ <Dimension value="[700, 375]"/>
+ </Property>
+ </Properties>
- <Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
+ <Layout class="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout"/>
+ <SubComponents>
+ <Container class="javax.swing.JPanel" name="pnlLocalTree">
+ <Properties>
+ <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
+ <Border info="org.netbeans.modules.form.compat2.border.SoftBevelBorderInfo">
+ <BevelBorder/>
+ </Border>
+ </Property>
+ <Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
+ <Dimension value="[0, 62]"/>
+ </Property>
+ </Properties>
+ <Constraints>
+ <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout$JSplitPaneConstraintsDescription">
+ <JSplitPaneConstraints position="left"/>
+ </Constraint>
+ </Constraints>
+
+ <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"/>
+ </Constraint>
+ </Constraints>
+
+ <Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>
+ <SubComponents>
+ <Container class="javax.swing.JPanel" name="pnlLocalRefreshButton">
+ <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="btnLocalRefresh">
+ <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.btnLocalRefresh.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
+ </Property>
+ </Properties>
+ </Component>
+ </SubComponents>
+ </Container>
+ <Container class="javax.swing.JScrollPane" name="scrollLocalDrives">
+ <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="pnlDrivesFiller">
+ <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="292" max="32767" attributes="0"/>
+ </Group>
+ </DimensionLayout>
+ <DimensionLayout dim="1">
+ <Group type="103" groupAlignment="0" attributes="0">
+ <EmptySpace min="0" pref="0" max="32767" attributes="0"/>
+ </Group>
+ </DimensionLayout>
+ </Layout>
+ </Container>
+ </SubComponents>
+ </Container>
+ <Container class="javax.swing.JScrollPane" name="scrollLocalFileTree">
+ <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>
+ </SubComponents>
+ </Container>
+ <Container class="javax.swing.JPanel" name="pnlIrodsTree">
+ <Properties>
+ <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
+ <Border info="org.netbeans.modules.form.compat2.border.SoftBevelBorderInfo">
+ <BevelBorder/>
+ </Border>
+ </Property>
+ </Properties>
+ <Constraints>
+ <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout$JSplitPaneConstraintsDescription">
+ <JSplitPaneConstraints position="right"/>
+ </Constraint>
+ </Constraints>
+
+ <Layout>
+ <DimensionLayout dim="0">
+ <Group type="103" groupAlignment="0" attributes="0">
+ <Component id="tabIrodsViews" alignment="0" pref="333" max="32767" attributes="0"/>
+ </Group>
+ </DimensionLayout>
+ <DimensionLayout dim="1">
+ <Group type="103" groupAlignment="0" attributes="0">
+ <Component id="tabIrodsViews" alignment="0" pref="341" max="32767" attributes="0"/>
+ </Group>
+ </DimensionLayout>
+ </Layout>
+ <SubComponents>
+ <Container class="javax.swing.JTabbedPane" name="tabIrodsViews">
+
+ <Layout class="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout"/>
+ <SubComponents>
+ <Container class="javax.swing.JPanel" name="pnlIrodsTreeView">
+ <Constraints>
+ <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout$JTabbedPaneConstraintsDescription">
+ <JTabbedPaneConstraints tabName="IRODS Tree View">
+ <Property name="tabTitle" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
+ <ResourceString bundle="org/irods/jargon/idrop/lite/Bundle.properties" key="iDropLiteApplet.pnlIrodsTreeView.TabConstraints.tabTitle" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
+ </Property>
+ </JTabbedPaneConstraints>
+ </Constraint>
+ </Constraints>
+
+ <Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>
+ <SubComponents>
+ <Container class="javax.swing.JPanel" name="pnlIrodsTreeViewButtons">
+ <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="btnIrodsTreeRefresh">
+ <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.btnIrodsTreeRefresh.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="btnIrodsTreeRefreshActionPerformed"/>
+ </Events>
+ </Component>
+ </SubComponents>
+ </Container>
+ <Container class="javax.swing.JScrollPane" name="scrIrodsTreeView">
+ <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>
+ </SubComponents>
+ </Container>
+ <Container class="javax.swing.JPanel" name="pnlIrodsSearch">
+ <Constraints>
+ <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout$JTabbedPaneConstraintsDescription">
+ <JTabbedPaneConstraints tabName="Search">
+ <Property name="tabTitle" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
+ <ResourceString bundle="org/irods/jargon/idrop/lite/Bundle.properties" key="iDropLiteApplet.pnlIrodsSearch.TabConstraints.tabTitle" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
+ </Property>
+ </JTabbedPaneConstraints>
+ </Constraint>
+ </Constraints>
+
+ <Layout>
+ <DimensionLayout dim="0">
+ <Group type="103" groupAlignment="0" attributes="0">
+ <Group type="102" alignment="0" attributes="0">
+ <EmptySpace min="-2" pref="83" max="-2" attributes="0"/>
+ <Component id="jLabel1" min="-2" max="-2" attributes="0"/>
+ <EmptySpace pref="141" max="32767" attributes="0"/>
+ </Group>
+ </Group>
+ </DimensionLayout>
+ <DimensionLayout dim="1">
+ <Group type="103" groupAlignment="0" attributes="0">
+ <Group type="102" alignment="0" attributes="0">
+ <EmptySpace min="-2" pref="84" max="-2" attributes="0"/>
+ <Component id="jLabel1" min="-2" max="-2" attributes="0"/>
+ <EmptySpace pref="195" max="32767" attributes="0"/>
+ </Group>
+ </Group>
+ </DimensionLayout>
+ </Layout>
+ <SubComponents>
+ <Component class="javax.swing.JLabel" name="jLabel1">
+ <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.jLabel1.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
+ </Property>
+ </Properties>
+ </Component>
+ </SubComponents>
+ </Container>
+ </SubComponents>
+ </Container>
+ </SubComponents>
+ </Container>
+ </SubComponents>
</Container>
</SubComponents>
</Container>
- <Container class="javax.swing.JPanel" name="pnlSearch">
+ <Container class="javax.swing.JPanel" name="pnlMainStatus">
<Properties>
- <Property name="name" type="java.lang.String" value="pnlSearch" noResource="true"/>
+ <Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
+ <Dimension value="[250, 30]"/>
+ </Property>
+ <Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
+ <Dimension value="[700, 34]"/>
+ </Property>
</Properties>
<Constraints>
- <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout$JTabbedPaneConstraintsDescription">
- <JTabbedPaneConstraints tabName="Search">
- <Property name="tabTitle" type="java.lang.String" value="Search"/>
- </JTabbedPaneConstraints>
+ <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="575" max="32767" attributes="0"/>
- </Group>
- </DimensionLayout>
- <DimensionLayout dim="1">
- <Group type="103" groupAlignment="0" attributes="0">
- <EmptySpace min="0" pref="271" max="32767" attributes="0"/>
- </Group>
- </DimensionLayout>
- </Layout>
+ <Layout class="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout"/>
+ <SubComponents>
+ <Component class="javax.swing.JLabel" name="lblTransferFileName">
+ <Properties>
+ <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
+ <Font name="Lucida Grande" size="12" style="0"/>
+ </Property>
+ <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.lblTransferFileName.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
+ </Property>
+ <Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
+ <Dimension value="[100, 16]"/>
+ </Property>
+ <Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
+ <Dimension value="[250, 16]"/>
+ </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"/>
+ </Constraint>
+ </Constraints>
+ </Component>
+ <Component class="javax.swing.JProgressBar" name="pbTransferStatus">
+ <Properties>
+ <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
+ <Border info="org.netbeans.modules.form.compat2.border.BevelBorderInfo">
+ <BevelBorder bevelType="1"/>
+ </Border>
+ </Property>
+ <Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
+ <Dimension value="[100, 24]"/>
+ </Property>
+ <Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
+ <Dimension value="[300, 24]"/>
+ </Property>
+ </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="0" ipadY="0" insetsTop="5" insetsLeft="5" insetsBottom="5" insetsRight="15" anchor="18" weightX="8.0" weightY="0.0"/>
+ </Constraint>
+ </Constraints>
+ </Component>
+ </SubComponents>
</Container>
</SubComponents>
</Container>
- <Container class="javax.swing.JPanel" name="pnlTransferStatus">
+ <Container class="javax.swing.JPanel" name="pnlOperationMode2">
<Properties>
+ <Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
+ <Dimension value="[250, 200]"/>
+ </Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
- <Dimension value="[600, 75]"/>
+ <Dimension value="[700, 450]"/>
</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="Last"/>
+ <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout$JTabbedPaneConstraintsDescription">
+ <JTabbedPaneConstraints tabName="Upload">
+ <Property name="tabTitle" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
+ <ResourceString bundle="org/irods/jargon/idrop/lite/Bundle.properties" key="iDropLiteApplet.pnlOperationMode2.TabConstraints.tabTitle" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
+ </Property>
+ </JTabbedPaneConstraints>
</Constraint>
</Constraints>
- <Layout class="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout"/>
+ <Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>
<SubComponents>
- <Component class="javax.swing.JLabel" name="jLabel1">
+ <Container class="javax.swing.JPanel" name="pnlUploadTrees">
<Properties>
- <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
- <Font name="Lucida Grande" size="12" style="0"/>
+ <Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
+ <Dimension value="[250, 160]"/>
+ </Property>
+ <Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
+ <Dimension value="[700, 385]"/>
</Property>
- <Property name="text" type="java.lang.String" value="Current File:"/>
</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="15" insetsBottom="0" insetsRight="0" anchor="18" weightX="0.0" weightY="0.0"/>
+ <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
+ <BorderConstraints direction="Center"/>
</Constraint>
</Constraints>
- </Component>
- <Component class="javax.swing.JLabel" name="lblTransferFileName">
+
+ <Layout class="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout"/>
+ <SubComponents>
+ <Container class="javax.swing.JPanel" name="pnlUploadLocalTree">
+ <Properties>
+ <Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
+ <Dimension value="[0, 0]"/>
+ </Property>
+ <Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
+ <Dimension value="[285, 380]"/>
+ </Property>
+ </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="1" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="18" weightX="0.4" weightY="0.2"/>
+ </Constraint>
+ </Constraints>
+
+ <Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>
+ <SubComponents>
+ <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"/>
+ </Constraint>
+ </Constraints>
+
+ <Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
+ </Container>
+ </SubComponents>
+ </Container>
+ <Container class="javax.swing.JPanel" name="pnlUploadCenterTools">
+ <Properties>
+ <Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
+ <Dimension value="[65, 32767]"/>
+ </Property>
+ <Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
+ <Dimension value="[30, 100]"/>
+ </Property>
+ <Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
+ <Dimension value="[50, 380]"/>
+ </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="1" gridY="0" gridWidth="1" gridHeight="1" fill="3" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="18" weightX="0.0" weightY="0.2"/>
+ </Constraint>
+ </Constraints>
+
+ <Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>
+ <SubComponents>
+ <Component class="javax.swing.JButton" name="btnUploadMove">
+ <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.btnUploadMove.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
+ </Property>
+ <Property name="margin" type="java.awt.Insets" editor="org.netbeans.beaninfo.editors.InsetsEditor">
+ <Insets value="[0, 0, 0, 0]"/>
+ </Property>
+ </Properties>
+ <Events>
+ <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnUploadMoveActionPerformed"/>
+ </Events>
+ <Constraints>
+ <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
+ <BorderConstraints direction="Center"/>
+ </Constraint>
+ </Constraints>
+ </Component>
+ </SubComponents>
+ </Container>
+ <Container class="javax.swing.JPanel" name="pnlUploadTable">
+ <Properties>
+ <Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
+ <Dimension value="[310, 380]"/>
+ </Property>
+ </Properties>
+ <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="1" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="18" weightX="0.4" weightY="0.2"/>
+ </Constraint>
+ </Constraints>
+
+ <Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>
+ <SubComponents>
+ <Container class="javax.swing.JScrollPane" name="jScrollPane3">
+ <Properties>
+ <Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
+ <Dimension value="[275, 380]"/>
+ </Property>
+ </Properties>
+ <AuxValues>
+ <AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
+ </AuxValues>
+ <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"/>
+ <SubComponents>
+ <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="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>
+ </SubComponents>
+ </Container>
+ </SubComponents>
+ </Container>
+ </SubComponents>
+ </Container>
+ <Container class="javax.swing.JPanel" name="pnlUploadToolbar">
<Properties>
- <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
- <Font name="Lucida Grande" size="10" style="0"/>
- </Property>
<Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
- <Dimension value="[200, 22]"/>
+ <Dimension value="[32767, 60]"/>
</Property>
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
- <Dimension value="[100, 22]"/>
+ <Dimension value="[250, 30]"/>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
- <Dimension value="[200, 22]"/>
+ <Dimension value="[700, 40]"/>
</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="1" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="12" insetsLeft="15" insetsBottom="0" insetsRight="0" anchor="17" weightX="0.0" weightY="0.0"/>
+ <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
+ <BorderConstraints direction="South"/>
</Constraint>
</Constraints>
- </Component>
- <Component class="javax.swing.JProgressBar" name="pbTransferStatus">
- <Properties>
- <Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
- <Font name="Lucida Grande" size="12" style="0"/>
- </Property>
- <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
- <Border info="org.netbeans.modules.form.compat2.border.BevelBorderInfo">
- <BevelBorder bevelType="1"/>
- </Border>
- </Property>
- <Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
- <Dimension value="[100, 24]"/>
- </Property>
- <Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
- <Dimension value="[300, 24]"/>
+
+ <Layout class="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout"/>
+ <SubComponents>
+ <Container class="javax.swing.JPanel" name="pnlUploadToolStatus">
+ <Properties>
+ <Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
+ <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="140.0" weightY="0.0"/>
+ </Constraint>
+ </Constraints>
+
+ <Layout class="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout"/>
+ <SubComponents>
+ <Component class="javax.swing.JLabel" name="lblUploadTransferFileName">
+ <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.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="[4000, 18]"/>
+ </Property>
+ <Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
+ <Dimension value="[100, 18]"/>
+ </Property>
+ <Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
+ <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="2" ipadX="0" ipadY="0" insetsTop="10" insetsLeft="10" insetsBottom="5" insetsRight="5" anchor="18" weightX="4.0" weightY="0.0"/>
+ </Constraint>
+ </Constraints>
+ </Component>
+ <Component class="javax.swing.JProgressBar" name="pbUploadTransferStatus">
+ <Properties>
+ <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
+ <Border info="org.netbeans.modules.form.compat2.border.BevelBorderInfo">
+ <BevelBorder bevelType="1"/>
+ </Border>
+ </Property>
+ </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="6.0" weightY="0.0"/>
+ </Constraint>
+ </Constraints>
+ </Component>
+ </SubComponents>
+ </Container>
+ <Component class="javax.swing.JButton" name="btnUploadBeginImport">
+ <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.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"/>
+ </Constraint>
+ </Constraints>
+ </Component>
+ <Component class="javax.swing.JButton" name="btnUploadCancel">
+ <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.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"/>
+ </Constraint>
+ </Constraints>
+ </Component>
+ </SubComponents>
+ </Container>
+ </SubComponents>
+ </Container>
+ <Container class="javax.swing.JPanel" name="pnlOperationMode3">
+ <Properties>
+ <Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
+ <Dimension value="[250, 200]"/>
+ </Property>
+ <Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
+ <Dimension value="[700, 450]"/>
+ </Property>
+ </Properties>
+ <Constraints>
+ <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout$JTabbedPaneConstraintsDescription">
+ <JTabbedPaneConstraints tabName="Progress">
+ <Property name="tabTitle" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
+ <ResourceString bundle="org/irods/jargon/idrop/lite/Bundle.properties" key="iDropLiteApplet.pnlOperationMode3.TabConstraints.tabTitle" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property>
- <Property name="stringPainted" type="boolean" value="true"/>
- </Properties>
+ </JTabbedPaneConstraints>
+ </Constraint>
+ </Constraints>
+
+ <Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>
+ <SubComponents>
+ <Container class="javax.swing.JPanel" name="pnlProgressTable">
<Constraints>
- <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
- <GridBagConstraints gridX="2" gridY="1" gridWidth="1" gridHeight="2" fill="2" ipadX="0" ipadY="0" insetsTop="10" insetsLeft="10" insetsBottom="0" insetsRight="15" anchor="18" weightX="40.0" weightY="0.0"/>
+ <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
+ <BorderConstraints direction="Center"/>
</Constraint>
</Constraints>
- </Component>
+
+ <Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>
+ <SubComponents>
+ <Container class="javax.swing.JScrollPane" name="jScrollPane4">
+ <AuxValues>
+ <AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
+ </AuxValues>
+ <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"/>
+ <SubComponents>
+ <Component class="javax.swing.JTable" name="tblProgress">
+ <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>
+ </Property>
+ <Property name="showGrid" type="boolean" value="true"/>
+ </Properties>
+ </Component>
+ </SubComponents>
+ </Container>
+ </SubComponents>
+ </Container>
</SubComponents>
</Container>
</SubComponents>
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 29c5922..99b091f 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
@@ -4,32 +4,33 @@
*/
/*
- * iDropLiteApplet.java
+ * NewJApplet.java
*
- * Created on Jun 7, 2011, 4:10:11 PM
+ * Created on Jul 13, 2011, 11:52:59 AM
*/
package org.irods.jargon.idrop.lite;
import java.awt.Rectangle;
-import java.awt.dnd.DnDConstants;
import java.awt.dnd.DropTarget;
-import java.awt.dnd.DropTargetDragEvent;
-import java.awt.dnd.DropTargetDropEvent;
-import java.awt.dnd.DropTargetEvent;
-import java.awt.dnd.DropTargetListener;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
import java.util.logging.Level;
-import javax.swing.JOptionPane;
import java.util.logging.Logger;
-import javax.swing.JToggleButton;
+
+import javax.swing.DefaultListModel;
+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 javax.swing.tree.TreeSelectionModel;
import org.irods.jargon.core.pub.domain.DataObject;
import org.irods.jargon.core.pub.domain.Collection;
import org.irods.jargon.core.query.CollectionAndDataObjectListingEntry;
+import org.irods.jargon.core.transfer.TransferControlBlock;
import org.irods.jargon.core.transfer.TransferStatus;
import org.irods.jargon.core.connection.IRODSAccount;
import org.irods.jargon.core.exception.JargonException;
@@ -37,6 +38,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;
@@ -46,13 +48,14 @@ import org.slf4j.LoggerFactory;
*
* @author lisa
*/
-public class iDropLiteApplet extends javax.swing.JApplet implements DropTargetListener, TransferStatusCallbackListener {
+public class iDropLiteApplet extends javax.swing.JApplet implements TransferStatusCallbackListener {
private static final org.slf4j.Logger log = LoggerFactory.getLogger(iDropLiteApplet.class);
private final Integer defaultLoginMode = -1;
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;
@@ -63,15 +66,17 @@ public class iDropLiteApplet extends javax.swing.JApplet implements DropTargetLi
private String tempPswd;
private String absPath;
IRODSFileSystem irodsFileSystem = null;
+ private LocalFileSystemModel localFileModel = null;
+ private LocalFileSystemModel localUploadFileModel = null;
+ private JList listLocalDrives;
+ private JList listUploadLocalDrives;
- /** Initializes the applet iDropLiteApplet */
+ /** Initializes the applet NewJApplet */
public void init() {
try {
-
java.awt.EventQueue.invokeAndWait(new Runnable() {
public void run() {
-
- getAppletParams();
+ getAppletParams();
if(doStartup()) {
initComponents();
}
@@ -82,7 +87,6 @@ public class iDropLiteApplet extends javax.swing.JApplet implements DropTargetLi
}
}
-
protected void getAppletParams() {
try {
@@ -90,7 +94,7 @@ public class iDropLiteApplet extends javax.swing.JApplet implements DropTargetLi
} catch (Exception ex) {
this.mode = defaultLoginMode;
}
-
+
try {
this.host = getParameter("host");
this.port = Integer.parseInt(getParameter("port"));
@@ -112,13 +116,13 @@ public class iDropLiteApplet extends javax.swing.JApplet implements DropTargetLi
Logger.getLogger(iDropLiteApplet.class.getName()).log(Level.SEVERE, null, ex);
showIdropException(ex);
}
-
+
}
-
+
private boolean retrievePermAccount()
{
String pswd = null;
-
+
DataCacheServiceImpl dataCache = new DataCacheServiceImpl();
try {
dataCache.setIrodsAccessObjectFactory(irodsFileSystem.getIRODSAccessObjectFactory());
@@ -126,7 +130,7 @@ public class iDropLiteApplet extends javax.swing.JApplet implements DropTargetLi
Logger.getLogger(iDropLiteApplet.class.getName()).log(Level.SEVERE, null, e1);
}
dataCache.setIrodsAccount(irodsAccount);
-
+
try {
log.info("sending user name and key user:{}", user);
pswd = dataCache.retrieveStringValueFromCache(user, tempPswd);
@@ -136,14 +140,14 @@ public class iDropLiteApplet extends javax.swing.JApplet implements DropTargetLi
Logger.getLogger(iDropLiteApplet.class.getName()).log(Level.SEVERE, null, e2);
return false;
}
-
+
return true;
}
-
+
private boolean createPermAccount()
{
this.irodsAccount = new IRODSAccount(host, port, user, tempPswd, absPath, zone, defaultStorageResource);
-
+
return true;
}
@@ -153,9 +157,9 @@ public class iDropLiteApplet extends javax.swing.JApplet implements DropTargetLi
// do different logins depending on which mode is used
// 0 - Hard-coded permanent password - just use this password to create and IRODS Account
// 1 - Temporary password supplied - use this password to retrieve permanent password from cache file in cacheServiceTempDir
-
+
switch(this.mode) {
-
+
case 1:
log.info("processLogin: retrieving permanent password...");
if(!retrievePermAccount()) {
@@ -173,10 +177,10 @@ public class iDropLiteApplet extends javax.swing.JApplet implements DropTargetLi
default:
showMessageFromOperation("Unsupported Login Mode");
return false;
-
+
}
-
-
+
+
try {
final UserAO userAO = irodsFileSystem.getIRODSAccessObjectFactory().getUserAO(irodsAccount);
@@ -216,17 +220,17 @@ public class iDropLiteApplet extends javax.swing.JApplet implements DropTargetLi
protected boolean doStartup() {
log.info("initiating startup sequence...");
-
+
log.info("creating irods file system instance...");
try {
irodsFileSystem = IRODSFileSystem.instance();
} catch (JargonException ex) {
Logger.getLogger(iDropLiteApplet.class.getName()).log(Level.SEVERE, null, ex);
}
-
+
log.info("creating temporary irods account...");
this.irodsAccount = new IRODSAccount(host, port, user, tempPswd, absPath, zone, defaultStorageResource);
-
+
log.info("creating idropCore...");
iDropCore = new iDropLiteCore();
@@ -235,7 +239,9 @@ public class iDropLiteApplet extends javax.swing.JApplet implements DropTargetLi
}
buildTargetTree();
-
+ setUpLocalFileSelectTree();
+ setUpUploadLocalFileSelectTree();
+
try {
DataTransferOperations dataTransferOperations = irodsFileSystem.getIRODSAccessObjectFactory()
@@ -245,7 +251,7 @@ public class iDropLiteApplet extends javax.swing.JApplet implements DropTargetLi
catch(JargonException ex) {
Logger.getLogger(iDropLiteApplet.class.getName()).log(Level.SEVERE, null, ex);
}
-
+
return true;
}
@@ -291,13 +297,13 @@ public class iDropLiteApplet extends javax.swing.JApplet implements DropTargetLi
throw new IdropRuntimeException(ex);
}
- scrollIrodsTree.setViewportView(getTreeStagingResource());
+ scrIrodsTreeView.setViewportView(getTreeStagingResource());
try {
TreePath selectedPath = TreeUtils.buildTreePathForIrodsAbsolutePath(irodsTree, absPath);
irodsTree.expandPath(selectedPath);
//irodsTree.getSelectionModel().setSelectionInterval(10, 12);
Rectangle rect = irodsTree.getPathBounds(selectedPath);
- scrollIrodsTree.getViewport().scrollRectToVisible(rect);
+ scrIrodsTreeView.getViewport().scrollRectToVisible(rect);
}
catch(IdropException ex) {
Logger.getLogger(iDropLiteApplet.class.getName()).log(Level.SEVERE, null, ex);
@@ -312,12 +318,211 @@ public class iDropLiteApplet extends javax.swing.JApplet implements DropTargetLi
irodsTree.setRefreshingTree(false);
getiDropCore().getIrodsFileSystem().closeAndEatExceptions(iDropCore.getIrodsAccount());
- DropTarget dt = new DropTarget();
- dt.setComponent(irodsTree.getEditorComponent());
- //dt.addDropTargetListener(this);
}
});
}
+
+
+ // NEED T) REFACTOR ALL OF THE FOLLOWING DUPLICATION!!!!!!!!
+ private void setUpLocalFileSelectTree() {
+
+ /*
+ * 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 (fileTree != null) {
+ log.info("file tree already initialized");
+ return;
+ }
+
+ log.info("building tree to look at local file system");
+ final iDropLiteApplet gui = this;
+
+ java.awt.EventQueue.invokeLater(new Runnable() {
+
+ @Override
+ public void run() {
+ listLocalDrives = new JList();
+
+ initializeLocalFileTreeModel(null);
+ fileTree = new LocalFileTree(localFileModel, gui);
+ listLocalDrives.getSelectionModel().addListSelectionListener(
+ new ListSelectionListener() {
+
+ @Override
+ public void valueChanged(final ListSelectionEvent e) {
+ if (e.getValueIsAdjusting()) {
+ return;
+ }
+
+ log.debug("new local file system model");
+ log.debug("selection event:{}", e);
+ Object selectedItem = listLocalDrives.getSelectedValue();
+ initializeLocalFileTreeModelWhenDriveIsSelected(selectedItem);
+
+ }
+ });
+ scrollLocalFileTree.setViewportView(fileTree);
+ pnlLocalTree.add(scrollLocalFileTree,
+ java.awt.BorderLayout.CENTER);
+ pnlLocalTree.setVisible(false);
+ }
+ });
+
+ }
+
+ 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) {
+ log.debug("selected drive is null, use the first one");
+ listLocalDrives.setSelectedIndex(0);
+
+ localFileModel = new LocalFileSystemModel(new LocalFileNode(
+ new File((String) listLocalDrives.getSelectedValue())));
+
+ fileTree.setModel(localFileModel);
+ } else {
+ log.debug(
+ "selected drive is not null, create new root based on selection",
+ selectedDrive);
+ listLocalDrives.setSelectedValue(selectedDrive, true);
+ localFileModel = new LocalFileSystemModel(new LocalFileNode(
+ new File((String) selectedDrive)));
+ fileTree.setModel(localFileModel);
+
+ }
+
+ scrollLocalDrives.setVisible(true);
+ }
+
+ private void initializeLocalFileTreeModel(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) {
+ scrollLocalDrives.setVisible(false);
+ localFileModel = new LocalFileSystemModel(new LocalFileNode(
+ new File(roots.get(0))));
+
+ } else {
+ DefaultListModel listModel = new DefaultListModel();
+ for (String root : roots) {
+ listModel.addElement(root);
+ }
+
+ listLocalDrives.setModel(listModel);
+
+ 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) {
@@ -325,10 +530,6 @@ public class iDropLiteApplet extends javax.swing.JApplet implements DropTargetLi
}
}
- public JToggleButton getToggleIrodsDetails() {
- // FIX ME: NEED TO IMPLEMENT
- return new JToggleButton();
- }
public void showIdropException(Exception idropException) {
JOptionPane.showMessageDialog(this, idropException.getMessage(), "iDROP Exception", JOptionPane.WARNING_MESSAGE);
@@ -347,12 +548,15 @@ public class iDropLiteApplet extends javax.swing.JApplet implements DropTargetLi
});
}
-
+
@Override
public void statusCallback(final TransferStatus ts) {
-
+
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);
@@ -368,15 +572,17 @@ public class iDropLiteApplet extends javax.swing.JApplet implements DropTargetLi
+ (ts.getTotalSize() / 1024));
*/
lblTransferFileName.setText(abbreviateFileName(ts.getSourceFileAbsolutePath()));
+
+ lblUploadTransferFileName.setText(abbreviateFileName(ts.getSourceFileAbsolutePath()));
}
});
-
+
}
@Override
public void overallStatusCallback(final TransferStatus ts) {
-
+
IRODSOutlineModel irodsTreeModel = (IRODSOutlineModel) irodsTree.getModel();
try {
irodsTreeModel.notifyCompletionOfOperation(irodsTree, ts);
@@ -402,12 +608,14 @@ public class iDropLiteApplet extends javax.swing.JApplet implements DropTargetLi
+ (ts.getTotalSize() / 1024));
*/
lblTransferFileName.setText(abbreviateFileName(ts.getSourceFileAbsolutePath()));
+
+ lblUploadTransferFileName.setText(abbreviateFileName(ts.getSourceFileAbsolutePath()));
}
});
-
+
}
-
+
private final String abbreviateFileName(final String fileName) {
if (fileName == null) {
@@ -428,6 +636,27 @@ public class iDropLiteApplet extends javax.swing.JApplet implements DropTargetLi
}
+ public IRODSTree getIrodsTree() {
+ return irodsTree;
+ }
+
+ public iDropLiteCore getiDropCore() {
+ return iDropCore;
+ }
+
+ public LocalFileTree getFileTree() {
+ return fileTree;
+ }
+
+ public Outline getTreeStagingResource() {
+ return irodsTree;
+ }
+
+ private void bntRefreshIrodsTreeActionPerformed(java.awt.event.ActionEvent evt) {
+ // FIX ME: get current view of irods tree and pass to buildTargetTree
+ buildTargetTree();
+ }
+
/** This method is called from within the init() method to
* initialize the form.
@@ -435,212 +664,647 @@ public class iDropLiteApplet extends javax.swing.JApplet implements DropTargetLi
* always regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
- // <editor-fold defaultstate="collapsed" desc="Generated Code">
+ // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
java.awt.GridBagConstraints gridBagConstraints;
+ pnlTabbedMain = new javax.swing.JTabbedPane();
pnlMain = new javax.swing.JPanel();
- pnlTools = new javax.swing.JPanel();
+ pnlMainToolBar = new javax.swing.JPanel();
+ pnlToolBarSizer = new javax.swing.JPanel();
+ pnlLocalToggleSizer = new javax.swing.JPanel();
+ btnToggleLocalView = new javax.swing.JToggleButton();
+ pnlSearchSizer = new javax.swing.JPanel();
+ pnlPlaceholder = new javax.swing.JPanel();
+ pnlMainTrees = new javax.swing.JPanel();
+ pnlSplitPaneLocalRemote = new javax.swing.JSplitPane();
+ pnlLocalTree = new javax.swing.JPanel();
+ pnlLocalRoots = new javax.swing.JPanel();
+ pnlLocalRefreshButton = new javax.swing.JPanel();
+ btnLocalRefresh = new javax.swing.JButton();
+ scrollLocalDrives = new javax.swing.JScrollPane();
+ pnlDrivesFiller = new javax.swing.JPanel();
+ scrollLocalFileTree = new javax.swing.JScrollPane();
+ pnlIrodsTree = new javax.swing.JPanel();
tabIrodsViews = new javax.swing.JTabbedPane();
pnlIrodsTreeView = new javax.swing.JPanel();
- pnlIrodsTreeToolbar = new javax.swing.JPanel();
- bntRefreshIrodsTree = new javax.swing.JButton();
- pnlTreeMaster = new javax.swing.JPanel();
- scrollIrodsTree = new javax.swing.JScrollPane();
- pnlSearch = new javax.swing.JPanel();
- pnlTransferStatus = new javax.swing.JPanel();
+ pnlIrodsTreeViewButtons = new javax.swing.JPanel();
+ btnIrodsTreeRefresh = new javax.swing.JButton();
+ scrIrodsTreeView = new javax.swing.JScrollPane();
+ pnlIrodsSearch = new javax.swing.JPanel();
jLabel1 = new javax.swing.JLabel();
+ pnlMainStatus = new javax.swing.JPanel();
lblTransferFileName = new javax.swing.JLabel();
pbTransferStatus = new javax.swing.JProgressBar();
-
- setPreferredSize(new java.awt.Dimension(600, 400));
+ pnlOperationMode2 = new javax.swing.JPanel();
+ pnlUploadTrees = new javax.swing.JPanel();
+ pnlUploadLocalTree = new javax.swing.JPanel();
+ 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();
+ jScrollPane3 = new javax.swing.JScrollPane();
+ tblUploadTable = new javax.swing.JTable();
+ pnlUploadToolbar = new javax.swing.JPanel();
+ pnlUploadToolStatus = new javax.swing.JPanel();
+ lblUploadTransferFileName = new javax.swing.JLabel();
+ pbUploadTransferStatus = new javax.swing.JProgressBar();
+ btnUploadBeginImport = new javax.swing.JButton();
+ btnUploadCancel = new javax.swing.JButton();
+ pnlOperationMode3 = new javax.swing.JPanel();
+ pnlProgressTable = new javax.swing.JPanel();
+ jScrollPane4 = new javax.swing.JScrollPane();
+ tblProgress = new javax.swing.JTable();
+
+ setMinimumSize(new java.awt.Dimension(250, 200));
+ setPreferredSize(new java.awt.Dimension(700, 450));
+
+ pnlTabbedMain.setTabPlacement(javax.swing.JTabbedPane.RIGHT);
+ pnlTabbedMain.setMinimumSize(new java.awt.Dimension(250, 200));
+ pnlTabbedMain.setPreferredSize(new java.awt.Dimension(700, 450));
pnlMain.setBorder(javax.swing.BorderFactory.createEtchedBorder());
- pnlMain.setMinimumSize(new java.awt.Dimension(200, 200));
- pnlMain.setPreferredSize(new java.awt.Dimension(600, 400));
- pnlMain.setRequestFocusEnabled(false);
+ pnlMain.setMinimumSize(new java.awt.Dimension(250, 200));
+ pnlMain.setPreferredSize(new java.awt.Dimension(700, 450));
pnlMain.setLayout(new java.awt.BorderLayout());
- pnlTools.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
+ pnlMainToolBar.setMinimumSize(new java.awt.Dimension(250, 30));
+ pnlMainToolBar.setPreferredSize(new java.awt.Dimension(700, 40));
+ pnlMainToolBar.setLayout(new java.awt.BorderLayout());
+
+ pnlToolBarSizer.setPreferredSize(new java.awt.Dimension(632, 50));
+ pnlToolBarSizer.setSize(new java.awt.Dimension(100, 50));
+ pnlToolBarSizer.setLayout(new java.awt.BorderLayout());
+
+ pnlLocalToggleSizer.setPreferredSize(new java.awt.Dimension(150, 50));
+
+ btnToggleLocalView.setText(org.openide.util.NbBundle.getMessage(iDropLiteApplet.class, "iDropLiteApplet.btnToggleLocalView.text")); // NOI18N
+ btnToggleLocalView.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ btnToggleLocalViewActionPerformed(evt);
+ }
+ });
+
+ org.jdesktop.layout.GroupLayout pnlLocalToggleSizerLayout = new org.jdesktop.layout.GroupLayout(pnlLocalToggleSizer);
+ pnlLocalToggleSizer.setLayout(pnlLocalToggleSizerLayout);
+ pnlLocalToggleSizerLayout.setHorizontalGroup(
+ pnlLocalToggleSizerLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
+ .add(pnlLocalToggleSizerLayout.createSequentialGroup()
+ .addContainerGap()
+ .add(btnToggleLocalView)
+ .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
+ );
+ pnlLocalToggleSizerLayout.setVerticalGroup(
+ pnlLocalToggleSizerLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
+ .add(pnlLocalToggleSizerLayout.createSequentialGroup()
+ .add(btnToggleLocalView)
+ .addContainerGap(11, Short.MAX_VALUE))
+ );
+
+ pnlToolBarSizer.add(pnlLocalToggleSizer, java.awt.BorderLayout.WEST);
+
+ pnlSearchSizer.setPreferredSize(new java.awt.Dimension(300, 50));
+
+ org.jdesktop.layout.GroupLayout pnlSearchSizerLayout = new org.jdesktop.layout.GroupLayout(pnlSearchSizer);
+ pnlSearchSizer.setLayout(pnlSearchSizerLayout);
+ pnlSearchSizerLayout.setHorizontalGroup(
+ pnlSearchSizerLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
+ .add(0, 350, Short.MAX_VALUE)
+ );
+ pnlSearchSizerLayout.setVerticalGroup(
+ pnlSearchSizerLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
+ .add(0, 40, Short.MAX_VALUE)
+ );
+
+ pnlToolBarSizer.add(pnlSearchSizer, java.awt.BorderLayout.CENTER);
+
+ pnlPlaceholder.setPreferredSize(new java.awt.Dimension(150, 50));
+
+ org.jdesktop.layout.GroupLayout pnlPlaceholderLayout = new org.jdesktop.layout.GroupLayout(pnlPlaceholder);
+ pnlPlaceholder.setLayout(pnlPlaceholderLayout);
+ pnlPlaceholderLayout.setHorizontalGroup(
+ pnlPlaceholderLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
+ .add(0, 150, Short.MAX_VALUE)
+ );
+ pnlPlaceholderLayout.setVerticalGroup(
+ pnlPlaceholderLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
+ .add(0, 40, Short.MAX_VALUE)
+ );
+
+ pnlToolBarSizer.add(pnlPlaceholder, java.awt.BorderLayout.EAST);
- org.jdesktop.layout.GroupLayout pnlToolsLayout = new org.jdesktop.layout.GroupLayout(pnlTools);
- pnlTools.setLayout(pnlToolsLayout);
- pnlToolsLayout.setHorizontalGroup(
- pnlToolsLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
- .add(0, 592, Short.MAX_VALUE)
+ pnlMainToolBar.add(pnlToolBarSizer, java.awt.BorderLayout.CENTER);
+
+ pnlMain.add(pnlMainToolBar, java.awt.BorderLayout.NORTH);
+
+ pnlMainTrees.setMinimumSize(new java.awt.Dimension(250, 150));
+ pnlMainTrees.setPreferredSize(new java.awt.Dimension(700, 375));
+ pnlMainTrees.setLayout(new javax.swing.BoxLayout(pnlMainTrees, javax.swing.BoxLayout.LINE_AXIS));
+
+ pnlSplitPaneLocalRemote.setDividerLocation(300);
+ pnlSplitPaneLocalRemote.setMinimumSize(new java.awt.Dimension(250, 150));
+ pnlSplitPaneLocalRemote.setPreferredSize(new java.awt.Dimension(700, 375));
+
+ pnlLocalTree.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.RAISED));
+ 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
+ pnlLocalRefreshButton.add(btnLocalRefresh);
+
+ pnlLocalRoots.add(pnlLocalRefreshButton, java.awt.BorderLayout.NORTH);
+ pnlLocalRoots.add(scrollLocalDrives, java.awt.BorderLayout.CENTER);
+
+ org.jdesktop.layout.GroupLayout pnlDrivesFillerLayout = new org.jdesktop.layout.GroupLayout(pnlDrivesFiller);
+ pnlDrivesFiller.setLayout(pnlDrivesFillerLayout);
+ pnlDrivesFillerLayout.setHorizontalGroup(
+ pnlDrivesFillerLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
+ .add(0, 292, Short.MAX_VALUE)
);
- pnlToolsLayout.setVerticalGroup(
- pnlToolsLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
+ pnlDrivesFillerLayout.setVerticalGroup(
+ pnlDrivesFillerLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(0, 0, Short.MAX_VALUE)
);
- pnlMain.add(pnlTools, java.awt.BorderLayout.NORTH);
+ pnlLocalRoots.add(pnlDrivesFiller, java.awt.BorderLayout.SOUTH);
+
+ pnlLocalTree.add(pnlLocalRoots, java.awt.BorderLayout.NORTH);
+ pnlLocalTree.add(scrollLocalFileTree, java.awt.BorderLayout.CENTER);
+
+ pnlSplitPaneLocalRemote.setLeftComponent(pnlLocalTree);
- tabIrodsViews.setMinimumSize(new java.awt.Dimension(300, 300));
- tabIrodsViews.setPreferredSize(new java.awt.Dimension(600, 400));
- tabIrodsViews.setRequestFocusEnabled(false);
+ pnlIrodsTree.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.RAISED));
pnlIrodsTreeView.setLayout(new java.awt.BorderLayout());
- bntRefreshIrodsTree.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
- bntRefreshIrodsTree.setLabel("Refresh");
- pnlIrodsTreeToolbar.add(bntRefreshIrodsTree);
- bntRefreshIrodsTree.addActionListener(new java.awt.event.ActionListener() {
+ btnIrodsTreeRefresh.setText(org.openide.util.NbBundle.getMessage(iDropLiteApplet.class, "iDropLiteApplet.btnIrodsTreeRefresh.text")); // NOI18N
+ btnIrodsTreeRefresh.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
- bntRefreshIrodsTreeActionPerformed(evt);
+ btnIrodsTreeRefreshActionPerformed(evt);
}
});
+ pnlIrodsTreeViewButtons.add(btnIrodsTreeRefresh);
- pnlIrodsTreeView.add(pnlIrodsTreeToolbar, java.awt.BorderLayout.NORTH);
+ pnlIrodsTreeView.add(pnlIrodsTreeViewButtons, java.awt.BorderLayout.NORTH);
+ pnlIrodsTreeView.add(scrIrodsTreeView, java.awt.BorderLayout.CENTER);
- pnlTreeMaster.setLayout(new java.awt.BorderLayout());
- pnlIrodsTreeView.add(pnlTreeMaster, java.awt.BorderLayout.SOUTH);
- pnlIrodsTreeView.add(scrollIrodsTree, java.awt.BorderLayout.CENTER);
+ tabIrodsViews.addTab(org.openide.util.NbBundle.getMessage(iDropLiteApplet.class, "iDropLiteApplet.pnlIrodsTreeView.TabConstraints.tabTitle"), pnlIrodsTreeView); // NOI18N
- tabIrodsViews.addTab("iRODS Tree View", pnlIrodsTreeView);
+ jLabel1.setText(org.openide.util.NbBundle.getMessage(iDropLiteApplet.class, "iDropLiteApplet.jLabel1.text")); // NOI18N
- pnlSearch.setName("pnlSearch"); // NOI18N
+ org.jdesktop.layout.GroupLayout pnlIrodsSearchLayout = new org.jdesktop.layout.GroupLayout(pnlIrodsSearch);
+ pnlIrodsSearch.setLayout(pnlIrodsSearchLayout);
+ pnlIrodsSearchLayout.setHorizontalGroup(
+ pnlIrodsSearchLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
+ .add(pnlIrodsSearchLayout.createSequentialGroup()
+ .add(83, 83, 83)
+ .add(jLabel1)
+ .addContainerGap(141, Short.MAX_VALUE))
+ );
+ pnlIrodsSearchLayout.setVerticalGroup(
+ pnlIrodsSearchLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
+ .add(pnlIrodsSearchLayout.createSequentialGroup()
+ .add(84, 84, 84)
+ .add(jLabel1)
+ .addContainerGap(195, Short.MAX_VALUE))
+ );
+
+ tabIrodsViews.addTab(org.openide.util.NbBundle.getMessage(iDropLiteApplet.class, "iDropLiteApplet.pnlIrodsSearch.TabConstraints.tabTitle"), pnlIrodsSearch); // NOI18N
- org.jdesktop.layout.GroupLayout pnlSearchLayout = new org.jdesktop.layout.GroupLayout(pnlSearch);
- pnlSearch.setLayout(pnlSearchLayout);
- pnlSearchLayout.setHorizontalGroup(
- pnlSearchLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
- .add(0, 575, Short.MAX_VALUE)
+ org.jdesktop.layout.GroupLayout pnlIrodsTreeLayout = new org.jdesktop.layout.GroupLayout(pnlIrodsTree);
+ pnlIrodsTree.setLayout(pnlIrodsTreeLayout);
+ pnlIrodsTreeLayout.setHorizontalGroup(
+ pnlIrodsTreeLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
+ .add(tabIrodsViews, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 333, Short.MAX_VALUE)
);
- pnlSearchLayout.setVerticalGroup(
- pnlSearchLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
- .add(0, 271, Short.MAX_VALUE)
+ pnlIrodsTreeLayout.setVerticalGroup(
+ pnlIrodsTreeLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
+ .add(tabIrodsViews, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 341, Short.MAX_VALUE)
);
- tabIrodsViews.addTab("Search", pnlSearch);
+ pnlSplitPaneLocalRemote.setRightComponent(pnlIrodsTree);
- pnlMain.add(tabIrodsViews, java.awt.BorderLayout.CENTER);
+ pnlMainTrees.add(pnlSplitPaneLocalRemote);
- pnlTransferStatus.setPreferredSize(new java.awt.Dimension(600, 75));
- pnlTransferStatus.setRequestFocusEnabled(false);
- pnlTransferStatus.setLayout(new java.awt.GridBagLayout());
+ pnlMain.add(pnlMainTrees, java.awt.BorderLayout.CENTER);
- jLabel1.setFont(new java.awt.Font("Lucida Grande", 0, 12)); // NOI18N
- jLabel1.setText("Current File:");
- gridBagConstraints = new java.awt.GridBagConstraints();
- gridBagConstraints.gridx = 0;
- gridBagConstraints.gridy = 0;
- gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
- gridBagConstraints.insets = new java.awt.Insets(10, 15, 0, 0);
- pnlTransferStatus.add(jLabel1, gridBagConstraints);
+ pnlMainStatus.setMinimumSize(new java.awt.Dimension(250, 30));
+ pnlMainStatus.setPreferredSize(new java.awt.Dimension(700, 34));
+ pnlMainStatus.setLayout(new java.awt.GridBagLayout());
- lblTransferFileName.setFont(new java.awt.Font("Lucida Grande", 0, 10)); // NOI18N
- lblTransferFileName.setMaximumSize(new java.awt.Dimension(200, 22));
- lblTransferFileName.setMinimumSize(new java.awt.Dimension(100, 22));
- lblTransferFileName.setPreferredSize(new java.awt.Dimension(200, 22));
+ lblTransferFileName.setFont(new java.awt.Font("Lucida Grande", 0, 12));
+ lblTransferFileName.setText(org.openide.util.NbBundle.getMessage(iDropLiteApplet.class, "iDropLiteApplet.lblTransferFileName.text")); // NOI18N
+ lblTransferFileName.setMinimumSize(new java.awt.Dimension(100, 16));
+ lblTransferFileName.setPreferredSize(new java.awt.Dimension(250, 16));
lblTransferFileName.setRequestFocusEnabled(false);
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 0;
- gridBagConstraints.gridy = 1;
- gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
- gridBagConstraints.insets = new java.awt.Insets(12, 15, 0, 0);
- pnlTransferStatus.add(lblTransferFileName, gridBagConstraints);
+ gridBagConstraints.gridy = 0;
+ gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
+ gridBagConstraints.insets = new java.awt.Insets(10, 10, 5, 5);
+ pnlMainStatus.add(lblTransferFileName, gridBagConstraints);
- pbTransferStatus.setFont(new java.awt.Font("Lucida Grande", 0, 12)); // NOI18N
pbTransferStatus.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.LOWERED));
pbTransferStatus.setMinimumSize(new java.awt.Dimension(100, 24));
pbTransferStatus.setPreferredSize(new java.awt.Dimension(300, 24));
- pbTransferStatus.setStringPainted(true);
gridBagConstraints = new java.awt.GridBagConstraints();
- gridBagConstraints.gridx = 2;
- gridBagConstraints.gridy = 1;
- gridBagConstraints.gridheight = 2;
+ gridBagConstraints.gridx = 1;
+ gridBagConstraints.gridy = 0;
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
- gridBagConstraints.weightx = 40.0;
- gridBagConstraints.insets = new java.awt.Insets(10, 10, 0, 15);
- pnlTransferStatus.add(pbTransferStatus, gridBagConstraints);
+ gridBagConstraints.weightx = 8.0;
+ gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 15);
+ pnlMainStatus.add(pbTransferStatus, gridBagConstraints);
+
+ pnlMain.add(pnlMainStatus, java.awt.BorderLayout.SOUTH);
+
+ pnlTabbedMain.addTab(org.openide.util.NbBundle.getMessage(iDropLiteApplet.class, "iDropLiteApplet.pnlMain.TabConstraints.tabTitle"), pnlMain); // NOI18N
+
+ pnlOperationMode2.setMinimumSize(new java.awt.Dimension(250, 200));
+ pnlOperationMode2.setPreferredSize(new java.awt.Dimension(700, 450));
+ pnlOperationMode2.setLayout(new java.awt.BorderLayout());
- pnlMain.add(pnlTransferStatus, java.awt.BorderLayout.PAGE_END);
+ pnlUploadTrees.setMinimumSize(new java.awt.Dimension(250, 160));
+ pnlUploadTrees.setPreferredSize(new java.awt.Dimension(700, 385));
+ pnlUploadTrees.setLayout(new java.awt.GridBagLayout());
- org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane());
- getContentPane().setLayout(layout);
- layout.setHorizontalGroup(
- layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
- .add(pnlMain, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+ pnlUploadLocalTree.setMinimumSize(new java.awt.Dimension(0, 0));
+ pnlUploadLocalTree.setPreferredSize(new java.awt.Dimension(285, 380));
+ pnlUploadLocalTree.setLayout(new java.awt.BorderLayout());
+
+ 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)
);
- layout.setVerticalGroup(
- layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
- .add(pnlMain, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+ pnlUploadLocalDrivesFillerLayout.setVerticalGroup(
+ pnlUploadLocalDrivesFillerLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
+ .add(0, 100, Short.MAX_VALUE)
);
- }// </editor-fold>
+ pnlUploadRoots.add(pnlUploadLocalDrivesFiller, java.awt.BorderLayout.SOUTH);
- // Variables declaration - do not modify//GEN-BEGIN:variables
- private javax.swing.JButton bntRefreshIrodsTree;
- private javax.swing.JLabel jLabel1;
- private javax.swing.JLabel lblTransferFileName;
- private javax.swing.JProgressBar pbTransferStatus;
- private javax.swing.JPanel pnlIrodsTreeToolbar;
- private javax.swing.JPanel pnlIrodsTreeView;
- private javax.swing.JPanel pnlMain;
- private javax.swing.JPanel pnlSearch;
- private javax.swing.JPanel pnlTools;
- private javax.swing.JPanel pnlTransferStatus;
- private javax.swing.JPanel pnlTreeMaster;
- private javax.swing.JScrollPane scrollIrodsTree;
- private javax.swing.JTabbedPane tabIrodsViews;
- // End of variables declaration//GEN-END:variables
+ pnlUploadLocalTree.add(pnlUploadRoots, java.awt.BorderLayout.NORTH);
+ pnlUploadLocalTree.add(scrollUploadLocalTree, java.awt.BorderLayout.CENTER);
- public IRODSTree getIrodsTree() {
- return irodsTree;
- }
+ gridBagConstraints = new java.awt.GridBagConstraints();
+ gridBagConstraints.gridx = 0;
+ gridBagConstraints.gridy = 0;
+ gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
+ gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
+ gridBagConstraints.weightx = 0.4;
+ gridBagConstraints.weighty = 0.2;
+ pnlUploadTrees.add(pnlUploadLocalTree, gridBagConstraints);
+
+ pnlUploadCenterTools.setMaximumSize(new java.awt.Dimension(65, 32767));
+ pnlUploadCenterTools.setMinimumSize(new java.awt.Dimension(30, 100));
+ pnlUploadCenterTools.setPreferredSize(new java.awt.Dimension(50, 380));
+ pnlUploadCenterTools.setRequestFocusEnabled(false);
+ pnlUploadCenterTools.setLayout(new java.awt.BorderLayout());
+
+ btnUploadMove.setText(org.openide.util.NbBundle.getMessage(iDropLiteApplet.class, "iDropLiteApplet.btnUploadMove.text")); // NOI18N
+ btnUploadMove.setMargin(new java.awt.Insets(0, 0, 0, 0));
+ btnUploadMove.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ btnUploadMoveActionPerformed(evt);
+ }
+ });
+ pnlUploadCenterTools.add(btnUploadMove, java.awt.BorderLayout.CENTER);
- public iDropLiteCore getiDropCore() {
- return iDropCore;
- }
+ gridBagConstraints = new java.awt.GridBagConstraints();
+ gridBagConstraints.gridx = 1;
+ gridBagConstraints.gridy = 0;
+ gridBagConstraints.fill = java.awt.GridBagConstraints.VERTICAL;
+ gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
+ gridBagConstraints.weighty = 0.2;
+ pnlUploadTrees.add(pnlUploadCenterTools, gridBagConstraints);
- public LocalFileTree getFileTree() {
- return fileTree;
- }
+ pnlUploadTable.setPreferredSize(new java.awt.Dimension(310, 380));
+ pnlUploadTable.setLayout(new java.awt.BorderLayout());
- public Outline getTreeStagingResource() {
- return irodsTree;
- }
+ jScrollPane3.setPreferredSize(new java.awt.Dimension(275, 380));
- private void bntRefreshIrodsTreeActionPerformed(java.awt.event.ActionEvent evt) {
- // FIX ME: get current view of irods tree and pass to buildTargetTree
- buildTargetTree();
- }
+ tblUploadTable.setModel(new javax.swing.table.DefaultTableModel(
+ new Object [][] {
+ },
+ new String [] {
+ "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];
+ }
- @Override
- public void dragEnter(DropTargetDragEvent arg0) {
- // TODO Auto-generated method stub
-
- }
+ 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);
+ pnlUploadTable.add(jScrollPane3, java.awt.BorderLayout.CENTER);
- @Override
- public void dragExit(DropTargetEvent arg0) {
- // TODO Auto-generated method stub
-
- }
+ gridBagConstraints = new java.awt.GridBagConstraints();
+ gridBagConstraints.gridx = 2;
+ gridBagConstraints.gridy = 0;
+ gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
+ gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
+ gridBagConstraints.weightx = 0.4;
+ gridBagConstraints.weighty = 0.2;
+ pnlUploadTrees.add(pnlUploadTable, gridBagConstraints);
+
+ pnlOperationMode2.add(pnlUploadTrees, java.awt.BorderLayout.CENTER);
+
+ pnlUploadToolbar.setMaximumSize(new java.awt.Dimension(32767, 60));
+ pnlUploadToolbar.setMinimumSize(new java.awt.Dimension(250, 30));
+ pnlUploadToolbar.setPreferredSize(new java.awt.Dimension(700, 40));
+ pnlUploadToolbar.setLayout(new java.awt.GridBagLayout());
+
+ 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(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);
+ pbUploadTransferStatus.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.LOWERED));
+ gridBagConstraints = new java.awt.GridBagConstraints();
+ gridBagConstraints.gridx = 1;
+ gridBagConstraints.gridy = 0;
+ gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
+ gridBagConstraints.ipadx = 136;
+ gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
+ gridBagConstraints.weightx = 6.0;
+ gridBagConstraints.insets = new java.awt.Insets(5, 5, 5, 15);
+ pnlUploadToolStatus.add(pbUploadTransferStatus, gridBagConstraints);
- @Override
- public void dragOver(DropTargetDragEvent arg0) {
- // TODO Auto-generated method stub
-
- }
+ 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 = 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;
+ gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
+ gridBagConstraints.weightx = 50.0;
+ 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;
+ gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
+ gridBagConstraints.weightx = 0.6;
+ pnlUploadToolbar.add(btnUploadCancel, gridBagConstraints);
- @Override
- public void drop(DropTargetDropEvent arg0) {
- // TODO Auto-generated method stub
-
- }
+ pnlOperationMode2.add(pnlUploadToolbar, java.awt.BorderLayout.SOUTH);
+ pnlTabbedMain.addTab(org.openide.util.NbBundle.getMessage(iDropLiteApplet.class, "iDropLiteApplet.pnlOperationMode2.TabConstraints.tabTitle"), pnlOperationMode2); // NOI18N
- @Override
- public void dropActionChanged(DropTargetDragEvent arg0) {
- // TODO Auto-generated method stub
-
- }
+ pnlOperationMode3.setMinimumSize(new java.awt.Dimension(250, 200));
+ pnlOperationMode3.setPreferredSize(new java.awt.Dimension(700, 450));
+ pnlOperationMode3.setLayout(new java.awt.BorderLayout());
+
+ pnlProgressTable.setLayout(new java.awt.BorderLayout());
+
+ tblProgress.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"
+ }
+ ));
+ tblProgress.setShowGrid(true);
+ jScrollPane4.setViewportView(tblProgress);
+
+ pnlProgressTable.add(jScrollPane4, java.awt.BorderLayout.CENTER);
+
+ pnlOperationMode3.add(pnlProgressTable, java.awt.BorderLayout.CENTER);
+
+ pnlTabbedMain.addTab(org.openide.util.NbBundle.getMessage(iDropLiteApplet.class, "iDropLiteApplet.pnlOperationMode3.TabConstraints.tabTitle"), pnlOperationMode3); // NOI18N
+
+ getContentPane().add(pnlTabbedMain, java.awt.BorderLayout.CENTER);
+ }// </editor-fold>//GEN-END:initComponents
+
+ private void btnIrodsTreeRefreshActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnIrodsTreeRefreshActionPerformed
+ // TODO add your handling code here:
+ }//GEN-LAST:event_btnIrodsTreeRefreshActionPerformed
+
+ private void btnUploadMoveActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnUploadMoveActionPerformed
+ //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
+ java.awt.EventQueue.invokeLater(new Runnable() {
+
+ @Override
+ public void run() {
+ pnlLocalTree.setVisible(btnToggleLocalView.isSelected());
+ if (pnlLocalTree.isVisible()) {
+ pnlSplitPaneLocalRemote.setDividerLocation(0.3d);
+ }
+ }
+ });
+ }//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, null);
+ 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;
+ private javax.swing.JButton btnLocalRefresh;
+ 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 jScrollPane3;
+ private javax.swing.JScrollPane jScrollPane4;
+ private javax.swing.JLabel lblTransferFileName;
+ private javax.swing.JLabel lblUploadTransferFileName;
+ private javax.swing.JProgressBar pbTransferStatus;
+ private javax.swing.JProgressBar pbUploadTransferStatus;
+ private javax.swing.JPanel pnlDrivesFiller;
+ private javax.swing.JPanel pnlIrodsSearch;
+ private javax.swing.JPanel pnlIrodsTree;
+ private javax.swing.JPanel pnlIrodsTreeView;
+ private javax.swing.JPanel pnlIrodsTreeViewButtons;
+ private javax.swing.JPanel pnlLocalRefreshButton;
+ private javax.swing.JPanel pnlLocalRoots;
+ private javax.swing.JPanel pnlLocalToggleSizer;
+ private javax.swing.JPanel pnlLocalTree;
+ private javax.swing.JPanel pnlMain;
+ private javax.swing.JPanel pnlMainStatus;
+ private javax.swing.JPanel pnlMainToolBar;
+ private javax.swing.JPanel pnlMainTrees;
+ private javax.swing.JPanel pnlOperationMode2;
+ private javax.swing.JPanel pnlOperationMode3;
+ private javax.swing.JPanel pnlPlaceholder;
+ private javax.swing.JPanel pnlProgressTable;
+ private javax.swing.JPanel pnlSearchSizer;
+ private javax.swing.JSplitPane pnlSplitPaneLocalRemote;
+ 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;
+ private javax.swing.JPanel pnlUploadTrees;
+ 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;
+ // End of variables declaration//GEN-END:variables
}
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
new file mode 100644
index 0000000..65cef47
--- /dev/null
+++ b/idrop-lite/src/main/resources/org/irods/jargon/idrop/lite/Bundle.properties
@@ -0,0 +1,16 @@
+NewJApplet.btnToggleLocalView.text=jButton1
+iDropLiteApplet.btnUploadBeginImport.text=Begin Import
+iDropLiteApplet.pnlOperationMode3.TabConstraints.tabTitle=Progress
+iDropLiteApplet.btnUploadCancel.text=Cancel
+iDropLiteApplet.lblTransferFileName.text=
+iDropLiteApplet.pnlMain.TabConstraints.tabTitle=Main
+iDropLiteApplet.jLabel1.text=Coming soon!
+iDropLiteApplet.pnlIrodsSearch.TabConstraints.tabTitle=Search
+iDropLiteApplet.btnIrodsTreeRefresh.text=Refresh
+iDropLiteApplet.pnlIrodsTreeView.TabConstraints.tabTitle=IRODS Tree View
+iDropLiteApplet.btnUploadMove.text=>>
+iDropLiteApplet.btnLocalRefresh.text=Refresh
+iDropLiteApplet.pnlOperationMode2.TabConstraints.tabTitle=Upload
+iDropLiteApplet.lblUploadTransferFileName.text=
+iDropLiteApplet.btnToggleLocalView.text=<<<Local Files
+iDropLiteApplet.btnUploadLocalRefresh.text=Refresh
diff --git a/idrop-lite/src/main/resources/org/irods/jargon/idrop/lite/finder/Bundle.properties b/idrop-lite/src/main/resources/org/irods/jargon/idrop/lite/finder/Bundle.properties
new file mode 100644
index 0000000..5dd2f57
--- /dev/null
+++ b/idrop-lite/src/main/resources/org/irods/jargon/idrop/lite/finder/Bundle.properties
@@ -0,0 +1,6 @@
+IRODSFinderDialog.btnRefreshTargetTree.toolTipText=Refresh the view of the iRODS server
+IRODSFinderDialog.btnRefreshTargetTree.text=Refresh
+IRODSFinderDialog.btnSelectFolder.text=Select
+# To change this template, choose Tools | Templates
+# and open the template in the editor.
+IRODSFinderDialog.btnCancel.text=Cancel
diff --git a/idrop-web/grails-app/views/idropLite/appletLoader.gsp b/idrop-web/grails-app/views/idropLite/appletLoader.gsp
index 29ccbe4..a0cbc84 100644
--- a/idrop-web/grails-app/views/idropLite/appletLoader.gsp
+++ b/idrop-web/grails-app/views/idropLite/appletLoader.gsp
@@ -13,7 +13,6 @@
<param name="password" value="${password}" />
<param name="absPath" value="${absPath}" />
</applet>
-</div>
<script type="text/javascript">