summaryrefslogtreecommitdiffstats
path: root/idrop-swing
diff options
context:
space:
mode:
authorLisa Stillwell <lisa@renci.org>2012-11-02 20:07:50 (GMT)
committer Lisa Stillwell <lisa@renci.org>2012-11-02 20:07:50 (GMT)
commit32db5d2278237c11708f6061618cd671d0e3381c (patch)
treed70cd32de72abe36c835c0be3a1725f38ad6bc59 /idrop-swing
parent7aa71fe5189ac6c892a2fc9b109226423a6dcd6a (diff)
downloadQCG-Data-32db5d2278237c11708f6061618cd671d0e3381c.zip
QCG-Data-32db5d2278237c11708f6061618cd671d0e3381c.tar.gz
QCG-Data-32db5d2278237c11708f6061618cd671d0e3381c.tar.bz2
[983] fix some bugs when canceling Upload and Download dialogs
Diffstat (limited to 'idrop-swing')
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/iDrop.form14
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/iDrop.java76
-rw-r--r--idrop-swing/src/main/resources/org/irods/jargon/idrop/desktop/systraygui/Bundle.properties4
3 files changed, 77 insertions, 17 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 ed748be..3428969 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
@@ -14,6 +14,9 @@
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[622, 158]"/>
</Property>
+ <Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
+ <Dimension value="[700, 635]"/>
+ </Property>
<Property name="size" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[822, 158]"/>
</Property>
@@ -31,7 +34,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,2,1,0,0,4,81"/>
+ <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,0,0,0,3,-29"/>
</AuxValues>
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>
@@ -226,15 +229,18 @@
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/icon_replicate.png"/>
</Property>
+ <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="iDrop.btnMainToolbarCopy.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
+ </Property>
+ <Property name="actionCommand" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
+ <ResourceString bundle="org/irods/jargon/idrop/desktop/systraygui/Bundle.properties" key="iDrop.btnMainToolbarCopy.actionCommand" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
+ </Property>
<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="1" left="1" right="24" top="1"/>
</Border>
</Property>
<Property name="horizontalTextPosition" type="int" value="0"/>
- <Property name="label" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
- <ResourceString bundle="org/irods/jargon/idrop/desktop/systraygui/Bundle.properties" key="iDrop.btnMainToolbarCopy.label" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
- </Property>
<Property name="verticalTextPosition" type="int" value="3"/>
</Properties>
</Component>
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 3f5d88d..1c8fabc 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
@@ -36,6 +36,7 @@ import javax.swing.tree.TreePath;
import javax.swing.tree.TreeSelectionModel;
import org.irods.jargon.core.connection.IRODSAccount;
import org.irods.jargon.core.exception.JargonException;
+import org.irods.jargon.core.pub.CollectionAndDataObjectListAndSearchAO;
import org.irods.jargon.core.pub.EnvironmentalInfoAO;
import org.irods.jargon.core.pub.io.IRODSFile;
import org.irods.jargon.core.query.CollectionAndDataObjectListingEntry;
@@ -1047,6 +1048,52 @@ public class iDrop extends javax.swing.JFrame implements ActionListener,
private void setBreadcrumb(String path) {
lblBreadCrumb.setText(path);
}
+
+ private void processSearchRequest() {
+ log.info("do a search for files and collections");
+// if (comboSearchType.getSelectedIndex() == 0) {
+// log.info("searching files and collections");
+ searchFilesAndShowSearchResultsTab(txtMainToolbarSearchTerms.getText());
+// } else if (comboSearchType.getSelectedIndex() == 1) {
+// log.info("searching by tag value");
+// searchTagsAndShowSearchResultsTag(txtMainSearch.getText());
+// } else {
+// throw new UnsupportedOperationException("not yet implemented");
+// }
+ }
+
+ private void searchFilesAndShowSearchResultsTab(final String searchText) {
+ if (searchText.isEmpty()) {
+ this.showMessageFromOperation("please enter text to search on");
+ return;
+ }
+
+ final String searchTerms = searchText.trim();
+ final iDrop idropGui = this;
+
+// java.awt.EventQueue.invokeLater(new Runnable() {
+//
+// @Override
+// public void run() {
+//
+// try {
+// idropGui.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
+// CollectionAndDataObjectListAndSearchAO collectionAndDataObjectListAndSearchAO = iDropCore.getIRODSAccessObjectFactory().getCollectionAndDataObjectListAndSearchAO(
+// iDropCore.getIrodsAccount());
+// IRODSSearchTableModel irodsSearchTableModel = new IRODSSearchTableModel(
+// collectionAndDataObjectListAndSearchAO.searchCollectionsAndDataObjectsBasedOnName(searchTerms));
+// tableSearchResults.setModel(irodsSearchTableModel);
+// tabIrodsViews.setSelectedComponent(pnlTabSearch);
+// } catch (Exception e) {
+// idropGui.showIdropException(e);
+// return;
+// } finally {
+// iDropCore.closeAllIRODSConnections();
+// idropGui.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
+// }
+// }
+// });
+ }
/**
* Look at the kind of irods node and handle appropriately
@@ -1538,6 +1585,7 @@ public class iDrop extends javax.swing.JFrame implements ActionListener,
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
setMinimumSize(new java.awt.Dimension(622, 158));
+ setPreferredSize(new java.awt.Dimension(700, 635));
setSize(new java.awt.Dimension(822, 158));
pnlMain.setMinimumSize(new java.awt.Dimension(622, 158));
@@ -1623,9 +1671,10 @@ public class iDrop extends javax.swing.JFrame implements ActionListener,
pnlMainToolbarIcons.add(btnMainToolbarAddEditMetaData);
btnMainToolbarCopy.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icon_replicate.png"))); // NOI18N
+ btnMainToolbarCopy.setText(org.openide.util.NbBundle.getMessage(iDrop.class, "iDrop.btnMainToolbarCopy.text")); // NOI18N
+ btnMainToolbarCopy.setActionCommand(org.openide.util.NbBundle.getMessage(iDrop.class, "iDrop.btnMainToolbarCopy.actionCommand")); // NOI18N
btnMainToolbarCopy.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 24));
btnMainToolbarCopy.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
- btnMainToolbarCopy.setLabel(org.openide.util.NbBundle.getMessage(iDrop.class, "iDrop.btnMainToolbarCopy.label")); // NOI18N
btnMainToolbarCopy.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
pnlMainToolbarIcons.add(btnMainToolbarCopy);
@@ -1855,9 +1904,11 @@ public class iDrop extends javax.swing.JFrame implements ActionListener,
localFileChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
localFileChooser.setDialogTitle("Select Download Target");
int returnVal = localFileChooser.showOpenDialog(this);
- String downloadPath = localFileChooser.getSelectedFile().getAbsolutePath();
-
- executeDownload(downloadPath);
+
+ if (returnVal == JFileChooser.APPROVE_OPTION) {
+ String downloadPath = localFileChooser.getSelectedFile().getAbsolutePath();
+ executeDownload(downloadPath);
+ }
}//GEN-LAST:event_btnMainToolbarDownloadActionPerformed
private void btnShowTransferManagerActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnShowTransferManagerActionPerformed
@@ -1911,17 +1962,18 @@ public class iDrop extends javax.swing.JFrame implements ActionListener,
localFileChooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
localFileChooser.setDialogTitle("Select Files and/or Folders to Upload");
int returnVal = localFileChooser.showOpenDialog(this);
- File files[] = localFileChooser.getSelectedFiles();
+
+ if (returnVal == JFileChooser.APPROVE_OPTION) {
+ File files[] = localFileChooser.getSelectedFiles();
- // now start upload
- if (files != null) {
- executeUpload(files);
- } else {
- // TODO: error dialog here
+ // now start upload
+ if (files != null) {
+ executeUpload(files);
+ } else {
+ // TODO: error dialog here
+ }
}
-
-
// String targetPath = null;
// open irods folder chooser
// try {
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 926f72f..1f7a1f5 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
@@ -121,7 +121,7 @@ iDrop.btnMainToolbarUpload.text=Upload
iDrop.btnMainToolbarSync.text=Sync
iDrop.btnMainToolbarSettings.text=Settings
iDrop.btnMainToolbarCopy.label=Copy to Another Server
-iDrop.btnMainToolbarAddEditMetaData.text=Add or Edit Metadata
+iDrop.btnMainToolbarAddEditMetaData.text=Info
iDrop.btnMainToolbarSearchFiles.text=Search Files
iDrop.txtMainToolbarSearchTerms.text=Enter search terms
iDrop.btnMainToolbarDelete.text_1=Delete
@@ -137,3 +137,5 @@ iDrop.lblTransferFilesCounts.text=Total Progress:
iDrop.progressIntraFile.string=
iDrop.lblBreadCrumb.text=
iDrop.scrollLocalFileTree.toolTipText=scroll panel tooltip
+iDrop.btnMainToolbarCopy.actionCommand=Copy/Move
+iDrop.btnMainToolbarCopy.text=Copy/Move