summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Conway <mikeconway@dhcp152-54-6-70.wireless.europa.renci.org>2011-08-02 18:05:58 (GMT)
committer Mike Conway <mikeconway@dhcp152-54-6-70.wireless.europa.renci.org>2011-08-02 18:05:58 (GMT)
commit86603d0b29273ddd75da67471f1216e783b5bb76 (patch)
tree5688f996ff00cb1ea7c2b00921d934c2eb8f60fd
parent6ef4dc78cd315177c4485b0e73577e685303af6b (diff)
downloadQCG-Data-86603d0b29273ddd75da67471f1216e783b5bb76.zip
QCG-Data-86603d0b29273ddd75da67471f1216e783b5bb76.tar.gz
QCG-Data-86603d0b29273ddd75da67471f1216e783b5bb76.tar.bz2
improve button behavior in config panel synch
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/IDROPConfigurationPanel.form11
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/IDROPConfigurationPanel.java42
-rw-r--r--idrop-swing/src/main/resources/org/irods/jargon/idrop/desktop/systraygui/Bundle.properties4
3 files changed, 37 insertions, 20 deletions
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/IDROPConfigurationPanel.form b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/IDROPConfigurationPanel.form
index 6a46d63..9fe2857 100644
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/IDROPConfigurationPanel.form
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/IDROPConfigurationPanel.form
@@ -436,18 +436,19 @@
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignFlowLayout"/>
<SubComponents>
- <Component class="javax.swing.JButton" name="btnDeleteSelected">
+ <Component class="javax.swing.JButton" name="btnDeleteSynch">
<Properties>
<Property name="mnemonic" type="int" value="100"/>
<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="IDROPConfigurationPanel.btnDeleteSelected.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
+ <ResourceString bundle="org/irods/jargon/idrop/desktop/systraygui/Bundle.properties" key="IDROPConfigurationPanel.btnDeleteSynch.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/desktop/systraygui/Bundle.properties" key="IDROPConfigurationPanel.btnDeleteSelected.toolTipText" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
+ <ResourceString bundle="org/irods/jargon/idrop/desktop/systraygui/Bundle.properties" key="IDROPConfigurationPanel.btnDeleteSynch.toolTipText" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property>
+ <Property name="enabled" type="boolean" value="false"/>
</Properties>
<Events>
- <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnDeleteSelectedActionPerformed"/>
+ <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnDeleteSynchActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="btnNewSynch">
@@ -473,6 +474,7 @@
<Property name="toolTipText" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/irods/jargon/idrop/desktop/systraygui/Bundle.properties" key="IDROPConfigurationPanel.btnUpdateSynch.toolTipText" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property>
+ <Property name="enabled" type="boolean" value="false"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnUpdateSynchActionPerformed"/>
@@ -487,6 +489,7 @@
<Property name="toolTipText" type="java.lang.String" editor="org.netbeans.modules.i18n.form.FormI18nStringEditor">
<ResourceString bundle="org/irods/jargon/idrop/desktop/systraygui/Bundle.properties" key="IDROPConfigurationPanel.btnSynchNow.toolTipText" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property>
+ <Property name="enabled" type="boolean" value="false"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnSynchNowActionPerformed"/>
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/IDROPConfigurationPanel.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/IDROPConfigurationPanel.java
index 34dad5b..023a136 100644
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/IDROPConfigurationPanel.java
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/IDROPConfigurationPanel.java
@@ -97,7 +97,7 @@ public class IDROPConfigurationPanel extends javax.swing.JDialog {
txtIrodsPath = new javax.swing.JTextField();
btnChooseIrodsSynch = new javax.swing.JButton();
panelSynchToolbar = new javax.swing.JPanel();
- btnDeleteSelected = new javax.swing.JButton();
+ btnDeleteSynch = new javax.swing.JButton();
btnNewSynch = new javax.swing.JButton();
btnUpdateSynch = new javax.swing.JButton();
btnSynchNow = new javax.swing.JButton();
@@ -317,15 +317,16 @@ public class IDROPConfigurationPanel extends javax.swing.JDialog {
pnlConfigSynchDetails.add(pnlSynchData, java.awt.BorderLayout.CENTER);
- btnDeleteSelected.setMnemonic('d');
- btnDeleteSelected.setText(org.openide.util.NbBundle.getMessage(IDROPConfigurationPanel.class, "IDROPConfigurationPanel.btnDeleteSelected.text")); // NOI18N
- btnDeleteSelected.setToolTipText(org.openide.util.NbBundle.getMessage(IDROPConfigurationPanel.class, "IDROPConfigurationPanel.btnDeleteSelected.toolTipText")); // NOI18N
- btnDeleteSelected.addActionListener(new java.awt.event.ActionListener() {
+ btnDeleteSynch.setMnemonic('d');
+ btnDeleteSynch.setText(org.openide.util.NbBundle.getMessage(IDROPConfigurationPanel.class, "IDROPConfigurationPanel.btnDeleteSynch.text")); // NOI18N
+ btnDeleteSynch.setToolTipText(org.openide.util.NbBundle.getMessage(IDROPConfigurationPanel.class, "IDROPConfigurationPanel.btnDeleteSynch.toolTipText")); // NOI18N
+ btnDeleteSynch.setEnabled(false);
+ btnDeleteSynch.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
- btnDeleteSelectedActionPerformed(evt);
+ btnDeleteSynchActionPerformed(evt);
}
});
- panelSynchToolbar.add(btnDeleteSelected);
+ panelSynchToolbar.add(btnDeleteSynch);
btnNewSynch.setMnemonic('n');
btnNewSynch.setText(org.openide.util.NbBundle.getMessage(IDROPConfigurationPanel.class, "IDROPConfigurationPanel.btnNewSynch.text")); // NOI18N
@@ -340,6 +341,7 @@ public class IDROPConfigurationPanel extends javax.swing.JDialog {
btnUpdateSynch.setMnemonic('u');
btnUpdateSynch.setText(org.openide.util.NbBundle.getMessage(IDROPConfigurationPanel.class, "IDROPConfigurationPanel.btnUpdateSynch.text")); // NOI18N
btnUpdateSynch.setToolTipText(org.openide.util.NbBundle.getMessage(IDROPConfigurationPanel.class, "IDROPConfigurationPanel.btnUpdateSynch.toolTipText")); // NOI18N
+ btnUpdateSynch.setEnabled(false);
btnUpdateSynch.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnUpdateSynchActionPerformed(evt);
@@ -350,6 +352,7 @@ public class IDROPConfigurationPanel extends javax.swing.JDialog {
btnSynchNow.setMnemonic('s');
btnSynchNow.setText(org.openide.util.NbBundle.getMessage(IDROPConfigurationPanel.class, "IDROPConfigurationPanel.btnSynchNow.text")); // NOI18N
btnSynchNow.setToolTipText(org.openide.util.NbBundle.getMessage(IDROPConfigurationPanel.class, "IDROPConfigurationPanel.btnSynchNow.toolTipText")); // NOI18N
+ btnSynchNow.setEnabled(false);
btnSynchNow.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnSynchNowActionPerformed(evt);
@@ -488,9 +491,12 @@ public class IDROPConfigurationPanel extends javax.swing.JDialog {
}
}//GEN-LAST:event_btnChooseIrodsSynchActionPerformed
- private void btnDeleteSelectedActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnDeleteSelectedActionPerformed
- // TODO add your handling code here:
- }//GEN-LAST:event_btnDeleteSelectedActionPerformed
+ /**
+ * Delete the selected synchronization
+ * @param evt
+ */
+ private void btnDeleteSynchActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnDeleteSynchActionPerformed
+ }//GEN-LAST:event_btnDeleteSynchActionPerformed
/**
* Called to clear and prepare for adding a new synchronization
@@ -498,8 +504,11 @@ public class IDROPConfigurationPanel extends javax.swing.JDialog {
*/
private void btnNewSynchActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnNewSynchActionPerformed
clearAndResetSynchPanel();
- jTableSynch.getSelectionModel().removeIndexInterval(0,jTableSynch.getModel().getRowCount() -1);
+ jTableSynch.getSelectionModel().removeIndexInterval(0, jTableSynch.getModel().getRowCount() - 1);
selectedSynchronization = new Synchronization();
+ btnDeleteSynch.setEnabled(false);
+ btnUpdateSynch.setEnabled(true);
+ btnSynchNow.setEnabled(false);
MessageManager.showMessage(this, "Enter the data for the new Synchronization and press Update to save", MessageManager.TITLE_MESSAGE);
}//GEN-LAST:event_btnNewSynchActionPerformed
@@ -563,7 +572,7 @@ public class IDROPConfigurationPanel extends javax.swing.JDialog {
MessageManager.showError(thisPanel, ex.getMessage(), MessageManager.TITLE_MESSAGE);
throw new IdropRuntimeException(ex);
}
-
+
synchronization.setIrodsPort(irodsAccount.getPort());
synchronization.setIrodsUserName(irodsAccount.getUserName());
synchronization.setIrodsZone(irodsAccount.getZone());
@@ -605,8 +614,10 @@ public class IDROPConfigurationPanel extends javax.swing.JDialog {
}
}
-
MessageManager.showMessage(thisPanel, "Configuration updated", MessageManager.TITLE_MESSAGE);
+ btnDeleteSynch.setEnabled(true);
+ btnUpdateSynch.setEnabled(true);
+ btnSynchNow.setEnabled(true);
} catch (IdropException ex) {
MessageManager.showError(thisPanel, ex.getMessage(), MessageManager.TITLE_MESSAGE);
@@ -668,7 +679,7 @@ public class IDROPConfigurationPanel extends javax.swing.JDialog {
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton btnChooseIrodsSynch;
private javax.swing.JButton btnChooseLocalSynch;
- private javax.swing.JButton btnDeleteSelected;
+ private javax.swing.JButton btnDeleteSynch;
private javax.swing.JButton btnNewSynch;
private javax.swing.JButton btnOK;
private javax.swing.JButton btnSynchNow;
@@ -783,6 +794,9 @@ public class IDROPConfigurationPanel extends javax.swing.JDialog {
txtIrodsPath.setText(selectedSynchronization.getIrodsSynchDirectory());
txtSynchName.setText(selectedSynchronization.getName());
+ btnDeleteSynch.setEnabled(true);
+ btnUpdateSynch.setEnabled(true);
+ btnSynchNow.setEnabled(true);
}
}
}
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 d2cc95c..c69d7d8 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
@@ -9,8 +9,6 @@ IDROPConfigurationPanel.checkShowGUI.text=Show iDrop GUI at Startup
IDROPConfigurationPanel.checkShowGUI.toolTipText=Show the gui at startup or just start in system tray
IDROPConfigurationPanel.checkLogSuccessfulTransfer.text=Log successful transfers file by file
IDROPConfigurationPanel.checkLogSuccessfulTransfer.toolTipText=Log each file in a transfer, can have performance impact
-IDROPConfigurationPanel.btnDeleteSelected.text=Delete
-IDROPConfigurationPanel.btnDeleteSelected.toolTipText=Delete the selected synchronization
IDROPConfigurationPanel.btnNewSynch.text=New
IDROPConfigurationPanel.btnNewSynch.toolTipText=Create a new Synchronization
IDROPConfigurationPanel.btnUpdateSynch.text=Update
@@ -34,3 +32,5 @@ IDROPConfigurationPanel.btnSynchNow.toolTipText=Synchronize now
IDROPConfigurationPanel.checkVerifyChecksumOnTransfer.text=Verfiy Checksum on get/put transfers
IDROPConfigurationPanel.lblSynchName.text=Name this synchronization folder:
IDROPConfigurationPanel.txtSynchName.text=
+IDROPConfigurationPanel.btnDeleteSynch.toolTipText=Delete the selected synchronization
+IDROPConfigurationPanel.btnDeleteSynch.text=Delete