summaryrefslogtreecommitdiffstats
path: root/idrop-swing
diff options
context:
space:
mode:
authorLisa Stillwell <lisa@renci.org>2012-10-26 15:22:55 (GMT)
committer Lisa Stillwell <lisa@renci.org>2012-10-26 15:22:55 (GMT)
commit24929e70cfad8e6c0c1ad121767400fd1e3905c1 (patch)
treea763abe216aaa00fc6d1e555bee90576972dcf50 /idrop-swing
parent8f938aef86b261b74d40620b4ddb1a381d599110 (diff)
downloadQCG-Data-24929e70cfad8e6c0c1ad121767400fd1e3905c1.zip
QCG-Data-24929e70cfad8e6c0c1ad121767400fd1e3905c1.tar.gz
QCG-Data-24929e70cfad8e6c0c1ad121767400fd1e3905c1.tar.bz2
[#983] hook in functionality for delete button
Diffstat (limited to 'idrop-swing')
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/iDrop.form3
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/iDrop.java37
2 files changed, 40 insertions, 0 deletions
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/iDrop.form b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/iDrop.form
index 4e293e1..a5ef47e 100644
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/iDrop.form
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/iDrop.form
@@ -250,6 +250,9 @@
<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="btnMainToolbarDeleteActionPerformed"/>
+ </Events>
</Component>
</SubComponents>
</Container>
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/iDrop.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/iDrop.java
index e2f10b9..719a155 100644
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/iDrop.java
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/iDrop.java
@@ -53,6 +53,7 @@ import org.irods.jargon.idrop.desktop.systraygui.viscomponents.LocalFileSystemMo
import org.irods.jargon.idrop.desktop.systraygui.viscomponents.LocalFileTree;
import org.irods.jargon.idrop.exceptions.IdropException;
import org.irods.jargon.idrop.exceptions.IdropRuntimeException;
+import org.irods.jargon.idrop.finder.FinderDeleteIRODSDialog;
import org.irods.jargon.transfer.engine.TransferManager;
import org.irods.jargon.transfer.engine.TransferManager.ErrorStatus;
import org.irods.jargon.transfer.engine.TransferManager.RunningStatus;
@@ -1445,6 +1446,11 @@ public class iDrop extends javax.swing.JFrame implements ActionListener,
btnMainToolbarDelete.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 1));
btnMainToolbarDelete.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
btnMainToolbarDelete.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
+ btnMainToolbarDelete.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ btnMainToolbarDeleteActionPerformed(evt);
+ }
+ });
pnlMainToolbarIcons.add(btnMainToolbarDelete);
pnlMainToolbar.add(pnlMainToolbarIcons, java.awt.BorderLayout.NORTH);
@@ -1636,6 +1642,37 @@ public class iDrop extends javax.swing.JFrame implements ActionListener,
buildTargetTree(false);
}//GEN-LAST:event_btnMainToolbarRefreshActionPerformed
+ private void btnMainToolbarDeleteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnMainToolbarDeleteActionPerformed
+ log.info("deleting a node");
+ int[] rows = irodsTree.getSelectedRows();
+ log.debug("selected rows for delete:{}", rows);
+
+ DeleteIRODSDialog deleteDialog;
+
+ if (rows.length == 1) {
+
+ IRODSNode toDelete = (IRODSNode) irodsTree.getValueAt(
+ rows[0], 0);
+ log.info("deleting a single node: {}", toDelete);
+ deleteDialog = new DeleteIRODSDialog(this, true,
+ irodsTree, toDelete);
+ } else {
+ List<IRODSNode> nodesToDelete = new ArrayList<IRODSNode>();
+ for (int row : rows) {
+ nodesToDelete.add((IRODSNode) irodsTree.getValueAt(row,
+ 0));
+
+ }
+
+ deleteDialog = new DeleteIRODSDialog(this, true,
+ irodsTree, nodesToDelete);
+ }
+
+ deleteDialog.setLocation(
+ (int) (this.getLocation().getX() + this.getWidth() / 2), (int) (this.getLocation().getY() + this.getHeight() / 2));
+ deleteDialog.setVisible(true);
+ }//GEN-LAST:event_btnMainToolbarDeleteActionPerformed
+
/**
* @param args the command line arguments
*/