summaryrefslogtreecommitdiffstats
path: root/idrop-swing
diff options
context:
space:
mode:
authorLisa Stillwell <lisa@renci.org>2012-11-26 20:45:31 (GMT)
committer Lisa Stillwell <lisa@renci.org>2012-11-26 20:45:31 (GMT)
commit7b02d43506e74d6697987238d2885282d81c45ed (patch)
tree42b7347f7d6e47ef6c0af8d8c070f36d13dec457 /idrop-swing
parent5404aa2c15874d7408cccbaa90b200787d3bf462 (diff)
downloadQCG-Data-7b02d43506e74d6697987238d2885282d81c45ed.zip
QCG-Data-7b02d43506e74d6697987238d2885282d81c45ed.tar.gz
QCG-Data-7b02d43506e74d6697987238d2885282d81c45ed.tar.bz2
[#983] redesign of Upload dialog per iPlant 11/13/12 version 2 design specs
Diffstat (limited to 'idrop-swing')
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/UploadDialog.form80
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/UploadDialog.java237
-rw-r--r--idrop-swing/src/main/resources/org/irods/jargon/idrop/desktop/systraygui/Bundle.properties5
3 files changed, 233 insertions, 89 deletions
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/UploadDialog.form b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/UploadDialog.form
index 1ee2552..81004e9 100644
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/UploadDialog.form
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/UploadDialog.form
@@ -20,7 +20,7 @@
<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,44,0,0,1,-65"/>
+ <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,8,0,0,1,-25"/>
</AuxValues>
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>
@@ -45,7 +45,7 @@
<Properties>
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
<Border info="org.netbeans.modules.form.compat2.border.EmptyBorderInfo">
- <EmptyBorder bottom="4" left="4" right="4" top="4"/>
+ <EmptyBorder bottom="16" left="4" right="4" top="16"/>
</Border>
</Property>
</Properties>
@@ -55,7 +55,7 @@
</Constraint>
</Constraints>
- <Layout class="org.netbeans.modules.form.compat2.layouts.DesignBoxLayout"/>
+ <Layout class="org.netbeans.modules.form.compat2.layouts.DesignFlowLayout"/>
<SubComponents>
<Component class="javax.swing.JLabel" name="jLabel1">
<Properties>
@@ -70,6 +70,10 @@
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/irods/jargon/idrop/desktop/systraygui/Bundle.properties" key="UploadDialog.txtUploadTarget.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property>
+ <Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
+ <Dimension value="[160, 28]"/>
+ </Property>
+ <Property name="requestFocusEnabled" type="boolean" value="false"/>
</Properties>
</Component>
<Component class="javax.swing.JButton" name="btnBrowseUploadTarget">
@@ -82,13 +86,59 @@
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnBrowseUploadTargetActionPerformed"/>
</Events>
</Component>
+ <Component class="javax.swing.JButton" name="btnUseIrodsHome">
+ <Properties>
+ <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
+ <ResourceString bundle="org/irods/jargon/idrop/desktop/systraygui/Bundle.properties" key="UploadDialog.btnUseIrodsHome.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="btnUseIrodsHomeActionPerformed"/>
+ </Events>
+ </Component>
+ <Component class="javax.swing.JButton" name="btnUseLastUpload">
+ <Properties>
+ <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
+ <ResourceString bundle="org/irods/jargon/idrop/desktop/systraygui/Bundle.properties" key="UploadDialog.btnUseLastUpload.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="btnUseLastUploadActionPerformed"/>
+ </Events>
+ </Component>
</SubComponents>
</Container>
<Container class="javax.swing.JPanel" name="jPanel3">
<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>
+ </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.DesignBoxLayout"/>
+ <SubComponents>
+ <Component class="javax.swing.JFileChooser" name="localChooser">
+ <Properties>
+ <Property name="controlButtonsAreShown" type="boolean" value="false"/>
+ <Property name="currentDirectory" type="java.io.File" value="null"/>
+ <Property name="fileSelectionMode" type="int" value="2"/>
+ <Property name="multiSelectionEnabled" type="boolean" value="true"/>
+ </Properties>
+ </Component>
+ </SubComponents>
+ </Container>
+ <Container class="javax.swing.JPanel" name="jPanel5">
+ <Properties>
+ <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
<Border info="org.netbeans.modules.form.compat2.border.EmptyBorderInfo">
- <EmptyBorder bottom="4" left="4" right="4" top="4"/>
+ <EmptyBorder bottom="1" left="4" right="4" top="14"/>
</Border>
</Property>
</Properties>
@@ -98,7 +148,7 @@
</Constraint>
</Constraints>
- <Layout class="org.netbeans.modules.form.compat2.layouts.DesignBoxLayout"/>
+ <Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>
<SubComponents>
<Component class="javax.swing.JLabel" name="jLabel2">
<Properties>
@@ -106,11 +156,21 @@
<ResourceString bundle="org/irods/jargon/idrop/desktop/systraygui/Bundle.properties" key="UploadDialog.jLabel2.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property>
</Properties>
+ <Constraints>
+ <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
+ <BorderConstraints direction="First"/>
+ </Constraint>
+ </Constraints>
</Component>
<Container class="javax.swing.JScrollPane" name="jScrollPane2">
<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>
@@ -123,16 +183,6 @@
</Component>
</SubComponents>
</Container>
- <Component class="javax.swing.JButton" name="btnBrowseUploadSource">
- <Properties>
- <Property name="text" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
- <ResourceString bundle="org/irods/jargon/idrop/desktop/systraygui/Bundle.properties" key="UploadDialog.btnBrowseUploadSource.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="btnBrowseUploadSourceActionPerformed"/>
- </Events>
- </Component>
</SubComponents>
</Container>
</SubComponents>
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/UploadDialog.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/UploadDialog.java
index e36eb31..eb0d765 100644
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/UploadDialog.java
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/UploadDialog.java
@@ -5,7 +5,10 @@
package org.irods.jargon.idrop.desktop.systraygui;
import java.awt.Cursor;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
import java.io.File;
+import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import javax.swing.JFileChooser;
@@ -14,6 +17,7 @@ import javax.swing.tree.TreePath;
import javax.swing.tree.TreeSelectionModel;
import org.irods.jargon.core.exception.JargonException;
import org.irods.jargon.core.pub.io.IRODSFile;
+import org.irods.jargon.core.utils.MiscIRODSUtils;
import org.irods.jargon.idrop.desktop.systraygui.services.IRODSFileService;
import org.irods.jargon.idrop.desktop.systraygui.viscomponents.IRODSNode;
import org.irods.jargon.idrop.desktop.systraygui.viscomponents.IRODSOutlineModel;
@@ -57,8 +61,9 @@ public class UploadDialog extends javax.swing.JDialog {
this.irodsTree = irodsTree;
this.localFileTree = localFileTree;
+ createChooserListener();
initUploadTarget();
- initSourcesFiles();
+// initSourcesFiles();
setUploadButtonState();
}
@@ -97,46 +102,52 @@ public class UploadDialog extends javax.swing.JDialog {
Exceptions.printStackTrace(ex);
}
}
- else {
-
- // next see if can find some put history in the transfer queue
- // manager and use that target location
- // next see if can find some get history in the transfer queue
- try {
- List<LocalIRODSTransfer> transfers = idropGUI.getiDropCore().getTransferManager().getRecentQueue();
-
- // assuming most recent first
- for (LocalIRODSTransfer transfer: transfers) {
- if (transfer.getTransferType() == TransferType.PUT) {
- target = transfer.getIrodsAbsolutePath();
- break;
- }
- }
- } catch (JargonException ex) {
- Exceptions.printStackTrace(ex);
- }
- }
+// else {
+//
+// // next see if can find some put history in the transfer queue
+// // manager and use that target location
+// // next see if can find some get history in the transfer queue
+// try {
+// List<LocalIRODSTransfer> transfers = idropGUI.getiDropCore().getTransferManager().getRecentQueue();
+//
+// // assuming most recent first
+// for (LocalIRODSTransfer transfer: transfers) {
+// if (transfer.getTransferType() == TransferType.PUT) {
+// target = transfer.getIrodsAbsolutePath();
+// break;
+// }
+// }
+// } catch (JargonException ex) {
+// Exceptions.printStackTrace(ex);
+// }
+// }
txtUploadTarget.setText(target);
}
- private void initSourcesFiles() {
-
- //check for selected files and/or folders to upload
- TreeSelectionModel selectionModel = localFileTree.getSelectionModel();
- LocalFileSystemModel fileSystemModel = (LocalFileSystemModel) localFileTree.getModel();
-
- TreePath[] selectionPaths = selectionModel.getSelectionPaths();
-
- if ( selectionPaths != null) {
- LocalFileNode sourceNode;
- for (TreePath selectionPath : selectionPaths) {
- sourceNode = (LocalFileNode) selectionPath.getLastPathComponent();
- File file = (File) sourceNode.getUserObject();
- txtareaUploadSourceList.append(file.getAbsolutePath() + "\n");
- }
- }
- }
+
+ // seems to be impossible to preselect files in filechooser component
+ // don't do this for now
+// private void initSourcesFiles() {
+//
+// //check for selected files and/or folders to upload
+// TreeSelectionModel selectionModel = localFileTree.getSelectionModel();
+// LocalFileSystemModel fileSystemModel = (LocalFileSystemModel) localFileTree.getModel();
+//
+// TreePath[] selectionPaths = selectionModel.getSelectionPaths();
+//
+// // now select these paths in the file chooser
+// if ( selectionPaths != null) {
+// LocalFileNode sourceNode;
+// for (TreePath selectionPath : selectionPaths) {
+// sourceNode = (LocalFileNode) selectionPath.getLastPathComponent();
+// File file = (File) sourceNode.getUserObject();
+// //txtareaUploadSourceList.append(file.getAbsolutePath() + "\n");
+// localChooser.setSelectedFile(file);
+// }
+// }
+//
+// }
private void setUploadButtonState() {
btnUploadNow.setEnabled(((txtUploadTarget.getText().length() > 0) &&
@@ -178,6 +189,46 @@ public class UploadDialog extends javax.swing.JDialog {
idropGUI.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
}
+
+ private void createChooserListener() {
+ localChooser.addPropertyChangeListener(new PropertyChangeListener() {
+ public void propertyChange(PropertyChangeEvent evt) {
+
+ if ((JFileChooser.SELECTED_FILE_CHANGED_PROPERTY.equals(evt.getPropertyName())) ||
+ (JFileChooser.SELECTED_FILES_CHANGED_PROPERTY.equals(evt.getPropertyName()))) {
+ // clear all items from listbox
+ txtareaUploadSourceList.setText(null);
+
+ if (evt.getNewValue() != null) {
+ File uploadFiles[] = localChooser.getSelectedFiles();
+ for (File uploadFile: uploadFiles) {
+ txtareaUploadSourceList.append(uploadFile.getAbsolutePath() + "\n");
+ }
+ }
+ setUploadButtonState();
+ }
+ }
+ });
+ }
+// private void btnBrowseUploadSourceActionPerformed(java.awt.event.ActionEvent evt) {
+//
+// JFileChooser localFileChooser = new JFileChooser();
+// localFileChooser.setMultiSelectionEnabled(true);
+// localFileChooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
+// localFileChooser.setDialogTitle("Select Files and Collections to Upload");
+// localFileChooser.setLocation(
+// (int)this.getLocation().getX(), (int)this.getLocation().getY());
+// int returnVal = localFileChooser.showOpenDialog(this);
+//
+// if (returnVal == JFileChooser.APPROVE_OPTION) {
+// File uploadFiles[] = localFileChooser.getSelectedFiles();
+// for (File uploadFile: uploadFiles) {
+// txtareaUploadSourceList.append(uploadFile.getAbsolutePath() + "\n");
+// }
+// setUploadButtonState();
+// }
+// }
+
/**
* This method is called from within the constructor to initialize the form.
@@ -193,11 +244,14 @@ public class UploadDialog extends javax.swing.JDialog {
jLabel1 = new javax.swing.JLabel();
txtUploadTarget = new javax.swing.JTextField();
btnBrowseUploadTarget = new javax.swing.JButton();
+ btnUseIrodsHome = new javax.swing.JButton();
+ btnUseLastUpload = new javax.swing.JButton();
jPanel3 = new javax.swing.JPanel();
+ localChooser = new javax.swing.JFileChooser();
+ jPanel5 = new javax.swing.JPanel();
jLabel2 = new javax.swing.JLabel();
jScrollPane2 = new javax.swing.JScrollPane();
txtareaUploadSourceList = new javax.swing.JTextArea();
- btnBrowseUploadSource = new javax.swing.JButton();
jPanel2 = new javax.swing.JPanel();
btnCancel = new javax.swing.JButton();
btnUploadNow = new javax.swing.JButton();
@@ -208,14 +262,15 @@ public class UploadDialog extends javax.swing.JDialog {
jPanel1.setBorder(javax.swing.BorderFactory.createEmptyBorder(4, 4, 4, 4));
jPanel1.setLayout(new java.awt.BorderLayout());
- jPanel4.setBorder(javax.swing.BorderFactory.createEmptyBorder(4, 4, 4, 4));
- jPanel4.setLayout(new javax.swing.BoxLayout(jPanel4, javax.swing.BoxLayout.LINE_AXIS));
+ jPanel4.setBorder(javax.swing.BorderFactory.createEmptyBorder(16, 4, 16, 4));
jLabel1.setText(org.openide.util.NbBundle.getMessage(UploadDialog.class, "UploadDialog.jLabel1.text")); // NOI18N
jPanel4.add(jLabel1);
txtUploadTarget.setEditable(false);
txtUploadTarget.setText(org.openide.util.NbBundle.getMessage(UploadDialog.class, "UploadDialog.txtUploadTarget.text")); // NOI18N
+ txtUploadTarget.setPreferredSize(new java.awt.Dimension(160, 28));
+ txtUploadTarget.setRequestFocusEnabled(false);
jPanel4.add(txtUploadTarget);
btnBrowseUploadTarget.setText(org.openide.util.NbBundle.getMessage(UploadDialog.class, "UploadDialog.btnBrowseUploadTarget.text")); // NOI18N
@@ -226,30 +281,49 @@ public class UploadDialog extends javax.swing.JDialog {
});
jPanel4.add(btnBrowseUploadTarget);
+ btnUseIrodsHome.setText(org.openide.util.NbBundle.getMessage(UploadDialog.class, "UploadDialog.btnUseIrodsHome.text")); // NOI18N
+ btnUseIrodsHome.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ btnUseIrodsHomeActionPerformed(evt);
+ }
+ });
+ jPanel4.add(btnUseIrodsHome);
+
+ btnUseLastUpload.setText(org.openide.util.NbBundle.getMessage(UploadDialog.class, "UploadDialog.btnUseLastUpload.text")); // NOI18N
+ btnUseLastUpload.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ btnUseLastUploadActionPerformed(evt);
+ }
+ });
+ jPanel4.add(btnUseLastUpload);
+
jPanel1.add(jPanel4, java.awt.BorderLayout.NORTH);
- jPanel3.setBorder(javax.swing.BorderFactory.createEmptyBorder(4, 4, 4, 4));
+ jPanel3.setBorder(javax.swing.BorderFactory.createEtchedBorder());
jPanel3.setLayout(new javax.swing.BoxLayout(jPanel3, javax.swing.BoxLayout.LINE_AXIS));
+ localChooser.setControlButtonsAreShown(false);
+ localChooser.setCurrentDirectory(null);
+ localChooser.setFileSelectionMode(javax.swing.JFileChooser.FILES_AND_DIRECTORIES);
+ localChooser.setMultiSelectionEnabled(true);
+ jPanel3.add(localChooser);
+
+ jPanel1.add(jPanel3, java.awt.BorderLayout.CENTER);
+
+ jPanel5.setBorder(javax.swing.BorderFactory.createEmptyBorder(14, 4, 1, 4));
+ jPanel5.setLayout(new java.awt.BorderLayout());
+
jLabel2.setText(org.openide.util.NbBundle.getMessage(UploadDialog.class, "UploadDialog.jLabel2.text")); // NOI18N
- jPanel3.add(jLabel2);
+ jPanel5.add(jLabel2, java.awt.BorderLayout.PAGE_START);
txtareaUploadSourceList.setEditable(false);
txtareaUploadSourceList.setColumns(20);
txtareaUploadSourceList.setRows(5);
jScrollPane2.setViewportView(txtareaUploadSourceList);
- jPanel3.add(jScrollPane2);
-
- btnBrowseUploadSource.setText(org.openide.util.NbBundle.getMessage(UploadDialog.class, "UploadDialog.btnBrowseUploadSource.text")); // NOI18N
- btnBrowseUploadSource.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent evt) {
- btnBrowseUploadSourceActionPerformed(evt);
- }
- });
- jPanel3.add(btnBrowseUploadSource);
+ jPanel5.add(jScrollPane2, java.awt.BorderLayout.CENTER);
- jPanel1.add(jPanel3, java.awt.BorderLayout.SOUTH);
+ jPanel1.add(jPanel5, java.awt.BorderLayout.SOUTH);
getContentPane().add(jPanel1, java.awt.BorderLayout.CENTER);
@@ -292,25 +366,6 @@ public class UploadDialog extends javax.swing.JDialog {
setUploadButtonState();
}//GEN-LAST:event_btnBrowseUploadTargetActionPerformed
- private void btnBrowseUploadSourceActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnBrowseUploadSourceActionPerformed
-
- JFileChooser localFileChooser = new JFileChooser();
- localFileChooser.setMultiSelectionEnabled(true);
- localFileChooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
- localFileChooser.setDialogTitle("Select Files and Collections to Upload");
- localFileChooser.setLocation(
- (int)this.getLocation().getX(), (int)this.getLocation().getY());
- int returnVal = localFileChooser.showOpenDialog(this);
-
- if (returnVal == JFileChooser.APPROVE_OPTION) {
- File uploadFiles[] = localFileChooser.getSelectedFiles();
- for (File uploadFile: uploadFiles) {
- txtareaUploadSourceList.append(uploadFile.getAbsolutePath() + "\n");
- }
- setUploadButtonState();
- }
- }//GEN-LAST:event_btnBrowseUploadSourceActionPerformed
-
private void btnCancelActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCancelActionPerformed
this.dispose();
}//GEN-LAST:event_btnCancelActionPerformed
@@ -320,18 +375,56 @@ public class UploadDialog extends javax.swing.JDialog {
this.dispose();
}//GEN-LAST:event_btnUploadNowActionPerformed
+ private void btnUseIrodsHomeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnUseIrodsHomeActionPerformed
+ String target = "";
+ if (idropGUI.getiDropCore().getIrodsAccount().isAnonymousAccount()) {
+ target = MiscIRODSUtils.computePublicDirectory(idropGUI.getiDropCore().getIrodsAccount());
+ } else {
+ target = MiscIRODSUtils.computeHomeDirectoryForIRODSAccount(idropGUI.getiDropCore().getIrodsAccount());
+ }
+ if (target != null) {
+ txtUploadTarget.setText(target);
+ }
+ setUploadButtonState();
+ }//GEN-LAST:event_btnUseIrodsHomeActionPerformed
+
+ private void btnUseLastUploadActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnUseLastUploadActionPerformed
+ String target = "";
+ // see if can find some get history in the transfer queue
+ try {
+ List<LocalIRODSTransfer> transfers = idropGUI.getiDropCore().getTransferManager().getRecentQueue();
+
+ // assuming most recent first
+ for (LocalIRODSTransfer transfer: transfers) {
+ if (transfer.getTransferType() == TransferType.PUT) {
+ target = transfer.getIrodsAbsolutePath();
+ break;
+ }
+ }
+ } catch (JargonException ex) {
+ Exceptions.printStackTrace(ex);
+ }
+ if (target != null) {
+ txtUploadTarget.setText(target);
+ }
+ setUploadButtonState();
+ }//GEN-LAST:event_btnUseLastUploadActionPerformed
+
// Variables declaration - do not modify//GEN-BEGIN:variables
- private javax.swing.JButton btnBrowseUploadSource;
private javax.swing.JButton btnBrowseUploadTarget;
private javax.swing.JButton btnCancel;
private javax.swing.JButton btnUploadNow;
+ private javax.swing.JButton btnUseIrodsHome;
+ private javax.swing.JButton btnUseLastUpload;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JPanel jPanel1;
private javax.swing.JPanel jPanel2;
private javax.swing.JPanel jPanel3;
private javax.swing.JPanel jPanel4;
+ private javax.swing.JPanel jPanel5;
private javax.swing.JScrollPane jScrollPane2;
+ private javax.swing.JFileChooser localChooser;
private javax.swing.JTextField txtUploadTarget;
private javax.swing.JTextArea txtareaUploadSourceList;
// End of variables declaration//GEN-END:variables
diff --git a/idrop-swing/src/main/resources/org/irods/jargon/idrop/desktop/systraygui/Bundle.properties b/idrop-swing/src/main/resources/org/irods/jargon/idrop/desktop/systraygui/Bundle.properties
index b3fa2f8..7509792 100644
--- a/idrop-swing/src/main/resources/org/irods/jargon/idrop/desktop/systraygui/Bundle.properties
+++ b/idrop-swing/src/main/resources/org/irods/jargon/idrop/desktop/systraygui/Bundle.properties
@@ -150,10 +150,9 @@ DownloadDialog.btnDownloadNow.text=Download Now
DownloadDialog.AccessibleContext.accessibleName=Download Files and Collections from iRODS
iDrop.btnMainToolbarInfo.label=Info
UploadDialog.jLabel1.text=Upload Target Location:
-UploadDialog.jLabel2.text=Files/Folders to Upload:
+UploadDialog.jLabel2.text=Files/Folders that will be uploaded:
UploadDialog.btnCancel.text=Cancel
UploadDialog.title=Upload Files and Folders to iRODS
-UploadDialog.btnBrowseUploadSource.text=Browse Local Files
UploadDialog.btnBrowseUploadTarget.text=Browse iRODS Collections
UploadDialog.btnUploadNow.text=Upload Now
UploadDialog.txtUploadTarget.text=
@@ -196,3 +195,5 @@ IRODSInfoDialog.btnCancel.text=Cancel
IRODSInfoDialog.btnSaveAll.text=Save
IRODSInfoDialog.jTabbedPane1.TabConstraints.tabTitle=MetaData
IRODSInfoDialog.jTabbedPane2.TabConstraints.tabTitle=Permissions
+UploadDialog.btnUseIrodsHome.text=Use iRODS home directory
+UploadDialog.btnUseLastUpload.text=Use last upload target