summaryrefslogtreecommitdiffstats
path: root/idrop-swing
diff options
context:
space:
mode:
authorMike Conway <mikeconway@dhcp152-54-6-70.wireless.europa.renci.org>2011-07-12 14:19:51 (GMT)
committer Mike Conway <mikeconway@dhcp152-54-6-70.wireless.europa.renci.org>2011-07-12 14:19:51 (GMT)
commit81db6273dfbb41a7abf8b09092191d4e2c5357bf (patch)
treeafd6e34264add33a40f6c1496c00c0b3f6c621de /idrop-swing
parent3aa0108281c33ea78a240ff107ea398fb6701904 (diff)
downloadQCG-Data-81db6273dfbb41a7abf8b09092191d4e2c5357bf.zip
QCG-Data-81db6273dfbb41a7abf8b09092191d4e2c5357bf.tar.gz
QCG-Data-81db6273dfbb41a7abf8b09092191d4e2c5357bf.tar.bz2
fix idrop to use startup sequencer for dev of synch config dialogs
Diffstat (limited to 'idrop-swing')
-rw-r--r--idrop-swing/release_notes.txt2
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/ChangePasswordDialog.java238
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/Constants.java58
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/DeleteIRODSDialog.java22
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/DeleteLocalFileDialog.java17
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/IDROPCore.java18
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/IDROPSplashWindow.java560
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/LoginDialog.java8
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/MetadataViewDialog.java10
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/MoveOrCopyiRODSDialog.java35
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/NewIRODSDirectoryDialog.java6
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/NewLocalDirectoryDialog.java6
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/QueueManagerDialog.java6
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/QueueTimerTaskThread.java8
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/RenameIRODSDirectoryDialog.java88
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/RenameLocalDirectoryDialog.java6
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/ReplicationDialog.java10
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/StartupSequencer.java243
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/SynchSetupDialog.form153
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/SynchSetupDialog.java272
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/iDrop.java (renamed from idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/IDROPDesktop.java)756
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/ChangePasswordCancelActionListener.java27
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/ChangePasswordDialogEnterKeyListener.java31
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/ChangePasswordDialogWindowListener.java24
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/ChangePasswordMenuActionListener.java33
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/ChangePasswordSaveActionListener.java124
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/EditSynchronizationDialogCancelActionListener.java23
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/EditSynchronizationDialogLocalPathBrowseActionListener.java54
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/EditSynchronizationDialogRemotePathBrowseActionListener.java58
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/EditSynchronizationDialogSaveActionListener.java105
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/EditSynchronizationsDialogDeleteActionListener.java48
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/EditSynchronizationsDialogEditActionListener.java62
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/EditSynchronizationsDialogNewActionListener.java31
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/EditSynchronizationsDialogRunNowActionListener.java34
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/EditSynchronizationsMenuActionListener.java49
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/LoginCancelActionListener.java29
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/LoginDialogEnterKeyListener.java31
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/LoginDialogWindowListener.java14
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/LoginOKActionListener.java146
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/PreferencesDialogCancelActionListener.java26
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/PreferencesDialogDefaultLocalDirectoryActionListener.java57
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/PreferencesDialogSaveActionListener.java45
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/PreferencesMenuActionListener.java57
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/RemoteFileChooserDialogCancelActionListener.java23
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/RemoteFileChooserDialogDetailsViewActionListener.java23
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/RemoteFileChooserDialogFileTypeActionListener.java23
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/RemoteFileChooserDialogHomeFolderActionListener.java23
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/RemoteFileChooserDialogListMouseListener.java101
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/RemoteFileChooserDialogListViewActionListener.java23
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/RemoteFileChooserDialogLookInActionListener.java58
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/RemoteFileChooserDialogNewFolderActionListener.java23
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/RemoteFileChooserDialogOpenActionListener.java23
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/RemoteFileChooserDialogUpFolderActionListener.java84
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/StartupEditSynchronizationDialogCancelActionListener.java23
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/StartupEditSynchronizationDialogLocalPathBrowseActionListener.java54
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/StartupEditSynchronizationDialogRemotePathBrowseActionListener.java58
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/StartupEditSynchronizationDialogSaveActionListener.java146
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/StartupPreferencesDialogCancelActionListener.java28
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/StartupPreferencesDialogDefaultLocalDirectoryActionListener.java57
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/StartupPreferencesDialogSaveActionListener.java55
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/StartupRemoteFileChooserDialogCancelActionListener.java23
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/StartupRemoteFileChooserDialogDetailsViewActionListener.java23
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/StartupRemoteFileChooserDialogFileTypeActionListener.java23
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/StartupRemoteFileChooserDialogHomeFolderActionListener.java23
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/StartupRemoteFileChooserDialogListMouseListener.java101
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/StartupRemoteFileChooserDialogListViewActionListener.java23
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/StartupRemoteFileChooserDialogLookInActionListener.java58
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/StartupRemoteFileChooserDialogNewFolderActionListener.java23
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/StartupRemoteFileChooserDialogOpenActionListener.java23
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/StartupRemoteFileChooserDialogUpFolderActionListener.java85
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/services/IconManager.java6
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/services/IdropConfigurationServiceImpl.java67
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/services/QueueSchedulerTimerTask.java18
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/services/RuleExecutionWorker.java6
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/utils/IconHelper.java4
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/IRODSOutlineModel.java71
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/IRODSTree.java20
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/IRODSTreeTransferHandler.java18
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/InfoPanelTransferHandler.java6
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/IrodsSelectionListenerForBuildingInfoPanel.java26
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/IrodsTreeListenerForBuildingInfoPanel.java6
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/LocalFileTree.java45
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/LocalTreeTransferHandler.java36
-rw-r--r--idrop-swing/src/main/resources/idrop.properties1
-rw-r--r--idrop-swing/src/test/java/org/irods/jargon/idrop/desktop/systraygui/services/IdropConfigurationServiceImplTest.java6
85 files changed, 1421 insertions, 3775 deletions
diff --git a/idrop-swing/release_notes.txt b/idrop-swing/release_notes.txt
index 5904212..bd5e5b2 100644
--- a/idrop-swing/release_notes.txt
+++ b/idrop-swing/release_notes.txt
@@ -5,7 +5,7 @@ iDrop Desktop Client
work in progress -- Milestone 0.9.8
*[#308] irods tree does not refresh when deleting a directory
-* [#61] delete local file multi-select
+*[#61] delete local file multi-select
*[#254] drag and drop, desktop to irods file should use irods parent as target
*[#153] local file dir copy/move
* [#316] feedback on tree node expansion
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/ChangePasswordDialog.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/ChangePasswordDialog.java
new file mode 100644
index 0000000..61a01cb
--- /dev/null
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/ChangePasswordDialog.java
@@ -0,0 +1,238 @@
+/*
+ * PreferencesDialog.java
+ *
+ * Created on Nov 23, 2010, 2:58:18 PM
+ */
+package org.irods.jargon.idrop.desktop.systraygui;
+
+import java.awt.Color;
+import java.util.List;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import javax.swing.JOptionPane;
+
+import org.irods.jargon.core.connection.IRODSAccount;
+import org.irods.jargon.core.exception.JargonException;
+import org.irods.jargon.core.pub.UserAO;
+import org.irods.jargon.transfer.dao.domain.LocalIRODSTransfer;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Dialog that can manage preferences
+ *
+ * @author mikeconway
+ */
+public class ChangePasswordDialog extends javax.swing.JDialog {
+
+ private final iDrop idrop;
+
+ public static org.slf4j.Logger log = LoggerFactory.getLogger(ChangePasswordDialog.class);
+
+ /** Creates new form PreferencesDialog */
+ public ChangePasswordDialog(final iDrop idrop, boolean modal) {
+ super(idrop, modal);
+ this.idrop = idrop;
+ initComponents();
+ }
+
+ /**
+ * 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() {
+ java.awt.GridBagConstraints gridBagConstraints;
+
+ tabPreferences = new javax.swing.JTabbedPane();
+ pnlPasswords = new javax.swing.JPanel();
+ lblCurrentAccountLabel = new javax.swing.JLabel();
+ lblCurrentAccount = new javax.swing.JLabel();
+ lblNewPassword = new javax.swing.JLabel();
+ passwdNewPassword = new javax.swing.JPasswordField();
+ lblConfirmPassword = new javax.swing.JLabel();
+ passwdConfirmPassword = new javax.swing.JPasswordField();
+ btnUpdatePassword = new javax.swing.JButton();
+
+ setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
+ setTitle("iDrop - Preferences");
+ setAlwaysOnTop(true);
+ setMinimumSize(new java.awt.Dimension(551, 400));
+
+ tabPreferences.addChangeListener(new javax.swing.event.ChangeListener() {
+ @Override
+ public void stateChanged(javax.swing.event.ChangeEvent evt) {
+ tabPreferencesStateChanged(evt);
+ }
+ });
+
+ pnlPasswords.setLayout(new java.awt.GridBagLayout());
+
+ lblCurrentAccountLabel.setText("Current account:");
+ gridBagConstraints = new java.awt.GridBagConstraints();
+ gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
+ pnlPasswords.add(lblCurrentAccountLabel, gridBagConstraints);
+
+ lblCurrentAccount.setText("XXXX");
+ gridBagConstraints = new java.awt.GridBagConstraints();
+ gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
+ pnlPasswords.add(lblCurrentAccount, gridBagConstraints);
+
+ lblNewPassword.setText("New password:");
+ gridBagConstraints = new java.awt.GridBagConstraints();
+ gridBagConstraints.gridx = 0;
+ gridBagConstraints.gridy = 1;
+ gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
+ pnlPasswords.add(lblNewPassword, gridBagConstraints);
+
+ passwdNewPassword.setColumns(15);
+ gridBagConstraints = new java.awt.GridBagConstraints();
+ gridBagConstraints.gridx = 1;
+ gridBagConstraints.gridy = 1;
+ gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
+ pnlPasswords.add(passwdNewPassword, gridBagConstraints);
+
+ lblConfirmPassword.setText("Confirm password:");
+ gridBagConstraints = new java.awt.GridBagConstraints();
+ gridBagConstraints.gridx = 0;
+ gridBagConstraints.gridy = 2;
+ gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
+ pnlPasswords.add(lblConfirmPassword, gridBagConstraints);
+
+ passwdConfirmPassword.setColumns(15);
+ gridBagConstraints = new java.awt.GridBagConstraints();
+ gridBagConstraints.gridx = 1;
+ gridBagConstraints.gridy = 2;
+ gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
+ pnlPasswords.add(passwdConfirmPassword, gridBagConstraints);
+
+ btnUpdatePassword.setMnemonic('P');
+ btnUpdatePassword.setText("Update Password");
+ btnUpdatePassword.setToolTipText("Change the current password to the new values");
+ btnUpdatePassword.addActionListener(new java.awt.event.ActionListener() {
+ @Override
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ btnUpdatePasswordActionPerformed(evt);
+ }
+ });
+ gridBagConstraints = new java.awt.GridBagConstraints();
+ gridBagConstraints.gridx = 2;
+ gridBagConstraints.gridy = 4;
+ pnlPasswords.add(btnUpdatePassword, gridBagConstraints);
+
+ tabPreferences.addTab("Passwords", null, pnlPasswords, "Manage passwords");
+
+ getContentPane().add(tabPreferences, java.awt.BorderLayout.CENTER);
+
+ pack();
+ }// </editor-fold>//GEN-END:initComponents
+
+ private void tabPreferencesStateChanged(javax.swing.event.ChangeEvent evt) {// GEN-FIRST:event_tabPreferencesStateChanged
+ // TODO add your handling code here:
+ log.debug("preferences tab state changed: {}", evt);
+ if (pnlPasswords.isVisible()) {
+ setUpPasswordPanel();
+ }
+ }// GEN-LAST:event_tabPreferencesStateChanged
+
+ private void btnUpdatePasswordActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_btnUpdatePasswordActionPerformed
+
+ log.info("changing password, doing edits first");
+ initializePasswordColors();
+
+ if (passwdNewPassword.getPassword().length == 0) {
+ passwdNewPassword.setBackground(Color.red);
+ }
+
+ if (passwdConfirmPassword.getPassword().length == 0) {
+ passwdConfirmPassword.setBackground(Color.red);
+ }
+
+ if (passwdNewPassword.getPassword().length == 0 || passwdConfirmPassword.getPassword().length == 0) {
+ JOptionPane.showMessageDialog(idrop, "New or confirm password is missing");
+ return;
+ }
+
+ String newPassword = new String(passwdNewPassword.getPassword());
+ String confirmPassword = new String(passwdConfirmPassword.getPassword());
+
+ if (newPassword.equals(confirmPassword)) {
+ // passwords match
+ } else {
+ passwdNewPassword.setBackground(Color.red);
+ passwdConfirmPassword.setBackground(Color.red);
+ JOptionPane.showMessageDialog(idrop, "New and confirm password do not match");
+ return;
+ }
+
+ log.info("edits pass, updating password");
+ try {
+ log.info("check queue for any jobs for the account, these have the old password.");
+ IRODSAccount irodsAccount = idrop.getIrodsAccount();
+ List<LocalIRODSTransfer> recentQueue = idrop.getiDropCore().getTransferManager().getRecentQueue();
+ for (LocalIRODSTransfer localIRODSTransfer : recentQueue) {
+ if (localIRODSTransfer.getTransferHost().equals(irodsAccount.getHost())
+ && localIRODSTransfer.getTransferZone().equals(irodsAccount.getZone())
+ && localIRODSTransfer.getTransferUserName().equals(irodsAccount.getUserName())) {
+ // FIXME: right now, do not differentiate transfers that are comlete, this is a hack right now
+ // if (localIRODSTransfer.getTransferState().equals(localIRODSTransfer.TRANSFER_STATE_COMPLETE)) {
+ // log.info("matched transfer was complete, ignored");
+ // } else {
+ JOptionPane
+ .showMessageDialog(this,
+ "Transfers for this account are pending, this account can not be changed until completed and purged");
+ return;
+ // }
+ }
+ }
+ UserAO userAO = idrop.getiDropCore().getIrodsFileSystem().getIRODSAccessObjectFactory()
+ .getUserAO(idrop.getIrodsAccount());
+ userAO.changeAUserPasswordByThatUser(irodsAccount.getUserName(), irodsAccount.getPassword(), newPassword);
+ log.info("password changed, resetting iRODS Account");
+ IRODSAccount newAccount = new IRODSAccount(irodsAccount.getHost(), irodsAccount.getPort(),
+ irodsAccount.getUserName(), newPassword, irodsAccount.getHomeDirectory(), irodsAccount.getZone(),
+ irodsAccount.getDefaultStorageResource());
+ idrop.setIrodsAccount(newAccount);
+ JOptionPane.showMessageDialog(this, "Password was changed");
+ passwdNewPassword.setText("");
+ passwdConfirmPassword.setText("");
+
+ } catch (JargonException ex) {
+ Logger.getLogger(ChangePasswordDialog.class.getName()).log(Level.SEVERE, null, ex);
+ } finally {
+ idrop.getiDropCore().closeIRODSConnection(idrop.getiDropCore().getIrodsAccount());
+ }
+ }// GEN-LAST:event_btnUpdatePasswordActionPerformed
+
+ private void setUpPasswordPanel() {
+ String acctUri = idrop.getIrodsAccount().toString();
+ lblCurrentAccount.setText(acctUri);
+ initializePasswordColors();
+ }
+
+ private void initializePasswordColors() {
+ passwdNewPassword.setBackground(Color.white);
+ passwdConfirmPassword.setBackground(Color.white);
+ }
+
+ // Variables declaration - do not modify//GEN-BEGIN:variables
+ private javax.swing.JButton btnUpdatePassword;
+
+ private javax.swing.JLabel lblConfirmPassword;
+
+ private javax.swing.JLabel lblCurrentAccount;
+
+ private javax.swing.JLabel lblCurrentAccountLabel;
+
+ private javax.swing.JLabel lblNewPassword;
+
+ private javax.swing.JPasswordField passwdConfirmPassword;
+
+ private javax.swing.JPasswordField passwdNewPassword;
+
+ private javax.swing.JPanel pnlPasswords;
+
+ private javax.swing.JTabbedPane tabPreferences;
+ // End of variables declaration//GEN-END:variables
+}
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/Constants.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/Constants.java
deleted file mode 100644
index b7da7aa..0000000
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/Constants.java
+++ /dev/null
@@ -1,58 +0,0 @@
-package org.irods.jargon.idrop.desktop.systraygui;
-
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-
-public interface Constants {
-
- public static final SimpleDateFormat SDF = new SimpleDateFormat("MM-dd-yyyy");
-
- public static final DateFormat df = DateFormat.getDateInstance(DateFormat.LONG);
-
- public static final String PREFERENCE_KEY_DEVICE_NAME = "device.name";
-
- public static final String PREFERENCE_KEY_FIRST_TIME_RUN = "first.time.run";
-
- public static final String PREFERENCE_KEY_SHOW_UI = "show.ui";
-
- public static final String PREFERENCE_KEY_SHOW_SPLASH = "show.splash";
-
- public static final String PREFERENCE_KEY_SHOW_PREFERENCES = "show.preferences";
-
- public static final String PREFERENCE_KEY_DEFAULT_LOCAL_DIR = "default.local.dir";
-
- public static final String PREFERENCE_KEY_SHOW_HIDDEN_FILES = "show.hidden.files";
-
- public static final int STARTUP_SEQUENCE_PAUSE_INTERVAL = 1000;
-
- public static final String PREFERENCE_KEY_LOGIN_PORT = "login.port";
-
- public static final String PREFERENCE_KEY_LOGIN_HOST = "login.host";
-
- public static final String PREFERENCE_KEY_LOGIN_ZONE = "login.zone";
-
- public static final String PREFERENCE_KEY_LOGIN_RESOURCE = "login.resource";
-
- public static final String PREFERENCE_KEY_LOGIN_USERNAME = "login.username";
-
- public static final String PROPERTY_KEY_ADVANCED_VIEW = "advanced.view";
-
- public static final String PROPERTY_KEY_POLICY_AWARE = "policy.aware";
-
- public static final String PROPERTY_KEY_LOGIN_PRESET = "login.preset";
-
- public static final String PROPERTY_KEY_LOGIN_PRESET_ZONE = "login.preset.zone";
-
- public static final String PROPERTY_KEY_LOGIN_PRESET_HOST = "login.preset.host";
-
- public static final String PROPERTY_KEY_LOGIN_PRESET_RESOURCE = "login.preset.resource";
-
- public static final String PROPERTY_KEY_LOGIN_PRESET_PORT = "login.preset.port";
-
- public static final String PROPERTY_KEY_ROLLING_LOG_LEVEL = "rolling.log.level";
-
- public static final String PROPERTY_KEY_TXFR_RECORD_SUCCESSFUL_FILES = "transferengine.record.successful.files";
-
- public static final String PROPERTY_KEY_FORCE_MODE = "force.mode";
-
-}
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/DeleteIRODSDialog.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/DeleteIRODSDialog.java
index ec41e01..9bbb448 100644
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/DeleteIRODSDialog.java
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/DeleteIRODSDialog.java
@@ -35,20 +35,16 @@ import org.slf4j.LoggerFactory;
*/
public class DeleteIRODSDialog extends javax.swing.JDialog {
- private final IDROPDesktop idrop;
-
+ private final iDrop idrop;
private final IRODSTree irodsTree;
-
private final IRODSNode deletedNode;
-
private final List<IRODSNode> deletedNodes;
-
public static org.slf4j.Logger log = LoggerFactory.getLogger(DeleteIRODSDialog.class);
/** Creates new form NewIRODSDirectoryDialog */
- public DeleteIRODSDialog(final IDROPDesktop parent, final boolean modal, final IRODSTree irodsTree,
+ public DeleteIRODSDialog(final iDrop parent, final boolean modal, final IRODSTree irodsTree,
final IRODSNode deletedNode) {
- super(parent.mainFrame, modal);
+ super(parent, modal);
this.idrop = parent;
this.irodsTree = irodsTree;
this.deletedNode = deletedNode;
@@ -68,9 +64,9 @@ public class DeleteIRODSDialog extends javax.swing.JDialog {
}
/** Creates new form NewIRODSDirectoryDialog */
- public DeleteIRODSDialog(final IDROPDesktop parent, final boolean modal, final IRODSTree irodsTree,
+ public DeleteIRODSDialog(final iDrop parent, final boolean modal, final IRODSTree irodsTree,
final List<IRODSNode> deletedNodes) {
- super(parent.mainFrame, modal);
+ super(parent, modal);
this.idrop = parent;
this.irodsTree = irodsTree;
this.deletedNodes = deletedNodes;
@@ -255,8 +251,7 @@ public class DeleteIRODSDialog extends javax.swing.JDialog {
throws IdropException {
log.info("node to delete is: {}", deletedNode);
- CollectionAndDataObjectListingEntry dataEntry = (CollectionAndDataObjectListingEntry) deletedNode
- .getUserObject();
+ CollectionAndDataObjectListingEntry dataEntry = (CollectionAndDataObjectListingEntry) deletedNode.getUserObject();
// dialog uses absolute path, so munge it for files
StringBuilder sb = new StringBuilder();
@@ -285,11 +280,8 @@ public class DeleteIRODSDialog extends javax.swing.JDialog {
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 DeleteIRODSDialog dialog;
-
private String message = "";
DeleteWorker(DeleteIRODSDialog dialog) {
@@ -345,7 +337,7 @@ public class DeleteIRODSDialog extends javax.swing.JDialog {
throw new IdropRuntimeException(ex);
}
dialog.dispose();
-
+
}
}
}
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/DeleteLocalFileDialog.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/DeleteLocalFileDialog.java
index 5b0e4e1..11841e3 100644
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/DeleteLocalFileDialog.java
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/DeleteLocalFileDialog.java
@@ -36,22 +36,17 @@ import org.slf4j.LoggerFactory;
*/
public class DeleteLocalFileDialog extends javax.swing.JDialog {
- private final IDROPDesktop idrop;
-
+ private final iDrop idrop;
private String directoryToDelete = "";
-
private final LocalFileTree localFileTree;
-
private final LocalFileNode deletedNode;
-
private final List<LocalFileNode> deletedNodes;
-
public static org.slf4j.Logger log = LoggerFactory.getLogger(DeleteLocalFileDialog.class);
/** Creates new form to delete a local file */
- public DeleteLocalFileDialog(final IDROPDesktop parent, final boolean modal, final String directoryToDelete,
+ public DeleteLocalFileDialog(final iDrop parent, final boolean modal, final String directoryToDelete,
final LocalFileTree localFileTree, final LocalFileNode deletedNode) {
- super(parent.mainFrame, modal);
+ super(parent, modal);
this.idrop = parent;
this.directoryToDelete = directoryToDelete;
this.localFileTree = localFileTree;
@@ -64,9 +59,9 @@ public class DeleteLocalFileDialog extends javax.swing.JDialog {
}
/** Creates new form to delete a local file */
- public DeleteLocalFileDialog(final IDROPDesktop parent, final boolean modal, final LocalFileTree localFileTree,
- final List<LocalFileNode> deletedNodes) {
- super(parent.mainFrame, modal);
+ public DeleteLocalFileDialog(final iDrop parent, final boolean modal,
+ final LocalFileTree localFileTree, final List<LocalFileNode> deletedNodes) {
+ super(parent, modal);
this.idrop = parent;
this.directoryToDelete = null;
this.localFileTree = localFileTree;
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/IDROPCore.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/IDROPCore.java
index 4da4459..0c85975 100644
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/IDROPCore.java
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/IDROPCore.java
@@ -21,6 +21,14 @@ public class IDROPCore {
private IRODSFileSystem irodsFileSystem = null;
+ public IRODSFileSystem getIrodsFileSystem() {
+ return irodsFileSystem;
+ }
+
+ public void setIrodsFileSystem(IRODSFileSystem irodsFileSystem) {
+ this.irodsFileSystem = irodsFileSystem;
+ }
+
private IdropConfig idropConfig = null;
private TransferManager transferManager = null;
@@ -31,14 +39,6 @@ public class IDROPCore {
private Preferences preferences = Preferences.userRoot();
- public IRODSFileSystem getIrodsFileSystem() {
- return irodsFileSystem;
- }
-
- public void setIrodsFileSystem(IRODSFileSystem irodsFileSystem) {
- this.irodsFileSystem = irodsFileSystem;
- }
-
public IDROPCore() {
super();
}
@@ -83,10 +83,12 @@ public class IDROPCore {
this.queueTimer = queueTimer;
}
+ @Deprecated
public Preferences getPreferences() {
return preferences;
}
+ @Deprecated
public void setPreferences(Preferences preferences) {
this.preferences = preferences;
}
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/IDROPSplashWindow.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/IDROPSplashWindow.java
index a1f5355..a65342b 100644
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/IDROPSplashWindow.java
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/IDROPSplashWindow.java
@@ -1,153 +1,46 @@
package org.irods.jargon.idrop.desktop.systraygui;
-import static org.irods.jargon.idrop.desktop.systraygui.Constants.PREFERENCE_KEY_DEVICE_NAME;
-import static org.irods.jargon.idrop.desktop.systraygui.Constants.PREFERENCE_KEY_FIRST_TIME_RUN;
-import static org.irods.jargon.idrop.desktop.systraygui.Constants.PREFERENCE_KEY_LOGIN_HOST;
-import static org.irods.jargon.idrop.desktop.systraygui.Constants.PREFERENCE_KEY_LOGIN_PORT;
-import static org.irods.jargon.idrop.desktop.systraygui.Constants.PREFERENCE_KEY_LOGIN_RESOURCE;
-import static org.irods.jargon.idrop.desktop.systraygui.Constants.PREFERENCE_KEY_LOGIN_USERNAME;
-import static org.irods.jargon.idrop.desktop.systraygui.Constants.PREFERENCE_KEY_LOGIN_ZONE;
-import static org.irods.jargon.idrop.desktop.systraygui.Constants.PREFERENCE_KEY_SHOW_SPLASH;
-import static org.irods.jargon.idrop.desktop.systraygui.Constants.PREFERENCE_KEY_SHOW_UI;
-import static org.irods.jargon.idrop.desktop.systraygui.Constants.PROPERTY_KEY_LOGIN_PRESET_HOST;
-import static org.irods.jargon.idrop.desktop.systraygui.Constants.PROPERTY_KEY_LOGIN_PRESET_PORT;
-import static org.irods.jargon.idrop.desktop.systraygui.Constants.PROPERTY_KEY_LOGIN_PRESET_RESOURCE;
-import static org.irods.jargon.idrop.desktop.systraygui.Constants.PROPERTY_KEY_LOGIN_PRESET_ZONE;
-import static org.irods.jargon.idrop.desktop.systraygui.Constants.STARTUP_SEQUENCE_PAUSE_INTERVAL;
-
-import java.awt.Component;
-import java.awt.Dimension;
+import java.awt.BorderLayout;
import java.awt.Toolkit;
-import java.awt.event.ActionListener;
-import java.awt.event.KeyListener;
-import java.awt.event.MouseListener;
-import java.awt.event.WindowListener;
-import java.io.File;
-import java.util.List;
-import java.util.Properties;
-import java.util.Timer;
-import java.util.logging.Level;
-import java.util.prefs.Preferences;
-import javax.swing.DefaultListModel;
-import javax.swing.Icon;
-import javax.swing.JButton;
-import javax.swing.JCheckBox;
-import javax.swing.JComboBox;
-import javax.swing.JDialog;
-import javax.swing.JFileChooser;
+import javax.swing.ImageIcon;
import javax.swing.JLabel;
-import javax.swing.JList;
-import javax.swing.JOptionPane;
-import javax.swing.JPasswordField;
import javax.swing.JProgressBar;
-import javax.swing.JTextField;
import javax.swing.JWindow;
-import javax.swing.SwingWorker;
-import javax.swing.UIManager;
-import javax.swing.UIManager.LookAndFeelInfo;
-import org.apache.commons.lang.StringUtils;
-import org.irods.jargon.core.exception.JargonException;
-import org.irods.jargon.core.pub.IRODSFileSystem;
-import org.irods.jargon.idrop.desktop.systraygui.components.RemoteFSChooserListCellRenderer;
-import org.irods.jargon.idrop.desktop.systraygui.components.RemoteFileChooserDialogLookInComboBoxRender;
-import org.irods.jargon.idrop.desktop.systraygui.listeners.LoginCancelActionListener;
-import org.irods.jargon.idrop.desktop.systraygui.listeners.LoginDialogEnterKeyListener;
-import org.irods.jargon.idrop.desktop.systraygui.listeners.LoginDialogWindowListener;
-import org.irods.jargon.idrop.desktop.systraygui.listeners.LoginOKActionListener;
-import org.irods.jargon.idrop.desktop.systraygui.listeners.StartupEditSynchronizationDialogCancelActionListener;
-import org.irods.jargon.idrop.desktop.systraygui.listeners.StartupEditSynchronizationDialogLocalPathBrowseActionListener;
-import org.irods.jargon.idrop.desktop.systraygui.listeners.StartupEditSynchronizationDialogRemotePathBrowseActionListener;
-import org.irods.jargon.idrop.desktop.systraygui.listeners.StartupEditSynchronizationDialogSaveActionListener;
-import org.irods.jargon.idrop.desktop.systraygui.listeners.StartupPreferencesDialogCancelActionListener;
-import org.irods.jargon.idrop.desktop.systraygui.listeners.StartupPreferencesDialogDefaultLocalDirectoryActionListener;
-import org.irods.jargon.idrop.desktop.systraygui.listeners.StartupPreferencesDialogSaveActionListener;
-import org.irods.jargon.idrop.desktop.systraygui.listeners.StartupRemoteFileChooserDialogCancelActionListener;
-import org.irods.jargon.idrop.desktop.systraygui.listeners.StartupRemoteFileChooserDialogDetailsViewActionListener;
-import org.irods.jargon.idrop.desktop.systraygui.listeners.StartupRemoteFileChooserDialogFileTypeActionListener;
-import org.irods.jargon.idrop.desktop.systraygui.listeners.StartupRemoteFileChooserDialogHomeFolderActionListener;
-import org.irods.jargon.idrop.desktop.systraygui.listeners.StartupRemoteFileChooserDialogListMouseListener;
-import org.irods.jargon.idrop.desktop.systraygui.listeners.StartupRemoteFileChooserDialogListViewActionListener;
-import org.irods.jargon.idrop.desktop.systraygui.listeners.StartupRemoteFileChooserDialogLookInActionListener;
-import org.irods.jargon.idrop.desktop.systraygui.listeners.StartupRemoteFileChooserDialogNewFolderActionListener;
-import org.irods.jargon.idrop.desktop.systraygui.listeners.StartupRemoteFileChooserDialogOpenActionListener;
-import org.irods.jargon.idrop.desktop.systraygui.listeners.StartupRemoteFileChooserDialogUpFolderActionListener;
-import org.irods.jargon.idrop.desktop.systraygui.services.IconManager;
-import org.irods.jargon.idrop.desktop.systraygui.services.IdropConfigurationService;
-import org.irods.jargon.idrop.desktop.systraygui.services.IdropConfigurationServiceImpl;
-import org.irods.jargon.idrop.desktop.systraygui.services.QueueSchedulerTimerTask;
-import org.irods.jargon.idrop.desktop.systraygui.util.MessageUtil;
-import org.irods.jargon.idrop.desktop.systraygui.utils.IdropConfig;
-import org.irods.jargon.idrop.exceptions.IdropAlreadyRunningException;
-import org.irods.jargon.idrop.exceptions.IdropException;
import org.irods.jargon.idrop.exceptions.IdropRuntimeException;
-import org.irods.jargon.transfer.TransferDAOManager;
-import org.irods.jargon.transfer.dao.SynchronizationDAO;
-import org.irods.jargon.transfer.dao.domain.LocalIRODSTransfer;
-import org.irods.jargon.transfer.dao.domain.Synchronization;
-import org.irods.jargon.transfer.engine.TransferManagerImpl;
-import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import cookxml.cookswing.CookSwing;
-
/**
*
* @author jdr0887
*/
-public class IDROPSplashWindow implements Runnable {
-
- private final Logger log = LoggerFactory.getLogger(IDROPSplashWindow.class);
-
- private IDROPCore idropCore;
-
- private IDROPDesktop desktop;
-
- public JWindow window;
-
- public JProgressBar startupProgressBar;
-
- public JLabel loginDialogUsernameLabel, loginDialogPasswordLabel, loginDialogHostLabel, loginDialogPortLabel,
- loginDialogZoneLabel, loginDialogResourceLabel;
-
- public JCheckBox preferencesDialogShowHiddenFilesCheckBox, preferencesDialogShowUICheckBox,
- preferencesDialogShowPreferencesCheckBox, preferencesDialogShowSplashScreenCheckBox;
+public class IDropSplashWindow extends JWindow {
- public JList remoteFileChooserDialogList;
-
- public JTextField loginDialogHostTextField, loginDialogZoneTextField, loginDialogResourceTextField,
- loginDialogPortTextField, loginDialogUsernameTextField, preferencesDialogDeviceNameTextField,
- preferencesDialogDefaultLocalDirectoryTextField;
-
- public JPasswordField loginDialogPasswordPasswordField;
-
- public JTextField editSynchronizationDialogLocalPathTextField, editSynchronizationDialogNameTextField,
- editSynchronizationDialogRemotePathTextField, remoteFileChooserDialogFileNameTextField,
- editSynchronizationDialogDeviceNameTextField;
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1L;
- public JDialog preferencesDialog, loginDialog, editSynchronizationDialog, remoteFileChooserDialog;
+ private final org.slf4j.Logger log = LoggerFactory.getLogger(IDropSplashWindow.class);
- public DefaultListModel remoteFileChooserDialogListModel;
+ private ImageIcon splashImage = new ImageIcon(IDropSplashWindow.class.getClassLoader().getResource(
+ "org/irods/jargon/idrop/desktop/images/iDrop.png"));
- public JButton editSynchronizationDialogSaveButton, editSynchronizationDialogCancelButton,
- editSynchronizationDialogRemotePathBrowseButton, editSynchronizationDialogLocalPathBrowseButton,
- remoteFileChooserDialogNewFolderButton, remoteFileChooserDialogUpFolderButton,
- remoteFileChooserDialogHomeFolderButton, remoteFileChooserDialogListViewButton,
- remoteFileChooserDialogDetailsViewButton, remoteFileChooserDialogOpenButton,
- remoteFileChooserDialogCancelButton, loginDialogOKButton, preferencesDialogDefaultLocalDirectoryButton;
+ private JLabel jlblImage = new JLabel();
- public JFileChooser editSynchronizationDialogLocalPathFileChooser, editSynchronizationDialogRemotePathFileChooser,
- preferencesDialogDefaultLocalDirectoryFileChooser;
+ private JProgressBar jProgressBar1 = new JProgressBar();
- public JComboBox remoteFileChooserDialogFileTypeComboBox, remoteFileChooserDialogLookInComboBox;
+ private iDrop iDrop;
- public IDROPSplashWindow() {
- super();
+ public IDropSplashWindow(iDrop iDrop) {
+ super(iDrop);
+ this.iDrop = iDrop;
try {
init();
} catch (Exception e) {
- e.printStackTrace();
+ log.error("error initializing iDrop splash window", e);
+ throw new IdropRuntimeException(e);
}
}
@@ -155,400 +48,45 @@ public class IDROPSplashWindow implements Runnable {
* This method stores all initialization commands for the window.
*/
private void init() throws Exception {
-
- try {
- for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
- if ("Nimbus".equals(info.getName())) {
- UIManager.setLookAndFeel(info.getClassName());
- break;
- }
- }
- } catch (Exception e) {
- throw new IdropRuntimeException(e);
- }
-
- log.info("creating idropCore...");
- idropCore = new IDROPCore();
- desktop = new IDROPDesktop(idropCore);
-
- Preferences prefs = idropCore.getPreferences();
-
- CookSwing cookSwing = new CookSwing(this);
- this.window = (JWindow) cookSwing.render("org/irods/jargon/idrop/splashWindow.xml");
-
- boolean showSplash = prefs.getBoolean(PREFERENCE_KEY_SHOW_SPLASH, true);
- preferencesDialogShowSplashScreenCheckBox.setSelected(showSplash ? true : false);
-
- boolean showUI = prefs.getBoolean(PREFERENCE_KEY_SHOW_UI, true);
- preferencesDialogShowUICheckBox.setSelected(showUI ? true : false);
-
- if (showUI) {
-
- Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
-
- int width = this.window.getWidth();
- int height = this.window.getHeight();
-
- int xLocation = (screenSize.width / 2) - (width / 2);
- int yLocation = (screenSize.height / 2) - (height / 2);
-
- this.window.setLocation(xLocation, yLocation);
- this.window.pack();
- this.window.setVisible(true);
-
- Icon newFolderIcon = UIManager.getIcon("FileChooser.newFolderIcon");
- remoteFileChooserDialogNewFolderButton.setIcon(newFolderIcon);
-
- Icon upFolderIcon = UIManager.getIcon("FileChooser.upFolderIcon");
- remoteFileChooserDialogUpFolderButton.setIcon(upFolderIcon);
-
- Icon homeFolderIcon = UIManager.getIcon("FileChooser.homeFolderIcon");
- remoteFileChooserDialogHomeFolderButton.setIcon(homeFolderIcon);
-
- Icon listViewIcon = UIManager.getIcon("FileChooser.listViewIcon");
- remoteFileChooserDialogListViewButton.setIcon(listViewIcon);
-
- Icon detailsViewIcon = UIManager.getIcon("FileChooser.detailsViewIcon");
- remoteFileChooserDialogDetailsViewButton.setIcon(detailsViewIcon);
-
- remoteFileChooserDialogList.setCellRenderer(new RemoteFSChooserListCellRenderer());
- remoteFileChooserDialogLookInComboBox.setRenderer(new RemoteFileChooserDialogLookInComboBoxRender());
-
- }
- }
-
- public final ActionListener editSynchronizationDialogLocalPathBrowseActionListener = new StartupEditSynchronizationDialogLocalPathBrowseActionListener(
- this);
-
- public final ActionListener editSynchronizationDialogRemotePathBrowseActionListener = new StartupEditSynchronizationDialogRemotePathBrowseActionListener(
- this);
-
- public final ActionListener editSynchronizationDialogSaveActionListener = new StartupEditSynchronizationDialogSaveActionListener(
- this);
-
- public final ActionListener editSynchronizationDialogCancelActionListener = new StartupEditSynchronizationDialogCancelActionListener(
- this);
-
- public final ActionListener remoteFileChooserDialogUpFolderActionListener = new StartupRemoteFileChooserDialogUpFolderActionListener(
- this);
-
- public final ActionListener remoteFileChooserDialogHomeFolderActionListener = new StartupRemoteFileChooserDialogHomeFolderActionListener(
- this);
-
- public final ActionListener remoteFileChooserDialogNewFolderActionListener = new StartupRemoteFileChooserDialogNewFolderActionListener(
- this);
-
- public final ActionListener remoteFileChooserDialogListViewActionListener = new StartupRemoteFileChooserDialogListViewActionListener(
- this);
-
- public final ActionListener remoteFileChooserDialogDetailsViewActionListener = new StartupRemoteFileChooserDialogDetailsViewActionListener(
- this);
-
- public final ActionListener remoteFileChooserDialogLookInActionListener = new StartupRemoteFileChooserDialogLookInActionListener(
- this);
-
- public final ActionListener remoteFileChooserDialogFileTypeActionListener = new StartupRemoteFileChooserDialogFileTypeActionListener(
- this);
-
- public final ActionListener remoteFileChooserDialogOpenActionListener = new StartupRemoteFileChooserDialogOpenActionListener(
- this);
-
- public final ActionListener remoteFileChooserDialogCancelActionListener = new StartupRemoteFileChooserDialogCancelActionListener(
- this);
-
- public final ActionListener loginDialogOKActionListener = new LoginOKActionListener(this);
-
- public final ActionListener loginDialogCancelActionListener = new LoginCancelActionListener(this);
-
- public final KeyListener loginDialogEnterKeyListener = new LoginDialogEnterKeyListener(this);
-
- public final MouseListener remoteFileChooserDialogListMouseListener = new StartupRemoteFileChooserDialogListMouseListener(
- this);
-
- public final ActionListener preferencesDialogSaveActionListener = new StartupPreferencesDialogSaveActionListener(
- this);
-
- public final ActionListener preferencesDialogCancelActionListener = new StartupPreferencesDialogCancelActionListener(
- this);
-
- public final ActionListener preferencesDialogDefaultLocalDirectoryActionListener = new StartupPreferencesDialogDefaultLocalDirectoryActionListener(
- this);
-
- public final WindowListener loginDialogWindowListener = new LoginDialogWindowListener();
-
- class Task extends SwingWorker<Void, Void> {
-
- @Override
- protected Void doInBackground() throws Exception {
-
- int count = 0;
-
- setStatus("Initializing...", ++count);
-
- System.setProperty("apple.laf.useScreenMenuBar", "true");
- System.setProperty("com.apple.mrj.application.apple.menu.about.name", "iDrop Client for iRODS");
-
- try {
- idropCore.setIrodsFileSystem(IRODSFileSystem.instance());
- } catch (JargonException ex) {
- java.util.logging.Logger.getLogger(IDROPSplashWindow.class.getName()).log(Level.SEVERE, null, ex);
- }
-
- log.info("determine config root directory");
- String userHomeDirectory = System.getProperty("user.home");
- StringBuilder sb = new StringBuilder();
- sb.append(userHomeDirectory).append(File.separator).append(".idrop");
- String derivedConfigHomeDirectory = sb.toString();
- log.info("set config home directory as: {}", derivedConfigHomeDirectory);
-
- setStatus("Checking preferences...", ++count);
-
- File propFile = new File(derivedConfigHomeDirectory, "idrop.properties");
-
- Properties derivedProperties = null;
- try {
- IdropConfigurationService idropConfigurationService = new IdropConfigurationServiceImpl(propFile);
- derivedProperties = idropConfigurationService.bootstrapConfiguration();
- } catch (IdropAlreadyRunningException are) {
- log.error("idrop is already running, shutting down");
- JOptionPane.showMessageDialog((Component) null, "iDrop is already running, cannot start",
- "iDrop Error", JOptionPane.OK_OPTION);
- System.exit(1);
- } catch (IdropException ex) {
- java.util.logging.Logger.getLogger(IDROPSplashWindow.class.getName()).log(Level.SEVERE, null, ex);
- throw new IdropRuntimeException(ex);
- }
-
- log.info("config properties derived...");
- IdropConfig config = new IdropConfig(derivedProperties);
- idropCore.setIdropConfig(config);
- idropCore.getIdropConfig().setUpLogging();
-
- log.info("logging in in splash background thread");
- setStatus("Logging in...", ++count);
-
- // predispose login info to preference values
- String host = idropCore.getPreferences().get(PREFERENCE_KEY_LOGIN_HOST, null);
- if (StringUtils.isNotEmpty(host)) {
- loginDialogHostTextField.setText(host);
- }
-
- String zone = idropCore.getPreferences().get(PREFERENCE_KEY_LOGIN_ZONE, null);
- if (StringUtils.isNotEmpty(zone)) {
- loginDialogZoneTextField.setText(zone);
- }
-
- String resource = idropCore.getPreferences().get(PREFERENCE_KEY_LOGIN_RESOURCE, null);
- if (StringUtils.isNotEmpty(resource)) {
- loginDialogResourceTextField.setText(resource);
- }
-
- String username = idropCore.getPreferences().get(PREFERENCE_KEY_LOGIN_USERNAME, null);
- if (StringUtils.isNotEmpty(username)) {
- loginDialogUsernameTextField.setText(username);
- }
-
- String port = idropCore.getPreferences().get(PREFERENCE_KEY_LOGIN_PORT, null);
- if (StringUtils.isNotEmpty(port)) {
- loginDialogPortTextField.setText(port);
- }
-
- Properties props = config.getIdropProperties();
-
- // overload login info with properties from config
- if (config.isLoginPreset()) {
-
- host = props.getProperty(PROPERTY_KEY_LOGIN_PRESET_HOST);
- if (StringUtils.isNotEmpty(host)) {
- loginDialogHostTextField.setText(host);
- loginDialogHostLabel.setVisible(false);
- loginDialogHostTextField.setVisible(false);
- }
-
- resource = props.getProperty(PROPERTY_KEY_LOGIN_PRESET_RESOURCE, null);
- if (StringUtils.isNotEmpty(resource)) {
- loginDialogResourceTextField.setText(resource);
- loginDialogResourceLabel.setVisible(false);
- loginDialogResourceTextField.setVisible(false);
- }
-
- port = props.getProperty(PROPERTY_KEY_LOGIN_PRESET_PORT, null);
- if (StringUtils.isNotEmpty(port)) {
- loginDialogPortTextField.setText(port);
- loginDialogPortLabel.setVisible(false);
- loginDialogPortTextField.setVisible(false);
- }
-
- zone = props.getProperty(PROPERTY_KEY_LOGIN_PRESET_ZONE, null);
- if (StringUtils.isNotEmpty(zone)) {
- loginDialogZoneTextField.setText(zone);
- loginDialogZoneLabel.setVisible(false);
- loginDialogZoneTextField.setVisible(false);
- }
-
- }
-
- loginDialog.pack();
-
- Toolkit tk = Toolkit.getDefaultToolkit();
- int x = (tk.getScreenSize().width - loginDialog.getWidth()) / 2;
- int y = (tk.getScreenSize().height - loginDialog.getHeight()) / 2;
- loginDialog.setLocation(x, y);
- window.toBack();
- loginDialog.toFront();
- loginDialog.setVisible(true);
-
- log.info("logged in, now checking for first run...");
-
- setStatus("Initial Synchronization setup...", ++count);
-
- TransferDAOManager transferMgr = TransferDAOManager.getInstance();
- SynchronizationDAO synchDAO = transferMgr.getTransferDAOBean().getSynchronizationDAO();
- Synchronization synch = synchDAO.findByName("Backup");
-
- Preferences prefs = idropCore.getPreferences();
- String deviceName = prefs.get(PREFERENCE_KEY_DEVICE_NAME, "");
- if (StringUtils.isNotEmpty(deviceName)) {
- preferencesDialogDeviceNameTextField.setText(deviceName);
- }
-
- boolean firstTimeRun = prefs.getBoolean(PREFERENCE_KEY_FIRST_TIME_RUN, true);
-
- if (firstTimeRun && synch == null) {
- log.info("first time running idrop, starting configuration wizard");
- editSynchronizationDialogDeviceNameTextField.setText(deviceName);
- if (StringUtils.isNotEmpty(deviceName)) {
- editSynchronizationDialogDeviceNameTextField.setText(deviceName);
- }
- editSynchronizationDialogNameTextField.setText("Backup");
- window.toBack();
- editSynchronizationDialog.setVisible(true);
- editSynchronizationDialog.toFront();
- remoteFileChooserDialog.setLocationRelativeTo(editSynchronizationDialog);
- }
-
- setStatus("Building transfer engine...", ++count);
-
- log.info("building transfer manager...");
-
- try {
- idropCore.setTransferManager(new TransferManagerImpl(idropCore.getIrodsFileSystem(), desktop, idropCore
- .getIdropConfig().isLogSuccessfulTransfers()));
- } catch (JargonException ex) {
- java.util.logging.Logger.getLogger(IDROPSplashWindow.class.getName()).log(Level.SEVERE, null, ex);
- throw new IdropRuntimeException("error creating transferManager", ex);
- }
-
- try {
- List<LocalIRODSTransfer> currentQueue = idropCore.getTransferManager().getCurrentQueue();
-
- if (!currentQueue.isEmpty()) {
- int result = JOptionPane.showConfirmDialog((Component) null,
- "Transfers are waiting to process, restart transfer?", "iDrop Transfers in Progress",
- JOptionPane.OK_CANCEL_OPTION);
- if (result == JOptionPane.CANCEL_OPTION) {
- idropCore.getTransferManager().pause();
- }
- }
- } catch (JargonException ex) {
- java.util.logging.Logger.getLogger(IDROPSplashWindow.class.getName()).log(Level.SEVERE, null, ex);
- throw new IdropRuntimeException("error evaluating current queue", ex);
- }
-
- setStatus("Starting work queue...", ++count);
- try {
- QueueSchedulerTimerTask queueSchedulerTimerTask = new QueueSchedulerTimerTask(
- idropCore.getTransferManager(), window);
- Timer timer = new Timer();
- timer.scheduleAtFixedRate(queueSchedulerTimerTask, 10000, 120000);
- idropCore.setQueueTimer(timer);
- } catch (IdropException ex) {
- java.util.logging.Logger.getLogger(IDROPSplashWindow.class.getName()).log(Level.SEVERE, null, ex);
- }
-
- window.dispose();
- return null;
- }
-
- @Override
- protected void done() {
- idropCore.setIconManager(new IconManager(desktop));
-
- desktop.createAndShowSystemTray();
-
- Preferences prefs = idropCore.getPreferences();
-
- boolean firstTimeRun = prefs.getBoolean(PREFERENCE_KEY_FIRST_TIME_RUN, true);
- if (firstTimeRun) {
- MessageUtil.showMessage(window,
- "Startup has finished. Please check system tray for status and access to iDROP.",
- "Startup Finished");
- }
- prefs.putBoolean(PREFERENCE_KEY_FIRST_TIME_RUN, false);
-
- // set some preferences
- boolean showUI = prefs.getBoolean(PREFERENCE_KEY_SHOW_UI, true);
- log.debug("showIU: {}", showUI);
- if (showUI) {
- desktop.showIdropGui();
- desktop.preferencesDialogShowUICheckBox.setSelected(showUI);
- desktop.mainFrame.setVisible(true);
- } else {
- MessageManager.showMessage(desktop.mainFrame,
- "iDrop has started.\nCheck your system tray to access the iDrop user interface.",
- "iDrop has started");
- }
- idropCore.getIconManager().setRunningStatus(idropCore.getTransferManager().getRunningStatus());
- idropCore.getIconManager().setErrorStatus(idropCore.getTransferManager().getErrorStatus());
- desktop.togglePauseTransfer.setSelected(desktop.pausedItem.getState());
-
- super.done();
-
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.lang.Runnable#run()
- */
- public void run() {
- Task t = new Task();
- try {
- t.execute();
- } catch (Exception e) {
- e.printStackTrace();
- }
+ // jlblImage.setText("jLabel1");
+ jlblImage.setIcon(splashImage);
+ jProgressBar1.setMinimum(1);
+ jProgressBar1.setMaximum(7);
+ jProgressBar1.setStringPainted(true);
+ this.getContentPane().add(jlblImage, BorderLayout.CENTER);
+ this.getContentPane().add(jProgressBar1, BorderLayout.SOUTH);
+
+ Toolkit tk = this.getToolkit();
+ int width = 420;
+ int height = 315;
+ int x = (tk.getScreenSize().width - width) / 2;
+ int y = (tk.getScreenSize().height - height) / 2;
+ this.setLocation(x, y);
+ this.setSize(width, height);
+ this.setAlwaysOnTop(false);
+ this.setVisible(true);
+ this.pack();
}
/**
+ * Sets the text of the progress bar and its value
*
* @param msg
- * @param value
+ * The message to be displayed in the progress bar
+ * @param theVal
+ * An integer value from 0 to 100
*/
public void setStatus(final String msg, final int value) {
- startupProgressBar.setString(msg);
- startupProgressBar.setValue(value);
- try {
- Thread.sleep(STARTUP_SEQUENCE_PAUSE_INTERVAL);
- } catch (InterruptedException e) {
- throw new IdropRuntimeException(e);
- }
- }
- /**
- * @return the desktop
- */
- public IDROPDesktop getDesktop() {
- return desktop;
- }
+ java.awt.EventQueue.invokeLater(new Runnable() {
- /**
- * @param desktop
- * the desktop to set
- */
- public void setDesktop(IDROPDesktop desktop) {
- this.desktop = desktop;
- }
+ @Override
+ public void run() {
+ jProgressBar1.setString(msg);
+ jProgressBar1.setValue(value);
+
+ }
+ });
+ }
}
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/LoginDialog.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/LoginDialog.java
index 7660fe9..81aeda3 100644
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/LoginDialog.java
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/LoginDialog.java
@@ -39,12 +39,12 @@ public class LoginDialog extends JDialog {
private static final String PREF_LOGIN_USERNAME = "login.username";
- private IDROPDesktop iDrop = null;
+ private iDrop iDrop = null;
public static org.slf4j.Logger log = LoggerFactory.getLogger(LoginDialog.class);
- public LoginDialog(IDROPDesktop iDrop) {
- super(iDrop.mainFrame, true);
+ public LoginDialog(iDrop iDrop) {
+ super(iDrop, true);
this.iDrop = iDrop;
initComponents();
@@ -59,7 +59,7 @@ public class LoginDialog extends JDialog {
}
- private void loginNormally(org.irods.jargon.idrop.desktop.systraygui.IDROPDesktop iDrop) {
+ private void loginNormally(org.irods.jargon.idrop.desktop.systraygui.iDrop iDrop) {
// predispose based on preferences
String host = iDrop.getiDropCore().getPreferences().get(PREF_LOGIN_HOST, null);
if (StringUtils.isNotEmpty(host)) {
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/MetadataViewDialog.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/MetadataViewDialog.java
index 473464b..522817d 100644
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/MetadataViewDialog.java
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/MetadataViewDialog.java
@@ -23,7 +23,7 @@ import org.irods.jargon.idrop.exceptions.IdropException;
*/
public class MetadataViewDialog extends javax.swing.JDialog {
- private final IDROPDesktop idropGui;
+ private final iDrop idropGui;
private final IRODSAccount irodsAccount;
@@ -34,8 +34,8 @@ public class MetadataViewDialog extends javax.swing.JDialog {
private final boolean collection;
/** Creates new form MetadataViewDialog */
- public MetadataViewDialog(final IDROPDesktop idropGui, final IRODSAccount irodsAccount, final String absolutePath) {
- super(idropGui.mainFrame, true);
+ public MetadataViewDialog(final iDrop idropGui, final IRODSAccount irodsAccount, final String absolutePath) {
+ super(idropGui, true);
this.idropGui = idropGui;
this.irodsAccount = irodsAccount;
this.irodsAbsolutePath = absolutePath;
@@ -46,9 +46,9 @@ public class MetadataViewDialog extends javax.swing.JDialog {
}
/** Creates new form MetadataViewDialog */
- public MetadataViewDialog(final IDROPDesktop idropGui, final IRODSAccount irodsAccount, final String absolutePath,
+ public MetadataViewDialog(final iDrop idropGui, final IRODSAccount irodsAccount, final String absolutePath,
final String fileName) {
- super(idropGui.mainFrame, true);
+ super(idropGui, true);
this.idropGui = idropGui;
this.irodsAccount = irodsAccount;
this.irodsAbsolutePath = absolutePath;
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/MoveOrCopyiRODSDialog.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/MoveOrCopyiRODSDialog.java
index 1a677ea..4f8f5bd 100644
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/MoveOrCopyiRODSDialog.java
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/MoveOrCopyiRODSDialog.java
@@ -37,28 +37,20 @@ import org.slf4j.LoggerFactory;
*/
public class MoveOrCopyiRODSDialog extends javax.swing.JDialog {
- private final IDROPDesktop idrop;
-
+ private final iDrop idrop;
private final IRODSTree stagingViewTree;
-
private final IRODSOutlineModel irodsFileSystemModel;
-
private final IRODSNode targetNode;
-
private final String targetAbsolutePath;
-
private final IRODSFile sourceFile;
-
private final List<IRODSFile> sourceFiles;
-
public static org.slf4j.Logger log = LoggerFactory.getLogger(MoveOrCopyiRODSDialog.class);
-
private final boolean isCopy;
- public MoveOrCopyiRODSDialog(final IDROPDesktop parent, final boolean modal, final IRODSNode targetNode,
+ public MoveOrCopyiRODSDialog(final iDrop parent, final boolean modal, final IRODSNode targetNode,
final IRODSTree stagingViewTree, final IRODSFile sourceFile, final String targetAbsolutePath,
final boolean isCopy) {
- super(parent.mainFrame, modal);
+ super(parent, modal);
this.idrop = parent;
this.targetNode = targetNode;
this.stagingViewTree = stagingViewTree;
@@ -70,10 +62,10 @@ public class MoveOrCopyiRODSDialog extends javax.swing.JDialog {
initializeDialog();
}
- public MoveOrCopyiRODSDialog(final IDROPDesktop parent, final boolean modal, final IRODSNode targetNode,
+ public MoveOrCopyiRODSDialog(final iDrop parent, final boolean modal, final IRODSNode targetNode,
final IRODSTree stagingViewTree, final List<IRODSFile> sourceFiles, final String targetAbsolutePath,
final boolean isCopy) {
- super(parent.mainFrame, modal);
+ super(parent, modal);
this.idrop = parent;
this.targetNode = targetNode;
this.stagingViewTree = stagingViewTree;
@@ -322,8 +314,7 @@ public class MoveOrCopyiRODSDialog extends javax.swing.JDialog {
DataTransferOperations dataTransferOperations;
try {
- dataTransferOperations = idrop.getiDropCore().getIRODSAccessObjectFactory()
- .getDataTransferOperations(idrop.getIrodsAccount());
+ dataTransferOperations = idrop.getiDropCore().getIRODSAccessObjectFactory().getDataTransferOperations(idrop.getIrodsAccount());
} catch (Exception e) {
idrop.getiDropCore().closeIRODSConnection(idrop.getIrodsAccount());
thisDialog.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
@@ -408,8 +399,7 @@ public class MoveOrCopyiRODSDialog extends javax.swing.JDialog {
log.debug("source file is a file, do a move");
dataTransferOperations.move(sourceFile.getAbsolutePath(), targetAbsolutePath);
- IRODSFile targetFile = idrop.getiDropCore().getIRODSFileFactoryForLoggedInAccount()
- .instanceIRODSFile(targetAbsolutePath);
+ IRODSFile targetFile = idrop.getiDropCore().getIRODSFileFactoryForLoggedInAccount().instanceIRODSFile(targetAbsolutePath);
String targetPathForNotify = null;
if (targetFile.isDirectory()) {
targetPathForNotify = targetFile.getAbsolutePath() + "/" + sourceFile.getName();
@@ -421,9 +411,8 @@ public class MoveOrCopyiRODSDialog extends javax.swing.JDialog {
} else {
log.debug("source file is a collection, reparent it");
- dataTransferOperations
- .moveTheSourceCollectionUnderneathTheTargetCollectionUsingSourceParentCollectionName(
- sourceFile.getAbsolutePath(), targetAbsolutePath);
+ dataTransferOperations.moveTheSourceCollectionUnderneathTheTargetCollectionUsingSourceParentCollectionName(
+ sourceFile.getAbsolutePath(), targetAbsolutePath);
irodsFileSystemModel.notifyFileShouldBeAdded(stagingViewTree, targetAbsolutePath);
}
} catch (JargonFileOrCollAlreadyExistsException fcae) {
@@ -445,10 +434,8 @@ public class MoveOrCopyiRODSDialog extends javax.swing.JDialog {
private void processACopyOfAnIndividualFile(DataTransferOperations dataTransferOperations, IRODSFile sourceFile,
String targetAbsolutePath) throws IdropException {
try {
- idrop.getiDropCore()
- .getTransferManager()
- .enqueueACopy(sourceFile.getAbsolutePath(), sourceFile.getResource(), targetAbsolutePath,
- idrop.getiDropCore().getIrodsAccount());
+ idrop.getiDropCore().getTransferManager().enqueueACopy(sourceFile.getAbsolutePath(), sourceFile.getResource(), targetAbsolutePath,
+ idrop.getiDropCore().getIrodsAccount());
} catch (JargonException ex) {
Logger.getLogger(MoveOrCopyiRODSDialog.class.getName()).log(Level.SEVERE, null, ex);
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/NewIRODSDirectoryDialog.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/NewIRODSDirectoryDialog.java
index 8e3c099..2991a8c 100644
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/NewIRODSDirectoryDialog.java
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/NewIRODSDirectoryDialog.java
@@ -39,7 +39,7 @@ import org.slf4j.LoggerFactory;
*/
public class NewIRODSDirectoryDialog extends javax.swing.JDialog {
- private final IDROPDesktop idrop;
+ private final iDrop idrop;
private String parentDirectory = "";
@@ -58,9 +58,9 @@ public class NewIRODSDirectoryDialog extends javax.swing.JDialog {
}
/** Creates new form NewIRODSDirectoryDialog */
- public NewIRODSDirectoryDialog(final IDROPDesktop parent, final boolean modal, final String parentDirectory,
+ public NewIRODSDirectoryDialog(final iDrop parent, final boolean modal, final String parentDirectory,
final IRODSTree stagingViewTree, final IRODSNode parentNode) {
- super(parent.mainFrame, modal);
+ super(parent, modal);
this.idrop = parent;
this.parentDirectory = parentDirectory;
this.stagingViewTree = stagingViewTree;
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/NewLocalDirectoryDialog.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/NewLocalDirectoryDialog.java
index 089dc89..c0b9324 100644
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/NewLocalDirectoryDialog.java
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/NewLocalDirectoryDialog.java
@@ -25,7 +25,7 @@ import org.slf4j.LoggerFactory;
*/
public class NewLocalDirectoryDialog extends javax.swing.JDialog {
- private final IDROPDesktop idrop;
+ private final iDrop idrop;
private String parentDirectory = "";
@@ -44,9 +44,9 @@ public class NewLocalDirectoryDialog extends javax.swing.JDialog {
}
/** Creates new form NewIRODSDirectoryDialog */
- public NewLocalDirectoryDialog(final IDROPDesktop parent, final boolean modal, final String parentDirectory,
+ public NewLocalDirectoryDialog(final iDrop parent, final boolean modal, final String parentDirectory,
final LocalFileTree localFileTree, final LocalFileNode parentNode) {
- super(parent.mainFrame, modal);
+ super(parent, modal);
this.idrop = parent;
this.parentDirectory = parentDirectory;
this.localFileTree = localFileTree;
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/QueueManagerDialog.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/QueueManagerDialog.java
index ccc8f00..cbaf3cc 100644
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/QueueManagerDialog.java
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/QueueManagerDialog.java
@@ -44,7 +44,7 @@ public class QueueManagerDialog extends javax.swing.JDialog implements ListSelec
private ViewType viewType = null;
- private IDROPDesktop iDropParent = null;
+ private iDrop iDropParent = null;
private RefreshQueueManagerTimerTask refreshQueueManagerTimerTask = null;
@@ -88,7 +88,7 @@ public class QueueManagerDialog extends javax.swing.JDialog implements ListSelec
}
/** Creates new form QueueManagerDialog */
- public QueueManagerDialog(final IDROPDesktop iDropParent, final TransferManager transferManager, final ViewType viewType)
+ public QueueManagerDialog(final iDrop iDropParent, final TransferManager transferManager, final ViewType viewType)
throws IdropException {
super((JFrame) null, true);
@@ -985,7 +985,7 @@ public class QueueManagerDialog extends javax.swing.JDialog implements ListSelec
refreshQueueManagerTimerTask = RefreshQueueManagerTimerTask.instance(this);
refreshQueueTimer.scheduleAtFixedRate(refreshQueueManagerTimerTask, 0, 10000);
} catch (IdropException ex) {
- Logger.getLogger(IDROPDesktop.class.getName()).log(Level.SEVERE, null, ex);
+ Logger.getLogger(iDrop.class.getName()).log(Level.SEVERE, null, ex);
iDropParent.showIdropException(ex);
return;
}
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/QueueTimerTaskThread.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/QueueTimerTaskThread.java
index b4ba595..7f07d2f 100644
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/QueueTimerTaskThread.java
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/QueueTimerTaskThread.java
@@ -6,11 +6,11 @@ import org.slf4j.LoggerFactory;
public class QueueTimerTaskThread extends Thread {
- private final org.slf4j.Logger logger = LoggerFactory.getLogger(IDROPDesktop.class);
+ private final org.slf4j.Logger logger = LoggerFactory.getLogger(iDrop.class);
- private IDROPDesktop iDrop;
+ private iDrop iDrop;
- public QueueTimerTaskThread(IDROPDesktop iDrop) {
+ public QueueTimerTaskThread(iDrop iDrop) {
super();
this.iDrop = iDrop;
}
@@ -23,7 +23,7 @@ public class QueueTimerTaskThread extends Thread {
try {
QueueSchedulerTimerTask queueTimerTask = new QueueSchedulerTimerTask(iDrop.getiDropCore()
- .getTransferManager(), iDrop.mainFrame);
+ .getTransferManager(), iDrop);
iDrop.getiDropCore().getQueueTimer()
.scheduleAtFixedRate(queueTimerTask, 1000, QueueSchedulerTimerTask.EVERY_10_MINUTES);
} catch (IdropException ex) {
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/RenameIRODSDirectoryDialog.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/RenameIRODSDirectoryDialog.java
index 130e5ea..40c7bf7 100644
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/RenameIRODSDirectoryDialog.java
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/RenameIRODSDirectoryDialog.java
@@ -21,19 +21,14 @@ import javax.swing.Action;
import javax.swing.JComponent;
import javax.swing.KeyStroke;
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.query.CollectionAndDataObjectListingEntry;
import org.irods.jargon.idrop.desktop.systraygui.services.IRODSFileService;
import org.irods.jargon.idrop.desktop.systraygui.utils.TreeUtils;
import org.irods.jargon.idrop.desktop.systraygui.viscomponents.IRODSFileSystemModel;
import org.irods.jargon.idrop.desktop.systraygui.viscomponents.IRODSNode;
-import org.irods.jargon.idrop.desktop.systraygui.viscomponents.IRODSOutlineModel;
import org.irods.jargon.idrop.desktop.systraygui.viscomponents.IRODSTree;
import org.irods.jargon.idrop.exceptions.IdropException;
import org.irods.jargon.idrop.exceptions.IdropRuntimeException;
-import org.openide.util.Exceptions;
import org.slf4j.LoggerFactory;
/**
@@ -42,17 +37,21 @@ import org.slf4j.LoggerFactory;
* @author mikeconway
*/
public class RenameIRODSDirectoryDialog extends javax.swing.JDialog {
-
- private final IDROPDesktop idrop;
+
+ private final iDrop 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 IDROPDesktop parent, final boolean modal, final String currentAbsolutePath,
+ public RenameIRODSDirectoryDialog(final iDrop parent, final boolean modal, final String currentAbsolutePath,
final IRODSTree stagingViewTree, final IRODSNode currentNode) {
- super(parent.mainFrame, modal);
+ super(parent, modal);
this.idrop = parent;
this.currentAbsolutePath = currentAbsolutePath;
this.stagingViewTree = stagingViewTree;
@@ -65,13 +64,13 @@ public class RenameIRODSDirectoryDialog extends javax.swing.JDialog {
idrop.showIdropException(new IdropException(msg));
return;
}
-
+
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();
}
@@ -268,6 +267,7 @@ public class RenameIRODSDirectoryDialog extends javax.swing.JDialog {
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
@@ -276,29 +276,29 @@ public class RenameIRODSDirectoryDialog extends javax.swing.JDialog {
idrop.showMessageFromOperation("please enter a new file or collection name");
return;
}
-
+
final RenameIRODSDirectoryDialog 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(idrop.getIrodsAccount(), idrop.getiDropCore().getIrodsFileSystem());
+
+ IRODSFileService irodsFileService = new IRODSFileService(idrop.getIrodsAccount(), idrop
+ .getiDropCore().getIrodsFileSystem());
String newPath = irodsFileService.renameIRODSFileOrDirectory(currentAbsolutePath,
txtNewFolder.getText());
-
log.debug("New path:{}", newPath);
- IRODSOutlineModel irodsOutlineModel = (IRODSOutlineModel) stagingViewTree.getModel();
+ IRODSFileSystemModel irodsFileSystemModel = (IRODSFileSystemModel) 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");
}
-
+
StringBuilder sb = new StringBuilder();
for (int i = 0; i < dirs.length - 1; i++) {
if (i > 0) {
@@ -306,50 +306,26 @@ public class RenameIRODSDirectoryDialog extends javax.swing.JDialog {
}
sb.append(dirs[i]);
}
-
+
String parentOfNewDir = sb.toString();
log.info("parent of new dir:{}", parentOfNewDir);
-
- 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();
+
+ TreePath pathForNew = TreeUtils.buildTreePathForIrodsAbsolutePath(stagingViewTree, parentOfNewDir);
+ log.debug("computed new path:{}", pathForNew);
+ IRODSNode targetParentNode = (IRODSNode) pathForNew.getParentPath().getLastPathComponent();
targetParentNode.forceReloadOfChildrenOfThisNode();
- irodsOutlineModel.reload(targetParentNode);
+ irodsFileSystemModel.reload(targetParentNode);
stagingViewTree.expandPath(pathForNew);
- * */
+ // idrop.showMessageFromOperation("The rename was successful");
- idrop.showMessageFromOperation("The rename was successful");
-
- } catch (Exception ex) {
+ } catch (IdropException ex) {
Logger.getLogger(RenameIRODSDirectoryDialog.class.getName()).log(Level.SEVERE, null, ex);
idrop.showIdropException(ex);
} finally {
thisDialog.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
}
-
+
thisDialog.dispose();
}
});
@@ -359,16 +335,16 @@ public class RenameIRODSDirectoryDialog extends javax.swing.JDialog {
* 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(ActionEvent e) {
doRename();
}
};
btnOK.registerKeyboardAction(enterAction, enter, JComponent.WHEN_IN_FOCUSED_WINDOW);
-
+
}
}
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/RenameLocalDirectoryDialog.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/RenameLocalDirectoryDialog.java
index af9ba8a..89bce61 100644
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/RenameLocalDirectoryDialog.java
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/RenameLocalDirectoryDialog.java
@@ -31,7 +31,7 @@ import org.slf4j.LoggerFactory;
*/
public class RenameLocalDirectoryDialog extends javax.swing.JDialog {
- private final IDROPDesktop idrop;
+ private final iDrop idrop;
private String currentAbsolutePath = "";
@@ -42,9 +42,9 @@ public class RenameLocalDirectoryDialog extends javax.swing.JDialog {
public static org.slf4j.Logger log = LoggerFactory.getLogger(RenameLocalDirectoryDialog.class);
/** Creates new form RenameLocalDirectoryDialog */
- public RenameLocalDirectoryDialog(final IDROPDesktop parent, final boolean modal, final String currentAbsolutePath,
+ public RenameLocalDirectoryDialog(final iDrop parent, final boolean modal, final String currentAbsolutePath,
final LocalFileTree localFileTree, final LocalFileNode currentNode) {
- super(parent.mainFrame, modal);
+ super(parent, modal);
this.idrop = parent;
this.currentAbsolutePath = currentAbsolutePath;
this.localFileTree = localFileTree;
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/ReplicationDialog.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/ReplicationDialog.java
index b2683da..f3ae4f8 100644
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/ReplicationDialog.java
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/ReplicationDialog.java
@@ -26,7 +26,7 @@ import org.slf4j.LoggerFactory;
*/
public class ReplicationDialog extends javax.swing.JDialog {
- private final IDROPDesktop idropParentGui;
+ private final iDrop idropParentGui;
private final String seriesAbsolutePath;
@@ -39,8 +39,8 @@ public class ReplicationDialog extends javax.swing.JDialog {
public static org.slf4j.Logger log = LoggerFactory.getLogger(ReplicationDialog.class);
/** Creates new form ReplicationDialog for a collection */
- public ReplicationDialog(IDROPDesktop idropParentGui, boolean modal, String seriesAbsolutePath) {
- super(idropParentGui.mainFrame, modal);
+ public ReplicationDialog(iDrop idropParentGui, boolean modal, String seriesAbsolutePath) {
+ super(idropParentGui, modal);
initComponents();
this.idropParentGui = idropParentGui;
this.seriesAbsolutePath = seriesAbsolutePath;
@@ -51,8 +51,8 @@ public class ReplicationDialog extends javax.swing.JDialog {
}
/** Creates new form ReplicationDialog for a file */
- public ReplicationDialog(IDROPDesktop idropParentGui, boolean modal, String fileAbsolutePath, String fileName) {
- super(idropParentGui.mainFrame, modal);
+ public ReplicationDialog(iDrop idropParentGui, boolean modal, String fileAbsolutePath, String fileName) {
+ super(idropParentGui, modal);
initComponents();
this.idropParentGui = idropParentGui;
this.seriesAbsolutePath = fileAbsolutePath;
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/StartupSequencer.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/StartupSequencer.java
new file mode 100644
index 0000000..a92068f
--- /dev/null
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/StartupSequencer.java
@@ -0,0 +1,243 @@
+package org.irods.jargon.idrop.desktop.systraygui;
+
+import java.awt.Component;
+import java.awt.Toolkit;
+import java.util.List;
+import java.util.Properties;
+import java.util.Timer;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import javax.swing.JOptionPane;
+
+import org.irods.jargon.core.exception.JargonException;
+import org.irods.jargon.core.pub.IRODSFileSystem;
+import org.irods.jargon.idrop.desktop.systraygui.services.IconManager;
+import org.irods.jargon.idrop.desktop.systraygui.services.IdropConfigurationService;
+import org.irods.jargon.idrop.desktop.systraygui.services.IdropConfigurationServiceImpl;
+import org.irods.jargon.idrop.desktop.systraygui.services.QueueSchedulerTimerTask;
+import org.irods.jargon.idrop.desktop.systraygui.utils.IdropConfig;
+import org.irods.jargon.idrop.exceptions.IdropAlreadyRunningException;
+import org.irods.jargon.idrop.exceptions.IdropException;
+import org.irods.jargon.idrop.exceptions.IdropRuntimeException;
+import org.irods.jargon.transfer.dao.domain.LocalIRODSTransfer;
+import org.irods.jargon.transfer.engine.TransferManagerImpl;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Bootstrapping class for iDrop, load config, create necessary services, and start the appropriate GUI components
+ *
+ * @author Mike Conway - DICE (www.irods.org)
+ */
+public class StartupSequencer {
+
+ private iDrop idrop;
+
+ private IDROPCore idropCore;
+
+ private static final org.slf4j.Logger log = LoggerFactory.getLogger(StartupSequencer.class);
+
+ public static final int STARTUP_SEQUENCE_PAUSE_INTERVAL = 2000;
+
+ public void doStartupSequence() {
+
+
+ log.info("initiating startup sequence...");
+
+ System.setProperty("apple.laf.useScreenMenuBar", "true");
+ System.setProperty("com.apple.mrj.application.apple.menu.about.name", "iDrop Client for iRODS");
+
+ int count = 0;
+ log.info("creating idropCore...");
+ idropCore = new IDROPCore();
+
+ try {
+ idropCore.setIrodsFileSystem(IRODSFileSystem.instance());
+ } catch (JargonException ex) {
+ Logger.getLogger(StartupSequencer.class.getName()).log(Level.SEVERE, null, ex);
+ }
+
+ log.info("creating idrop GUI app...");
+ idrop = new iDrop(idropCore);
+
+ IDropSplashWindow idropSplashWindow = new IDropSplashWindow(idrop);
+
+ try {
+ Thread.sleep(STARTUP_SEQUENCE_PAUSE_INTERVAL);
+ } catch (InterruptedException e) {
+ throw new IdropRuntimeException(e);
+ }
+
+ idropSplashWindow.setStatus("Initializing...", ++count);
+
+ idropCore.setIconManager(new IconManager(idrop));
+
+ try {
+ Thread.sleep(STARTUP_SEQUENCE_PAUSE_INTERVAL);
+ } catch (InterruptedException e) {
+ throw new IdropRuntimeException(e);
+ }
+
+ log.info("determine config root directory");
+ String userHomeDirectory = System.getProperty("user.home");
+ StringBuilder sb = new StringBuilder();
+ sb.append(userHomeDirectory);
+ sb.append("/.idrop");
+ String derivedConfigHomeDirectory = sb.toString();
+ log.info("set config home directory as: {}", derivedConfigHomeDirectory);
+
+ /*
+ * Here is where I first try and start the database to get the configuration. A database error indicates that
+ * iDrop is already running
+ */
+
+ idropSplashWindow.setStatus("Looking for configuration information...", ++count);
+
+ Properties derivedProperties = null;
+ try {
+ IdropConfigurationService idropConfigurationService = new IdropConfigurationServiceImpl(
+ derivedConfigHomeDirectory);
+ derivedProperties = idropConfigurationService.bootstrapConfiguration();
+
+
+
+ } catch (IdropAlreadyRunningException are) {
+ log.error("idrop is already running, shutting down");
+ JOptionPane.showMessageDialog((Component) null, "iDrop is already running, cannot start", "iDrop Error",
+ JOptionPane.OK_OPTION);
+ System.exit(1);
+ } catch (IdropException ex) {
+ Logger.getLogger(StartupSequencer.class.getName()).log(Level.SEVERE, null, ex);
+ throw new IdropRuntimeException(ex);
+ }
+
+ try {
+ Thread.sleep(STARTUP_SEQUENCE_PAUSE_INTERVAL);
+ } catch (InterruptedException e) {
+ throw new IdropRuntimeException(e);
+ }
+
+ idropSplashWindow.setStatus("Configuration information gathered, logging in...", ++count);
+
+ log.info("config properties derived...");
+ idropCore.setIdropConfig(new IdropConfig(derivedProperties));
+ idropCore.getIdropConfig().setUpLogging();
+
+ log.info("logging in in splash background thread");
+ idropSplashWindow.setStatus("Logging in...", ++count);
+
+ final LoginDialog loginDialog = new LoginDialog(idrop);
+ Toolkit tk = idrop.getToolkit();
+ int x = (tk.getScreenSize().width - loginDialog.getWidth()) / 2;
+ int y = (tk.getScreenSize().height - loginDialog.getHeight()) / 2;
+ loginDialog.setLocation(x, y);
+ idropSplashWindow.toBack();
+ loginDialog.setAlwaysOnTop(true);
+ loginDialog.toFront();
+ loginDialog.setVisible(true);
+
+ idropSplashWindow.toFront();
+ log.info("logged in, now checking for first run...");
+
+ try {
+ Thread.sleep(STARTUP_SEQUENCE_PAUSE_INTERVAL);
+ } catch (InterruptedException e) {
+ throw new IdropRuntimeException(e);
+ }
+
+ idropSplashWindow.setStatus("Checking if this is the first time run to set up synch...", ++count);
+
+ String synchDeviceName = idropCore.getIdropConfig().getSynchDeviceName();
+
+ if (synchDeviceName == null) {
+ log.info("first time running idrop, starting configuration wizard");
+ doFirstTimeConfigurationWizard();
+ }
+
+ try {
+ Thread.sleep(STARTUP_SEQUENCE_PAUSE_INTERVAL);
+ } catch (InterruptedException e) {
+ throw new IdropRuntimeException(e);
+ }
+
+ idropSplashWindow.setStatus("Building transfer engine...", ++count);
+
+ log.info("building transfer manager...");
+
+ try {
+ idropCore.setTransferManager(new TransferManagerImpl(idropCore.getIrodsFileSystem(), idrop, idropCore
+ .getIdropConfig().isLogSuccessfulTransfers()));
+ } catch (JargonException ex) {
+ Logger.getLogger(StartupSequencer.class.getName()).log(Level.SEVERE, null, ex);
+ throw new IdropRuntimeException("error creating transferManager", ex);
+ }
+
+ try {
+ List<LocalIRODSTransfer> currentQueue = idropCore.getTransferManager().getCurrentQueue();
+
+ if (!currentQueue.isEmpty()) {
+
+ idropSplashWindow.toBack();
+ int result = JOptionPane.showConfirmDialog((Component) null,
+ "Transfers are waiting to process, restart transfer?", "iDrop Transfers in Progress",
+ JOptionPane.OK_CANCEL_OPTION);
+ if (result == JOptionPane.CANCEL_OPTION) {
+ idropCore.getTransferManager().pause();
+ }
+ idropSplashWindow.toFront();
+ }
+ } catch (JargonException ex) {
+ Logger.getLogger(StartupSequencer.class.getName()).log(Level.SEVERE, null, ex);
+ throw new IdropRuntimeException("error evaluating current queue", ex);
+ }
+
+ try {
+ Thread.sleep(STARTUP_SEQUENCE_PAUSE_INTERVAL);
+ } catch (InterruptedException e) {
+ throw new IdropRuntimeException(e);
+ }
+
+ idropSplashWindow.setStatus("Starting work queue...", ++count);
+ try {
+ QueueSchedulerTimerTask queueSchedulerTimerTask = new QueueSchedulerTimerTask(
+ idropCore.getTransferManager(), idrop);
+ Timer timer = new Timer();
+ timer.scheduleAtFixedRate(queueSchedulerTimerTask, 10000, 120000);
+ idropCore.setQueueTimer(timer);
+ } catch (IdropException ex) {
+ Logger.getLogger(StartupSequencer.class.getName()).log(Level.SEVERE, null, ex);
+ }
+
+ log.info("signal that the startup sequence is complete");
+ try {
+ idrop.signalIdropCoreReadyAndSplashComplete();
+ idropSplashWindow.setVisible(false);
+ idropSplashWindow = null;
+ } catch (Exception e) {
+ Logger.getLogger(StartupSequencer.class.getName()).log(Level.SEVERE, null, e);
+
+ throw new IdropRuntimeException("error starting idrop gui", e);
+ }
+
+ }
+
+ /**
+ * Start up iDrop as a system tray application. This is the main entry point for iDrop
+ *
+ * @param args
+ * the command line arguments
+ */
+ public static void main(String args[]) throws InterruptedException {
+ StartupSequencer startupSequencer = new StartupSequencer();
+ try {
+ startupSequencer.doStartupSequence();
+ } catch (Exception e) {
+ log.error("unable to start application due to error", e);
+ System.exit(1);
+ }
+ }
+
+ private void doFirstTimeConfigurationWizard() {
+ log.info("doFirstTimeConfigurationWizard()");
+ }
+}
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/SynchSetupDialog.form b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/SynchSetupDialog.form
new file mode 100644
index 0000000..09e2c57
--- /dev/null
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/SynchSetupDialog.form
@@ -0,0 +1,153 @@
+<?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"/>
+ </AuxValues>
+
+ <Layout>
+ <DimensionLayout dim="0">
+ <Group type="103" groupAlignment="0" attributes="0">
+ <Group type="102" alignment="1" attributes="0">
+ <Group type="103" groupAlignment="1" attributes="0">
+ <Group type="102" alignment="1" attributes="0">
+ <EmptySpace max="-2" attributes="0"/>
+ <Component id="btnUpdateTimestamps" min="-2" max="-2" attributes="0"/>
+ </Group>
+ <Group type="102" alignment="1" attributes="0">
+ <EmptySpace min="-2" pref="47" max="-2" attributes="0"/>
+ <Group type="103" groupAlignment="0" attributes="0">
+ <Group type="103" alignment="0" groupAlignment="0" max="-2" attributes="0">
+ <Group type="102" alignment="0" attributes="1">
+ <Component id="lblDeviceName1" min="-2" max="-2" attributes="0"/>
+ <EmptySpace max="32767" attributes="0"/>
+ <Component id="txtIrodsPath" min="-2" pref="394" max="-2" attributes="0"/>
+ </Group>
+ <Group type="102" alignment="0" attributes="0">
+ <Component id="lblDeviceName" min="-2" max="-2" attributes="0"/>
+ <EmptySpace type="separate" max="-2" attributes="0"/>
+ <Component id="txtDeviceName" min="-2" pref="394" max="-2" attributes="0"/>
+ </Group>
+ </Group>
+ <Group type="102" alignment="1" attributes="0">
+ <Component id="lblDeviceName2" min="-2" max="-2" attributes="0"/>
+ <EmptySpace pref="36" max="32767" attributes="0"/>
+ <Group type="103" groupAlignment="0" max="-2" attributes="0">
+ <Group type="102" alignment="0" attributes="1">
+ <Component id="btnAdd" min="-2" max="-2" attributes="0"/>
+ <EmptySpace max="32767" attributes="0"/>
+ <Component id="btnSynch" min="-2" max="-2" attributes="0"/>
+ </Group>
+ <Component id="localPath" alignment="0" min="-2" pref="394" max="-2" attributes="0"/>
+ </Group>
+ </Group>
+ </Group>
+ </Group>
+ </Group>
+ <EmptySpace min="-2" pref="279" max="-2" attributes="0"/>
+ </Group>
+ <Group type="102" alignment="0" attributes="0">
+ <EmptySpace min="-2" pref="67" max="-2" attributes="0"/>
+ <Component id="jLabel1" min="-2" pref="604" max="-2" attributes="0"/>
+ <EmptySpace pref="153" 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="jLabel1" min="-2" max="-2" attributes="0"/>
+ <EmptySpace min="-2" pref="4" max="-2" attributes="0"/>
+ <Group type="103" groupAlignment="3" attributes="0">
+ <Component id="lblDeviceName" alignment="3" min="-2" max="-2" attributes="0"/>
+ <Component id="txtDeviceName" alignment="3" min="-2" max="-2" attributes="0"/>
+ </Group>
+ <EmptySpace max="-2" attributes="0"/>
+ <Group type="103" groupAlignment="3" attributes="0">
+ <Component id="lblDeviceName1" alignment="3" min="-2" max="-2" attributes="0"/>
+ <Component id="txtIrodsPath" alignment="3" min="-2" max="-2" attributes="0"/>
+ </Group>
+ <EmptySpace max="-2" attributes="0"/>
+ <Group type="103" groupAlignment="3" attributes="0">
+ <Component id="lblDeviceName2" alignment="3" min="-2" max="-2" attributes="0"/>
+ <Component id="localPath" alignment="3" min="-2" max="-2" attributes="0"/>
+ </Group>
+ <EmptySpace type="separate" max="-2" attributes="0"/>
+ <Group type="103" groupAlignment="3" attributes="0">
+ <Component id="btnAdd" alignment="3" min="-2" max="-2" attributes="0"/>
+ <Component id="btnSynch" alignment="3" min="-2" max="-2" attributes="0"/>
+ </Group>
+ <EmptySpace type="unrelated" max="-2" attributes="0"/>
+ <Component id="btnUpdateTimestamps" min="-2" max="-2" attributes="0"/>
+ <EmptySpace pref="25" max="32767" attributes="0"/>
+ </Group>
+ </Group>
+ </DimensionLayout>
+ </Layout>
+ <SubComponents>
+ <Component class="javax.swing.JLabel" name="lblDeviceName">
+ <Properties>
+ <Property name="text" type="java.lang.String" value="Device Name:"/>
+ </Properties>
+ </Component>
+ <Component class="javax.swing.JTextField" name="txtDeviceName">
+ </Component>
+ <Component class="javax.swing.JLabel" name="lblDeviceName1">
+ <Properties>
+ <Property name="text" type="java.lang.String" value="iRODS Path:"/>
+ </Properties>
+ </Component>
+ <Component class="javax.swing.JTextField" name="txtIrodsPath">
+ </Component>
+ <Component class="javax.swing.JLabel" name="lblDeviceName2">
+ <Properties>
+ <Property name="text" type="java.lang.String" value="Local Path:"/>
+ </Properties>
+ </Component>
+ <Component class="javax.swing.JTextField" name="localPath">
+ </Component>
+ <Component class="javax.swing.JButton" name="btnAdd">
+ <Properties>
+ <Property name="text" type="java.lang.String" value="Add Device"/>
+ </Properties>
+ <Events>
+ <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnAddActionPerformed"/>
+ </Events>
+ </Component>
+ <Component class="javax.swing.JButton" name="btnSynch">
+ <Properties>
+ <Property name="text" type="java.lang.String" value="Synch"/>
+ </Properties>
+ <Events>
+ <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnSynchActionPerformed"/>
+ </Events>
+ </Component>
+ <Component class="javax.swing.JButton" name="btnUpdateTimestamps">
+ <Properties>
+ <Property name="text" type="java.lang.String" value="Update Timestamps"/>
+ </Properties>
+ <Events>
+ <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnUpdateTimestampsActionPerformed"/>
+ </Events>
+ </Component>
+ <Component class="javax.swing.JLabel" name="jLabel1">
+ <Properties>
+ <Property name="text" type="java.lang.String" value="Testing only....."/>
+ </Properties>
+ </Component>
+ </SubComponents>
+</Form>
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/SynchSetupDialog.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/SynchSetupDialog.java
new file mode 100644
index 0000000..6981b9e
--- /dev/null
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/SynchSetupDialog.java
@@ -0,0 +1,272 @@
+/*
+ * SynchSetupDialog.java
+ *
+ * Created on Mar 22, 2011, 10:34:06 AM
+ */
+
+package org.irods.jargon.idrop.desktop.systraygui;
+
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import org.irods.jargon.core.exception.DuplicateDataException;
+import org.irods.jargon.core.exception.JargonException;
+import org.irods.jargon.core.pub.IRODSFileSystem;
+import org.irods.jargon.datautils.synchproperties.SynchPropertiesService;
+import org.irods.jargon.datautils.synchproperties.SynchPropertiesServiceImpl;
+import org.irods.jargon.datautils.tree.FileTreeDiffUtilityImpl;
+import org.irods.jargon.idrop.exceptions.IdropRuntimeException;
+import org.irods.jargon.transfer.synch.SynchronizeProcessor;
+import org.irods.jargon.transfer.synch.SynchronizeProcessorImpl;
+
+/**
+ *
+ * @author mikeconway
+ */
+public class SynchSetupDialog extends javax.swing.JDialog {
+
+ private final IDROPCore idropCore;
+
+ private final IRODSFileSystem irodsFileSystem;
+
+ private final SynchPropertiesService synchPropertiesService;
+
+ /** Creates new form SynchSetupDialog */
+ public SynchSetupDialog(iDrop parent, IDROPCore idropCore, IRODSFileSystem irodsFileSystem) {
+ super(parent, false);
+ this.idropCore = idropCore;
+ this.irodsFileSystem = irodsFileSystem;
+ initComponents();
+ try {
+ synchPropertiesService = new SynchPropertiesServiceImpl(irodsFileSystem.getIRODSAccessObjectFactory(),
+ idropCore.getIrodsAccount());
+ } catch (JargonException ex) {
+ Logger.getLogger(SynchSetupDialog.class.getName()).log(Level.SEVERE, null, ex);
+ throw new IdropRuntimeException("unable to build synchPropertiesService", ex);
+ }
+ }
+
+ /**
+ * 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() {
+
+ lblDeviceName = new javax.swing.JLabel();
+ txtDeviceName = new javax.swing.JTextField();
+ lblDeviceName1 = new javax.swing.JLabel();
+ txtIrodsPath = new javax.swing.JTextField();
+ lblDeviceName2 = new javax.swing.JLabel();
+ localPath = new javax.swing.JTextField();
+ btnAdd = new javax.swing.JButton();
+ btnSynch = new javax.swing.JButton();
+ btnUpdateTimestamps = new javax.swing.JButton();
+ jLabel1 = new javax.swing.JLabel();
+
+ setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
+
+ lblDeviceName.setText("Device Name:");
+
+ lblDeviceName1.setText("iRODS Path:");
+
+ lblDeviceName2.setText("Local Path:");
+
+ btnAdd.setText("Add Device");
+ btnAdd.addActionListener(new java.awt.event.ActionListener() {
+ @Override
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ btnAddActionPerformed(evt);
+ }
+ });
+
+ btnSynch.setText("Synch");
+ btnSynch.addActionListener(new java.awt.event.ActionListener() {
+ @Override
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ btnSynchActionPerformed(evt);
+ }
+ });
+
+ btnUpdateTimestamps.setText("Update Timestamps");
+ btnUpdateTimestamps.addActionListener(new java.awt.event.ActionListener() {
+ @Override
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ btnUpdateTimestampsActionPerformed(evt);
+ }
+ });
+
+ jLabel1.setText("Testing only.....");
+
+ org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane());
+ getContentPane().setLayout(layout);
+ layout.setHorizontalGroup(layout
+ .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
+ .add(org.jdesktop.layout.GroupLayout.TRAILING,
+ layout.createSequentialGroup()
+ .add(layout
+ .createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
+ .add(layout.createSequentialGroup().addContainerGap().add(btnUpdateTimestamps))
+ .add(layout
+ .createSequentialGroup()
+ .add(47, 47, 47)
+ .add(layout
+ .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
+ .add(layout
+ .createParallelGroup(
+ org.jdesktop.layout.GroupLayout.LEADING, false)
+ .add(layout
+ .createSequentialGroup()
+ .add(lblDeviceName1)
+ .addPreferredGap(
+ org.jdesktop.layout.LayoutStyle.RELATED,
+ org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
+ Short.MAX_VALUE)
+ .add(txtIrodsPath,
+ org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
+ 394,
+ org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
+ .add(layout
+ .createSequentialGroup()
+ .add(lblDeviceName)
+ .add(18, 18, 18)
+ .add(txtDeviceName,
+ org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
+ 394,
+ org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))
+ .add(org.jdesktop.layout.GroupLayout.TRAILING,
+ layout.createSequentialGroup()
+ .add(lblDeviceName2)
+ .addPreferredGap(
+ org.jdesktop.layout.LayoutStyle.RELATED,
+ 36, Short.MAX_VALUE)
+ .add(layout
+ .createParallelGroup(
+ org.jdesktop.layout.GroupLayout.LEADING,
+ false)
+ .add(layout
+ .createSequentialGroup()
+ .add(btnAdd)
+ .addPreferredGap(
+ org.jdesktop.layout.LayoutStyle.RELATED,
+ org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
+ Short.MAX_VALUE)
+ .add(btnSynch))
+ .add(localPath,
+ org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
+ 394,
+ org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))))))
+ .add(279, 279, 279))
+ .add(layout
+ .createSequentialGroup()
+ .add(67, 67, 67)
+ .add(jLabel1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 604,
+ org.jdesktop.layout.GroupLayout.PREFERRED_SIZE).addContainerGap(153, Short.MAX_VALUE)));
+ layout.setVerticalGroup(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING).add(
+ layout.createSequentialGroup()
+ .add(jLabel1)
+ .add(4, 4, 4)
+ .add(layout
+ .createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
+ .add(lblDeviceName)
+ .add(txtDeviceName, 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(layout
+ .createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
+ .add(lblDeviceName1)
+ .add(txtIrodsPath, 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(layout
+ .createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
+ .add(lblDeviceName2)
+ .add(localPath, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
+ org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
+ org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
+ .add(18, 18, 18)
+ .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE).add(btnAdd)
+ .add(btnSynch)).addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
+ .add(btnUpdateTimestamps).addContainerGap(25, Short.MAX_VALUE)));
+
+ pack();
+ }// </editor-fold>//GEN-END:initComponents
+
+ private void btnAddActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_btnAddActionPerformed
+ try {
+ SynchPropertiesService synchPropertiesService = new SynchPropertiesServiceImpl(
+ irodsFileSystem.getIRODSAccessObjectFactory(), idropCore.getIrodsAccount());
+ synchPropertiesService.addSynchDeviceForUserAndIrodsAbsolutePath(idropCore.getIrodsAccount().getUserName(),
+ txtDeviceName.getText().trim(), txtIrodsPath.getText().trim(), localPath.getText().trim());
+ } catch (DuplicateDataException ex) {
+ Logger.getLogger(SynchSetupDialog.class.getName()).log(Level.SEVERE, null, ex);
+ } catch (JargonException ex) {
+ Logger.getLogger(SynchSetupDialog.class.getName()).log(Level.SEVERE, null, ex);
+ }
+ }// GEN-LAST:event_btnAddActionPerformed
+
+ private void btnSynchActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_btnSynchActionPerformed
+
+ try {
+ SynchronizeProcessor synchProcessor = new SynchronizeProcessorImpl();
+ synchProcessor.setFileTreeDiffUtility(new FileTreeDiffUtilityImpl(idropCore.getIrodsAccount(),
+ irodsFileSystem.getIRODSAccessObjectFactory()));
+ synchProcessor.setIrodsAccessObjectFactory(irodsFileSystem.getIRODSAccessObjectFactory());
+ synchProcessor.setIrodsAccount(idropCore.getIrodsAccount());
+ synchProcessor.setTransferManager(idropCore.getTransferManager());
+ synchProcessor.setSynchPropertiesService(synchPropertiesService);
+ // FIXME: refactor to not pass this stuff in, or alt method
+ synchProcessor.synchronizeLocalToIRODS(txtDeviceName.getText().trim(), txtIrodsPath.getText().trim());
+ } catch (JargonException ex) {
+ Logger.getLogger(SynchSetupDialog.class.getName()).log(Level.SEVERE, null, ex);
+ } finally {
+ irodsFileSystem.closeAndEatExceptions();
+ }
+
+ }// GEN-LAST:event_btnSynchActionPerformed
+
+ private void btnUpdateTimestampsActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_btnUpdateTimestampsActionPerformed
+ try {
+ SynchronizeProcessor synchProcessor = new SynchronizeProcessorImpl();
+ synchProcessor.setFileTreeDiffUtility(new FileTreeDiffUtilityImpl(idropCore.getIrodsAccount(),
+ irodsFileSystem.getIRODSAccessObjectFactory()));
+ synchProcessor.setIrodsAccessObjectFactory(irodsFileSystem.getIRODSAccessObjectFactory());
+ synchProcessor.setIrodsAccount(idropCore.getIrodsAccount());
+ synchProcessor.setTransferManager(idropCore.getTransferManager());
+ synchProcessor.setSynchPropertiesService(synchPropertiesService);
+ synchProcessor.getTimestampsAndUpdateSynchDataInIRODS(idropCore.getIrodsAccount().getUserName(),
+ txtDeviceName.getText().trim(), txtIrodsPath.getText().trim());
+ } catch (JargonException ex) {
+ Logger.getLogger(SynchSetupDialog.class.getName()).log(Level.SEVERE, null, ex);
+ } finally {
+ irodsFileSystem.closeAndEatExceptions();
+ }
+
+ }// GEN-LAST:event_btnUpdateTimestampsActionPerformed
+
+ // Variables declaration - do not modify//GEN-BEGIN:variables
+ private javax.swing.JButton btnAdd;
+
+ private javax.swing.JButton btnSynch;
+
+ private javax.swing.JButton btnUpdateTimestamps;
+
+ private javax.swing.JLabel jLabel1;
+
+ private javax.swing.JLabel lblDeviceName;
+
+ private javax.swing.JLabel lblDeviceName1;
+
+ private javax.swing.JLabel lblDeviceName2;
+
+ private javax.swing.JTextField localPath;
+
+ private javax.swing.JTextField txtDeviceName;
+
+ private javax.swing.JTextField txtIrodsPath;
+ // End of variables declaration//GEN-END:variables
+
+}
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/IDROPDesktop.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/iDrop.java
index 1e7c8d4..a514f38 100644
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/IDROPDesktop.java
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/iDrop.java
@@ -8,7 +8,6 @@ package org.irods.jargon.idrop.desktop.systraygui;
import java.awt.AWTException;
import java.awt.CheckboxMenuItem;
import java.awt.Cursor;
-import java.awt.Dimension;
import java.awt.HeadlessException;
import java.awt.Image;
import java.awt.MenuItem;
@@ -20,35 +19,27 @@ import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
-import java.awt.event.KeyListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.io.File;
-import java.lang.reflect.InvocationTargetException;
import java.net.URL;
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
import java.util.Enumeration;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.DefaultListModel;
-import javax.swing.Icon;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JCheckBox;
-import javax.swing.JComboBox;
import javax.swing.JDialog;
-import javax.swing.JFileChooser;
-import javax.swing.JFrame;
-import javax.swing.JLabel;
-import javax.swing.JList;
import javax.swing.JOptionPane;
-import javax.swing.JPasswordField;
-import javax.swing.JTextField;
import javax.swing.JToggleButton;
-import javax.swing.SwingUtilities;
import javax.swing.UIManager;
+import javax.swing.UIManager.LookAndFeelInfo;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
import javax.swing.tree.TreePath;
@@ -63,34 +54,6 @@ import org.irods.jargon.core.pub.domain.DataObject;
import org.irods.jargon.core.query.CollectionAndDataObjectListingEntry;
import org.irods.jargon.core.query.MetaDataAndDomainData.MetadataDomain;
import org.irods.jargon.core.transfer.TransferStatus;
-import org.irods.jargon.idrop.desktop.systraygui.components.RemoteFSChooserListCellRenderer;
-import org.irods.jargon.idrop.desktop.systraygui.components.RemoteFileChooserDialogLookInComboBoxRender;
-import org.irods.jargon.idrop.desktop.systraygui.listeners.ChangePasswordCancelActionListener;
-import org.irods.jargon.idrop.desktop.systraygui.listeners.ChangePasswordDialogEnterKeyListener;
-import org.irods.jargon.idrop.desktop.systraygui.listeners.ChangePasswordMenuActionListener;
-import org.irods.jargon.idrop.desktop.systraygui.listeners.ChangePasswordSaveActionListener;
-import org.irods.jargon.idrop.desktop.systraygui.listeners.EditSynchronizationDialogCancelActionListener;
-import org.irods.jargon.idrop.desktop.systraygui.listeners.EditSynchronizationDialogLocalPathBrowseActionListener;
-import org.irods.jargon.idrop.desktop.systraygui.listeners.EditSynchronizationDialogRemotePathBrowseActionListener;
-import org.irods.jargon.idrop.desktop.systraygui.listeners.EditSynchronizationDialogSaveActionListener;
-import org.irods.jargon.idrop.desktop.systraygui.listeners.EditSynchronizationsDialogDeleteActionListener;
-import org.irods.jargon.idrop.desktop.systraygui.listeners.EditSynchronizationsDialogEditActionListener;
-import org.irods.jargon.idrop.desktop.systraygui.listeners.EditSynchronizationsDialogNewActionListener;
-import org.irods.jargon.idrop.desktop.systraygui.listeners.EditSynchronizationsDialogRunNowActionListener;
-import org.irods.jargon.idrop.desktop.systraygui.listeners.EditSynchronizationsMenuActionListener;
-import org.irods.jargon.idrop.desktop.systraygui.listeners.PreferencesDialogCancelActionListener;
-import org.irods.jargon.idrop.desktop.systraygui.listeners.PreferencesDialogSaveActionListener;
-import org.irods.jargon.idrop.desktop.systraygui.listeners.PreferencesMenuActionListener;
-import org.irods.jargon.idrop.desktop.systraygui.listeners.RemoteFileChooserDialogCancelActionListener;
-import org.irods.jargon.idrop.desktop.systraygui.listeners.RemoteFileChooserDialogDetailsViewActionListener;
-import org.irods.jargon.idrop.desktop.systraygui.listeners.RemoteFileChooserDialogFileTypeActionListener;
-import org.irods.jargon.idrop.desktop.systraygui.listeners.RemoteFileChooserDialogHomeFolderActionListener;
-import org.irods.jargon.idrop.desktop.systraygui.listeners.RemoteFileChooserDialogListMouseListener;
-import org.irods.jargon.idrop.desktop.systraygui.listeners.RemoteFileChooserDialogListViewActionListener;
-import org.irods.jargon.idrop.desktop.systraygui.listeners.RemoteFileChooserDialogLookInActionListener;
-import org.irods.jargon.idrop.desktop.systraygui.listeners.RemoteFileChooserDialogNewFolderActionListener;
-import org.irods.jargon.idrop.desktop.systraygui.listeners.RemoteFileChooserDialogOpenActionListener;
-import org.irods.jargon.idrop.desktop.systraygui.listeners.RemoteFileChooserDialogUpFolderActionListener;
import org.irods.jargon.idrop.desktop.systraygui.utils.IDropUtils;
import org.irods.jargon.idrop.desktop.systraygui.utils.IconHelper;
import org.irods.jargon.idrop.desktop.systraygui.utils.LocalFileUtils;
@@ -117,160 +80,56 @@ import org.irods.jargon.usertagging.domain.TagQuerySearchResult;
import org.netbeans.swing.outline.Outline;
import org.slf4j.LoggerFactory;
-import cookxml.cookswing.CookSwing;
-import javax.swing.JProgressBar;
-
/**
* Main system tray and GUI. Create system tray menu, start timer process for queue.
*
* @author Mike Conway - DICE (www.irods.org)
*/
-public class IDROPDesktop implements ActionListener, ItemListener, TransferManagerCallbackListener {
-
- public JFrame mainFrame;
+public class iDrop extends javax.swing.JFrame implements ActionListener, ItemListener, TransferManagerCallbackListener {
+ private static final long serialVersionUID = 1L;
private LocalFileSystemModel localFileModel = null;
-
- private static final org.slf4j.Logger log = LoggerFactory.getLogger(IDROPDesktop.class);
-
+ private static final org.slf4j.Logger log = LoggerFactory.getLogger(iDrop.class);
private boolean formShown = false;
-
- private CookSwing cookSwing = null;
-
private LocalFileTree fileTree = null;
-
private IRODSTree irodsTree = null;
-
private QueueManagerDialog queueManagerDialog = null;
-
- private IDROPCore iDropCore;
-
- public CheckboxMenuItem pausedItem = null;
-
+ private IDROPCore iDropCore = new IDROPCore();
+ private CheckboxMenuItem pausedItem = null;
private TrayIcon trayIcon = null;
-
private Object lastCachedInfoItem = null;
+ public DateFormat df = DateFormat.getDateInstance(DateFormat.LONG);
+ private ChangePasswordDialog changePasswordDialog = null;
+ private SynchSetupDialog synchSetupDialog = null;
+ public static JDialog newPreferencesDialog;
+ public JCheckBox showGUICheckBox;
+ public JButton preferencesDialogOKButton;
+ private static SimpleDateFormat SDF = new SimpleDateFormat("MM-dd-yyyy");
- public JList editSynchronizationsDialogList, remoteFileChooserDialogList;
-
- public JLabel loginDialogUsernameLabel, loginDialogPasswordLabel, loginDialogHostLabel, loginDialogPortLabel,
- loginDialogZoneLabel, loginDialogResourceLabel;
-
- public JPasswordField changePasswordDialogPasswordPasswordField, changePasswordDialogPasswordConfirmPasswordField;
-
- public JTextField editSynchronizationDialogLocalPathTextField, editSynchronizationDialogNameTextField,
- editSynchronizationDialogRemotePathTextField, remoteFileChooserDialogFileNameTextField,
- preferencesDialogDefaultLocalDirectoryTextField, editSynchronizationDialogDeviceNameTextField,
- preferencesDialogDeviceNameTextField, changePasswordDialogCurrentAccountTextField;
-
- public JDialog editSynchronizationsDialog, editSynchronizationDialog, remoteFileChooserDialog, preferencesDialog,
- changePasswordDialog;
+ public iDrop(final IDROPCore idropCore) {
- public JCheckBox preferencesDialogShowUICheckBox, preferencesDialogShowHiddenFilesCheckBox,
- preferencesDialogShowPreferencesCheckBox, preferencesDialogShowSplashScreenCheckBox;
-
- public DefaultListModel editSynchronizationsDialogListModel, remoteFileChooserDialogListModel;
-
- public JButton preferencesDialogOKButton, editSynchronizationsDialogNewButton,
- editSynchronizationsDialogEditButton, editSynchronizationsDialogDeleteButton,
- editSynchronizationsDialogRunNowButton, editSynchronizationDialogSaveButton,
- editSynchronizationDialogCancelButton, editSynchronizationDialogRemotePathBrowseButton,
- editSynchronizationDialogLocalPathBrowseButton, remoteFileChooserDialogNewFolderButton,
- remoteFileChooserDialogUpFolderButton, remoteFileChooserDialogHomeFolderButton,
- remoteFileChooserDialogListViewButton, remoteFileChooserDialogDetailsViewButton,
- remoteFileChooserDialogOpenButton, remoteFileChooserDialogCancelButton, changePasswordDialogSaveButton,
- changePasswordDialogCancelButton;
-
- public JFileChooser editSynchronizationDialogLocalPathFileChooser, editSynchronizationDialogRemotePathFileChooser,
- preferencesDialogDefaultLocalDirectoryFileChooser;
-
- public JComboBox editSynchronizationDialogFrequencyComboBox, remoteFileChooserDialogFileTypeComboBox,
- remoteFileChooserDialogLookInComboBox;
-
- public IDROPDesktop(final IDROPCore idropCore) {
- this();
if (idropCore == null) {
throw new IllegalArgumentException("null idropCore");
}
+ try {
+ for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
+ if ("Nimbus".equals(info.getName())) {
+ UIManager.setLookAndFeel(info.getClassName());
+ break;
+ }
+ }
+ } catch (Exception e) {
+ throw new IdropRuntimeException(e);
+ }
+
this.iDropCore = idropCore;
}
/** Creates new form IDrop */
- public IDROPDesktop() {
+ public iDrop() {
}
- public final ActionListener editSynchronizationsDialogNewActionListener = new EditSynchronizationsDialogNewActionListener(
- this);
-
- public final ActionListener editSynchronizationsDialogEditActionListener = new EditSynchronizationsDialogEditActionListener(
- this);
-
- public final ActionListener editSynchronizationsDialogDeleteActionListener = new EditSynchronizationsDialogDeleteActionListener(
- this);
-
- public final ActionListener editSynchronizationsDialogRunNowActionListener = new EditSynchronizationsDialogRunNowActionListener(
- this);
-
- public final ActionListener editSynchronizationDialogLocalPathBrowseActionListener = new EditSynchronizationDialogLocalPathBrowseActionListener(
- this);
-
- public final ActionListener editSynchronizationDialogRemotePathBrowseActionListener = new EditSynchronizationDialogRemotePathBrowseActionListener(
- this);
-
- public final ActionListener editSynchronizationDialogSaveActionListener = new EditSynchronizationDialogSaveActionListener(
- this);
-
- public final ActionListener editSynchronizationDialogCancelActionListener = new EditSynchronizationDialogCancelActionListener(
- this);
-
- public final ActionListener editSynchronizationsMenuActionListener = new EditSynchronizationsMenuActionListener(
- this);
-
- public final ActionListener remoteFileChooserDialogUpFolderActionListener = new RemoteFileChooserDialogUpFolderActionListener(
- this);
-
- public final ActionListener remoteFileChooserDialogHomeFolderActionListener = new RemoteFileChooserDialogHomeFolderActionListener(
- this);
-
- public final ActionListener remoteFileChooserDialogNewFolderActionListener = new RemoteFileChooserDialogNewFolderActionListener(
- this);
-
- public final ActionListener remoteFileChooserDialogListViewActionListener = new RemoteFileChooserDialogListViewActionListener(
- this);
-
- public final ActionListener remoteFileChooserDialogDetailsViewActionListener = new RemoteFileChooserDialogDetailsViewActionListener(
- this);
-
- public final ActionListener remoteFileChooserDialogLookInActionListener = new RemoteFileChooserDialogLookInActionListener(
- this);
-
- public final ActionListener remoteFileChooserDialogFileTypeActionListener = new RemoteFileChooserDialogFileTypeActionListener(
- this);
-
- public final ActionListener remoteFileChooserDialogOpenActionListener = new RemoteFileChooserDialogOpenActionListener(
- this);
-
- public final ActionListener remoteFileChooserDialogCancelActionListener = new RemoteFileChooserDialogCancelActionListener(
- this);
-
- public final MouseListener remoteFileChooserDialogListMouseListener = new RemoteFileChooserDialogListMouseListener(
- this);
-
- public final ActionListener preferencesMenuActionListener = new PreferencesMenuActionListener(this);
-
- public final ActionListener preferencesDialogCancelActionListener = new PreferencesDialogCancelActionListener(this);
-
- public final ActionListener preferencesDialogSaveActionListener = new PreferencesDialogSaveActionListener(this);
-
- public final ActionListener changePasswordDialogSaveActionListener = new ChangePasswordSaveActionListener(this);
-
- public final ActionListener changePasswordDialogCancelActionListener = new ChangePasswordCancelActionListener(this);
-
- public final ActionListener changePasswordMenuActionListener = new ChangePasswordMenuActionListener(this);
-
- public final KeyListener changePasswordDialogEnterKeyListener = new ChangePasswordDialogEnterKeyListener(this);
-
protected void buildIdropGuiComponents() throws IdropRuntimeException, HeadlessException {
initComponents();
this.pnlLocalTreeArea.setVisible(false);
@@ -279,7 +138,7 @@ public class IDROPDesktop implements ActionListener, ItemListener, TransferManag
try {
pnlIrodsInfo.setTransferHandler(new InfoPanelTransferHandler(this));
} catch (IdropException ex) {
- Logger.getLogger(IDROPDesktop.class.getName()).log(Level.SEVERE, null, ex);
+ Logger.getLogger(iDrop.class.getName()).log(Level.SEVERE, null, ex);
throw new IdropRuntimeException("error setting up infoPanelTransferHandler", ex);
}
@@ -289,13 +148,22 @@ public class IDROPDesktop implements ActionListener, ItemListener, TransferManag
tableSearchResults.addMouseListener(popupListener);
tableSearchResults.getTableHeader().addMouseListener(popupListener);
- // for (FrequencyType ft : FrequencyType.values()) {
- // this.editSynchronizationDialogFrequencyComboBox.addItem(ft.getReadableName());
- // }
+ Toolkit t = getToolkit();
+ int width = t.getScreenSize().width;
+ int height = t.getScreenSize().height;
- this.remoteFileChooserDialogList.setCellRenderer(new RemoteFSChooserListCellRenderer());
- this.remoteFileChooserDialogLookInComboBox.setRenderer(new RemoteFileChooserDialogLookInComboBoxRender());
+ // FIXME: don't build prefs panel here
+ int showX = (width / 2) - (this.getWidth() / 2);
+ int showY = (height / 2) - (this.getHeight() / 2);
+ this.setLocation(showX, showY);
+ /*
+ * FIXME: remove cookswing deps for issues
+ *
+ * CookSwing cookSwing = new CookSwing(this); newPreferencesDialog = (JDialog)
+ * cookSwing.render("org/irods/jargon/idrop/preferencesDialog.xml"); boolean showGUI =
+ * getiDropCore().getPreferences().getBoolean("showGUI", true); showGUICheckBox.setSelected(showGUI);
+ */
if (!getiDropCore().getIdropConfig().isAdvancedView()) {
toolBarInfo.setVisible(false);
}
@@ -307,45 +175,36 @@ public class IDROPDesktop implements ActionListener, ItemListener, TransferManag
userNameLabel.setText("User: " + getiDropCore().getIrodsAccount().getUserName());
- Icon newFolderIcon = UIManager.getIcon("FileChooser.newFolderIcon");
- remoteFileChooserDialogNewFolderButton.setIcon(newFolderIcon);
-
- Icon upFolderIcon = UIManager.getIcon("FileChooser.upFolderIcon");
- remoteFileChooserDialogUpFolderButton.setIcon(upFolderIcon);
-
- Icon homeFolderIcon = UIManager.getIcon("FileChooser.homeFolderIcon");
- remoteFileChooserDialogHomeFolderButton.setIcon(homeFolderIcon);
-
- Icon listViewIcon = UIManager.getIcon("FileChooser.listViewIcon");
- remoteFileChooserDialogListViewButton.setIcon(listViewIcon);
-
- Icon detailsViewIcon = UIManager.getIcon("FileChooser.detailsViewIcon");
- remoteFileChooserDialogDetailsViewButton.setIcon(detailsViewIcon);
-
}
protected void showIdropGui() {
- if (cookSwing == null) {
- cookSwing = new CookSwing(this);
- changePasswordDialog = (JDialog) cookSwing.render("org/irods/jargon/idrop/changePasswordDialog.xml");
- editSynchronizationDialog = (JDialog) cookSwing
- .render("org/irods/jargon/idrop/editSynchronizationDialog.xml");
- editSynchronizationsDialog = (JDialog) cookSwing
- .render("org/irods/jargon/idrop/editSynchronizationsDialog.xml");
- preferencesDialog = (JDialog) cookSwing.render("org/irods/jargon/idrop/preferencesDialog.xml");
- remoteFileChooserDialog = (JDialog) cookSwing.render("org/irods/jargon/idrop/remoteFileChooserDialog.xml");
- }
-
if (fileTree == null) {
buildIdropGuiComponents();
}
setUpLocalFileSelectTree();
buildTargetTree();
+ setVisible(true);
}
+ protected void signalIdropCoreReadyAndSplashComplete() {
+ createAndShowSystemTray();
+
+ boolean showGUI = getiDropCore().getPreferences().getBoolean("showGUI", true);
+ if (showGUI) {
+ showIdropGui();
+ } else {
+ MessageManager.showMessage(this,
+ "iDrop has started.\nCheck your system tray to access the iDrop user interface.",
+ "iDrop has started");
+ }
+ iDropCore.getIconManager().setRunningStatus(iDropCore.getTransferManager().getRunningStatus());
+ iDropCore.getIconManager().setErrorStatus(iDropCore.getTransferManager().getErrorStatus());
+ togglePauseTransfer.setSelected(pausedItem.getState());
+ }
+
@Override
public synchronized void transferManagerErrorStatusUpdate(ErrorStatus es) {
iDropCore.getIconManager().setErrorStatus(es);
@@ -368,6 +227,8 @@ public class IDROPDesktop implements ActionListener, ItemListener, TransferManag
*/
@Override
public void statusCallback(final TransferStatus ts) {
+ // this.queuedTransfersLabel.setText("Queued Transfers: " + ts.getTotalFilesTransferredSoFar() + "/"
+ // + ts.getTotalFilesToTransfer());
this.transferStatusProgressBar.setMaximum(ts.getTotalFilesToTransfer());
this.transferStatusProgressBar.setValue(ts.getTotalFilesTransferredSoFar());
log.info("transfer status callback to iDROP:{}", ts);
@@ -396,39 +257,32 @@ public class IDROPDesktop implements ActionListener, ItemListener, TransferManag
@Override
public void overallStatusCallback(final TransferStatus ts) {
- final JProgressBar thisProgressBar = transferStatusProgressBar;
- if (ts.getTransferState() == TransferStatus.TransferState.OVERALL_INITIATION) {
-
- java.awt.EventQueue.invokeLater(new Runnable() {
-
- @Override
- public void run() {
- // on initiation, clear and reset the status bar info
- lblTransferType.setText(ts.getTransferType().name());
- lblTransferFilesCounts.setText("Files: " + ts.getTotalFilesTransferredSoFar() + " / "
- + ts.getTotalFilesToTransfer());
- lblTransferByteCounts.setText("Bytes (kb):" + (ts.getBytesTransfered() / 1024) + " / "
- + (ts.getTotalSize() / 1024));
- lblCurrentFile.setText(IDropUtils.abbreviateFileName(ts.getSourceFileAbsolutePath()));
- thisProgressBar.setMaximum(ts.getTotalFilesToTransfer());
- thisProgressBar.setValue(ts.getTotalFilesTransferredSoFar());
+ IRODSOutlineModel irodsTreeModel = (IRODSOutlineModel) irodsTree.getModel();
+ try {
+ irodsTreeModel.notifyCompletionOfOperation(irodsTree, ts);
+ // if a get callback on completion, notify the local tree model
+ if (ts.getTransferType() == TransferStatus.TransferType.GET
+ && ts.getTransferState() == TransferStatus.TransferState.OVERALL_COMPLETION) {
+ ((LocalFileSystemModel) getFileTree().getModel()).notifyCompletionOfOperation(getFileTree(), ts);
+ }
+ } catch (IdropException ex) {
+ Logger.getLogger(iDrop.class.getName()).log(Level.SEVERE, null, ex);
+ this.showIdropException(ex);
+ }
- }
- });
- } else {
- try {
- IRODSOutlineModel irodsTreeModel = (IRODSOutlineModel) irodsTree.getModel();
+ java.awt.EventQueue.invokeLater(new Runnable() {
- irodsTreeModel.notifyCompletionOfOperation(irodsTree, ts);
- // if a get callback on completion, notify the local tree model
- if (ts.getTransferType() == TransferStatus.TransferType.GET) {
- ((LocalFileSystemModel) getFileTree().getModel()).notifyCompletionOfOperation(getFileTree(), ts);
- }
- } catch (IdropException ex) {
- Logger.getLogger(IDROPDesktop.class.getName()).log(Level.SEVERE, null, ex);
- this.showIdropException(ex);
+ @Override
+ public void run() {
+ // on initiation, clear and reset the status bar info
+ lblTransferType.setText(ts.getTransferType().name());
+ lblTransferFilesCounts.setText("Files: " + ts.getTotalFilesTransferredSoFar() + " / "
+ + ts.getTotalFilesToTransfer());
+ lblTransferByteCounts.setText("Bytes (kb):" + (ts.getBytesTransfered() / 1024) + " / "
+ + (ts.getTotalSize() / 1024));
+ lblCurrentFile.setText(IDropUtils.abbreviateFileName(ts.getSourceFileAbsolutePath()));
}
- }
+ });
}
@@ -438,8 +292,7 @@ public class IDROPDesktop implements ActionListener, ItemListener, TransferManag
* @param idropException
*/
public void showIdropException(Exception idropException) {
- JOptionPane.showMessageDialog(mainFrame, idropException.getMessage(), "iDROP Exception",
- JOptionPane.WARNING_MESSAGE);
+ JOptionPane.showMessageDialog(this, idropException.getMessage(), "iDROP Exception", JOptionPane.WARNING_MESSAGE);
}
/**
@@ -449,12 +302,12 @@ public class IDROPDesktop implements ActionListener, ItemListener, TransferManag
*/
public void showMessageFromOperation(final String messageFromOperation) {
- final IDROPDesktop thisIdropGui = this;
+ final iDrop thisIdropGui = this;
java.awt.EventQueue.invokeLater(new Runnable() {
@Override
public void run() {
- JOptionPane.showMessageDialog(mainFrame, messageFromOperation, "iDROP Message",
+ JOptionPane.showMessageDialog(thisIdropGui, messageFromOperation, "iDROP Message",
JOptionPane.INFORMATION_MESSAGE);
}
});
@@ -567,7 +420,7 @@ public class IDROPDesktop implements ActionListener, ItemListener, TransferManag
/** Returns an ImageIcon, or null if the path was invalid. FIXME: move to static util */
protected static Image createImage(String path, String description) {
- URL imageURL = IDROPDesktop.class.getResource(path);
+ URL imageURL = iDrop.class.getResource(path);
if (imageURL == null) {
System.err.println("Resource not found: " + path);
@@ -607,7 +460,7 @@ public class IDROPDesktop implements ActionListener, ItemListener, TransferManag
@Override
public void actionPerformed(ActionEvent e) {
- Toolkit toolkit = Toolkit.getDefaultToolkit();
+ Toolkit toolkit = getToolkit();
if (e.getActionCommand().equals("Exit")) {
getiDropCore().getQueueTimer().cancel();
@@ -622,24 +475,31 @@ public class IDROPDesktop implements ActionListener, ItemListener, TransferManag
log.warn("no account, exiting");
System.exit(0);
} else {
- mainFrame.setVisible(false);
+ this.setVisible(false);
}
} else if (e.getActionCommand().equals("About")) {
- AboutDialog aboutDialog = new AboutDialog(mainFrame, true);
+ AboutDialog aboutDialog = new AboutDialog(this, true);
int x = (toolkit.getScreenSize().width - aboutDialog.getWidth()) / 2;
int y = (toolkit.getScreenSize().height - aboutDialog.getHeight()) / 2;
aboutDialog.setLocation(x, y);
aboutDialog.setVisible(true);
} else if (e.getActionCommand().equals("Preferences")) {
- ActionEvent ae = new ActionEvent(mainFrame, ActionEvent.ACTION_PERFORMED, "");
- preferencesMenuActionListener.actionPerformed(ae);
+ showGUICheckBox.setSelected(getiDropCore().getPreferences().getBoolean("showGUI", true));
+ newPreferencesDialog.setVisible(true);
} else if (e.getActionCommand().equals("Synch")) {
- ActionEvent ae = new ActionEvent(mainFrame, ActionEvent.ACTION_PERFORMED, "");
- editSynchronizationsMenuActionListener.actionPerformed(ae);
+ synchSetupDialog = new SynchSetupDialog(this, getiDropCore(), getiDropCore().getIrodsFileSystem());
+ synchSetupDialog.setVisible(true);
} else if (e.getActionCommand().equals("Change Password")) {
- ActionEvent ae = new ActionEvent(mainFrame, ActionEvent.ACTION_PERFORMED, "");
- changePasswordMenuActionListener.actionPerformed(ae);
+
+ if (changePasswordDialog == null) {
+ changePasswordDialog = new ChangePasswordDialog(this, true);
+ int x = (toolkit.getScreenSize().width - changePasswordDialog.getWidth()) / 2;
+ int y = (toolkit.getScreenSize().height - changePasswordDialog.getHeight()) / 2;
+ changePasswordDialog.setLocation(x, y);
+ }
+ changePasswordDialog.setVisible(true);
+
} else if (e.getActionCommand().equals("Show Current and Past Activity")) {
log.info("showing recent items in queue");
@@ -648,14 +508,17 @@ public class IDROPDesktop implements ActionListener, ItemListener, TransferManag
} else {
if (!this.formShown) {
+
showIdropGui();
+
} else {
// refresh the tree when setting visible again, the account may have changed.
+
buildTargetTree();
+ this.setVisible(true);
}
- mainFrame.setVisible(true);
- mainFrame.toFront();
+ this.toFront();
}
}
@@ -669,7 +532,7 @@ public class IDROPDesktop implements ActionListener, ItemListener, TransferManag
queueManagerDialog.refreshTableView(QueueManagerDialog.ViewType.RECENT);
}
} catch (IdropException ex) {
- Logger.getLogger(IDROPDesktop.class.getName()).log(Level.SEVERE, null, ex);
+ Logger.getLogger(iDrop.class.getName()).log(Level.SEVERE, null, ex);
this.showIdropException(ex);
return true;
}
@@ -706,8 +569,7 @@ public class IDROPDesktop implements ActionListener, ItemListener, TransferManag
sb.append(targetPath);
// default icon, custom title
- int n = JOptionPane.showConfirmDialog(mainFrame, sb.toString(), "Transfer Confirmaiton",
- JOptionPane.YES_NO_OPTION);
+ int n = JOptionPane.showConfirmDialog(this, sb.toString(), "Transfer Confirmaiton", JOptionPane.YES_NO_OPTION);
return n;
}
@@ -718,11 +580,10 @@ public class IDROPDesktop implements ActionListener, ItemListener, TransferManag
public int showTransferStartupConfirm() {
// default icon, custom title
- int n = JOptionPane
- .showConfirmDialog(
- mainFrame,
- "There are transfers ready to process, should the transfer queue be started? Click NO to pause the transfersf",
- "Begin Transfer Confirmation", JOptionPane.YES_NO_OPTION);
+ int n = JOptionPane.showConfirmDialog(
+ this,
+ "There are transfers ready to process, should the transfer queue be started? Click NO to pause the transfersf",
+ "Begin Transfer Confirmation", JOptionPane.YES_NO_OPTION);
return n;
}
@@ -777,7 +638,7 @@ public class IDROPDesktop implements ActionListener, ItemListener, TransferManag
iDropCore.getTransferManager().resume();
}
} catch (Exception ex) {
- Logger.getLogger(IDROPDesktop.class.getName()).log(Level.SEVERE, null, ex);
+ Logger.getLogger(iDrop.class.getName()).log(Level.SEVERE, null, ex);
}
}
@@ -788,7 +649,7 @@ public class IDROPDesktop implements ActionListener, ItemListener, TransferManag
* synch
*/
private void handleInfoPanelShowOrHide() {
- final IDROPDesktop idropGuiReference = this;
+ final iDrop idropGuiReference = this;
java.awt.EventQueue.invokeLater(new Runnable() {
@Override
@@ -823,7 +684,7 @@ public class IDROPDesktop implements ActionListener, ItemListener, TransferManag
}
log.info("building tree to look at local file system");
- final IDROPDesktop gui = this;
+ final iDrop gui = this;
java.awt.EventQueue.invokeLater(new Runnable() {
@@ -903,7 +764,7 @@ public class IDROPDesktop implements ActionListener, ItemListener, TransferManag
*/
public void buildTargetTree() {
log.info("building tree to look at staging resource");
- final IDROPDesktop gui = this;
+ final iDrop gui = this;
java.awt.EventQueue.invokeLater(new Runnable() {
@@ -964,7 +825,7 @@ public class IDROPDesktop implements ActionListener, ItemListener, TransferManag
* irodsTree.setSelectionRow(0);
*/
} catch (Exception ex) {
- Logger.getLogger(IDROPDesktop.class.getName()).log(Level.SEVERE, null, ex);
+ Logger.getLogger(iDrop.class.getName()).log(Level.SEVERE, null, ex);
throw new IdropRuntimeException(ex);
}
@@ -993,27 +854,27 @@ public class IDROPDesktop implements ActionListener, ItemListener, TransferManag
if (collectionAndDataObjectListingEntry == null) {
throw new IdropException("null collectionAndDataObjectListingEntry");
}
+
+ final iDrop idropGui = this;
+
// need to get the collection or data object info from iRODS
java.awt.EventQueue.invokeLater(new Runnable() {
@Override
public void run() {
+ idropGui.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
+
try {
- mainFrame.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
if (collectionAndDataObjectListingEntry.getObjectType() == CollectionAndDataObjectListingEntry.ObjectType.COLLECTION) {
log.info("looking up collection to build info panel");
- CollectionAO collectionAO = getiDropCore().getIrodsFileSystem().getIRODSAccessObjectFactory()
- .getCollectionAO(getIrodsAccount());
- Collection collection = collectionAO.findByAbsolutePath(collectionAndDataObjectListingEntry
- .getPathOrName());
+ CollectionAO collectionAO = getiDropCore().getIrodsFileSystem().getIRODSAccessObjectFactory().getCollectionAO(getIrodsAccount());
+ Collection collection = collectionAO.findByAbsolutePath(collectionAndDataObjectListingEntry.getPathOrName());
initializeInfoPanel(collection);
} else {
log.info("looking up data object to build info panel");
- DataObjectAO dataObjectAO = getiDropCore().getIrodsFileSystem().getIRODSAccessObjectFactory()
- .getDataObjectAO(getIrodsAccount());
- DataObject dataObject = dataObjectAO.findByAbsolutePath(collectionAndDataObjectListingEntry
- .getParentPath() + "/" + collectionAndDataObjectListingEntry.getPathOrName());
+ DataObjectAO dataObjectAO = getiDropCore().getIrodsFileSystem().getIRODSAccessObjectFactory().getDataObjectAO(getIrodsAccount());
+ DataObject dataObject = dataObjectAO.findByAbsolutePath(collectionAndDataObjectListingEntry.getParentPath() + "/" + collectionAndDataObjectListingEntry.getPathOrName());
initializeInfoPanel(dataObject);
}
@@ -1023,7 +884,7 @@ public class IDROPDesktop implements ActionListener, ItemListener, TransferManag
throw new IdropRuntimeException(e);
} finally {
getiDropCore().getIrodsFileSystem().closeAndEatExceptions(getIrodsAccount());
- mainFrame.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
+ idropGui.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
}
}
@@ -1049,12 +910,13 @@ public class IDROPDesktop implements ActionListener, ItemListener, TransferManag
}
this.lastCachedInfoItem = dataObject;
+ final iDrop idropGui = this;
java.awt.EventQueue.invokeLater(new Runnable() {
@Override
public void run() {
- mainFrame.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
+ idropGui.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
lblFileOrCollectionName.setText(dataObject.getDataName());
txtParentPath.setText(dataObject.getCollectionName());
@@ -1063,25 +925,23 @@ public class IDROPDesktop implements ActionListener, ItemListener, TransferManag
log.debug("getting available tags for data object");
try {
- FreeTaggingService freeTaggingService = FreeTaggingServiceImpl.instance(getiDropCore()
- .getIrodsFileSystem().getIRODSAccessObjectFactory(), getiDropCore().getIrodsAccount());
- IRODSTagGrouping irodsTagGrouping = freeTaggingService.getTagsForDataObjectInFreeTagForm(dataObject
- .getCollectionName() + "/" + dataObject.getDataName());
+ FreeTaggingService freeTaggingService = FreeTaggingServiceImpl.instance(getiDropCore().getIrodsFileSystem().getIRODSAccessObjectFactory(), getiDropCore().getIrodsAccount());
+ IRODSTagGrouping irodsTagGrouping = freeTaggingService.getTagsForDataObjectInFreeTagForm(dataObject.getCollectionName() + "/" + dataObject.getDataName());
txtTags.setText(irodsTagGrouping.getSpaceDelimitedTagsForDomain());
pnlInfoIcon.removeAll();
pnlInfoIcon.add(IconHelper.getFileIcon());
pnlInfoIcon.validate();
- lblInfoCreatedAtValue.setText(Constants.df.format(dataObject.getCreatedAt()));
- lblInfoUpdatedAtValue.setText(Constants.df.format(dataObject.getUpdatedAt()));
+ lblInfoCreatedAtValue.setText(df.format(dataObject.getCreatedAt()));
+ lblInfoUpdatedAtValue.setText(df.format(dataObject.getUpdatedAt()));
lblInfoLengthValue.setText(String.valueOf(dataObject.getDataSize()));
lblInfoLengthValue.setVisible(true);
lblInfoLength.setVisible(true);
} catch (JargonException ex) {
- Logger.getLogger(IDROPDesktop.class.getName()).log(Level.SEVERE, null, ex);
+ Logger.getLogger(iDrop.class.getName()).log(Level.SEVERE, null, ex);
throw new IdropRuntimeException(ex);
} finally {
getiDropCore().getIrodsFileSystem().closeAndEatExceptions(getIrodsAccount());
- mainFrame.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
+ idropGui.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
}
}
});
@@ -1107,13 +967,14 @@ public class IDROPDesktop implements ActionListener, ItemListener, TransferManag
}
this.lastCachedInfoItem = collection;
+ final iDrop idropGui = this;
java.awt.EventQueue.invokeLater(new Runnable() {
@Override
public void run() {
- mainFrame.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
+ idropGui.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
lblFileOrCollectionName.setText(collection.getCollectionLastPathComponent());
txtParentPath.setText(collection.getCollectionParentName());
@@ -1122,24 +983,22 @@ public class IDROPDesktop implements ActionListener, ItemListener, TransferManag
log.debug("getting available tags for data object");
try {
- FreeTaggingService freeTaggingService = FreeTaggingServiceImpl.instance(getiDropCore()
- .getIrodsFileSystem().getIRODSAccessObjectFactory(), getIrodsAccount());
- IRODSTagGrouping irodsTagGrouping = freeTaggingService.getTagsForCollectionInFreeTagForm(collection
- .getCollectionName());
+ FreeTaggingService freeTaggingService = FreeTaggingServiceImpl.instance(getiDropCore().getIrodsFileSystem().getIRODSAccessObjectFactory(), getIrodsAccount());
+ IRODSTagGrouping irodsTagGrouping = freeTaggingService.getTagsForCollectionInFreeTagForm(collection.getCollectionName());
txtTags.setText(irodsTagGrouping.getSpaceDelimitedTagsForDomain());
pnlInfoIcon.removeAll();
pnlInfoIcon.add(IconHelper.getFolderIcon());
pnlInfoIcon.validate();
- lblInfoCreatedAtValue.setText(Constants.df.format(collection.getCreatedAt()));
- lblInfoUpdatedAtValue.setText(Constants.df.format(collection.getModifiedAt()));
+ lblInfoCreatedAtValue.setText(df.format(collection.getCreatedAt()));
+ lblInfoUpdatedAtValue.setText(df.format(collection.getModifiedAt()));
lblInfoLengthValue.setVisible(false);
lblInfoLength.setVisible(false);
} catch (JargonException ex) {
- Logger.getLogger(IDROPDesktop.class.getName()).log(Level.SEVERE, null, ex);
+ Logger.getLogger(iDrop.class.getName()).log(Level.SEVERE, null, ex);
throw new IdropRuntimeException(ex);
} finally {
getiDropCore().getIrodsFileSystem().closeAndEatExceptions(getIrodsAccount());
- mainFrame.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
+ idropGui.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
}
}
});
@@ -1262,19 +1121,6 @@ public class IDROPDesktop implements ActionListener, ItemListener, TransferManag
jMenuFile = new javax.swing.JMenu();
jMenuItemExit = new javax.swing.JMenuItem();
jMenuEdit = new javax.swing.JMenu();
-
- jMenuItemEditSynchronizations = new javax.swing.JMenuItem();
- jMenuItemEditSynchronizations.setText("Synchronizations");
- jMenuItemEditSynchronizations.addActionListener(editSynchronizationsMenuActionListener);
-
- jMenuItemChangePassword = new javax.swing.JMenuItem();
- jMenuItemChangePassword.setText("Change Password");
- jMenuItemChangePassword.addActionListener(changePasswordMenuActionListener);
-
- jMenuItemPreferences = new javax.swing.JMenuItem();
- jMenuItemPreferences.setText("Preferences");
- jMenuItemPreferences.addActionListener(preferencesMenuActionListener);
-
jMenuView = new javax.swing.JMenu();
jCheckBoxMenuItemShowSourceTree = new javax.swing.JCheckBoxMenuItem();
jCheckBoxMenuItemShowIrodsInfo = new javax.swing.JCheckBoxMenuItem();
@@ -1282,20 +1128,16 @@ public class IDROPDesktop implements ActionListener, ItemListener, TransferManag
menuItemShowInHierarchy.setText("Show in iRODS");
menuItemShowInHierarchy.setToolTipText("Show this file or collection in the iRODS hierarchy");
menuItemShowInHierarchy.addActionListener(new java.awt.event.ActionListener() {
-
public void actionPerformed(java.awt.event.ActionEvent evt) {
menuItemShowInHierarchyActionPerformed(evt);
}
});
searchTablePopupMenu.add(menuItemShowInHierarchy);
- mainFrame = new JFrame();
- mainFrame.setMinimumSize(new Dimension(800, 600));
-
- mainFrame.setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
- mainFrame.setTitle("iDrop - iRODS Cloud Browser");
- mainFrame.addWindowListener(new java.awt.event.WindowAdapter() {
-
+ setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
+ setTitle("iDrop - iRODS Cloud Browser");
+ setMinimumSize(new java.awt.Dimension(600, 600));
+ addWindowListener(new java.awt.event.WindowAdapter() {
public void windowClosed(java.awt.event.WindowEvent evt) {
formWindowClosed(evt);
}
@@ -1320,8 +1162,7 @@ public class IDROPDesktop implements ActionListener, ItemListener, TransferManag
lblMainSearch.setPreferredSize(new java.awt.Dimension(45, 40));
pnlSearchSizer.add(lblMainSearch);
- comboSearchType.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "by name", "by tag",
- "by name and tag" }));
+ comboSearchType.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "by name", "by tag", "by name and tag" }));
comboSearchType.setToolTipText("Select the type of search to be carried out using the supplied search string");
pnlSearchSizer.add(comboSearchType);
@@ -1330,7 +1171,6 @@ public class IDROPDesktop implements ActionListener, ItemListener, TransferManag
txtMainSearch.setMinimumSize(null);
txtMainSearch.setPreferredSize(new java.awt.Dimension(100, 30));
txtMainSearch.addKeyListener(new java.awt.event.KeyAdapter() {
-
public void keyPressed(java.awt.event.KeyEvent evt) {
txtMainSearchKeyPressed(evt);
}
@@ -1341,7 +1181,6 @@ public class IDROPDesktop implements ActionListener, ItemListener, TransferManag
btnearch.setText("Search");
btnearch.setToolTipText("Search iRODS based on the current view selected");
btnearch.addActionListener(new java.awt.event.ActionListener() {
-
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnearchActionPerformed(evt);
}
@@ -1360,13 +1199,11 @@ public class IDROPDesktop implements ActionListener, ItemListener, TransferManag
toggleLocalFiles.setMinimumSize(new java.awt.Dimension(144, 10));
toggleLocalFiles.setPreferredSize(new java.awt.Dimension(144, 30));
toggleLocalFiles.addChangeListener(new javax.swing.event.ChangeListener() {
-
public void stateChanged(javax.swing.event.ChangeEvent evt) {
toggleLocalFilesStateChanged(evt);
}
});
toggleLocalFiles.addActionListener(new java.awt.event.ActionListener() {
-
public void actionPerformed(java.awt.event.ActionEvent evt) {
toggleLocalFilesActionPerformed(evt);
}
@@ -1379,18 +1216,16 @@ public class IDROPDesktop implements ActionListener, ItemListener, TransferManag
pnlIrodsDetailsToggleSizer.setLayout(new java.awt.BorderLayout());
toggleIrodsDetails.setToolTipText("Browse the local file system.");
- toggleIrodsDetails.setText("iRODS Info >>>>");
+ toggleIrodsDetails.setLabel("iRODS Info >>>>");
toggleIrodsDetails.setMaximumSize(new java.awt.Dimension(144, 10));
toggleIrodsDetails.setMinimumSize(new java.awt.Dimension(144, 10));
toggleIrodsDetails.setPreferredSize(new java.awt.Dimension(144, 30));
toggleIrodsDetails.addChangeListener(new javax.swing.event.ChangeListener() {
-
public void stateChanged(javax.swing.event.ChangeEvent evt) {
toggleIrodsDetailsStateChanged(evt);
}
});
toggleIrodsDetails.addActionListener(new java.awt.event.ActionListener() {
-
public void actionPerformed(java.awt.event.ActionEvent evt) {
toggleIrodsDetailsActionPerformed(evt);
}
@@ -1402,7 +1237,7 @@ public class IDROPDesktop implements ActionListener, ItemListener, TransferManag
iDropToolbar.add(pnlToolbarSizer, java.awt.BorderLayout.NORTH);
- mainFrame.getContentPane().add(iDropToolbar, java.awt.BorderLayout.NORTH);
+ getContentPane().add(iDropToolbar, java.awt.BorderLayout.NORTH);
pnlIdropMain.setPreferredSize(new java.awt.Dimension(500, 300));
pnlIdropMain.setLayout(new javax.swing.BoxLayout(pnlIdropMain, javax.swing.BoxLayout.PAGE_AXIS));
@@ -1440,11 +1275,10 @@ public class IDROPDesktop implements ActionListener, ItemListener, TransferManag
pnlRefreshButton.setMinimumSize(new java.awt.Dimension(0, 0));
pnlRefreshButton.setPreferredSize(new java.awt.Dimension(101, 30));
- btnRefreshLocalDrives.setText("Refresh");
+ btnRefreshLocalDrives.setLabel("Refresh");
btnRefreshLocalDrives.setMaximumSize(new java.awt.Dimension(200, 50));
btnRefreshLocalDrives.setMinimumSize(new java.awt.Dimension(0, 0));
btnRefreshLocalDrives.addActionListener(new java.awt.event.ActionListener() {
-
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnRefreshLocalDrivesActionPerformed(evt);
}
@@ -1477,7 +1311,6 @@ public class IDROPDesktop implements ActionListener, ItemListener, TransferManag
tabIrodsViews.setMinimumSize(new java.awt.Dimension(200, 129));
tabIrodsViews.setPreferredSize(new java.awt.Dimension(350, 300));
tabIrodsViews.addChangeListener(new javax.swing.event.ChangeListener() {
-
public void stateChanged(javax.swing.event.ChangeEvent evt) {
tabIrodsViewsStateChanged(evt);
}
@@ -1492,7 +1325,6 @@ public class IDROPDesktop implements ActionListener, ItemListener, TransferManag
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);
}
@@ -1514,17 +1346,24 @@ public class IDROPDesktop implements ActionListener, ItemListener, TransferManag
pnlTabSearchResults.setLayout(new java.awt.GridLayout(1, 0));
- tableSearchResults.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" }));
+ tableSearchResults.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"
+ }
+ ));
scrollPaneSearchResults.setViewportView(tableSearchResults);
pnlTabSearchResults.add(scrollPaneSearchResults);
pnlTabSearch.add(pnlTabSearchResults, java.awt.BorderLayout.CENTER);
- tabIrodsViews.addTab("Search", null, pnlTabSearch,
- "Search for files and collections in iRODS and display search results");
+ tabIrodsViews.addTab("Search", null, pnlTabSearch, "Search for files and collections in iRODS and display search results");
splitTargetCollections.setLeftComponent(tabIrodsViews);
@@ -1570,8 +1409,7 @@ public class IDROPDesktop implements ActionListener, ItemListener, TransferManag
lblFileParent.setText("Parent path of file:");
pnlInfoCollectionParent.add(lblFileParent, java.awt.BorderLayout.NORTH);
- lblFileParent.getAccessibleContext().setAccessibleDescription(
- "The path of the parent of the file or collection");
+ lblFileParent.getAccessibleContext().setAccessibleDescription("The path of the parent of the file or collection");
scrollParentPath.setMinimumSize(new java.awt.Dimension(100, 100));
@@ -1628,13 +1466,11 @@ public class IDROPDesktop implements ActionListener, ItemListener, TransferManag
txtTags.setMinimumSize(null);
txtTags.setPreferredSize(null);
txtTags.addFocusListener(new java.awt.event.FocusAdapter() {
-
public void focusLost(java.awt.event.FocusEvent evt) {
txtTagsFocusLost(evt);
}
});
txtTags.addKeyListener(new java.awt.event.KeyAdapter() {
-
public void keyPressed(java.awt.event.KeyEvent evt) {
txtTagsKeyPressed(evt);
}
@@ -1655,7 +1491,6 @@ public class IDROPDesktop implements ActionListener, ItemListener, TransferManag
btnUpdateInfo.setText("Update Info");
btnUpdateInfo.setToolTipText("Update information on the info panel such as tags and comment");
btnUpdateInfo.addActionListener(new java.awt.event.ActionListener() {
-
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnUpdateInfoActionPerformed(evt);
}
@@ -1738,7 +1573,6 @@ public class IDROPDesktop implements ActionListener, ItemListener, TransferManag
btnViewMetadata.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
btnViewMetadata.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
btnViewMetadata.addActionListener(new java.awt.event.ActionListener() {
-
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnViewMetadataActionPerformed(evt);
}
@@ -1750,7 +1584,6 @@ public class IDROPDesktop implements ActionListener, ItemListener, TransferManag
btnReplication.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
btnReplication.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
btnReplication.addActionListener(new java.awt.event.ActionListener() {
-
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnReplicationActionPerformed(evt);
}
@@ -1788,7 +1621,7 @@ public class IDROPDesktop implements ActionListener, ItemListener, TransferManag
pnlIdropMain.add(jSplitPanelLocalRemote);
- mainFrame.getContentPane().add(pnlIdropMain, java.awt.BorderLayout.CENTER);
+ getContentPane().add(pnlIdropMain, java.awt.BorderLayout.CENTER);
pnlIdropBottom.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.LOWERED));
pnlIdropBottom.setToolTipText("Display area for status and messages");
@@ -1839,8 +1672,7 @@ public class IDROPDesktop implements ActionListener, ItemListener, TransferManag
gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
pnlIdropBottom.add(pnlTransferOverview, gridBagConstraints);
- transferStatusProgressBar.setBorder(javax.swing.BorderFactory
- .createBevelBorder(javax.swing.border.BevelBorder.LOWERED));
+ transferStatusProgressBar.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.LOWERED));
transferStatusProgressBar.setStringPainted(true);
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 1;
@@ -1860,7 +1692,6 @@ public class IDROPDesktop implements ActionListener, ItemListener, TransferManag
btnShowTransferManager.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
btnShowTransferManager.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
btnShowTransferManager.addActionListener(new java.awt.event.ActionListener() {
-
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnShowTransferManagerActionPerformed(evt);
}
@@ -1873,7 +1704,6 @@ public class IDROPDesktop implements ActionListener, ItemListener, TransferManag
togglePauseTransfer.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
togglePauseTransfer.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
togglePauseTransfer.addActionListener(new java.awt.event.ActionListener() {
-
public void actionPerformed(java.awt.event.ActionEvent evt) {
togglePauseTransferActionPerformed(evt);
}
@@ -1891,7 +1721,7 @@ public class IDROPDesktop implements ActionListener, ItemListener, TransferManag
gridBagConstraints.gridy = 1;
pnlIdropBottom.add(transferQueueToolbarPanel, gridBagConstraints);
- mainFrame.getContentPane().add(pnlIdropBottom, java.awt.BorderLayout.SOUTH);
+ getContentPane().add(pnlIdropBottom, java.awt.BorderLayout.SOUTH);
jMenuFile.setMnemonic('f');
jMenuFile.setText("File");
@@ -1900,7 +1730,6 @@ public class IDROPDesktop implements ActionListener, ItemListener, TransferManag
jMenuItemExit.setText("Exit");
jMenuItemExit.setToolTipText("Close the iDROP console window");
jMenuItemExit.addActionListener(new java.awt.event.ActionListener() {
-
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenuItemExitActionPerformed(evt);
}
@@ -1911,34 +1740,25 @@ public class IDROPDesktop implements ActionListener, ItemListener, TransferManag
jMenuEdit.setMnemonic('E');
jMenuEdit.setText("Edit");
-
- jMenuEdit.add(jMenuItemEditSynchronizations);
- jMenuEdit.add(jMenuItemPreferences);
- jMenuEdit.add(jMenuItemChangePassword);
-
jMenuBar1.add(jMenuEdit);
jMenuView.setMnemonic('V');
jMenuView.setText("View");
- jCheckBoxMenuItemShowSourceTree.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_L,
- java.awt.event.InputEvent.SHIFT_MASK));
+ jCheckBoxMenuItemShowSourceTree.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_L, java.awt.event.InputEvent.SHIFT_MASK));
jCheckBoxMenuItemShowSourceTree.setMnemonic('L');
jCheckBoxMenuItemShowSourceTree.setText("Show Local");
jCheckBoxMenuItemShowSourceTree.addActionListener(new java.awt.event.ActionListener() {
-
public void actionPerformed(java.awt.event.ActionEvent evt) {
jCheckBoxMenuItemShowSourceTreeActionPerformed(evt);
}
});
jMenuView.add(jCheckBoxMenuItemShowSourceTree);
- jCheckBoxMenuItemShowIrodsInfo.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_L,
- java.awt.event.InputEvent.SHIFT_MASK));
+ jCheckBoxMenuItemShowIrodsInfo.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_L, java.awt.event.InputEvent.SHIFT_MASK));
jCheckBoxMenuItemShowIrodsInfo.setMnemonic('I');
jCheckBoxMenuItemShowIrodsInfo.setText("Show iRODS Info");
jCheckBoxMenuItemShowIrodsInfo.addActionListener(new java.awt.event.ActionListener() {
-
public void actionPerformed(java.awt.event.ActionEvent evt) {
jCheckBoxMenuItemShowIrodsInfoActionPerformed(evt);
}
@@ -1947,20 +1767,9 @@ public class IDROPDesktop implements ActionListener, ItemListener, TransferManag
jMenuBar1.add(jMenuView);
- mainFrame.setJMenuBar(jMenuBar1);
-
- mainFrame.pack();
-
- // packing screws up the size, so setLocation after packing
- Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
-
- int width = mainFrame.getSize().width;
- int height = mainFrame.getSize().height;
-
- int xLocation = (screenSize.width - width) / 2;
- int yLocation = (screenSize.height - height) / 2;
- mainFrame.setLocation(xLocation, yLocation);
+ setJMenuBar(jMenuBar1);
+ pack();
}// </editor-fold>//GEN-END:initComponents
private void btnShowTransferManagerActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_btnShowTransferManagerActionPerformed
@@ -1984,12 +1793,29 @@ public class IDROPDesktop implements ActionListener, ItemListener, TransferManag
iDropCore.getTransferManager().resume();
}
} catch (Exception ex) {
- Logger.getLogger(IDROPDesktop.class.getName()).log(Level.SEVERE, null, ex);
+ Logger.getLogger(iDrop.class.getName()).log(Level.SEVERE, null, ex);
}
}// GEN-LAST:event_togglePauseTransferActionPerformed
+ public ActionListener showPreferencesDialogActionListener = new ActionListener() {
+
+ private static final long serialVersionUID = 1L;
+
+ public void actionPerformed(ActionEvent e) {
+ newPreferencesDialog.setVisible(true);
+ }
+ };
+ public ActionListener okButtonPreferencesDialogActionListener = new ActionListener() {
+
+ private static final long serialVersionUID = 1L;
+
+ public void actionPerformed(ActionEvent e) {
+ getiDropCore().getPreferences().putBoolean("showGUI", showGUICheckBox.isSelected() ? true : false);
+ newPreferencesDialog.setVisible(false);
+ }
+ };
private void formWindowClosed(java.awt.event.WindowEvent evt) {// GEN-FIRST:event_formWindowClosed
- mainFrame.setVisible(false);
+ this.setVisible(false);
this.formShown = false;
}// GEN-LAST:event_formWindowClosed
@@ -2030,7 +1856,7 @@ public class IDROPDesktop implements ActionListener, ItemListener, TransferManag
}// GEN-LAST:event_jCheckBoxMenuItemShowSourceTreeActionPerformed
private void jMenuItemExitActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_jMenuItemExitActionPerformed
- mainFrame.setVisible(false);
+ this.setVisible(false);
}// GEN-LAST:event_jMenuItemExitActionPerformed
/**
@@ -2065,7 +1891,7 @@ public class IDROPDesktop implements ActionListener, ItemListener, TransferManag
final Enumeration<TreePath> pathsToExpand = currentPaths;
fileTree.expandTreeNodesBasedOnListOfPreviouslyExpandedNodes(pathsToExpand);
} catch (IdropException ex) {
- Logger.getLogger(IDROPDesktop.class.getName()).log(Level.SEVERE, null, ex);
+ Logger.getLogger(iDrop.class.getName()).log(Level.SEVERE, null, ex);
throw new IdropRuntimeException("exception expanding tree nodes", ex);
}
@@ -2184,15 +2010,7 @@ public class IDROPDesktop implements ActionListener, ItemListener, TransferManag
throw new IdropRuntimeException("unknown type of object displayed in info area");
}
- Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
-
- int width = replicationDialog.getSize().width;
- int height = replicationDialog.getSize().height;
-
- int xLocation = (screenSize.width - width) / 2;
- int yLocation = (screenSize.height - height) / 2;
- replicationDialog.setLocation(xLocation, yLocation);
-
+ replicationDialog.setLocation((int) (this.getLocation().getX() + replicationDialog.getWidth() / 2), (int) (this.getLocation().getY() + replicationDialog.getHeight() / 2));
replicationDialog.setVisible(true);
}// GEN-LAST:event_btnReplicationActionPerformed
@@ -2220,15 +2038,8 @@ public class IDROPDesktop implements ActionListener, ItemListener, TransferManag
throw new IdropRuntimeException("unknown type of object displayed in info area");
}
- Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
-
- int width = metadataViewDialog.getSize().width;
- int height = metadataViewDialog.getSize().height;
-
- int xLocation = (screenSize.width - width) / 2;
- int yLocation = (screenSize.height - height) / 2;
- metadataViewDialog.setLocation(xLocation, yLocation);
-
+ metadataViewDialog.setLocation((int) (this.getLocation().getX() + metadataViewDialog.getWidth() / 2),
+ (int) (this.getLocation().getY() + metadataViewDialog.getHeight() / 2));
metadataViewDialog.setVisible(true);
}// GEN-LAST:event_btnViewMetadataActionPerformed
@@ -2242,7 +2053,7 @@ public class IDROPDesktop implements ActionListener, ItemListener, TransferManag
// initialize a variable with the last item visible to the runnable
final Object lastCachedItemToProcessTagsFor = this.lastCachedInfoItem;
- final IDROPDesktop idropGui = this;
+ final iDrop idropGui = this;
java.awt.EventQueue.invokeLater(new Runnable() {
@@ -2253,21 +2064,18 @@ public class IDROPDesktop implements ActionListener, ItemListener, TransferManag
FreeTaggingService freeTaggingService;
try {
- freeTaggingService = FreeTaggingServiceImpl.instance(getiDropCore().getIrodsFileSystem()
- .getIRODSAccessObjectFactory(), getIrodsAccount());
+ freeTaggingService = FreeTaggingServiceImpl.instance(getiDropCore().getIrodsFileSystem().getIRODSAccessObjectFactory(), getIrodsAccount());
if (lastCachedInfoItem instanceof Collection) {
log.info("processing tags for collection");
Collection collection = (Collection) lastCachedItemToProcessTagsFor;
- IRODSTagGrouping irodsTagGrouping = new IRODSTagGrouping(MetadataDomain.COLLECTION, collection
- .getCollectionName(), txtTags.getText(), getIrodsAccount().getUserName());
+ IRODSTagGrouping irodsTagGrouping = new IRODSTagGrouping(MetadataDomain.COLLECTION, collection.getCollectionName(), txtTags.getText(), getIrodsAccount().getUserName());
log.debug("new tag set is:{}", txtTags.getText());
freeTaggingService.updateTags(irodsTagGrouping);
} else if (lastCachedInfoItem instanceof DataObject) {
log.info("processing tags for data object");
DataObject dataObject = (DataObject) lastCachedItemToProcessTagsFor;
- IRODSTagGrouping irodsTagGrouping = new IRODSTagGrouping(MetadataDomain.DATA, dataObject
- .getCollectionName() + "/" + dataObject.getDataName(), txtTags.getText(),
+ IRODSTagGrouping irodsTagGrouping = new IRODSTagGrouping(MetadataDomain.DATA, dataObject.getCollectionName() + "/" + dataObject.getDataName(), txtTags.getText(),
getIrodsAccount().getUserName());
log.debug("new tag set is:{}", txtTags.getText());
freeTaggingService.updateTags(irodsTagGrouping);
@@ -2280,13 +2088,13 @@ public class IDROPDesktop implements ActionListener, ItemListener, TransferManag
} catch (JargonException ex) {
idropGui.showIdropException(ex);
- Logger.getLogger(IDROPDesktop.class.getName()).log(Level.SEVERE, null, ex);
+ Logger.getLogger(iDrop.class.getName()).log(Level.SEVERE, null, ex);
throw new IdropRuntimeException(ex);
} finally {
try {
getiDropCore().getIrodsFileSystem().close(getIrodsAccount());
} catch (JargonException ex) {
- Logger.getLogger(IDROPDesktop.class.getName()).log(Level.SEVERE, null, ex);
+ Logger.getLogger(iDrop.class.getName()).log(Level.SEVERE, null, ex);
// logged and ignored
}
idropGui.setNormalCursor();
@@ -2317,7 +2125,7 @@ public class IDROPDesktop implements ActionListener, ItemListener, TransferManag
try {
selPath = TreeUtils.buildTreePathForIrodsAbsolutePath(irodsTree, entry.getFormattedAbsolutePath());
} catch (IdropException ex) {
- Logger.getLogger(IDROPDesktop.class.getName()).log(Level.SEVERE, null, ex);
+ Logger.getLogger(iDrop.class.getName()).log(Level.SEVERE, null, ex);
this.showMessageFromOperation("That collection or file is not visible in the context of the current tree");
return;
}
@@ -2333,211 +2141,107 @@ public class IDROPDesktop implements ActionListener, ItemListener, TransferManag
// irodsTree.scrollPathToVisible(selPath);
tabIrodsViews.setSelectedComponent(pnlTabHierarchicalView);
}// GEN-LAST:event_menuItemShowInHierarchyActionPerformed
- // Variables declaration - do not modify//GEN-BEGIN:variables
-
+ // Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton btnMoveToTrash;
-
private javax.swing.JButton btnRefreshLocalDrives;
-
private javax.swing.JButton btnRefreshTargetTree;
-
private javax.swing.JButton btnReplication;
-
private javax.swing.JButton btnShowTransferManager;
-
private javax.swing.JButton btnUpdateInfo;
-
private javax.swing.JButton btnViewMetadata;
-
private javax.swing.JButton btnearch;
-
private javax.swing.JComboBox comboSearchType;
-
private javax.swing.JPanel iDropToolbar;
-
private javax.swing.JToolBar idropProgressPanelToolbar;
-
private javax.swing.JCheckBoxMenuItem jCheckBoxMenuItemShowIrodsInfo;
-
private javax.swing.JCheckBoxMenuItem jCheckBoxMenuItemShowSourceTree;
-
private javax.swing.JMenuBar jMenuBar1;
-
private javax.swing.JMenu jMenuEdit;
-
- private javax.swing.JMenuItem jMenuItemEditSynchronizations;
-
- private javax.swing.JMenuItem jMenuItemPreferences;
-
- private javax.swing.JMenuItem jMenuItemChangePassword;
-
private javax.swing.JMenu jMenuFile;
-
private javax.swing.JMenuItem jMenuItemExit;
-
private javax.swing.JMenu jMenuView;
-
private javax.swing.JSplitPane jSplitPanelLocalRemote;
-
private javax.swing.JLabel lblComment;
-
private javax.swing.JLabel lblCurrentFile;
-
private javax.swing.JLabel lblCurrentFileLabel;
-
private javax.swing.JLabel lblFileOrCollectionName;
-
private javax.swing.JLabel lblFileParent;
-
private javax.swing.JLabel lblInfoCreatedAt;
-
private javax.swing.JLabel lblInfoCreatedAtValue;
-
private javax.swing.JLabel lblInfoLength;
-
private javax.swing.JLabel lblInfoLengthValue;
-
private javax.swing.JLabel lblInfoUpdatedAt;
-
private javax.swing.JLabel lblInfoUpdatedAtValue;
-
private javax.swing.JLabel lblMainSearch;
-
private javax.swing.JLabel lblTags;
-
private javax.swing.JLabel lblTransferByteCounts;
-
private javax.swing.JLabel lblTransferFilesCounts;
-
private javax.swing.JLabel lblTransferType;
-
private javax.swing.JLabel lblTransferTypeLabel;
-
private javax.swing.JList listLocalDrives;
-
private javax.swing.JMenuItem menuItemShowInHierarchy;
-
private javax.swing.JPanel pnlDrivesFiller;
-
private javax.swing.JPanel pnlFileIconSizer;
-
private javax.swing.JPanel pnlFileNameAndIcon;
-
private javax.swing.JPanel pnlIdropBottom;
-
private javax.swing.JPanel pnlIdropMain;
-
private javax.swing.JPanel pnlIdropProgressIcon;
-
private javax.swing.JPanel pnlInfoButton;
-
private javax.swing.JPanel pnlInfoCollectionParent;
-
private javax.swing.JPanel pnlInfoComment;
-
private javax.swing.JPanel pnlInfoDetails;
-
private javax.swing.JPanel pnlInfoIcon;
-
private javax.swing.JPanel pnlInfoTags;
-
private javax.swing.JPanel pnlIrodsArea;
-
private javax.swing.JPanel pnlIrodsDetailsToggleSizer;
-
private javax.swing.JPanel pnlIrodsInfo;
-
private javax.swing.JPanel pnlIrodsInfoInner;
-
private javax.swing.JPanel pnlIrodsTreeMaster;
-
private javax.swing.JPanel pnlIrodsTreeToolbar;
-
private javax.swing.JPanel pnlLocalRoots;
-
private javax.swing.JPanel pnlLocalToggleSizer;
-
private javax.swing.JPanel pnlLocalTreeArea;
-
private javax.swing.JPanel pnlRefreshButton;
-
private javax.swing.JPanel pnlSearchSizer;
-
private javax.swing.JPanel pnlTabHierarchicalView;
-
private javax.swing.JPanel pnlTabSearch;
-
private javax.swing.JPanel pnlTabSearchResults;
-
private javax.swing.JPanel pnlTabSearchTop;
-
private javax.swing.JPanel pnlToolbarInfo;
-
private javax.swing.JPanel pnlToolbarSizer;
-
private javax.swing.JPanel pnlTopToolbarSearchArea;
-
private javax.swing.JPanel pnlTransferByteCounts;
-
private javax.swing.JPanel pnlTransferFileCounts;
-
private javax.swing.JPanel pnlTransferFileInfo;
-
private javax.swing.JPanel pnlTransferOverview;
-
private javax.swing.JPanel pnlTransferStatus;
-
private javax.swing.JPanel pnlTransferType;
-
private javax.swing.JLabel progressIconImageLabel;
-
private javax.swing.JScrollPane scrollComment;
-
private javax.swing.JScrollPane scrollIrodsTree;
-
private javax.swing.JScrollPane scrollLocalDrives;
-
private javax.swing.JScrollPane scrollLocalFileTree;
-
private javax.swing.JScrollPane scrollPaneSearchResults;
-
private javax.swing.JScrollPane scrollParentPath;
-
protected javax.swing.JPopupMenu searchTablePopupMenu;
-
private javax.swing.JToolBar.Separator separator1;
-
private javax.swing.JToolBar.Separator separator2;
-
private javax.swing.JSplitPane splitTargetCollections;
-
private javax.swing.JTabbedPane tabIrodsViews;
-
private javax.swing.JTable tableSearchResults;
-
private javax.swing.JToggleButton toggleIrodsDetails;
-
private javax.swing.JToggleButton toggleLocalFiles;
-
- public javax.swing.JToggleButton togglePauseTransfer;
-
+ private javax.swing.JToggleButton togglePauseTransfer;
private javax.swing.JToolBar toolBarInfo;
-
private javax.swing.JPanel transferQueueToolbarPanel;
-
private javax.swing.JProgressBar transferStatusProgressBar;
-
private javax.swing.JTextArea txtComment;
-
private javax.swing.JTextField txtMainSearch;
-
private javax.swing.JTextArea txtParentPath;
-
private javax.swing.JTextField txtTags;
-
private javax.swing.JLabel userNameLabel;
-
// End of variables declaration//GEN-END:variables
+
public Object getLastCachedInfoItem() {
return lastCachedInfoItem;
}
@@ -2549,6 +2253,7 @@ public class IDROPDesktop implements ActionListener, ItemListener, TransferManag
}
final String searchTerms = searchText.trim();
+ final iDrop idropGui = this;
java.awt.EventQueue.invokeLater(new Runnable() {
@@ -2556,21 +2261,19 @@ public class IDROPDesktop implements ActionListener, ItemListener, TransferManag
public void run() {
try {
- mainFrame.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
- CollectionAndDataObjectListAndSearchAO collectionAndDataObjectListAndSearchAO = iDropCore
- .getIRODSAccessObjectFactory().getCollectionAndDataObjectListAndSearchAO(
- iDropCore.getIrodsAccount());
+ idropGui.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
+ CollectionAndDataObjectListAndSearchAO collectionAndDataObjectListAndSearchAO = iDropCore.getIRODSAccessObjectFactory().getCollectionAndDataObjectListAndSearchAO(
+ iDropCore.getIrodsAccount());
IRODSSearchTableModel irodsSearchTableModel = new IRODSSearchTableModel(
- collectionAndDataObjectListAndSearchAO
- .searchCollectionsAndDataObjectsBasedOnName(searchTerms));
+ collectionAndDataObjectListAndSearchAO.searchCollectionsAndDataObjectsBasedOnName(searchTerms));
tableSearchResults.setModel(irodsSearchTableModel);
tabIrodsViews.setSelectedComponent(pnlTabSearch);
} catch (Exception e) {
- showIdropException(e);
+ idropGui.showIdropException(e);
return;
} finally {
iDropCore.closeAllIRODSConnections();
- mainFrame.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
+ idropGui.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
}
}
});
@@ -2583,6 +2286,7 @@ public class IDROPDesktop implements ActionListener, ItemListener, TransferManag
}
final String searchTerms = searchText.trim();
+ final iDrop idropGui = this;
java.awt.EventQueue.invokeLater(new Runnable() {
@@ -2590,20 +2294,19 @@ public class IDROPDesktop implements ActionListener, ItemListener, TransferManag
public void run() {
try {
- mainFrame.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
+ idropGui.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
FreeTaggingService freeTaggingService = FreeTaggingServiceImpl.instance(
iDropCore.getIRODSAccessObjectFactory(), getIrodsAccount());
TagQuerySearchResult result = freeTaggingService.searchUsingFreeTagString(searchTerms);
- IRODSSearchTableModel irodsSearchTableModel = new IRODSSearchTableModel(result
- .getQueryResultEntries());
+ IRODSSearchTableModel irodsSearchTableModel = new IRODSSearchTableModel(result.getQueryResultEntries());
tableSearchResults.setModel(irodsSearchTableModel);
tabIrodsViews.setSelectedComponent(pnlTabSearch);
} catch (Exception e) {
- showIdropException(e);
+ idropGui.showIdropException(e);
return;
} finally {
iDropCore.closeIRODSConnectionForLoggedInAccount();
- mainFrame.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
+ idropGui.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
}
}
});
@@ -2639,11 +2342,11 @@ public class IDROPDesktop implements ActionListener, ItemListener, TransferManag
}
public void setBusyCursor() {
- mainFrame.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
+ this.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
}
public void setNormalCursor() {
- mainFrame.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
+ this.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
}
public LocalFileTree getFileTree() {
@@ -2653,17 +2356,4 @@ public class IDROPDesktop implements ActionListener, ItemListener, TransferManag
public void setFileTree(LocalFileTree fileTree) {
this.fileTree = fileTree;
}
-
- public static void main(String[] args) {
-
- final IDROPSplashWindow splash = new IDROPSplashWindow();
- try {
- SwingUtilities.invokeAndWait(splash);
- } catch (InterruptedException e) {
- e.printStackTrace();
- } catch (InvocationTargetException e) {
- e.printStackTrace();
- }
-
- }
}
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/ChangePasswordCancelActionListener.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/ChangePasswordCancelActionListener.java
deleted file mode 100644
index b998a86..0000000
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/ChangePasswordCancelActionListener.java
+++ /dev/null
@@ -1,27 +0,0 @@
-package org.irods.jargon.idrop.desktop.systraygui.listeners;
-
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-
-import org.irods.jargon.idrop.desktop.systraygui.IDROPDesktop;
-
-/**
- *
- * @author jdr0887
- *
- */
-public class ChangePasswordCancelActionListener implements ActionListener {
-
- private IDROPDesktop desktop;
-
- public ChangePasswordCancelActionListener(IDROPDesktop desktop) {
- super();
- this.desktop = desktop;
- }
-
- public void actionPerformed(ActionEvent e) {
- desktop.changePasswordDialog.setVisible(false);
- desktop.mainFrame.requestFocus();
- }
-
-}
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/ChangePasswordDialogEnterKeyListener.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/ChangePasswordDialogEnterKeyListener.java
deleted file mode 100644
index e8f6308..0000000
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/ChangePasswordDialogEnterKeyListener.java
+++ /dev/null
@@ -1,31 +0,0 @@
-package org.irods.jargon.idrop.desktop.systraygui.listeners;
-
-import java.awt.event.ActionEvent;
-import java.awt.event.KeyAdapter;
-import java.awt.event.KeyEvent;
-
-import org.irods.jargon.idrop.desktop.systraygui.IDROPDesktop;
-
-public class ChangePasswordDialogEnterKeyListener extends KeyAdapter {
-
- private IDROPDesktop desktop;
-
- public ChangePasswordDialogEnterKeyListener(IDROPDesktop desktop) {
- super();
- this.desktop = desktop;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.awt.event.KeyListener#keyReleased(java.awt.event.KeyEvent)
- */
- @Override
- public void keyReleased(KeyEvent e) {
- int key = e.getKeyCode();
- if (key == KeyEvent.VK_ENTER) {
- ActionEvent ae = new ActionEvent(desktop.changePasswordDialogSaveButton, ActionEvent.ACTION_PERFORMED, "");
- desktop.changePasswordDialogSaveActionListener.actionPerformed(ae);
- }
- }
-}
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/ChangePasswordDialogWindowListener.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/ChangePasswordDialogWindowListener.java
deleted file mode 100644
index a6cc0c6..0000000
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/ChangePasswordDialogWindowListener.java
+++ /dev/null
@@ -1,24 +0,0 @@
-package org.irods.jargon.idrop.desktop.systraygui.listeners;
-
-
-import java.awt.event.WindowAdapter;
-import java.awt.event.WindowEvent;
-
-import org.irods.jargon.idrop.desktop.systraygui.IDROPDesktop;
-
-public class ChangePasswordDialogWindowListener extends WindowAdapter {
-
- private IDROPDesktop desktop;
-
- public ChangePasswordDialogWindowListener(IDROPDesktop desktop) {
- super();
- this.desktop = desktop;
- }
-
- @Override
- public void windowClosing(WindowEvent e) {
- super.windowClosing(e);
- desktop.mainFrame.requestFocus();
- }
-
-}
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/ChangePasswordMenuActionListener.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/ChangePasswordMenuActionListener.java
deleted file mode 100644
index 9bd55f9..0000000
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/ChangePasswordMenuActionListener.java
+++ /dev/null
@@ -1,33 +0,0 @@
-package org.irods.jargon.idrop.desktop.systraygui.listeners;
-
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-
-import org.irods.jargon.core.connection.IRODSAccount;
-import org.irods.jargon.idrop.desktop.systraygui.IDROPDesktop;
-
-/**
- *
- * @author jdr0887
- *
- */
-public class ChangePasswordMenuActionListener implements ActionListener {
-
- private IDROPDesktop desktop;
-
- public ChangePasswordMenuActionListener(IDROPDesktop desktop) {
- super();
- this.desktop = desktop;
- }
-
- public void actionPerformed(ActionEvent e) {
- StringBuilder sb = new StringBuilder();
- IRODSAccount account = desktop.getiDropCore().getIrodsAccount();
- sb.append("irods://").append(account.getUserName()).append("@").append(account.getHost()).append(":")
- .append(account.getPort());
-
- desktop.changePasswordDialogCurrentAccountTextField.setText(sb.toString());
- desktop.changePasswordDialog.setVisible(true);
- }
-
-}
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/ChangePasswordSaveActionListener.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/ChangePasswordSaveActionListener.java
deleted file mode 100644
index efc877c..0000000
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/ChangePasswordSaveActionListener.java
+++ /dev/null
@@ -1,124 +0,0 @@
-package org.irods.jargon.idrop.desktop.systraygui.listeners;
-
-import java.awt.Color;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.util.List;
-
-import javax.swing.JOptionPane;
-
-import org.apache.commons.lang.StringUtils;
-import org.irods.jargon.core.connection.IRODSAccount;
-import org.irods.jargon.core.exception.JargonException;
-import org.irods.jargon.core.pub.IRODSAccessObjectFactory;
-import org.irods.jargon.core.pub.IRODSFileSystem;
-import org.irods.jargon.core.pub.UserAO;
-import org.irods.jargon.idrop.desktop.systraygui.IDROPDesktop;
-import org.irods.jargon.idrop.desktop.systraygui.util.MessageUtil;
-import org.irods.jargon.transfer.dao.domain.LocalIRODSTransfer;
-
-import com.jgoodies.validation.ValidationMessage;
-import com.jgoodies.validation.ValidationResult;
-
-/**
- *
- * @author jdr0887
- *
- */
-public class ChangePasswordSaveActionListener implements ActionListener {
-
- private IDROPDesktop desktop;
-
- public ChangePasswordSaveActionListener(IDROPDesktop desktop) {
- super();
- this.desktop = desktop;
- }
-
- public void actionPerformed(ActionEvent e) {
- ValidationResult validationResults = validateLoginForm();
-
- if (validationResults.hasErrors()) {
- String msg = "";
- List<ValidationMessage> errors = validationResults.getErrors();
- for (ValidationMessage error : errors) {
- msg += error.formattedText() + "\n";
- }
- JOptionPane.showMessageDialog(desktop.changePasswordDialog, msg, "Error", JOptionPane.ERROR_MESSAGE);
- return;
- }
-
- String password = new String(desktop.changePasswordDialogPasswordPasswordField.getPassword());
-
- try {
- IRODSAccount irodsAccount = desktop.getiDropCore().getIrodsAccount();
- // List<Transfer> recentQueue = idrop.getTransferManager().getRecentQueue();
- List<LocalIRODSTransfer> recentQueue = null;
- if (recentQueue != null) {
- for (LocalIRODSTransfer transfer : recentQueue) {
- if (transfer.getTransferHost().equals(irodsAccount.getHost())
- && transfer.getTransferZone().equals(irodsAccount.getZone())
- && transfer.getTransferUserName().equals(irodsAccount.getUserName())) {
- // FIXME: right now, do not differentiate transfers that are comlete, this is a hack right now
- // if (localIRODSTransfer.getTransferState().equals(localIRODSTransfer.TRANSFER_STATE_COMPLETE))
- // {
- // log.info("matched transfer was complete, ignored");
- // } else {
- MessageUtil
- .showMessage(
- desktop.changePasswordDialog,
- "Transfers for this account are pending, this account can not be changed until completed and purged",
- "Transfer Pending");
- return;
- // }
- }
- }
- }
-
- IRODSFileSystem irodsFileSystem = desktop.getiDropCore().getIrodsFileSystem();
- IRODSAccessObjectFactory irodsAOFactory = irodsFileSystem.getIRODSAccessObjectFactory();
- UserAO userAO = irodsAOFactory.getUserAO(desktop.getiDropCore().getIrodsAccount());
- userAO.changeAUserPasswordByThatUser(irodsAccount.getUserName(), irodsAccount.getPassword(), password);
- IRODSAccount newAccount = new IRODSAccount(irodsAccount.getHost(), irodsAccount.getPort(),
- irodsAccount.getUserName(), password, irodsAccount.getHomeDirectory(), irodsAccount.getZone(),
- irodsAccount.getDefaultStorageResource());
- desktop.getiDropCore().setIrodsAccount(newAccount);
- desktop.changePasswordDialogPasswordPasswordField.setText("");
- desktop.changePasswordDialogPasswordConfirmPasswordField.setText("");
-
- } catch (JargonException ex) {
- } finally {
- // idrop.getIrodsFileSystem().closeAndEatExceptions(idrop.getIrodsAccount());
- }
-
- MessageUtil.showMessage(desktop.changePasswordDialog, "Password was changed", "Password Changed");
-
- }
-
- private ValidationResult validateLoginForm() {
- ValidationResult result = new ValidationResult();
-
- String password = new String(desktop.changePasswordDialogPasswordPasswordField.getPassword());
- String passwordConfirm = new String(desktop.changePasswordDialogPasswordConfirmPasswordField.getPassword());
-
- if (StringUtils.isEmpty(password)) {
- desktop.changePasswordDialogPasswordPasswordField.setBackground(Color.red);
- }
-
- if (StringUtils.isEmpty(passwordConfirm)) {
- desktop.changePasswordDialogPasswordConfirmPasswordField.setBackground(Color.red);
- }
-
- if (StringUtils.isEmpty(password) || StringUtils.isEmpty(passwordConfirm)) {
- result.addError("New or confirm password is missing");
- }
-
- if (!password.equals(passwordConfirm)) {
- desktop.changePasswordDialogPasswordPasswordField.setBackground(Color.red);
- desktop.changePasswordDialogPasswordConfirmPasswordField.setBackground(Color.red);
- result.addError("Passwords do not match");
- }
-
- return result;
- }
-
-}
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/EditSynchronizationDialogCancelActionListener.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/EditSynchronizationDialogCancelActionListener.java
deleted file mode 100644
index fb07f82..0000000
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/EditSynchronizationDialogCancelActionListener.java
+++ /dev/null
@@ -1,23 +0,0 @@
-package org.irods.jargon.idrop.desktop.systraygui.listeners;
-
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-
-import org.irods.jargon.idrop.desktop.systraygui.IDROPDesktop;
-
-public class EditSynchronizationDialogCancelActionListener implements ActionListener {
-
- private IDROPDesktop desktop;
-
- public EditSynchronizationDialogCancelActionListener(IDROPDesktop desktop) {
- super();
- this.desktop = desktop;
- }
-
- @Override
- public void actionPerformed(ActionEvent e) {
- desktop.editSynchronizationDialog.setVisible(false);
- desktop.editSynchronizationsDialog.requestFocus();
- }
-
-}
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/EditSynchronizationDialogLocalPathBrowseActionListener.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/EditSynchronizationDialogLocalPathBrowseActionListener.java
deleted file mode 100644
index af5cf65..0000000
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/EditSynchronizationDialogLocalPathBrowseActionListener.java
+++ /dev/null
@@ -1,54 +0,0 @@
-package org.irods.jargon.idrop.desktop.systraygui.listeners;
-
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.io.File;
-
-import javax.swing.JFileChooser;
-import javax.swing.filechooser.FileFilter;
-
-import org.irods.jargon.idrop.desktop.systraygui.IDROPDesktop;
-
-public class EditSynchronizationDialogLocalPathBrowseActionListener implements ActionListener {
-
- private IDROPDesktop desktop;
-
- public EditSynchronizationDialogLocalPathBrowseActionListener(IDROPDesktop desktop) {
- super();
- this.desktop = desktop;
- }
-
- @Override
- public void actionPerformed(ActionEvent e) {
-
- desktop.editSynchronizationDialogLocalPathFileChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
- desktop.editSynchronizationDialogLocalPathFileChooser.setCurrentDirectory(new File(System
- .getProperty("user.home")));
- desktop.editSynchronizationDialogLocalPathFileChooser.addChoosableFileFilter(new FileFilter() {
-
- @Override
- public boolean accept(File f) {
- if (f.isDirectory()) {
- return true;
- }
- return false;
- }
-
- @Override
- public String getDescription() {
- return null;
- }
-
- });
- int response = desktop.editSynchronizationDialogLocalPathFileChooser
- .showOpenDialog(desktop.editSynchronizationDialog);
- if (response == JFileChooser.APPROVE_OPTION) {
- File file = desktop.editSynchronizationDialogLocalPathFileChooser.getSelectedFile();
- if (file != null && file.isDirectory()) {
- desktop.editSynchronizationDialogLocalPathTextField.setText(file.getAbsolutePath());
- }
- }
-
- }
-
-}
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/EditSynchronizationDialogRemotePathBrowseActionListener.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/EditSynchronizationDialogRemotePathBrowseActionListener.java
deleted file mode 100644
index 6b5d315..0000000
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/EditSynchronizationDialogRemotePathBrowseActionListener.java
+++ /dev/null
@@ -1,58 +0,0 @@
-package org.irods.jargon.idrop.desktop.systraygui.listeners;
-
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.util.List;
-
-import org.irods.jargon.core.exception.JargonException;
-import org.irods.jargon.core.pub.CollectionAndDataObjectListAndSearchAO;
-import org.irods.jargon.core.pub.IRODSAccessObjectFactory;
-import org.irods.jargon.core.pub.IRODSFileSystem;
-import org.irods.jargon.core.query.CollectionAndDataObjectListingEntry;
-import org.irods.jargon.idrop.desktop.systraygui.IDROPDesktop;
-
-public class EditSynchronizationDialogRemotePathBrowseActionListener implements ActionListener {
-
- private IDROPDesktop desktop;
-
- public EditSynchronizationDialogRemotePathBrowseActionListener(IDROPDesktop desktop) {
- super();
- this.desktop = desktop;
- }
-
- @Override
- public void actionPerformed(ActionEvent e) {
-
- CollectionAndDataObjectListingEntry rootEntry = new CollectionAndDataObjectListingEntry();
- rootEntry.setPathOrName("/");
- desktop.remoteFileChooserDialog.setLocationRelativeTo(desktop.editSynchronizationDialog);
- desktop.remoteFileChooserDialogListModel.clear();
- desktop.remoteFileChooserDialogLookInComboBox.removeAllItems();
- desktop.remoteFileChooserDialogLookInComboBox.addItem("/");
-
- try {
-
- IRODSFileSystem irodsFS = desktop.getiDropCore().getIrodsFileSystem();
- IRODSAccessObjectFactory irodsAOFactory = irodsFS.getIRODSAccessObjectFactory();
- CollectionAndDataObjectListAndSearchAO collectionAO = irodsAOFactory
- .getCollectionAndDataObjectListAndSearchAO(desktop.getiDropCore().getIrodsAccount());
- List<CollectionAndDataObjectListingEntry> childCache = collectionAO
- .listDataObjectsAndCollectionsUnderPath(rootEntry.getPathOrName());
-
- if (childCache != null) {
-
- for (int i = 0; i < childCache.size(); i++) {
- CollectionAndDataObjectListingEntry childEntry = childCache.get(i);
- desktop.remoteFileChooserDialogListModel.addElement(childEntry);
- }
-
- }
- desktop.remoteFileChooserDialog.setVisible(true);
- } catch (JargonException e1) {
- e1.printStackTrace();
- } catch (SecurityException se) {
- }
-
- }
-
-}
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/EditSynchronizationDialogSaveActionListener.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/EditSynchronizationDialogSaveActionListener.java
deleted file mode 100644
index 5e4e164..0000000
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/EditSynchronizationDialogSaveActionListener.java
+++ /dev/null
@@ -1,105 +0,0 @@
-package org.irods.jargon.idrop.desktop.systraygui.listeners;
-
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.util.Date;
-import java.util.List;
-
-import javax.swing.JOptionPane;
-
-import org.apache.commons.lang.StringUtils;
-import org.irods.jargon.idrop.desktop.systraygui.IDROPDesktop;
-import org.irods.jargon.transfer.TransferDAOManager;
-import org.irods.jargon.transfer.dao.SynchronizationDAO;
-import org.irods.jargon.transfer.dao.TransferDAOException;
-import org.irods.jargon.transfer.dao.domain.FrequencyType;
-import org.irods.jargon.transfer.dao.domain.Synchronization;
-import org.irods.jargon.transfer.dao.domain.SynchronizationType;
-
-import com.jgoodies.validation.ValidationMessage;
-import com.jgoodies.validation.ValidationResult;
-
-public class EditSynchronizationDialogSaveActionListener implements ActionListener {
-
- private final TransferDAOManager transferDAOMgr = TransferDAOManager.getInstance();
-
- private IDROPDesktop desktop;
-
- public EditSynchronizationDialogSaveActionListener(IDROPDesktop desktop) {
- super();
- this.desktop = desktop;
- }
-
- @Override
- public void actionPerformed(ActionEvent arg0) {
-
- ValidationResult validationResults = validateLoginForm();
-
- if (validationResults.hasErrors()) {
- String msg = "";
- List<ValidationMessage> errors = validationResults.getErrors();
- for (ValidationMessage error : errors) {
- msg += error.formattedText() + "\n";
- }
- JOptionPane.showMessageDialog(desktop.editSynchronizationDialog, msg, "Error", JOptionPane.ERROR_MESSAGE);
- return;
- }
-
- String name = desktop.editSynchronizationDialogNameTextField.getText();
- String localPath = desktop.editSynchronizationDialogLocalPathTextField.getText();
- String remotePath = desktop.editSynchronizationDialogRemotePathTextField.getText();
- String frequency = desktop.editSynchronizationDialogFrequencyComboBox.getSelectedItem().toString();
-
- Synchronization synch = new Synchronization();
- synch.setName(name);
- synch.setIrodsHostName(desktop.getiDropCore().getIrodsAccount().getHost());
- synch.setIrodsPort(desktop.getiDropCore().getIrodsAccount().getPort());
- synch.setIrodsUserName(desktop.getiDropCore().getIrodsAccount().getUserName());
- synch.setIrodsPassword(desktop.getiDropCore().getIrodsAccount().getPassword());
- synch.setIrodsZone(desktop.getiDropCore().getIrodsAccount().getZone());
- synch.setLocalSynchDirectory(localPath);
- synch.setIrodsSynchDirectory(remotePath);
- synch.setSynchronizationMode(SynchronizationType.ONE_WAY_LOCAL_TO_IRODS);
- synch.setCreatedAt(new Date());
-
- frequency: for (FrequencyType ft : FrequencyType.values()) {
- if (ft.getReadableName().equals(frequency)) {
- synch.setFrequencyType(ft);
- break frequency;
- }
- }
-
- try {
- SynchronizationDAO synchronizationDAO = transferDAOMgr.getTransferDAOBean().getSynchronizationDAO();
- synchronizationDAO.save(synch);
- } catch (TransferDAOException e) {
- e.printStackTrace();
- }
- desktop.editSynchronizationsDialogListModel.addElement(name);
- desktop.editSynchronizationDialog.setVisible(false);
- desktop.editSynchronizationsDialog.requestFocus();
- }
-
- private ValidationResult validateLoginForm() {
- ValidationResult result = new ValidationResult();
-
- if (StringUtils.isEmpty(desktop.editSynchronizationDialogNameTextField.getText())) {
- result.addError("Name is required");
- }
-
- if (StringUtils.isEmpty(desktop.editSynchronizationDialogLocalPathTextField.getText())) {
- result.addError("Local Path is required");
- }
-
- if (StringUtils.isEmpty(desktop.editSynchronizationDialogRemotePathTextField.getText())) {
- result.addError("Remote Path is required");
- }
-
- if (desktop.editSynchronizationDialogFrequencyComboBox.getSelectedIndex() == 0) {
- result.addError("Please choose a valid frequency");
- }
-
- return result;
- }
-
-}
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/EditSynchronizationsDialogDeleteActionListener.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/EditSynchronizationsDialogDeleteActionListener.java
deleted file mode 100644
index 3164a24..0000000
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/EditSynchronizationsDialogDeleteActionListener.java
+++ /dev/null
@@ -1,48 +0,0 @@
-package org.irods.jargon.idrop.desktop.systraygui.listeners;
-
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-
-import javax.swing.JOptionPane;
-
-import org.irods.jargon.idrop.desktop.systraygui.IDROPDesktop;
-import org.irods.jargon.transfer.TransferDAOManager;
-import org.irods.jargon.transfer.dao.SynchronizationDAO;
-import org.irods.jargon.transfer.dao.TransferDAOException;
-import org.irods.jargon.transfer.dao.domain.Synchronization;
-
-public class EditSynchronizationsDialogDeleteActionListener implements ActionListener {
-
- private final TransferDAOManager transferDAOMgr = TransferDAOManager.getInstance();
-
- private IDROPDesktop desktop;
-
- public EditSynchronizationsDialogDeleteActionListener(IDROPDesktop desktop) {
- super();
- this.desktop = desktop;
- }
-
- @Override
- public void actionPerformed(ActionEvent e) {
-
- SynchronizationDAO synchronizationDAO = transferDAOMgr.getTransferDAOBean().getSynchronizationDAO();
- int[] indices = desktop.editSynchronizationsDialogList.getSelectedIndices();
- for (int index : indices) {
- if (index != -1) {
- Object item = desktop.editSynchronizationsDialogListModel.getElementAt(index);
- try {
- Synchronization synch = synchronizationDAO.findByName(item.toString());
- synchronizationDAO.delete(synch);
- } catch (TransferDAOException e1) {
- e1.printStackTrace();
- JOptionPane.showMessageDialog(desktop.editSynchronizationsDialog, e1.getCause().getMessage(), "Error",
- JOptionPane.ERROR_MESSAGE);
- return;
- }
- desktop.editSynchronizationsDialogListModel.remove(index);
- }
- }
-
- }
-
-}
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/EditSynchronizationsDialogEditActionListener.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/EditSynchronizationsDialogEditActionListener.java
deleted file mode 100644
index 600a3e5..0000000
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/EditSynchronizationsDialogEditActionListener.java
+++ /dev/null
@@ -1,62 +0,0 @@
-package org.irods.jargon.idrop.desktop.systraygui.listeners;
-
-import static org.irods.jargon.idrop.desktop.systraygui.Constants.PREFERENCE_KEY_DEVICE_NAME;
-
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.util.prefs.Preferences;
-
-import javax.swing.JOptionPane;
-
-import org.irods.jargon.idrop.desktop.systraygui.IDROPDesktop;
-import org.irods.jargon.transfer.TransferDAOManager;
-import org.irods.jargon.transfer.dao.SynchronizationDAO;
-import org.irods.jargon.transfer.dao.TransferDAOException;
-import org.irods.jargon.transfer.dao.domain.Synchronization;
-
-public class EditSynchronizationsDialogEditActionListener implements ActionListener {
-
- private final TransferDAOManager transferDAOMgr = TransferDAOManager.getInstance();
-
- private IDROPDesktop desktop;
-
- public EditSynchronizationsDialogEditActionListener(IDROPDesktop desktop) {
- super();
- this.desktop = desktop;
- }
-
- @Override
- public void actionPerformed(ActionEvent e) {
-
- int index = desktop.editSynchronizationsDialogList.getSelectedIndex();
- if (index != -1) {
-
- Object item = desktop.editSynchronizationsDialogListModel.getElementAt(index);
-
- SynchronizationDAO synchronizationDAO = transferDAOMgr.getTransferDAOBean().getSynchronizationDAO();
-
- try {
- Synchronization synchronization = synchronizationDAO.findByName(item.toString());
- desktop.editSynchronizationDialogNameTextField.setText(synchronization.getName());
- desktop.editSynchronizationDialogDeviceNameTextField.setEnabled(false);
-
- Preferences prefs = desktop.getiDropCore().getPreferences();
- desktop.editSynchronizationDialogDeviceNameTextField.setText(prefs.get(PREFERENCE_KEY_DEVICE_NAME, ""));
-
- desktop.editSynchronizationDialogLocalPathTextField.setText(synchronization.getLocalSynchDirectory());
- desktop.editSynchronizationDialogRemotePathTextField.setText(synchronization.getIrodsSynchDirectory());
- // desktop.editSynchronizationDialogFrequencyComboBox.setSelectedItem(synchronization.getFrequencyType()
- // .getReadableName());
- } catch (TransferDAOException e1) {
- e1.printStackTrace();
- JOptionPane.showMessageDialog(desktop.editSynchronizationsDialog, e1.getCause().getMessage(), "Error",
- JOptionPane.ERROR_MESSAGE);
- return;
- }
-
- desktop.editSynchronizationDialog.setVisible(true);
- }
-
- }
-
-}
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/EditSynchronizationsDialogNewActionListener.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/EditSynchronizationsDialogNewActionListener.java
deleted file mode 100644
index 37e2d77..0000000
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/EditSynchronizationsDialogNewActionListener.java
+++ /dev/null
@@ -1,31 +0,0 @@
-package org.irods.jargon.idrop.desktop.systraygui.listeners;
-
-import static org.irods.jargon.idrop.desktop.systraygui.Constants.PREFERENCE_KEY_DEVICE_NAME;
-
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.util.prefs.Preferences;
-
-import org.irods.jargon.idrop.desktop.systraygui.IDROPDesktop;
-
-public class EditSynchronizationsDialogNewActionListener implements ActionListener {
-
- private IDROPDesktop desktop;
-
- public EditSynchronizationsDialogNewActionListener(IDROPDesktop desktop) {
- super();
- this.desktop = desktop;
- }
-
- @Override
- public void actionPerformed(ActionEvent arg0) {
- desktop.editSynchronizationDialogNameTextField.setText("");
- desktop.editSynchronizationDialogLocalPathTextField.setText("");
- Preferences prefs = desktop.getiDropCore().getPreferences();
- desktop.editSynchronizationDialogDeviceNameTextField.setText(prefs.get(PREFERENCE_KEY_DEVICE_NAME, ""));
- desktop.editSynchronizationDialogRemotePathTextField.setText("");
- //desktop.editSynchronizationDialogFrequencyComboBox.setSelectedIndex(0);
- desktop.editSynchronizationDialog.setVisible(true);
- }
-
-}
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/EditSynchronizationsDialogRunNowActionListener.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/EditSynchronizationsDialogRunNowActionListener.java
deleted file mode 100644
index 52730f6..0000000
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/EditSynchronizationsDialogRunNowActionListener.java
+++ /dev/null
@@ -1,34 +0,0 @@
-package org.irods.jargon.idrop.desktop.systraygui.listeners;
-
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-
-import org.irods.jargon.idrop.desktop.systraygui.IDROPDesktop;
-import org.irods.jargon.idrop.desktop.systraygui.util.MessageUtil;
-
-/**
- *
- * @author jdr0887
- *
- */
-public class EditSynchronizationsDialogRunNowActionListener implements ActionListener {
-
- private IDROPDesktop desktop;
-
- public EditSynchronizationsDialogRunNowActionListener(IDROPDesktop desktop) {
- super();
- this.desktop = desktop;
- }
-
- public void actionPerformed(ActionEvent e) {
- int index = desktop.editSynchronizationsDialogList.getSelectedIndex();
- if (index == -1) {
- MessageUtil.showWarning(desktop.editSynchronizationsDialog, "No Synchronizations Selected", "Warning");
- } else {
-
-
- }
-
- }
-
-}
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/EditSynchronizationsMenuActionListener.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/EditSynchronizationsMenuActionListener.java
deleted file mode 100644
index b3a1250..0000000
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/EditSynchronizationsMenuActionListener.java
+++ /dev/null
@@ -1,49 +0,0 @@
-package org.irods.jargon.idrop.desktop.systraygui.listeners;
-
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.util.List;
-
-import org.irods.jargon.idrop.desktop.systraygui.IDROPDesktop;
-import org.irods.jargon.transfer.TransferDAOManager;
-import org.irods.jargon.transfer.dao.SynchronizationDAO;
-import org.irods.jargon.transfer.dao.TransferDAOException;
-import org.irods.jargon.transfer.dao.domain.Synchronization;
-
-/**
- *
- * @author jdr0887
- *
- */
-public class EditSynchronizationsMenuActionListener implements ActionListener {
-
- private final TransferDAOManager transferDAOMgr = TransferDAOManager.getInstance();
-
- private IDROPDesktop desktop;
-
- public EditSynchronizationsMenuActionListener(IDROPDesktop desktop) {
- super();
- this.desktop = desktop;
- }
-
- public void actionPerformed(ActionEvent e) {
-
- SynchronizationDAO synchronizationDAO = transferDAOMgr.getTransferDAOBean().getSynchronizationDAO();
-
- try {
- desktop.editSynchronizationsDialogListModel.clear();
- desktop.editSynchronizationsDialogListModel.removeAllElements();
- List<Synchronization> synchList = synchronizationDAO.findAll();
-
- for (Synchronization synch : synchList) {
- desktop.editSynchronizationsDialogListModel.addElement(synch.getName());
- }
-
- } catch (TransferDAOException e1) {
- e1.printStackTrace();
- }
-
- desktop.editSynchronizationsDialog.setVisible(true);
- }
-
-}
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/LoginCancelActionListener.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/LoginCancelActionListener.java
deleted file mode 100644
index 723e51d..0000000
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/LoginCancelActionListener.java
+++ /dev/null
@@ -1,29 +0,0 @@
-package org.irods.jargon.idrop.desktop.systraygui.listeners;
-
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-
-import org.irods.jargon.idrop.desktop.systraygui.IDROPSplashWindow;
-
-/**
- *
- * @author jdr0887
- *
- */
-public class LoginCancelActionListener implements ActionListener {
-
- private IDROPSplashWindow desktop;
-
- public LoginCancelActionListener(IDROPSplashWindow desktop) {
- super();
- this.desktop = desktop;
- }
-
- public void actionPerformed(ActionEvent e) {
- if (desktop.loginDialog != null) {
- desktop.loginDialog.setVisible(false);
- System.exit(0);
- }
- }
-
-}
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/LoginDialogEnterKeyListener.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/LoginDialogEnterKeyListener.java
deleted file mode 100644
index cf5e7fe..0000000
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/LoginDialogEnterKeyListener.java
+++ /dev/null
@@ -1,31 +0,0 @@
-package org.irods.jargon.idrop.desktop.systraygui.listeners;
-
-import java.awt.event.ActionEvent;
-import java.awt.event.KeyAdapter;
-import java.awt.event.KeyEvent;
-
-import org.irods.jargon.idrop.desktop.systraygui.IDROPSplashWindow;
-
-public class LoginDialogEnterKeyListener extends KeyAdapter {
-
- private IDROPSplashWindow desktop;
-
- public LoginDialogEnterKeyListener(IDROPSplashWindow desktop) {
- super();
- this.desktop = desktop;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.awt.event.KeyListener#keyReleased(java.awt.event.KeyEvent)
- */
- @Override
- public void keyReleased(KeyEvent e) {
- int key = e.getKeyCode();
- if (key == KeyEvent.VK_ENTER) {
- ActionEvent ae = new ActionEvent(desktop.loginDialogOKButton, ActionEvent.ACTION_PERFORMED, "");
- desktop.loginDialogOKActionListener.actionPerformed(ae);
- }
- }
-}
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/LoginDialogWindowListener.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/LoginDialogWindowListener.java
deleted file mode 100644
index d4b0741..0000000
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/LoginDialogWindowListener.java
+++ /dev/null
@@ -1,14 +0,0 @@
-package org.irods.jargon.idrop.desktop.systraygui.listeners;
-
-import java.awt.event.WindowAdapter;
-import java.awt.event.WindowEvent;
-
-public class LoginDialogWindowListener extends WindowAdapter {
-
- @Override
- public void windowClosing(WindowEvent e) {
- super.windowClosing(e);
- System.exit(0);
- }
-
-}
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/LoginOKActionListener.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/LoginOKActionListener.java
deleted file mode 100644
index 605ca49..0000000
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/LoginOKActionListener.java
+++ /dev/null
@@ -1,146 +0,0 @@
-package org.irods.jargon.idrop.desktop.systraygui.listeners;
-
-import static org.irods.jargon.idrop.desktop.systraygui.Constants.PREFERENCE_KEY_LOGIN_HOST;
-import static org.irods.jargon.idrop.desktop.systraygui.Constants.PREFERENCE_KEY_LOGIN_PORT;
-import static org.irods.jargon.idrop.desktop.systraygui.Constants.PREFERENCE_KEY_LOGIN_RESOURCE;
-import static org.irods.jargon.idrop.desktop.systraygui.Constants.PREFERENCE_KEY_LOGIN_USERNAME;
-import static org.irods.jargon.idrop.desktop.systraygui.Constants.PREFERENCE_KEY_LOGIN_ZONE;
-
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.util.List;
-
-import javax.swing.JOptionPane;
-
-import org.apache.commons.lang.StringUtils;
-import org.irods.jargon.core.connection.IRODSAccount;
-import org.irods.jargon.core.exception.JargonException;
-import org.irods.jargon.core.pub.IRODSAccessObjectFactory;
-import org.irods.jargon.core.pub.IRODSFileSystem;
-import org.irods.jargon.core.pub.UserAO;
-import org.irods.jargon.core.pub.domain.User;
-import org.irods.jargon.idrop.desktop.systraygui.IDROPSplashWindow;
-import org.irods.jargon.idrop.desktop.systraygui.util.MessageUtil;
-
-import com.jgoodies.validation.ValidationMessage;
-import com.jgoodies.validation.ValidationResult;
-
-/**
- *
- * @author jdr0887
- *
- */
-public class LoginOKActionListener implements ActionListener {
-
- private IDROPSplashWindow splash;
-
- public LoginOKActionListener(IDROPSplashWindow splash) {
- super();
- this.splash = splash;
- }
-
- public void actionPerformed(ActionEvent e) {
-
- ValidationResult validationResults = validateLoginForm();
-
- if (validationResults.hasErrors()) {
- String msg = "";
- List<ValidationMessage> errors = validationResults.getErrors();
- for (ValidationMessage error : errors) {
- msg += error.formattedText() + "\n";
- }
- JOptionPane.showMessageDialog(splash.loginDialog, msg, "Error", JOptionPane.ERROR_MESSAGE);
- return;
- }
-
- String username = splash.loginDialogUsernameTextField.getText();
- String password = new String(splash.loginDialogPasswordPasswordField.getPassword());
- String host = splash.loginDialogHostTextField.getText();
- String port = splash.loginDialogPortTextField.getText();
- String resource = splash.loginDialogResourceTextField.getText();
- String zone = splash.loginDialogZoneTextField.getText();
-
- splash.getDesktop().getiDropCore().getPreferences().put(PREFERENCE_KEY_LOGIN_HOST, host);
- splash.getDesktop().getiDropCore().getPreferences().put(PREFERENCE_KEY_LOGIN_ZONE, zone);
- splash.getDesktop().getiDropCore().getPreferences().put(PREFERENCE_KEY_LOGIN_RESOURCE, resource);
- splash.getDesktop().getiDropCore().getPreferences().put(PREFERENCE_KEY_LOGIN_USERNAME, username);
- splash.getDesktop().getiDropCore().getPreferences().put(PREFERENCE_KEY_LOGIN_PORT, port);
-
- StringBuilder sb = new StringBuilder();
- sb.append('/').append(zone).append("/home/").append(username);
-
- IRODSAccount irodsAccount;
- try {
- irodsAccount = IRODSAccount.instance(host, Integer.valueOf(port), username, password, sb.toString(), zone,
- resource);
- } catch (JargonException e1) {
- e1.printStackTrace();
- MessageUtil.showError(splash.loginDialog, e1.getMessage(), "IRODS Account");
- return;
- }
-
- IRODSFileSystem irodsFileSystem = null;
- try {
- irodsFileSystem = IRODSFileSystem.instance();
- IRODSAccessObjectFactory irodsAOFactory = irodsFileSystem.getIRODSAccessObjectFactory();
- UserAO userAO = irodsAOFactory.getUserAO(irodsAccount);
- User loggedInUser = userAO.findByName(username);
- } catch (JargonException ex) {
- if (ex.getMessage().indexOf("Connection refused") > -1) {
- MessageUtil.showError(splash.loginDialog, "Cannot connect to the server, is it down?", "Login Error");
- } else if (ex.getMessage().indexOf("Connection reset") > -1) {
- MessageUtil.showError(splash.loginDialog, "Cannot connect to the server, is it down?", "Login Error");
- } else if (ex.getMessage().indexOf("io exception opening socket") > -1) {
- MessageUtil.showError(splash.loginDialog, "Cannot connect to the server, is it down?", "Login Error");
- } else {
- MessageUtil.showError(splash.loginDialog, "login error - unable to log in, or invalid user id",
- "Login Error");
- }
- return;
- } finally {
- }
-
- splash.getDesktop().getiDropCore().setIrodsFileSystem(irodsFileSystem);
- splash.getDesktop().getiDropCore().setIrodsAccount(irodsAccount);
- splash.loginDialog.setVisible(false);
- }
-
- private ValidationResult validateLoginForm() {
- ValidationResult result = new ValidationResult();
-
- if (StringUtils.isEmpty(splash.loginDialogUsernameTextField.getText())) {
- result.addError("Username is required");
- }
-
- if (StringUtils.isEmpty(new String(splash.loginDialogPasswordPasswordField.getPassword()))) {
- result.addError("Password is required");
- }
-
- if (StringUtils.isEmpty(splash.loginDialogHostTextField.getText())) {
- result.addError("Host is required");
- }
-
- if (StringUtils.isEmpty(splash.loginDialogResourceTextField.getText())) {
- result.addError("Resource is required");
- }
-
- if (StringUtils.isEmpty(splash.loginDialogZoneTextField.getText())) {
- result.addError("Zone is required");
- }
-
- if (StringUtils.isEmpty(splash.loginDialogPortTextField.getText())) {
- result.addError("Port is required");
- }
-
- if (StringUtils.isNotEmpty(splash.loginDialogPortTextField.getText())) {
- try {
- Integer.valueOf(splash.loginDialogPortTextField.getText());
- } catch (NumberFormatException e) {
- result.addError("Port is invalid");
- }
- }
-
- return result;
- }
-
-}
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/PreferencesDialogCancelActionListener.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/PreferencesDialogCancelActionListener.java
deleted file mode 100644
index 224aebe..0000000
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/PreferencesDialogCancelActionListener.java
+++ /dev/null
@@ -1,26 +0,0 @@
-package org.irods.jargon.idrop.desktop.systraygui.listeners;
-
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-
-import org.irods.jargon.idrop.desktop.systraygui.IDROPDesktop;
-
-/**
- *
- * @author jdr0887
- *
- */
-public class PreferencesDialogCancelActionListener implements ActionListener {
-
- private IDROPDesktop desktop;
-
- public PreferencesDialogCancelActionListener(IDROPDesktop desktop) {
- super();
- this.desktop = desktop;
- }
-
- public void actionPerformed(ActionEvent e) {
- desktop.preferencesDialog.setVisible(false);
- }
-
-}
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/PreferencesDialogDefaultLocalDirectoryActionListener.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/PreferencesDialogDefaultLocalDirectoryActionListener.java
deleted file mode 100644
index 26aada9..0000000
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/PreferencesDialogDefaultLocalDirectoryActionListener.java
+++ /dev/null
@@ -1,57 +0,0 @@
-package org.irods.jargon.idrop.desktop.systraygui.listeners;
-
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.io.File;
-
-import javax.swing.JFileChooser;
-import javax.swing.filechooser.FileFilter;
-
-import org.irods.jargon.idrop.desktop.systraygui.IDROPDesktop;
-
-/**
- *
- * @author jdr0887
- *
- */
-public class PreferencesDialogDefaultLocalDirectoryActionListener implements ActionListener {
-
- private IDROPDesktop desktop;
-
- public PreferencesDialogDefaultLocalDirectoryActionListener(IDROPDesktop desktop) {
- super();
- this.desktop = desktop;
- }
-
- public void actionPerformed(ActionEvent e) {
-
- desktop.preferencesDialogDefaultLocalDirectoryFileChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
- desktop.preferencesDialogDefaultLocalDirectoryFileChooser.setCurrentDirectory(new File(System
- .getProperty("user.home")));
- desktop.preferencesDialogDefaultLocalDirectoryFileChooser.addChoosableFileFilter(new FileFilter() {
-
- @Override
- public boolean accept(File f) {
- if (f.isDirectory()) {
- return true;
- }
- return false;
- }
-
- @Override
- public String getDescription() {
- return null;
- }
-
- });
- int response = desktop.preferencesDialogDefaultLocalDirectoryFileChooser
- .showSaveDialog(desktop.preferencesDialog);
- if (response == JFileChooser.APPROVE_OPTION) {
- File file = desktop.preferencesDialogDefaultLocalDirectoryFileChooser.getSelectedFile();
- if (file != null && file.isDirectory()) {
- desktop.preferencesDialogDefaultLocalDirectoryTextField.setText(file.getAbsolutePath());
- }
- }
-
- }
-}
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/PreferencesDialogSaveActionListener.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/PreferencesDialogSaveActionListener.java
deleted file mode 100644
index 0b4bcc6..0000000
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/PreferencesDialogSaveActionListener.java
+++ /dev/null
@@ -1,45 +0,0 @@
-package org.irods.jargon.idrop.desktop.systraygui.listeners;
-
-import static org.irods.jargon.idrop.desktop.systraygui.Constants.PREFERENCE_KEY_DEFAULT_LOCAL_DIR;
-import static org.irods.jargon.idrop.desktop.systraygui.Constants.PREFERENCE_KEY_SHOW_HIDDEN_FILES;
-import static org.irods.jargon.idrop.desktop.systraygui.Constants.PREFERENCE_KEY_SHOW_UI;
-import static org.irods.jargon.idrop.desktop.systraygui.Constants.PREFERENCE_KEY_SHOW_SPLASH;
-
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-
-import org.irods.jargon.idrop.desktop.systraygui.IDROPDesktop;
-
-/**
- *
- * @author jdr0887
- *
- */
-public class PreferencesDialogSaveActionListener implements ActionListener {
-
- private IDROPDesktop desktop;
-
- public PreferencesDialogSaveActionListener(IDROPDesktop desktop) {
- super();
- this.desktop = desktop;
- }
-
- public void actionPerformed(ActionEvent e) {
-
- boolean showUI = desktop.preferencesDialogShowUICheckBox.isSelected();
- desktop.getiDropCore().getPreferences().putBoolean(PREFERENCE_KEY_SHOW_UI, showUI ? true : false);
-
- boolean showSplash = desktop.preferencesDialogShowSplashScreenCheckBox.isSelected();
- desktop.getiDropCore().getPreferences().putBoolean(PREFERENCE_KEY_SHOW_SPLASH, showSplash ? true : false);
-
- String defaultLocalDir = desktop.preferencesDialogDefaultLocalDirectoryTextField.getText();
- desktop.getiDropCore().getPreferences().put(PREFERENCE_KEY_DEFAULT_LOCAL_DIR, defaultLocalDir);
-
- boolean showHiddenFiles = desktop.preferencesDialogShowHiddenFilesCheckBox.isSelected();
- desktop.getiDropCore().getPreferences()
- .putBoolean(PREFERENCE_KEY_SHOW_HIDDEN_FILES, showHiddenFiles ? true : false);
-
- desktop.preferencesDialog.setVisible(false);
- }
-
-}
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/PreferencesMenuActionListener.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/PreferencesMenuActionListener.java
deleted file mode 100644
index 411a520..0000000
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/PreferencesMenuActionListener.java
+++ /dev/null
@@ -1,57 +0,0 @@
-package org.irods.jargon.idrop.desktop.systraygui.listeners;
-
-import static org.irods.jargon.idrop.desktop.systraygui.Constants.PREFERENCE_KEY_DEFAULT_LOCAL_DIR;
-import static org.irods.jargon.idrop.desktop.systraygui.Constants.PREFERENCE_KEY_DEVICE_NAME;
-import static org.irods.jargon.idrop.desktop.systraygui.Constants.PREFERENCE_KEY_SHOW_PREFERENCES;
-import static org.irods.jargon.idrop.desktop.systraygui.Constants.PREFERENCE_KEY_SHOW_SPLASH;
-import static org.irods.jargon.idrop.desktop.systraygui.Constants.PREFERENCE_KEY_SHOW_UI;
-
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.util.prefs.Preferences;
-
-import org.apache.commons.lang.StringUtils;
-import org.irods.jargon.idrop.desktop.systraygui.IDROPDesktop;
-
-/**
- *
- * @author jdr0887
- *
- */
-public class PreferencesMenuActionListener implements ActionListener {
-
- private IDROPDesktop desktop;
-
- public PreferencesMenuActionListener(IDROPDesktop desktop) {
- super();
- this.desktop = desktop;
- }
-
- public void actionPerformed(ActionEvent e) {
-
- Preferences prefs = desktop.getiDropCore().getPreferences();
-
- String deviceName = prefs.get(PREFERENCE_KEY_DEVICE_NAME, null);
- if (StringUtils.isNotEmpty(deviceName)) {
- desktop.preferencesDialogDeviceNameTextField.setText(deviceName);
- }
-
- String defaultLocalDirectory = prefs.get(PREFERENCE_KEY_DEFAULT_LOCAL_DIR, null);
- if (StringUtils.isNotEmpty(defaultLocalDirectory)) {
- desktop.preferencesDialogDefaultLocalDirectoryTextField.setText(defaultLocalDirectory);
- }
-
- boolean showPreferences = prefs.getBoolean(PREFERENCE_KEY_SHOW_PREFERENCES, true);
- desktop.preferencesDialogShowPreferencesCheckBox.setSelected(showPreferences ? true : false);
-
- boolean showSplash = prefs.getBoolean(PREFERENCE_KEY_SHOW_SPLASH, true);
- desktop.preferencesDialogShowSplashScreenCheckBox.setSelected(showSplash ? true : false);
-
- boolean showGUI = prefs.getBoolean(PREFERENCE_KEY_SHOW_UI, true);
- desktop.preferencesDialogShowUICheckBox.setSelected(showGUI);
-
- desktop.preferencesDialog.setLocationRelativeTo(desktop.mainFrame);
- desktop.preferencesDialog.setVisible(true);
- }
-
-}
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/RemoteFileChooserDialogCancelActionListener.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/RemoteFileChooserDialogCancelActionListener.java
deleted file mode 100644
index 02a4aa6..0000000
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/RemoteFileChooserDialogCancelActionListener.java
+++ /dev/null
@@ -1,23 +0,0 @@
-package org.irods.jargon.idrop.desktop.systraygui.listeners;
-
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-
-import org.irods.jargon.idrop.desktop.systraygui.IDROPDesktop;
-
-public class RemoteFileChooserDialogCancelActionListener implements ActionListener {
-
- private IDROPDesktop desktop;
-
- public RemoteFileChooserDialogCancelActionListener(IDROPDesktop desktop) {
- super();
- this.desktop = desktop;
- }
-
- @Override
- public void actionPerformed(ActionEvent e) {
- desktop.remoteFileChooserDialog.setVisible(false);
- desktop.editSynchronizationDialog.requestFocus();
- }
-
-}
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/RemoteFileChooserDialogDetailsViewActionListener.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/RemoteFileChooserDialogDetailsViewActionListener.java
deleted file mode 100644
index 4e116e4..0000000
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/RemoteFileChooserDialogDetailsViewActionListener.java
+++ /dev/null
@@ -1,23 +0,0 @@
-package org.irods.jargon.idrop.desktop.systraygui.listeners;
-
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-
-import org.irods.jargon.idrop.desktop.systraygui.IDROPDesktop;
-
-public class RemoteFileChooserDialogDetailsViewActionListener implements ActionListener {
-
- private IDROPDesktop desktop;
-
- public RemoteFileChooserDialogDetailsViewActionListener(IDROPDesktop desktop) {
- super();
- this.desktop = desktop;
- }
-
- @Override
- public void actionPerformed(ActionEvent e) {
- // TODO Auto-generated method stub
-
- }
-
-}
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/RemoteFileChooserDialogFileTypeActionListener.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/RemoteFileChooserDialogFileTypeActionListener.java
deleted file mode 100644
index 356d38e..0000000
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/RemoteFileChooserDialogFileTypeActionListener.java
+++ /dev/null
@@ -1,23 +0,0 @@
-package org.irods.jargon.idrop.desktop.systraygui.listeners;
-
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-
-import org.irods.jargon.idrop.desktop.systraygui.IDROPDesktop;
-
-public class RemoteFileChooserDialogFileTypeActionListener implements ActionListener {
-
- private IDROPDesktop desktop;
-
- public RemoteFileChooserDialogFileTypeActionListener(IDROPDesktop desktop) {
- super();
- this.desktop = desktop;
- }
-
- @Override
- public void actionPerformed(ActionEvent e) {
- // TODO Auto-generated method stub
-
- }
-
-}
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/RemoteFileChooserDialogHomeFolderActionListener.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/RemoteFileChooserDialogHomeFolderActionListener.java
deleted file mode 100644
index c0f1f07..0000000
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/RemoteFileChooserDialogHomeFolderActionListener.java
+++ /dev/null
@@ -1,23 +0,0 @@
-package org.irods.jargon.idrop.desktop.systraygui.listeners;
-
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-
-import org.irods.jargon.idrop.desktop.systraygui.IDROPDesktop;
-
-public class RemoteFileChooserDialogHomeFolderActionListener implements ActionListener {
-
- private IDROPDesktop desktop;
-
- public RemoteFileChooserDialogHomeFolderActionListener(IDROPDesktop desktop) {
- super();
- this.desktop = desktop;
- }
-
- @Override
- public void actionPerformed(ActionEvent e) {
- // TODO Auto-generated method stub
-
- }
-
-}
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/RemoteFileChooserDialogListMouseListener.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/RemoteFileChooserDialogListMouseListener.java
deleted file mode 100644
index ac560cd..0000000
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/RemoteFileChooserDialogListMouseListener.java
+++ /dev/null
@@ -1,101 +0,0 @@
-package org.irods.jargon.idrop.desktop.systraygui.listeners;
-
-import java.awt.event.MouseAdapter;
-import java.awt.event.MouseEvent;
-import java.util.List;
-
-import org.apache.commons.lang.StringUtils;
-import org.irods.jargon.core.exception.JargonException;
-import org.irods.jargon.core.pub.CollectionAndDataObjectListAndSearchAO;
-import org.irods.jargon.core.pub.IRODSAccessObjectFactory;
-import org.irods.jargon.core.pub.IRODSFileSystem;
-import org.irods.jargon.core.query.CollectionAndDataObjectListingEntry;
-import org.irods.jargon.idrop.desktop.systraygui.IDROPDesktop;
-
-public class RemoteFileChooserDialogListMouseListener extends MouseAdapter {
-
- private IDROPDesktop desktop;
-
- public RemoteFileChooserDialogListMouseListener(IDROPDesktop desktop) {
- super();
- this.desktop = desktop;
- }
-
- @Override
- public void mousePressed(MouseEvent me) {
-
- if (me.getClickCount() == 2) {
- doDoubleClickStuff(me);
- } else {
- doSingleClickStuff(me);
- }
- }
-
- @Override
- public void mouseReleased(MouseEvent me) {
- if (me.getClickCount() == 2) {
- doDoubleClickStuff(me);
- } else {
- doSingleClickStuff(me);
- }
- }
-
- private void doSingleClickStuff(MouseEvent me) {
-
- Object o = desktop.remoteFileChooserDialogList.getSelectedValue();
-
- if (o instanceof CollectionAndDataObjectListingEntry) {
-
- CollectionAndDataObjectListingEntry entry = (CollectionAndDataObjectListingEntry) o;
- desktop.remoteFileChooserDialogFileNameTextField.setText(entry.getPathOrName());
-
- }
-
- }
-
- private void doDoubleClickStuff(MouseEvent me) {
-
- Object o = desktop.remoteFileChooserDialogList.getSelectedValue();
-
- if (o instanceof CollectionAndDataObjectListingEntry) {
-
- CollectionAndDataObjectListingEntry entry = (CollectionAndDataObjectListingEntry) o;
- desktop.remoteFileChooserDialogListModel.clear();
- desktop.remoteFileChooserDialogLookInComboBox.removeAllItems();
- desktop.remoteFileChooserDialogLookInComboBox.addItem("/");
-
- String[] parentEntries = entry.getFormattedAbsolutePath().split("/");
-
- for (int i = 0; i < parentEntries.length; i++) {
- if (StringUtils.isNotEmpty(parentEntries[i])) {
- desktop.remoteFileChooserDialogLookInComboBox.addItem(parentEntries[i]);
- }
- }
- desktop.remoteFileChooserDialogLookInComboBox.setSelectedIndex(parentEntries.length - 1);
-
- try {
-
- IRODSFileSystem irodsFS = desktop.getiDropCore().getIrodsFileSystem();
- IRODSAccessObjectFactory irodsAOFactory = irodsFS.getIRODSAccessObjectFactory();
- CollectionAndDataObjectListAndSearchAO collectionAO = irodsAOFactory
- .getCollectionAndDataObjectListAndSearchAO(desktop.getiDropCore().getIrodsAccount());
- List<CollectionAndDataObjectListingEntry> childCache = collectionAO
- .listDataObjectsAndCollectionsUnderPath(entry.getPathOrName());
-
- if (childCache != null) {
-
- for (int i = 0; i < childCache.size(); i++) {
- CollectionAndDataObjectListingEntry childEntry = childCache.get(i);
- desktop.remoteFileChooserDialogListModel.addElement(childEntry);
- }
-
- }
- } catch (JargonException e1) {
- e1.printStackTrace();
- } catch (SecurityException se) {
- }
-
- }
-
- }
-}
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/RemoteFileChooserDialogListViewActionListener.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/RemoteFileChooserDialogListViewActionListener.java
deleted file mode 100644
index e21ddbd..0000000
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/RemoteFileChooserDialogListViewActionListener.java
+++ /dev/null
@@ -1,23 +0,0 @@
-package org.irods.jargon.idrop.desktop.systraygui.listeners;
-
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-
-import org.irods.jargon.idrop.desktop.systraygui.IDROPDesktop;
-
-public class RemoteFileChooserDialogListViewActionListener implements ActionListener {
-
- private IDROPDesktop desktop;
-
- public RemoteFileChooserDialogListViewActionListener(IDROPDesktop desktop) {
- super();
- this.desktop = desktop;
- }
-
- @Override
- public void actionPerformed(ActionEvent e) {
- // TODO Auto-generated method stub
-
- }
-
-}
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/RemoteFileChooserDialogLookInActionListener.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/RemoteFileChooserDialogLookInActionListener.java
deleted file mode 100644
index aaef165..0000000
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/RemoteFileChooserDialogLookInActionListener.java
+++ /dev/null
@@ -1,58 +0,0 @@
-package org.irods.jargon.idrop.desktop.systraygui.listeners;
-
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.util.List;
-
-import org.irods.jargon.core.exception.JargonException;
-import org.irods.jargon.core.pub.CollectionAndDataObjectListAndSearchAO;
-import org.irods.jargon.core.pub.IRODSAccessObjectFactory;
-import org.irods.jargon.core.pub.IRODSFileSystem;
-import org.irods.jargon.core.query.CollectionAndDataObjectListingEntry;
-import org.irods.jargon.idrop.desktop.systraygui.IDROPDesktop;
-
-public class RemoteFileChooserDialogLookInActionListener implements ActionListener {
-
- private IDROPDesktop desktop;
-
- public RemoteFileChooserDialogLookInActionListener(IDROPDesktop desktop) {
- super();
- this.desktop = desktop;
- }
-
- @Override
- public void actionPerformed(ActionEvent arg0) {
-
- Object o = desktop.remoteFileChooserDialogLookInComboBox.getSelectedItem();
-
- if (o instanceof CollectionAndDataObjectListingEntry) {
-
- CollectionAndDataObjectListingEntry entry = (CollectionAndDataObjectListingEntry) o;
- desktop.remoteFileChooserDialogListModel.clear();
-
- try {
-
- IRODSFileSystem irodsFS = desktop.getiDropCore().getIrodsFileSystem();
- IRODSAccessObjectFactory irodsAOFactory = irodsFS.getIRODSAccessObjectFactory();
- CollectionAndDataObjectListAndSearchAO collectionAO = irodsAOFactory
- .getCollectionAndDataObjectListAndSearchAO(desktop.getiDropCore().getIrodsAccount());
- List<CollectionAndDataObjectListingEntry> childCache = collectionAO
- .listDataObjectsAndCollectionsUnderPath(entry.getPathOrName());
-
- if (childCache != null) {
-
- for (int i = 0; i < childCache.size(); i++) {
- CollectionAndDataObjectListingEntry childEntry = childCache.get(i);
- desktop.remoteFileChooserDialogListModel.addElement(childEntry);
- }
-
- }
- } catch (JargonException e1) {
- e1.printStackTrace();
- } catch (SecurityException se) {
- }
-
- }
- }
-
-}
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/RemoteFileChooserDialogNewFolderActionListener.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/RemoteFileChooserDialogNewFolderActionListener.java
deleted file mode 100644
index b71f9c0..0000000
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/RemoteFileChooserDialogNewFolderActionListener.java
+++ /dev/null
@@ -1,23 +0,0 @@
-package org.irods.jargon.idrop.desktop.systraygui.listeners;
-
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-
-import org.irods.jargon.idrop.desktop.systraygui.IDROPDesktop;
-
-public class RemoteFileChooserDialogNewFolderActionListener implements ActionListener {
-
- private IDROPDesktop desktop;
-
- public RemoteFileChooserDialogNewFolderActionListener(IDROPDesktop desktop) {
- super();
- this.desktop = desktop;
- }
-
- @Override
- public void actionPerformed(ActionEvent e) {
- // TODO Auto-generated method stub
-
- }
-
-}
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/RemoteFileChooserDialogOpenActionListener.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/RemoteFileChooserDialogOpenActionListener.java
deleted file mode 100644
index a9c968b..0000000
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/RemoteFileChooserDialogOpenActionListener.java
+++ /dev/null
@@ -1,23 +0,0 @@
-package org.irods.jargon.idrop.desktop.systraygui.listeners;
-
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-
-import org.irods.jargon.idrop.desktop.systraygui.IDROPDesktop;
-
-public class RemoteFileChooserDialogOpenActionListener implements ActionListener {
-
- private IDROPDesktop desktop;
-
- public RemoteFileChooserDialogOpenActionListener(IDROPDesktop desktop) {
- super();
- this.desktop = desktop;
- }
-
- @Override
- public void actionPerformed(ActionEvent e) {
- desktop.editSynchronizationDialogRemotePathTextField.setText(desktop.remoteFileChooserDialogFileNameTextField.getText());
- desktop.remoteFileChooserDialog.setVisible(false);
- }
-
-}
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/RemoteFileChooserDialogUpFolderActionListener.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/RemoteFileChooserDialogUpFolderActionListener.java
deleted file mode 100644
index 1a61bf3..0000000
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/RemoteFileChooserDialogUpFolderActionListener.java
+++ /dev/null
@@ -1,84 +0,0 @@
-package org.irods.jargon.idrop.desktop.systraygui.listeners;
-
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.util.List;
-
-import org.apache.commons.lang.StringUtils;
-import org.irods.jargon.core.exception.JargonException;
-import org.irods.jargon.core.pub.CollectionAndDataObjectListAndSearchAO;
-import org.irods.jargon.core.pub.IRODSAccessObjectFactory;
-import org.irods.jargon.core.pub.IRODSFileSystem;
-import org.irods.jargon.core.query.CollectionAndDataObjectListingEntry;
-import org.irods.jargon.idrop.desktop.systraygui.IDROPDesktop;
-
-public class RemoteFileChooserDialogUpFolderActionListener implements ActionListener {
-
- private IDROPDesktop desktop;
-
- public RemoteFileChooserDialogUpFolderActionListener(IDROPDesktop desktop) {
- super();
- this.desktop = desktop;
- }
-
- @Override
- public void actionPerformed(ActionEvent arg0) {
-
- StringBuilder sb = new StringBuilder();
- for (int i = 0; i < desktop.remoteFileChooserDialogLookInComboBox.getItemCount() - 1; i++) {
- Object o = desktop.remoteFileChooserDialogLookInComboBox.getItemAt(i);
- if (i > 1) {
- sb.append("/").append(o.toString());
- } else {
- sb.append(o.toString());
- }
- }
-
- String path = sb.toString();
-
- if (StringUtils.isNotEmpty(path)) {
-
- desktop.remoteFileChooserDialogListModel.clear();
- desktop.remoteFileChooserDialogLookInComboBox.removeAllItems();
- desktop.remoteFileChooserDialogLookInComboBox.addItem("/");
-
- CollectionAndDataObjectListingEntry entry = new CollectionAndDataObjectListingEntry();
- entry.setPathOrName(sb.toString());
- desktop.remoteFileChooserDialogFileNameTextField.setText(entry.getPathOrName());
-
- String[] parentEntries = entry.getFormattedAbsolutePath().split("/");
-
- for (int i = 0; i < parentEntries.length; i++) {
- if (StringUtils.isNotEmpty(parentEntries[i])) {
- desktop.remoteFileChooserDialogLookInComboBox.addItem(parentEntries[i]);
- }
- }
- desktop.remoteFileChooserDialogLookInComboBox.setSelectedIndex(desktop.remoteFileChooserDialogLookInComboBox.getItemCount() - 1);
-
- try {
-
- IRODSFileSystem irodsFS = desktop.getiDropCore().getIrodsFileSystem();
- IRODSAccessObjectFactory irodsAOFactory = irodsFS.getIRODSAccessObjectFactory();
- CollectionAndDataObjectListAndSearchAO collectionAO = irodsAOFactory
- .getCollectionAndDataObjectListAndSearchAO(desktop.getiDropCore().getIrodsAccount());
- List<CollectionAndDataObjectListingEntry> childCache = collectionAO
- .listDataObjectsAndCollectionsUnderPath(entry.getPathOrName());
-
- if (childCache != null) {
-
- for (int i = 0; i < childCache.size(); i++) {
- CollectionAndDataObjectListingEntry childEntry = childCache.get(i);
- desktop.remoteFileChooserDialogListModel.addElement(childEntry);
- }
-
- }
- } catch (JargonException e1) {
- e1.printStackTrace();
- } catch (SecurityException se) {
- }
-
- }
-
- }
-
-}
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/StartupEditSynchronizationDialogCancelActionListener.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/StartupEditSynchronizationDialogCancelActionListener.java
deleted file mode 100644
index 97c5f0f..0000000
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/StartupEditSynchronizationDialogCancelActionListener.java
+++ /dev/null
@@ -1,23 +0,0 @@
-package org.irods.jargon.idrop.desktop.systraygui.listeners;
-
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-
-import org.irods.jargon.idrop.desktop.systraygui.IDROPSplashWindow;
-
-public class StartupEditSynchronizationDialogCancelActionListener implements ActionListener {
-
- private IDROPSplashWindow desktop;
-
- public StartupEditSynchronizationDialogCancelActionListener(IDROPSplashWindow desktop) {
- super();
- this.desktop = desktop;
- }
-
- @Override
- public void actionPerformed(ActionEvent e) {
- desktop.editSynchronizationDialog.setVisible(false);
- //don't want to exit here...just close and move along
- }
-
-}
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/StartupEditSynchronizationDialogLocalPathBrowseActionListener.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/StartupEditSynchronizationDialogLocalPathBrowseActionListener.java
deleted file mode 100644
index e67dbfb..0000000
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/StartupEditSynchronizationDialogLocalPathBrowseActionListener.java
+++ /dev/null
@@ -1,54 +0,0 @@
-package org.irods.jargon.idrop.desktop.systraygui.listeners;
-
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.io.File;
-
-import javax.swing.JFileChooser;
-import javax.swing.filechooser.FileFilter;
-
-import org.irods.jargon.idrop.desktop.systraygui.IDROPSplashWindow;
-
-public class StartupEditSynchronizationDialogLocalPathBrowseActionListener implements ActionListener {
-
- private IDROPSplashWindow desktop;
-
- public StartupEditSynchronizationDialogLocalPathBrowseActionListener(IDROPSplashWindow desktop) {
- super();
- this.desktop = desktop;
- }
-
- @Override
- public void actionPerformed(ActionEvent e) {
-
- desktop.editSynchronizationDialogLocalPathFileChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
- desktop.editSynchronizationDialogLocalPathFileChooser.setCurrentDirectory(new File(System
- .getProperty("user.home")));
- desktop.editSynchronizationDialogLocalPathFileChooser.addChoosableFileFilter(new FileFilter() {
-
- @Override
- public boolean accept(File f) {
- if (f.isDirectory()) {
- return true;
- }
- return false;
- }
-
- @Override
- public String getDescription() {
- return null;
- }
-
- });
- int response = desktop.editSynchronizationDialogLocalPathFileChooser
- .showOpenDialog(desktop.editSynchronizationDialog);
- if (response == JFileChooser.APPROVE_OPTION) {
- File file = desktop.editSynchronizationDialogLocalPathFileChooser.getSelectedFile();
- if (file != null && file.isDirectory()) {
- desktop.editSynchronizationDialogLocalPathTextField.setText(file.getAbsolutePath());
- }
- }
-
- }
-
-}
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/StartupEditSynchronizationDialogRemotePathBrowseActionListener.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/StartupEditSynchronizationDialogRemotePathBrowseActionListener.java
deleted file mode 100644
index bc91e71..0000000
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/StartupEditSynchronizationDialogRemotePathBrowseActionListener.java
+++ /dev/null
@@ -1,58 +0,0 @@
-package org.irods.jargon.idrop.desktop.systraygui.listeners;
-
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.util.List;
-
-import org.irods.jargon.core.exception.JargonException;
-import org.irods.jargon.core.pub.CollectionAndDataObjectListAndSearchAO;
-import org.irods.jargon.core.pub.IRODSAccessObjectFactory;
-import org.irods.jargon.core.pub.IRODSFileSystem;
-import org.irods.jargon.core.query.CollectionAndDataObjectListingEntry;
-import org.irods.jargon.idrop.desktop.systraygui.IDROPSplashWindow;
-
-public class StartupEditSynchronizationDialogRemotePathBrowseActionListener implements ActionListener {
-
- private IDROPSplashWindow splash;
-
- public StartupEditSynchronizationDialogRemotePathBrowseActionListener(IDROPSplashWindow splash) {
- super();
- this.splash = splash;
- }
-
- @Override
- public void actionPerformed(ActionEvent e) {
-
- CollectionAndDataObjectListingEntry rootEntry = new CollectionAndDataObjectListingEntry();
- rootEntry.setPathOrName("/");
- splash.remoteFileChooserDialog.setLocationRelativeTo(splash.editSynchronizationDialog);
- splash.remoteFileChooserDialogListModel.clear();
- splash.remoteFileChooserDialogLookInComboBox.removeAllItems();
- splash.remoteFileChooserDialogLookInComboBox.addItem("/");
-
- try {
-
- IRODSFileSystem irodsFS = splash.getDesktop().getiDropCore().getIrodsFileSystem();
- IRODSAccessObjectFactory irodsAOFactory = irodsFS.getIRODSAccessObjectFactory();
- CollectionAndDataObjectListAndSearchAO collectionAO = irodsAOFactory
- .getCollectionAndDataObjectListAndSearchAO(splash.getDesktop().getiDropCore().getIrodsAccount());
- List<CollectionAndDataObjectListingEntry> childCache = collectionAO
- .listDataObjectsAndCollectionsUnderPath(rootEntry.getPathOrName());
-
- if (childCache != null) {
-
- for (int i = 0; i < childCache.size(); i++) {
- CollectionAndDataObjectListingEntry childEntry = childCache.get(i);
- splash.remoteFileChooserDialogListModel.addElement(childEntry);
- }
-
- }
- splash.remoteFileChooserDialog.setVisible(true);
- } catch (JargonException e1) {
- e1.printStackTrace();
- } catch (SecurityException se) {
- }
-
- }
-
-}
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/StartupEditSynchronizationDialogSaveActionListener.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/StartupEditSynchronizationDialogSaveActionListener.java
deleted file mode 100644
index de32f05..0000000
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/StartupEditSynchronizationDialogSaveActionListener.java
+++ /dev/null
@@ -1,146 +0,0 @@
-package org.irods.jargon.idrop.desktop.systraygui.listeners;
-
-import static org.irods.jargon.idrop.desktop.systraygui.Constants.PREFERENCE_KEY_DEVICE_NAME;
-
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.util.Date;
-import java.util.List;
-import java.util.prefs.Preferences;
-
-import javax.swing.JOptionPane;
-
-import org.apache.commons.lang.StringUtils;
-import org.irods.jargon.core.connection.IRODSAccount;
-import org.irods.jargon.idrop.desktop.systraygui.IDROPCore;
-import org.irods.jargon.idrop.desktop.systraygui.IDROPSplashWindow;
-import org.irods.jargon.transfer.TransferDAOManager;
-import org.irods.jargon.transfer.dao.SynchronizationDAO;
-import org.irods.jargon.transfer.dao.TransferDAOException;
-import org.irods.jargon.transfer.dao.domain.Synchronization;
-import org.irods.jargon.transfer.dao.domain.SynchronizationType;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import com.jgoodies.validation.ValidationMessage;
-import com.jgoodies.validation.ValidationResult;
-
-public class StartupEditSynchronizationDialogSaveActionListener implements ActionListener {
-
- private final Logger log = LoggerFactory.getLogger(StartupEditSynchronizationDialogSaveActionListener.class);
-
- private final TransferDAOManager transferDAOMgr = TransferDAOManager.getInstance();
-
- private IDROPSplashWindow splash;
-
- public StartupEditSynchronizationDialogSaveActionListener(IDROPSplashWindow splash) {
- super();
- this.splash = splash;
- }
-
- @Override
- public void actionPerformed(ActionEvent arg0) {
-
- ValidationResult validationResults = validateLoginForm();
-
- if (validationResults.hasErrors()) {
- String msg = "";
- List<ValidationMessage> errors = validationResults.getErrors();
- for (ValidationMessage error : errors) {
- msg += error.formattedText() + "\n";
- }
- JOptionPane.showMessageDialog(splash.editSynchronizationDialog, msg, "Error", JOptionPane.ERROR_MESSAGE);
- return;
- }
-
- String name = splash.editSynchronizationDialogNameTextField.getText();
- String deviceName = splash.editSynchronizationDialogDeviceNameTextField.getText();
- String localPath = splash.editSynchronizationDialogLocalPathTextField.getText();
- String remotePath = splash.editSynchronizationDialogRemotePathTextField.getText();
- // String frequency = desktop.editSynchronizationDialogFrequencyComboBox.getSelectedItem().toString();
-
- Synchronization synch = new Synchronization();
- synch.setName(name);
-
- IDROPCore core = splash.getDesktop().getiDropCore();
- IRODSAccount account = core.getIrodsAccount();
-
- String host = account.getHost();
- synch.setIrodsHostName(host);
-
- int port = account.getPort();
- synch.setIrodsPort(port);
-
- String username = account.getUserName();
- synch.setIrodsUserName(username);
-
- String password = account.getPassword();
- synch.setIrodsPassword(password);
-
- String zone = account.getZone();
- synch.setIrodsZone(zone);
-
- synch.setLocalSynchDirectory(localPath);
- synch.setIrodsSynchDirectory(remotePath);
- synch.setSynchronizationMode(SynchronizationType.ONE_WAY_LOCAL_TO_IRODS);
- synch.setCreatedAt(new Date());
-
- // frequency: for (FrequencyType ft : FrequencyType.values()) {
- // if (ft.getReadableName().equals(frequency)) {
- // synch.setFrequencyType(ft);
- // break frequency;
- // }
- // }
-
-// try {
-// // save device name on server
-// SynchPropertiesService synchPropService = new SynchPropertiesServiceImpl(core.getIRODSAccessObjectFactory(), account);
-// synchPropService.addSynchDeviceForUserAndIrodsAbsolutePath(username, deviceName, remotePath, localPath);
-// } catch (DuplicateDataException e) {
-// log.error("DuplicateDataException", e);
-// MessageUtil.showError(splash.editSynchronizationDialog, "Device name is not unique", "Error");
-// return;
-// } catch (JargonException e) {
-// e.printStackTrace();
-// }
-
- try {
- // save synch locally
- SynchronizationDAO synchronizationDAO = transferDAOMgr.getTransferDAOBean().getSynchronizationDAO();
- synchronizationDAO.save(synch);
- } catch (TransferDAOException e) {
- e.printStackTrace();
- }
-
- Preferences preferences = splash.getDesktop().getiDropCore().getPreferences();
- preferences.put(PREFERENCE_KEY_DEVICE_NAME, deviceName);
- splash.editSynchronizationDialog.setVisible(false);
- }
-
- private ValidationResult validateLoginForm() {
- ValidationResult result = new ValidationResult();
-
- if (StringUtils.isEmpty(splash.editSynchronizationDialogNameTextField.getText())) {
- result.addError("Name is required");
- }
-
- if (StringUtils.isEmpty(splash.editSynchronizationDialogDeviceNameTextField.getText())) {
- result.addError("Device Name is required");
- }
-
- if (StringUtils.isEmpty(splash.editSynchronizationDialogLocalPathTextField.getText())) {
- result.addError("Local Path is required");
- }
-
- if (StringUtils.isEmpty(splash.editSynchronizationDialogRemotePathTextField.getText())) {
- result.addError("Remote Path is required");
- }
-
- // if (desktop.editSynchronizationDialogFrequencyComboBox.getSelectedIndex() == 0) {
- // result.addError("Please choose a valid frequency");
- // }
-
- return result;
- }
-
-}
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/StartupPreferencesDialogCancelActionListener.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/StartupPreferencesDialogCancelActionListener.java
deleted file mode 100644
index 2fe6d51..0000000
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/StartupPreferencesDialogCancelActionListener.java
+++ /dev/null
@@ -1,28 +0,0 @@
-package org.irods.jargon.idrop.desktop.systraygui.listeners;
-
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-
-import org.irods.jargon.idrop.desktop.systraygui.IDROPSplashWindow;
-
-/**
- *
- * @author jdr0887
- *
- */
-public class StartupPreferencesDialogCancelActionListener implements ActionListener {
-
- private IDROPSplashWindow splash;
-
- public StartupPreferencesDialogCancelActionListener(IDROPSplashWindow splash) {
- super();
- this.splash = splash;
- }
-
- public void actionPerformed(ActionEvent e) {
- if (splash.preferencesDialog != null) {
- splash.preferencesDialog.setVisible(false);
- }
- }
-
-}
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/StartupPreferencesDialogDefaultLocalDirectoryActionListener.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/StartupPreferencesDialogDefaultLocalDirectoryActionListener.java
deleted file mode 100644
index b0f8c2f..0000000
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/StartupPreferencesDialogDefaultLocalDirectoryActionListener.java
+++ /dev/null
@@ -1,57 +0,0 @@
-package org.irods.jargon.idrop.desktop.systraygui.listeners;
-
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.io.File;
-
-import javax.swing.JFileChooser;
-import javax.swing.filechooser.FileFilter;
-
-import org.irods.jargon.idrop.desktop.systraygui.IDROPSplashWindow;
-
-/**
- *
- * @author jdr0887
- *
- */
-public class StartupPreferencesDialogDefaultLocalDirectoryActionListener implements ActionListener {
-
- private IDROPSplashWindow splash;
-
- public StartupPreferencesDialogDefaultLocalDirectoryActionListener(IDROPSplashWindow splash) {
- super();
- this.splash = splash;
- }
-
- public void actionPerformed(ActionEvent e) {
-
- splash.preferencesDialogDefaultLocalDirectoryFileChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
- splash.preferencesDialogDefaultLocalDirectoryFileChooser.setCurrentDirectory(new File(System
- .getProperty("user.home")));
- splash.preferencesDialogDefaultLocalDirectoryFileChooser.addChoosableFileFilter(new FileFilter() {
-
- @Override
- public boolean accept(File f) {
- if (f.isDirectory()) {
- return true;
- }
- return false;
- }
-
- @Override
- public String getDescription() {
- return null;
- }
-
- });
- int response = splash.preferencesDialogDefaultLocalDirectoryFileChooser
- .showSaveDialog(splash.preferencesDialog);
- if (response == JFileChooser.APPROVE_OPTION) {
- File file = splash.preferencesDialogDefaultLocalDirectoryFileChooser.getSelectedFile();
- if (file != null && file.isDirectory()) {
- splash.preferencesDialogDefaultLocalDirectoryTextField.setText(file.getAbsolutePath());
- }
- }
-
- }
-}
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/StartupPreferencesDialogSaveActionListener.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/StartupPreferencesDialogSaveActionListener.java
deleted file mode 100644
index d1edf0b..0000000
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/StartupPreferencesDialogSaveActionListener.java
+++ /dev/null
@@ -1,55 +0,0 @@
-package org.irods.jargon.idrop.desktop.systraygui.listeners;
-
-import static org.irods.jargon.idrop.desktop.systraygui.Constants.PREFERENCE_KEY_DEFAULT_LOCAL_DIR;
-import static org.irods.jargon.idrop.desktop.systraygui.Constants.PREFERENCE_KEY_DEVICE_NAME;
-import static org.irods.jargon.idrop.desktop.systraygui.Constants.PREFERENCE_KEY_SHOW_HIDDEN_FILES;
-import static org.irods.jargon.idrop.desktop.systraygui.Constants.PREFERENCE_KEY_SHOW_PREFERENCES;
-import static org.irods.jargon.idrop.desktop.systraygui.Constants.PREFERENCE_KEY_SHOW_SPLASH;
-import static org.irods.jargon.idrop.desktop.systraygui.Constants.PREFERENCE_KEY_SHOW_UI;
-
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.util.prefs.Preferences;
-
-import org.irods.jargon.idrop.desktop.systraygui.IDROPSplashWindow;
-
-/**
- *
- * @author jdr0887
- *
- */
-public class StartupPreferencesDialogSaveActionListener implements ActionListener {
-
- private IDROPSplashWindow splash;
-
- public StartupPreferencesDialogSaveActionListener(IDROPSplashWindow splash) {
- super();
- this.splash = splash;
- }
-
- public void actionPerformed(ActionEvent e) {
-
- Preferences prefs = splash.getDesktop().getiDropCore().getPreferences();
-
- boolean showUI = splash.preferencesDialogShowUICheckBox.isSelected();
- prefs.putBoolean(PREFERENCE_KEY_SHOW_UI, showUI ? true : false);
-
- boolean showPreferences = splash.preferencesDialogShowPreferencesCheckBox.isSelected();
- prefs.putBoolean(PREFERENCE_KEY_SHOW_PREFERENCES, showPreferences ? true : false);
-
- boolean showSplash = splash.preferencesDialogShowSplashScreenCheckBox.isSelected();
- prefs.putBoolean(PREFERENCE_KEY_SHOW_SPLASH, showSplash ? true : false);
-
- String defaultLocalDir = splash.preferencesDialogDefaultLocalDirectoryTextField.getText();
- prefs.put(PREFERENCE_KEY_DEFAULT_LOCAL_DIR, defaultLocalDir);
-
- String deviceName = splash.preferencesDialogDeviceNameTextField.getText();
- prefs.put(PREFERENCE_KEY_DEVICE_NAME, deviceName);
-
- boolean showHiddenFiles = splash.preferencesDialogShowHiddenFilesCheckBox.isSelected();
- prefs.putBoolean(PREFERENCE_KEY_SHOW_HIDDEN_FILES, showHiddenFiles ? true : false);
-
- splash.preferencesDialog.setVisible(false);
- }
-
-}
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/StartupRemoteFileChooserDialogCancelActionListener.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/StartupRemoteFileChooserDialogCancelActionListener.java
deleted file mode 100644
index b35c9cd..0000000
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/StartupRemoteFileChooserDialogCancelActionListener.java
+++ /dev/null
@@ -1,23 +0,0 @@
-package org.irods.jargon.idrop.desktop.systraygui.listeners;
-
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-
-import org.irods.jargon.idrop.desktop.systraygui.IDROPSplashWindow;
-
-public class StartupRemoteFileChooserDialogCancelActionListener implements ActionListener {
-
- private IDROPSplashWindow desktop;
-
- public StartupRemoteFileChooserDialogCancelActionListener(IDROPSplashWindow desktop) {
- super();
- this.desktop = desktop;
- }
-
- @Override
- public void actionPerformed(ActionEvent e) {
- desktop.remoteFileChooserDialog.setVisible(false);
- desktop.editSynchronizationDialog.requestFocus();
- }
-
-}
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/StartupRemoteFileChooserDialogDetailsViewActionListener.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/StartupRemoteFileChooserDialogDetailsViewActionListener.java
deleted file mode 100644
index e445fba..0000000
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/StartupRemoteFileChooserDialogDetailsViewActionListener.java
+++ /dev/null
@@ -1,23 +0,0 @@
-package org.irods.jargon.idrop.desktop.systraygui.listeners;
-
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-
-import org.irods.jargon.idrop.desktop.systraygui.IDROPSplashWindow;
-
-public class StartupRemoteFileChooserDialogDetailsViewActionListener implements ActionListener {
-
- private IDROPSplashWindow desktop;
-
- public StartupRemoteFileChooserDialogDetailsViewActionListener(IDROPSplashWindow desktop) {
- super();
- this.desktop = desktop;
- }
-
- @Override
- public void actionPerformed(ActionEvent e) {
- // TODO Auto-generated method stub
-
- }
-
-}
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/StartupRemoteFileChooserDialogFileTypeActionListener.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/StartupRemoteFileChooserDialogFileTypeActionListener.java
deleted file mode 100644
index 5eb47a5..0000000
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/StartupRemoteFileChooserDialogFileTypeActionListener.java
+++ /dev/null
@@ -1,23 +0,0 @@
-package org.irods.jargon.idrop.desktop.systraygui.listeners;
-
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-
-import org.irods.jargon.idrop.desktop.systraygui.IDROPSplashWindow;
-
-public class StartupRemoteFileChooserDialogFileTypeActionListener implements ActionListener {
-
- private IDROPSplashWindow desktop;
-
- public StartupRemoteFileChooserDialogFileTypeActionListener(IDROPSplashWindow desktop) {
- super();
- this.desktop = desktop;
- }
-
- @Override
- public void actionPerformed(ActionEvent e) {
- // TODO Auto-generated method stub
-
- }
-
-}
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/StartupRemoteFileChooserDialogHomeFolderActionListener.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/StartupRemoteFileChooserDialogHomeFolderActionListener.java
deleted file mode 100644
index e9ed4e6..0000000
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/StartupRemoteFileChooserDialogHomeFolderActionListener.java
+++ /dev/null
@@ -1,23 +0,0 @@
-package org.irods.jargon.idrop.desktop.systraygui.listeners;
-
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-
-import org.irods.jargon.idrop.desktop.systraygui.IDROPSplashWindow;
-
-public class StartupRemoteFileChooserDialogHomeFolderActionListener implements ActionListener {
-
- private IDROPSplashWindow desktop;
-
- public StartupRemoteFileChooserDialogHomeFolderActionListener(IDROPSplashWindow desktop) {
- super();
- this.desktop = desktop;
- }
-
- @Override
- public void actionPerformed(ActionEvent e) {
- // TODO Auto-generated method stub
-
- }
-
-}
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/StartupRemoteFileChooserDialogListMouseListener.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/StartupRemoteFileChooserDialogListMouseListener.java
deleted file mode 100644
index 9f7bd6a..0000000
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/StartupRemoteFileChooserDialogListMouseListener.java
+++ /dev/null
@@ -1,101 +0,0 @@
-package org.irods.jargon.idrop.desktop.systraygui.listeners;
-
-import java.awt.event.MouseAdapter;
-import java.awt.event.MouseEvent;
-import java.util.List;
-
-import org.apache.commons.lang.StringUtils;
-import org.irods.jargon.core.exception.JargonException;
-import org.irods.jargon.core.pub.CollectionAndDataObjectListAndSearchAO;
-import org.irods.jargon.core.pub.IRODSAccessObjectFactory;
-import org.irods.jargon.core.pub.IRODSFileSystem;
-import org.irods.jargon.core.query.CollectionAndDataObjectListingEntry;
-import org.irods.jargon.idrop.desktop.systraygui.IDROPSplashWindow;
-
-public class StartupRemoteFileChooserDialogListMouseListener extends MouseAdapter {
-
- private IDROPSplashWindow splash;
-
- public StartupRemoteFileChooserDialogListMouseListener(IDROPSplashWindow splash) {
- super();
- this.splash = splash;
- }
-
- @Override
- public void mousePressed(MouseEvent me) {
-
- if (me.getClickCount() == 2) {
- doDoubleClickStuff(me);
- } else {
- doSingleClickStuff(me);
- }
- }
-
- @Override
- public void mouseReleased(MouseEvent me) {
- if (me.getClickCount() == 2) {
- doDoubleClickStuff(me);
- } else {
- doSingleClickStuff(me);
- }
- }
-
- private void doSingleClickStuff(MouseEvent me) {
-
- Object o = splash.remoteFileChooserDialogList.getSelectedValue();
-
- if (o instanceof CollectionAndDataObjectListingEntry) {
-
- CollectionAndDataObjectListingEntry entry = (CollectionAndDataObjectListingEntry) o;
- splash.remoteFileChooserDialogFileNameTextField.setText(entry.getPathOrName());
-
- }
-
- }
-
- private void doDoubleClickStuff(MouseEvent me) {
-
- Object o = splash.remoteFileChooserDialogList.getSelectedValue();
-
- if (o instanceof CollectionAndDataObjectListingEntry) {
-
- CollectionAndDataObjectListingEntry entry = (CollectionAndDataObjectListingEntry) o;
- splash.remoteFileChooserDialogListModel.clear();
- splash.remoteFileChooserDialogLookInComboBox.removeAllItems();
- splash.remoteFileChooserDialogLookInComboBox.addItem("/");
-
- String[] parentEntries = entry.getFormattedAbsolutePath().split("/");
-
- for (int i = 0; i < parentEntries.length; i++) {
- if (StringUtils.isNotEmpty(parentEntries[i])) {
- splash.remoteFileChooserDialogLookInComboBox.addItem(parentEntries[i]);
- }
- }
- splash.remoteFileChooserDialogLookInComboBox.setSelectedIndex(parentEntries.length - 1);
-
- try {
-
- IRODSFileSystem irodsFS = splash.getDesktop().getiDropCore().getIrodsFileSystem();
- IRODSAccessObjectFactory irodsAOFactory = irodsFS.getIRODSAccessObjectFactory();
- CollectionAndDataObjectListAndSearchAO collectionAO = irodsAOFactory
- .getCollectionAndDataObjectListAndSearchAO(splash.getDesktop().getiDropCore().getIrodsAccount());
- List<CollectionAndDataObjectListingEntry> childCache = collectionAO
- .listDataObjectsAndCollectionsUnderPath(entry.getPathOrName());
-
- if (childCache != null) {
-
- for (int i = 0; i < childCache.size(); i++) {
- CollectionAndDataObjectListingEntry childEntry = childCache.get(i);
- splash.remoteFileChooserDialogListModel.addElement(childEntry);
- }
-
- }
- } catch (JargonException e1) {
- e1.printStackTrace();
- } catch (SecurityException se) {
- }
-
- }
-
- }
-}
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/StartupRemoteFileChooserDialogListViewActionListener.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/StartupRemoteFileChooserDialogListViewActionListener.java
deleted file mode 100644
index c74ab0e..0000000
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/StartupRemoteFileChooserDialogListViewActionListener.java
+++ /dev/null
@@ -1,23 +0,0 @@
-package org.irods.jargon.idrop.desktop.systraygui.listeners;
-
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-
-import org.irods.jargon.idrop.desktop.systraygui.IDROPSplashWindow;
-
-public class StartupRemoteFileChooserDialogListViewActionListener implements ActionListener {
-
- private IDROPSplashWindow desktop;
-
- public StartupRemoteFileChooserDialogListViewActionListener(IDROPSplashWindow desktop) {
- super();
- this.desktop = desktop;
- }
-
- @Override
- public void actionPerformed(ActionEvent e) {
- // TODO Auto-generated method stub
-
- }
-
-}
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/StartupRemoteFileChooserDialogLookInActionListener.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/StartupRemoteFileChooserDialogLookInActionListener.java
deleted file mode 100644
index 234a931..0000000
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/StartupRemoteFileChooserDialogLookInActionListener.java
+++ /dev/null
@@ -1,58 +0,0 @@
-package org.irods.jargon.idrop.desktop.systraygui.listeners;
-
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.util.List;
-
-import org.irods.jargon.core.exception.JargonException;
-import org.irods.jargon.core.pub.CollectionAndDataObjectListAndSearchAO;
-import org.irods.jargon.core.pub.IRODSAccessObjectFactory;
-import org.irods.jargon.core.pub.IRODSFileSystem;
-import org.irods.jargon.core.query.CollectionAndDataObjectListingEntry;
-import org.irods.jargon.idrop.desktop.systraygui.IDROPSplashWindow;
-
-public class StartupRemoteFileChooserDialogLookInActionListener implements ActionListener {
-
- private IDROPSplashWindow splash;
-
- public StartupRemoteFileChooserDialogLookInActionListener(IDROPSplashWindow splash) {
- super();
- this.splash = splash;
- }
-
- @Override
- public void actionPerformed(ActionEvent arg0) {
-
- Object o = splash.remoteFileChooserDialogLookInComboBox.getSelectedItem();
-
- if (o instanceof CollectionAndDataObjectListingEntry) {
-
- CollectionAndDataObjectListingEntry entry = (CollectionAndDataObjectListingEntry) o;
- splash.remoteFileChooserDialogListModel.clear();
-
- try {
-
- IRODSFileSystem irodsFS = splash.getDesktop().getiDropCore().getIrodsFileSystem();
- IRODSAccessObjectFactory irodsAOFactory = irodsFS.getIRODSAccessObjectFactory();
- CollectionAndDataObjectListAndSearchAO collectionAO = irodsAOFactory
- .getCollectionAndDataObjectListAndSearchAO(splash.getDesktop().getiDropCore().getIrodsAccount());
- List<CollectionAndDataObjectListingEntry> childCache = collectionAO
- .listDataObjectsAndCollectionsUnderPath(entry.getPathOrName());
-
- if (childCache != null) {
-
- for (int i = 0; i < childCache.size(); i++) {
- CollectionAndDataObjectListingEntry childEntry = childCache.get(i);
- splash.remoteFileChooserDialogListModel.addElement(childEntry);
- }
-
- }
- } catch (JargonException e1) {
- e1.printStackTrace();
- } catch (SecurityException se) {
- }
-
- }
- }
-
-}
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/StartupRemoteFileChooserDialogNewFolderActionListener.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/StartupRemoteFileChooserDialogNewFolderActionListener.java
deleted file mode 100644
index 5f7d3cb..0000000
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/StartupRemoteFileChooserDialogNewFolderActionListener.java
+++ /dev/null
@@ -1,23 +0,0 @@
-package org.irods.jargon.idrop.desktop.systraygui.listeners;
-
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-
-import org.irods.jargon.idrop.desktop.systraygui.IDROPSplashWindow;
-
-public class StartupRemoteFileChooserDialogNewFolderActionListener implements ActionListener {
-
- private IDROPSplashWindow desktop;
-
- public StartupRemoteFileChooserDialogNewFolderActionListener(IDROPSplashWindow desktop) {
- super();
- this.desktop = desktop;
- }
-
- @Override
- public void actionPerformed(ActionEvent e) {
- // TODO Auto-generated method stub
-
- }
-
-}
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/StartupRemoteFileChooserDialogOpenActionListener.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/StartupRemoteFileChooserDialogOpenActionListener.java
deleted file mode 100644
index cb8c419..0000000
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/StartupRemoteFileChooserDialogOpenActionListener.java
+++ /dev/null
@@ -1,23 +0,0 @@
-package org.irods.jargon.idrop.desktop.systraygui.listeners;
-
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-
-import org.irods.jargon.idrop.desktop.systraygui.IDROPSplashWindow;
-
-public class StartupRemoteFileChooserDialogOpenActionListener implements ActionListener {
-
- private IDROPSplashWindow desktop;
-
- public StartupRemoteFileChooserDialogOpenActionListener(IDROPSplashWindow desktop) {
- super();
- this.desktop = desktop;
- }
-
- @Override
- public void actionPerformed(ActionEvent e) {
- desktop.editSynchronizationDialogRemotePathTextField.setText(desktop.remoteFileChooserDialogFileNameTextField.getText());
- desktop.remoteFileChooserDialog.setVisible(false);
- }
-
-}
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/StartupRemoteFileChooserDialogUpFolderActionListener.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/StartupRemoteFileChooserDialogUpFolderActionListener.java
deleted file mode 100644
index 9cb5969..0000000
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/StartupRemoteFileChooserDialogUpFolderActionListener.java
+++ /dev/null
@@ -1,85 +0,0 @@
-package org.irods.jargon.idrop.desktop.systraygui.listeners;
-
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.util.List;
-
-import org.apache.commons.lang.StringUtils;
-import org.irods.jargon.core.exception.JargonException;
-import org.irods.jargon.core.pub.CollectionAndDataObjectListAndSearchAO;
-import org.irods.jargon.core.pub.IRODSAccessObjectFactory;
-import org.irods.jargon.core.pub.IRODSFileSystem;
-import org.irods.jargon.core.query.CollectionAndDataObjectListingEntry;
-import org.irods.jargon.idrop.desktop.systraygui.IDROPSplashWindow;
-
-public class StartupRemoteFileChooserDialogUpFolderActionListener implements ActionListener {
-
- private IDROPSplashWindow splash;
-
- public StartupRemoteFileChooserDialogUpFolderActionListener(IDROPSplashWindow splash) {
- super();
- this.splash = splash;
- }
-
- @Override
- public void actionPerformed(ActionEvent arg0) {
-
- StringBuilder sb = new StringBuilder();
- for (int i = 0; i < splash.remoteFileChooserDialogLookInComboBox.getItemCount() - 1; i++) {
- Object o = splash.remoteFileChooserDialogLookInComboBox.getItemAt(i);
- if (i > 1) {
- sb.append("/").append(o.toString());
- } else {
- sb.append(o.toString());
- }
- }
-
- String path = sb.toString();
-
- if (StringUtils.isNotEmpty(path)) {
-
- splash.remoteFileChooserDialogListModel.clear();
- splash.remoteFileChooserDialogLookInComboBox.removeAllItems();
- splash.remoteFileChooserDialogLookInComboBox.addItem("/");
-
- CollectionAndDataObjectListingEntry entry = new CollectionAndDataObjectListingEntry();
- entry.setPathOrName(sb.toString());
- splash.remoteFileChooserDialogFileNameTextField.setText(entry.getPathOrName());
-
- String[] parentEntries = entry.getFormattedAbsolutePath().split("/");
-
- for (int i = 0; i < parentEntries.length; i++) {
- if (StringUtils.isNotEmpty(parentEntries[i])) {
- splash.remoteFileChooserDialogLookInComboBox.addItem(parentEntries[i]);
- }
- }
- splash.remoteFileChooserDialogLookInComboBox.setSelectedIndex(splash.remoteFileChooserDialogLookInComboBox
- .getItemCount() - 1);
-
- try {
-
- IRODSFileSystem irodsFS = splash.getDesktop().getiDropCore().getIrodsFileSystem();
- IRODSAccessObjectFactory irodsAOFactory = irodsFS.getIRODSAccessObjectFactory();
- CollectionAndDataObjectListAndSearchAO collectionAO = irodsAOFactory
- .getCollectionAndDataObjectListAndSearchAO(splash.getDesktop().getiDropCore().getIrodsAccount());
- List<CollectionAndDataObjectListingEntry> childCache = collectionAO
- .listDataObjectsAndCollectionsUnderPath(entry.getPathOrName());
-
- if (childCache != null) {
-
- for (int i = 0; i < childCache.size(); i++) {
- CollectionAndDataObjectListingEntry childEntry = childCache.get(i);
- splash.remoteFileChooserDialogListModel.addElement(childEntry);
- }
-
- }
- } catch (JargonException e1) {
- e1.printStackTrace();
- } catch (SecurityException se) {
- }
-
- }
-
- }
-
-}
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/services/IconManager.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/services/IconManager.java
index 595746b..3ef4935 100644
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/services/IconManager.java
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/services/IconManager.java
@@ -1,6 +1,6 @@
package org.irods.jargon.idrop.desktop.systraygui.services;
-import org.irods.jargon.idrop.desktop.systraygui.IDROPDesktop;
+import org.irods.jargon.idrop.desktop.systraygui.iDrop;
import org.irods.jargon.transfer.engine.TransferManager;
/**
@@ -14,9 +14,9 @@ public class IconManager {
private TransferManager.RunningStatus runningStatus = null;
- private final IDROPDesktop idropGui;
+ private final iDrop idropGui;
- public IconManager(final IDROPDesktop idropClient) {
+ public IconManager(final iDrop idropClient) {
this.idropGui = idropClient;
}
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/services/IdropConfigurationServiceImpl.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/services/IdropConfigurationServiceImpl.java
index 6d372d4..4284534 100644
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/services/IdropConfigurationServiceImpl.java
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/services/IdropConfigurationServiceImpl.java
@@ -1,6 +1,5 @@
package org.irods.jargon.idrop.desktop.systraygui.services;
-import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
@@ -8,7 +7,6 @@ import java.util.Properties;
import java.util.logging.Level;
import java.util.logging.Logger;
-import org.apache.commons.io.FileUtils;
import org.irods.jargon.idrop.desktop.systraygui.utils.IdropPropertiesHelper;
import org.irods.jargon.idrop.exceptions.IdropAlreadyRunningException;
import org.irods.jargon.idrop.exceptions.IdropException;
@@ -24,22 +22,23 @@ import org.slf4j.LoggerFactory;
*/
public class IdropConfigurationServiceImpl implements IdropConfigurationService {
- private final File propertyFile;
+ private final String idropConfigRootDirectoryAbsolutePath;
private final ConfigurationService configurationService;
private static final org.slf4j.Logger log = LoggerFactory.getLogger(IdropConfigurationServiceImpl.class);
- public IdropConfigurationServiceImpl(final File propertyFile) throws IdropAlreadyRunningException, IdropException {
+ public IdropConfigurationServiceImpl(final String idropConfigRootDirectoryAbsolutePath)
+ throws IdropAlreadyRunningException, IdropException {
- if (propertyFile == null) {
- throw new IllegalArgumentException("propertyFile is null");
+ if (idropConfigRootDirectoryAbsolutePath == null) {
+ throw new IllegalArgumentException("idropConfigRootDirectoryAbsolutePath is null");
}
log.info("getting config service via factory");
try {
TransferServiceFactoryImpl transferServiceFactory = new TransferServiceFactoryImpl();
- this.propertyFile = propertyFile;
+ this.idropConfigRootDirectoryAbsolutePath = idropConfigRootDirectoryAbsolutePath;
this.configurationService = transferServiceFactory.instanceConfigurationService();
} catch (Exception ex) {
@@ -61,7 +60,7 @@ public class IdropConfigurationServiceImpl implements IdropConfigurationService
try {
databaseProperties = configurationService.exportProperties();
configFileProperties = this.importPropertiesFromDefaultFile();
- configFileProperties.putAll(getProperties());
+
} catch (Exception ex) {
Logger.getLogger(IdropConfigurationServiceImpl.class.getName()).log(Level.SEVERE, null, ex);
if (ex.getMessage().indexOf("Could not open Hibernate Session") != -1) {
@@ -84,15 +83,12 @@ public class IdropConfigurationServiceImpl implements IdropConfigurationService
}
log.info("now storing derived properties in idrop configuration");
-
- databaseProperties.putAll(configFileProperties);
-
+
/*
- * This is something of a shim right now until config things settle down. For lifetime library, force into login
- * preset mode
+ * This is something of a shim right now until config things settle down. For lifetime library, force into login preset mode
*/
-
- String forceMode = databaseProperties.getProperty(FORCE_MODE);
+
+ String forceMode = (String) configFileProperties.getProperty(FORCE_MODE);
if (forceMode != null) {
boolean isForce = Boolean.valueOf(forceMode);
log.info("force mode is:{}", isForce);
@@ -101,10 +97,9 @@ public class IdropConfigurationServiceImpl implements IdropConfigurationService
databaseProperties.setProperty(LOGIN_PRESET, "true");
}
}
-
+
log.info("checking for force mode, which forces certain properties to be loaded from the idrop.properties file");
-
- importGivenPropertiesIntoDatabase(databaseProperties);
+
saveConfigurationToPropertiesFile();
return databaseProperties;
@@ -118,9 +113,13 @@ public class IdropConfigurationServiceImpl implements IdropConfigurationService
@Override
public void saveConfigurationToPropertiesFile() throws IdropException {
log.info("saveConfigurationToPropertiesFile()");
+ StringBuilder sb = new StringBuilder(idropConfigRootDirectoryAbsolutePath);
+ sb.append("/");
+ sb.append(IDROP_PROPS_FILE_NAME);
+
try {
Properties databaseProperties = configurationService.exportProperties();
- databaseProperties.store(new FileOutputStream(propertyFile), null);
+ databaseProperties.store(new FileOutputStream(sb.toString()), null);
} catch (TransferEngineException ex) {
Logger.getLogger(IdropConfigurationServiceImpl.class.getName()).log(Level.SEVERE, null, ex);
throw new IdropException("exception exporting final properties", ex);
@@ -138,25 +137,19 @@ public class IdropConfigurationServiceImpl implements IdropConfigurationService
*/
private Properties importPropertiesFromPropertiesFile() throws IdropException {
log.info("importPropertiesFromPropertiesFile()");
- Properties properties = getProperties();
- importGivenPropertiesIntoDatabase(properties);
- return properties;
- }
-
- private Properties getProperties() throws IdropException {
- log.debug("getProperties()");
+ StringBuilder sb = new StringBuilder(idropConfigRootDirectoryAbsolutePath);
+ sb.append("/");
+ sb.append(IDROP_PROPS_FILE_NAME);
Properties properties = new Properties();
try {
- if (!this.propertyFile.exists()) {
- FileUtils.touch(this.propertyFile);
- }
- FileInputStream fis = new FileInputStream(this.propertyFile);
- properties.load(fis);
- fis.close();
+ properties.load(new FileInputStream(sb.toString()));
+ importGivenPropertiesIntoDatabase(properties);
} catch (IOException ex) {
log.warn("idrop properties not found");
}
+
return properties;
+
}
private void importGivenPropertiesIntoDatabase(Properties properties) throws IdropException {
@@ -179,14 +172,4 @@ public class IdropConfigurationServiceImpl implements IdropConfigurationService
importGivenPropertiesIntoDatabase(properties);
return properties;
}
-
- private Properties importPropertiesFromDefaultFile(Properties props) throws IdropException {
- log.info("importPropertiesFromDefaultFile()");
- IdropPropertiesHelper idropPropertiesHelper = new IdropPropertiesHelper();
- Properties properties = idropPropertiesHelper.loadIdropProperties();
-
- importGivenPropertiesIntoDatabase(properties);
- return properties;
- }
-
}
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/services/QueueSchedulerTimerTask.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/services/QueueSchedulerTimerTask.java
index 850adfd..3c7de2c 100644
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/services/QueueSchedulerTimerTask.java
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/services/QueueSchedulerTimerTask.java
@@ -1,12 +1,11 @@
package org.irods.jargon.idrop.desktop.systraygui.services;
-import java.awt.Component;
import java.util.TimerTask;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.irods.jargon.core.exception.JargonException;
-import org.irods.jargon.idrop.desktop.systraygui.util.MessageUtil;
+import org.irods.jargon.idrop.desktop.systraygui.iDrop;
import org.irods.jargon.idrop.exceptions.IdropException;
import org.irods.jargon.transfer.engine.TransferManager;
import org.slf4j.LoggerFactory;
@@ -18,23 +17,28 @@ public class QueueSchedulerTimerTask extends TimerTask {
private final TransferManager transferManager;
+ private final iDrop idropGui;
+
public final static long EVERY_10_MINUTES = 1000 * 60 * 10;
public final static long EVERY_30_SECONDS = 1000 * 30;
private final org.slf4j.Logger log = LoggerFactory.getLogger(QueueSchedulerTimerTask.class);
-
- private Component parent;
- public QueueSchedulerTimerTask(TransferManager transferManager, Component parent) throws IdropException {
+ public QueueSchedulerTimerTask(TransferManager transferManager, iDrop idropGui) throws IdropException {
super();
if (transferManager == null) {
throw new IdropException("null transfer manager");
}
+ if (idropGui == null) {
+ throw new IdropException("null idropGui");
+ }
+
this.transferManager = transferManager;
- this.parent = parent;
+ this.idropGui = idropGui;
+
}
@Override
@@ -51,7 +55,7 @@ public class QueueSchedulerTimerTask extends TimerTask {
transferManager.processNextInQueueIfIdle();
} catch (JargonException ex) {
Logger.getLogger(QueueSchedulerTimerTask.class.getName()).log(Level.SEVERE, null, ex);
- MessageUtil.showError(parent, ex.getMessage(), "Error starting queue");
+ idropGui.showIdropException(ex);
return;
}
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/services/RuleExecutionWorker.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/services/RuleExecutionWorker.java
index 29bb7de..8a56e91 100644
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/services/RuleExecutionWorker.java
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/services/RuleExecutionWorker.java
@@ -4,7 +4,7 @@ import javax.swing.SwingWorker;
import org.irods.jargon.core.connection.IRODSAccount;
import org.irods.jargon.core.rule.IRODSRuleExecResult;
-import org.irods.jargon.idrop.desktop.systraygui.IDROPDesktop;
+import org.irods.jargon.idrop.desktop.systraygui.iDrop;
import org.irods.jargon.idrop.exceptions.IdropException;
import org.slf4j.LoggerFactory;
@@ -23,11 +23,11 @@ public final class RuleExecutionWorker extends SwingWorker {
private final IRODSAccount irodsAccount;
- private final IDROPDesktop idropGui;
+ private final iDrop idropGui;
private IRODSRuleExecResult execResult = null;
- public RuleExecutionWorker(final IDROPDesktop idropGui, final String irodsTargetAbsolutePath, final String targetResource,
+ public RuleExecutionWorker(final iDrop idropGui, final String irodsTargetAbsolutePath, final String targetResource,
final IRODSAccount irodsAccount) throws IdropException {
if (idropGui == null) {
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/utils/IconHelper.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/utils/IconHelper.java
index 2985e15..fedf4d1 100644
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/utils/IconHelper.java
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/utils/IconHelper.java
@@ -6,7 +6,7 @@ import java.net.URL;
import javax.swing.ImageIcon;
import javax.swing.JLabel;
-import org.irods.jargon.idrop.desktop.systraygui.IDROPDesktop;
+import org.irods.jargon.idrop.desktop.systraygui.iDrop;
/**
* Helper class to manage icons
@@ -150,7 +150,7 @@ public class IconHelper {
/** Returns an ImageIcon, or null if the path was invalid. */
protected static Image createImage(String path, String description) {
- URL imageURL = IDROPDesktop.class.getResource(path);
+ URL imageURL = iDrop.class.getResource(path);
if (imageURL == null) {
System.err.println("Resource not found: " + path);
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/IRODSOutlineModel.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/IRODSOutlineModel.java
index 63315d5..ca9e899 100644
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/IRODSOutlineModel.java
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/IRODSOutlineModel.java
@@ -18,7 +18,7 @@ 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.desktop.systraygui.IDROPDesktop;
+import org.irods.jargon.idrop.desktop.systraygui.iDrop;
import org.irods.jargon.idrop.desktop.systraygui.utils.TreeUtils;
import org.irods.jargon.idrop.exceptions.IdropException;
import org.irods.jargon.idrop.exceptions.IdropRuntimeException;
@@ -34,58 +34,64 @@ public class IRODSOutlineModel extends DefaultOutlineModel {
public static final org.slf4j.Logger log = LoggerFactory.getLogger(IRODSOutlineModel.class);
private final IRODSFileSystemModel treeModel;
- public IRODSFileSystemModel getTreeModel() {
- return treeModel;
- }
- private IDROPDesktop idrop;
-
- public IRODSOutlineModel(IDROPDesktop idrop, TreeModel tm, TableModel tm1, boolean bln, String string) {
+ private iDrop idrop;
+
+ public IRODSOutlineModel(iDrop idrop, TreeModel tm, TableModel tm1, boolean bln, String string) {
super(tm, tm1, bln, string);
this.treeModel = (IRODSFileSystemModel) tm;
this.idrop = idrop;
}
- public IRODSOutlineModel(IDROPDesktop idrop, TreeModel tm, RowModel rm, boolean bln, String string) {
+ public IRODSOutlineModel(iDrop idrop, TreeModel tm, RowModel rm, boolean bln, String string) {
super(tm, rm, bln, string);
- this.treeModel = (IRODSFileSystemModel) tm;
+ this.treeModel = (IRODSFileSystemModel) tm;
this.idrop = idrop;
}
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 IRODSOutlineModel thisModel = this;
java.awt.EventQueue.invokeLater(new Runnable() {
@Override
public void run() {
- CollectionAndDataObjectListingEntry deletedEntry = (CollectionAndDataObjectListingEntry) deletedNode.getUserObject();
- CollectionAndDataObjectListingEntry entry = (CollectionAndDataObjectListingEntry) ((IRODSNode) parent).getUserObject();
- IRODSTree stagingViewTree = idrop.getIrodsTree();
- TreePath path;
-
+ CollectionAndDataObjectListingEntry entry = (CollectionAndDataObjectListingEntry) ((IRODSNode) parent)
+ .getUserObject();
+ IRODSTree stagingViewTree = idrop.getIrodsTree();
+ TreePath path;
try {
path = TreeUtils.buildTreePathForIrodsAbsolutePath(stagingViewTree,
- entry.getFormattedAbsolutePath());
-
+ entry.getFormattedAbsolutePath());
} catch (IdropException ex) {
- Logger.getLogger(IRODSOutlineModel.class.getName()).log(Level.SEVERE, null, ex);
- throw new IdropRuntimeException(ex);
+ Logger.getLogger(IRODSOutlineModel.class.getName()).log(Level.SEVERE, null, ex);
+ throw new IdropRuntimeException(ex);
}
+
+ // thisModel.getTreePathSupport().removePath(path);
+ parent.remove(deletedNode);
- thisModel.treeModel.removeNodeFromParent(deletedNode);
-
+
+ //parent.forceReloadOfChildrenOfThisNode();
+ treeModel.nodeChanged(deletedNode);
+ treeModel.nodeChanged(parent);
+
+ //treeModel.nodeChanged(parent);
+
+ //stagingViewTree.highlightPath(path);
+
+
+
}
});
}
@@ -103,7 +109,7 @@ public class IRODSOutlineModel extends DefaultOutlineModel {
|| transferStatus.getTransferType() == TransferStatus.TransferType.COPY) {
log.info("successful put transfer, find the parent tree node, and clear the children");
notifyFileShouldBeAdded(irodsTree, transferStatus.getTargetFileAbsolutePath());
-
+
}
}
@@ -119,27 +125,25 @@ public class IRODSOutlineModel extends DefaultOutlineModel {
try {
try {
// if the node already exists (e.g. an overwrite, don' add it
-
- TreePath currentPath = TreeUtils.buildTreePathForIrodsAbsolutePath(irodsTree,
- irodsFileAbsolutePath);
+
+ 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);
+ 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;
}
-
+
} 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: {}",
@@ -174,7 +178,8 @@ 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) {
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/IRODSTree.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/IRODSTree.java
index 720380c..3dfa3eb 100644
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/IRODSTree.java
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/IRODSTree.java
@@ -24,7 +24,7 @@ import org.irods.jargon.core.query.CollectionAndDataObjectListingEntry;
import org.irods.jargon.idrop.desktop.systraygui.DeleteIRODSDialog;
import org.irods.jargon.idrop.desktop.systraygui.NewIRODSDirectoryDialog;
import org.irods.jargon.idrop.desktop.systraygui.RenameIRODSDirectoryDialog;
-import org.irods.jargon.idrop.desktop.systraygui.IDROPDesktop;
+import org.irods.jargon.idrop.desktop.systraygui.iDrop;
import org.irods.jargon.idrop.exceptions.IdropException;
import org.irods.jargon.idrop.exceptions.IdropRuntimeException;
import org.netbeans.swing.outline.DefaultOutlineModel;
@@ -42,7 +42,7 @@ public class IRODSTree extends Outline implements TreeWillExpandListener, TreeEx
public static org.slf4j.Logger log = LoggerFactory.getLogger(IRODSTree.class);
- protected IDROPDesktop idropParentGui = null;
+ protected iDrop idropParentGui = null;
protected JPopupMenu m_popup = null;
@@ -68,7 +68,7 @@ public class IRODSTree extends Outline implements TreeWillExpandListener, TreeEx
}
}
- public IRODSTree(TreeModel newModel, IDROPDesktop idropParentGui) {
+ public IRODSTree(TreeModel newModel, iDrop idropParentGui) {
super();
OutlineModel mdl = DefaultOutlineModel.createOutlineModel(newModel, new IRODSRowModel(), true, "File System");
@@ -84,7 +84,7 @@ public class IRODSTree extends Outline implements TreeWillExpandListener, TreeEx
super();
}
- public IRODSTree(IDROPDesktop idropParentGui) {
+ public IRODSTree(iDrop idropParentGui) {
super();
this.idropParentGui = idropParentGui;
initializeMenusAndListeners();
@@ -152,8 +152,8 @@ public class IRODSTree extends Outline implements TreeWillExpandListener, TreeEx
NewIRODSDirectoryDialog newDirectoryDialog = new NewIRODSDirectoryDialog(idropParentGui, true,
dataEntry.getPathOrName(), thisTree, parent);
newDirectoryDialog.setLocation(
- (int) (idropParentGui.mainFrame.getLocation().getX() + idropParentGui.mainFrame.getWidth() / 2),
- (int) (idropParentGui.mainFrame.getLocation().getY() + idropParentGui.mainFrame.getHeight() / 2));
+ (int) (idropParentGui.getLocation().getX() + idropParentGui.getWidth() / 2),
+ (int) (idropParentGui.getLocation().getY() + idropParentGui.getHeight() / 2));
newDirectoryDialog.setVisible(true);
}
};
@@ -186,8 +186,8 @@ public class IRODSTree extends Outline implements TreeWillExpandListener, TreeEx
deleteDialog = new DeleteIRODSDialog(idropParentGui, true, thisTree, nodesToDelete);
}
- deleteDialog.setLocation((int) (idropParentGui.mainFrame.getLocation().getX() + idropParentGui.mainFrame.getWidth() / 2),
- (int) (idropParentGui.mainFrame.getLocation().getY() + idropParentGui.mainFrame.getHeight() / 2));
+ deleteDialog.setLocation((int) (idropParentGui.getLocation().getX() + idropParentGui.getWidth() / 2),
+ (int) (idropParentGui.getLocation().getY() + idropParentGui.getHeight() / 2));
deleteDialog.setVisible(true);
}
};
@@ -217,8 +217,8 @@ 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.mainFrame.getLocation().getX() + idropParentGui.mainFrame.getWidth() / 2),
- (int) (idropParentGui.mainFrame.getLocation().getY() + idropParentGui.mainFrame.getHeight() / 2));
+ renameDialog.setLocation((int) (idropParentGui.getLocation().getX() + idropParentGui.getWidth() / 2),
+ (int) (idropParentGui.getLocation().getY() + idropParentGui.getHeight() / 2));
renameDialog.setVisible(true);
}
};
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/IRODSTreeTransferHandler.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/IRODSTreeTransferHandler.java
index 4d74203..7d15a84 100644
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/IRODSTreeTransferHandler.java
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/IRODSTreeTransferHandler.java
@@ -26,7 +26,7 @@ import org.irods.jargon.core.exception.JargonException;
import org.irods.jargon.core.pub.io.IRODSFile;
import org.irods.jargon.core.query.CollectionAndDataObjectListingEntry;
import org.irods.jargon.idrop.desktop.systraygui.MoveOrCopyiRODSDialog;
-import org.irods.jargon.idrop.desktop.systraygui.IDROPDesktop;
+import org.irods.jargon.idrop.desktop.systraygui.iDrop;
import org.irods.jargon.idrop.desktop.systraygui.services.IRODSFileService;
import org.irods.jargon.idrop.exceptions.IdropException;
import org.irods.jargon.idrop.exceptions.IdropRuntimeException;
@@ -53,9 +53,9 @@ public class IRODSTreeTransferHandler extends TransferHandler {
public static org.slf4j.Logger log = LoggerFactory.getLogger(IRODSTreeTransferHandler.class);
- public final IDROPDesktop idropGui;
+ public final iDrop idropGui;
- public IRODSTreeTransferHandler(final IDROPDesktop idropGui, final String string) {
+ public IRODSTreeTransferHandler(final iDrop idropGui, final String string) {
super(string);
if (idropGui == null) {
throw new IdropRuntimeException("null idrop gui");
@@ -274,7 +274,7 @@ public class IRODSTreeTransferHandler extends TransferHandler {
}
// default icon, custom title
- int n = JOptionPane.showConfirmDialog(idropGui.mainFrame, sb.toString(), "Confirm a Put to iRODS ",
+ int n = JOptionPane.showConfirmDialog(idropGui, sb.toString(), "Confirm a Put to iRODS ",
JOptionPane.YES_NO_OPTION);
if (n == JOptionPane.YES_OPTION) {
@@ -347,8 +347,8 @@ public class IRODSTreeTransferHandler extends TransferHandler {
idropGui.getIrodsTree(), sourceFiles, targetFileAbsolutePath, false);
}
- moveIRODSFileOrDirectoryDialog.setLocation((int) (idropGui.mainFrame.getLocation().getX() + idropGui.mainFrame.getWidth() / 2),
- (int) (idropGui.mainFrame.getLocation().getY() + idropGui.mainFrame.getHeight() / 2));
+ moveIRODSFileOrDirectoryDialog.setLocation((int) (idropGui.getLocation().getX() + idropGui.getWidth() / 2),
+ (int) (idropGui.getLocation().getY() + idropGui.getHeight() / 2));
moveIRODSFileOrDirectoryDialog.setVisible(true);
}
@@ -400,7 +400,7 @@ public class IRODSTreeTransferHandler extends TransferHandler {
}
// default icon, custom title
- int n = JOptionPane.showConfirmDialog(idropGui.mainFrame, sb.toString(), "Confirm a Put to iRODS ",
+ int n = JOptionPane.showConfirmDialog(idropGui, sb.toString(), "Confirm a Put to iRODS ",
JOptionPane.YES_NO_OPTION);
if (n == JOptionPane.YES_OPTION) {
@@ -480,8 +480,8 @@ public class IRODSTreeTransferHandler extends TransferHandler {
idropGui.getIrodsTree(), sourceFiles, targetFileAbsolutePath, true);
}
- moveIRODSFileOrDirectoryDialog.setLocation((int) (idropGui.mainFrame.getLocation().getX() + idropGui.mainFrame.getWidth() / 2),
- (int) (idropGui.mainFrame.getLocation().getY() + idropGui.mainFrame.getHeight() / 2));
+ moveIRODSFileOrDirectoryDialog.setLocation((int) (idropGui.getLocation().getX() + idropGui.getWidth() / 2),
+ (int) (idropGui.getLocation().getY() + idropGui.getHeight() / 2));
moveIRODSFileOrDirectoryDialog.setVisible(true);
}
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/InfoPanelTransferHandler.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/InfoPanelTransferHandler.java
index de467a8..e676151 100644
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/InfoPanelTransferHandler.java
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/InfoPanelTransferHandler.java
@@ -18,7 +18,7 @@ import javax.swing.tree.TreeSelectionModel;
import org.irods.jargon.core.exception.JargonException;
import org.irods.jargon.core.pub.domain.Collection;
import org.irods.jargon.core.pub.domain.DataObject;
-import org.irods.jargon.idrop.desktop.systraygui.IDROPDesktop;
+import org.irods.jargon.idrop.desktop.systraygui.iDrop;
import org.irods.jargon.idrop.exceptions.IdropException;
import org.irods.jargon.idrop.exceptions.IdropRuntimeException;
import org.slf4j.LoggerFactory;
@@ -35,9 +35,9 @@ public class InfoPanelTransferHandler extends TransferHandler {
public DataFlavor treeDataFlavor;
- private final IDROPDesktop idropGui;
+ private final iDrop idropGui;
- public InfoPanelTransferHandler(final IDROPDesktop idropGui) throws IdropException {
+ public InfoPanelTransferHandler(final iDrop idropGui) throws IdropException {
super();
if (idropGui == null) {
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/IrodsSelectionListenerForBuildingInfoPanel.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/IrodsSelectionListenerForBuildingInfoPanel.java
index f5fd148..d929715 100644
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/IrodsSelectionListenerForBuildingInfoPanel.java
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/IrodsSelectionListenerForBuildingInfoPanel.java
@@ -5,7 +5,6 @@ package org.irods.jargon.idrop.desktop.systraygui.viscomponents;
import java.util.logging.Level;
import java.util.logging.Logger;
-import javax.swing.ListSelectionModel;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
@@ -17,7 +16,7 @@ import org.irods.jargon.core.pub.DataObjectAO;
import org.irods.jargon.core.pub.domain.Collection;
import org.irods.jargon.core.pub.domain.DataObject;
import org.irods.jargon.core.query.CollectionAndDataObjectListingEntry;
-import org.irods.jargon.idrop.desktop.systraygui.IDROPDesktop;
+import org.irods.jargon.idrop.desktop.systraygui.iDrop;
import org.irods.jargon.idrop.exceptions.IdropException;
import org.irods.jargon.idrop.exceptions.IdropRuntimeException;
import org.slf4j.LoggerFactory;
@@ -34,11 +33,11 @@ public class IrodsSelectionListenerForBuildingInfoPanel implements ListSelection
public static org.slf4j.Logger log = LoggerFactory.getLogger(IrodsSelectionListenerForBuildingInfoPanel.class);
- private final IDROPDesktop idrop;
+ private final iDrop idrop;
- private IRODSOutlineModel irodsOutlineModel = null;
+ private IRODSOutlineModel irodsFileSystemModel = null;
- public IrodsSelectionListenerForBuildingInfoPanel(final IDROPDesktop idrop) throws IdropException {
+ public IrodsSelectionListenerForBuildingInfoPanel(final iDrop idrop) throws IdropException {
if (idrop == null) {
throw new IdropException("null iDrop");
}
@@ -89,10 +88,6 @@ public class IrodsSelectionListenerForBuildingInfoPanel implements ListSelection
if (!idrop.getToggleIrodsDetails().isSelected()) {
return;
}
-
- if (irodsNode == null) {
- return;
- }
if (irodsNode.isLeaf()) {
log.info("selected node is a leaf, get a data object");
@@ -156,18 +151,13 @@ public class IrodsSelectionListenerForBuildingInfoPanel implements ListSelection
}
log.info("lse: {}", lse);
- if (irodsOutlineModel == null) {
- irodsOutlineModel = (IRODSOutlineModel) idrop.getIrodsTree().getModel();
+ if (irodsFileSystemModel == null) {
+ irodsFileSystemModel = (IRODSOutlineModel) idrop.getIrodsTree().getModel();
}
- ListSelectionModel selectionModel = idrop.getIrodsTree().getSelectionModel();
- int idx = selectionModel.getAnchorSelectionIndex();
- idx = idrop.getIrodsTree().convertRowIndexToModel(idx);
// use first selection for info
- // int idx = lse.getLastIndex();
- //int idx = lse.getFirstIndex();
-
- IRODSNode selectedNode = (IRODSNode) irodsOutlineModel.getValueAt(idx, 0);
+ int idx = lse.getLastIndex();
+ IRODSNode selectedNode = (IRODSNode) irodsFileSystemModel.getValueAt(idx, 0);
log.info("selected node to initialize info panel:{}", selectedNode);
try {
identifyNodeTypeAndInitializeInfoPanel(selectedNode);
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/IrodsTreeListenerForBuildingInfoPanel.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/IrodsTreeListenerForBuildingInfoPanel.java
index 336b1be..0261d8b 100644
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/IrodsTreeListenerForBuildingInfoPanel.java
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/IrodsTreeListenerForBuildingInfoPanel.java
@@ -13,7 +13,7 @@ import org.irods.jargon.core.pub.DataObjectAO;
import org.irods.jargon.core.pub.domain.Collection;
import org.irods.jargon.core.pub.domain.DataObject;
import org.irods.jargon.core.query.CollectionAndDataObjectListingEntry;
-import org.irods.jargon.idrop.desktop.systraygui.IDROPDesktop;
+import org.irods.jargon.idrop.desktop.systraygui.iDrop;
import org.irods.jargon.idrop.exceptions.IdropException;
import org.slf4j.LoggerFactory;
@@ -29,9 +29,9 @@ public class IrodsTreeListenerForBuildingInfoPanel implements TreeSelectionListe
public static org.slf4j.Logger log = LoggerFactory.getLogger(IrodsTreeListenerForBuildingInfoPanel.class);
- private final IDROPDesktop idrop;
+ private final iDrop idrop;
- public IrodsTreeListenerForBuildingInfoPanel(final IDROPDesktop idrop) throws IdropException {
+ public IrodsTreeListenerForBuildingInfoPanel(final iDrop idrop) throws IdropException {
if (idrop == null) {
throw new IdropException("null iDrop");
}
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/LocalFileTree.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/LocalFileTree.java
index f73d2b4..26911ac 100644
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/LocalFileTree.java
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/LocalFileTree.java
@@ -28,7 +28,7 @@ import javax.swing.tree.TreePath;
import org.irods.jargon.idrop.desktop.systraygui.DeleteLocalFileDialog;
import org.irods.jargon.idrop.desktop.systraygui.NewLocalDirectoryDialog;
import org.irods.jargon.idrop.desktop.systraygui.RenameLocalDirectoryDialog;
-import org.irods.jargon.idrop.desktop.systraygui.IDROPDesktop;
+import org.irods.jargon.idrop.desktop.systraygui.iDrop;
import org.irods.jargon.idrop.exceptions.IdropException;
import org.slf4j.LoggerFactory;
@@ -40,21 +40,13 @@ import org.slf4j.LoggerFactory;
public class LocalFileTree extends JTree implements TreeWillExpandListener {
public static org.slf4j.Logger log = LoggerFactory.getLogger(LocalFileTree.class);
-
- private IDROPDesktop idropParentGui = null;
-
+ private iDrop idropParentGui = null;
protected JPopupMenu m_popup = null;
-
protected Action m_action;
-
protected TreePath m_clickedPath;
-
protected LocalFileTree thisTree;
-
private int highlightedRow = -1;
-
private Rectangle dirtyRegion = null;
-
private Color highlightColor = new Color(Color.BLUE.getRed(), Color.BLUE.getGreen(), Color.BLUE.getBlue(), 100);
public Rectangle getDirtyRegion() {
@@ -81,7 +73,7 @@ public class LocalFileTree extends JTree implements TreeWillExpandListener {
this.highlightedRow = highlightedRow;
}
- public LocalFileTree(TreeModel newModel, IDROPDesktop idropParentGui) {
+ public LocalFileTree(TreeModel newModel, iDrop idropParentGui) {
super(newModel);
this.idropParentGui = idropParentGui;
setDragEnabled(true);
@@ -257,10 +249,8 @@ public class LocalFileTree extends JTree implements TreeWillExpandListener {
NewLocalDirectoryDialog newLocalDirectoryDialog = new NewLocalDirectoryDialog(idropParentGui,
true, parentFile.getAbsolutePath(), thisTree, parentNode);
newLocalDirectoryDialog.setLocation(
- (int) (idropParentGui.mainFrame.getLocation().getX() + idropParentGui.mainFrame
- .getWidth() / 2),
- (int) (idropParentGui.mainFrame.getLocation().getY() + idropParentGui.mainFrame
- .getHeight() / 2));
+ (int) (idropParentGui.getLocation().getX() + idropParentGui.getWidth() / 2),
+ (int) (idropParentGui.getLocation().getY() + idropParentGui.getHeight() / 2));
newLocalDirectoryDialog.setVisible(true);
}
@@ -286,29 +276,22 @@ public class LocalFileTree extends JTree implements TreeWillExpandListener {
if (rows.length == 1) {
// single selection
- LocalFileNode toDelete = (LocalFileNode) thisTree.getSelectionModel().getSelectionPaths()[0]
- .getLastPathComponent();
+ LocalFileNode toDelete = (LocalFileNode) thisTree.getSelectionModel().getSelectionPaths()[0].getLastPathComponent();
File fileToDelete = (File) toDelete.getUserObject();
log.info("deleting a single node: {}", toDelete);
- deleteDialog = new DeleteLocalFileDialog(idropParentGui, true, fileToDelete.getAbsolutePath(),
- thisTree, toDelete);
+ deleteDialog = new DeleteLocalFileDialog(idropParentGui, true, fileToDelete.getAbsolutePath(), thisTree, toDelete);
} else {
List<LocalFileNode> nodesToDelete = new ArrayList<LocalFileNode>();
for (int row : rows) {
- nodesToDelete.add((LocalFileNode) (LocalFileNode) thisTree.getSelectionModel()
- .getSelectionPaths()[row].getLastPathComponent());
+ nodesToDelete.add((LocalFileNode) (LocalFileNode) thisTree.getSelectionModel().getSelectionPaths()[row].getLastPathComponent());
}
deleteDialog = new DeleteLocalFileDialog(idropParentGui, true, thisTree, nodesToDelete);
}
- double xLocation = idropParentGui.mainFrame.getLocation().getX();
- double yLocation = idropParentGui.mainFrame.getLocation().getY();
- int width = idropParentGui.mainFrame.getWidth();
- int height = idropParentGui.mainFrame.getHeight();
-
- deleteDialog.setLocation((int) (xLocation + width / 2), (int) (yLocation + height / 2));
+ deleteDialog.setLocation((int) (idropParentGui.getLocation().getX() + idropParentGui.getWidth() / 2),
+ (int) (idropParentGui.getLocation().getY() + idropParentGui.getHeight() / 2));
deleteDialog.setVisible(true);
}
@@ -326,11 +309,9 @@ public class LocalFileTree extends JTree implements TreeWillExpandListener {
RenameLocalDirectoryDialog renameLocalDirectoryDialog = new RenameLocalDirectoryDialog(idropParentGui,
true, parentFile.getAbsolutePath(), thisTree, parentNode);
- renameLocalDirectoryDialog
- .setLocation((int) (idropParentGui.mainFrame.getLocation().getX() + idropParentGui.mainFrame
- .getWidth() / 2),
- (int) (idropParentGui.mainFrame.getLocation().getY() + idropParentGui.mainFrame
- .getHeight() / 2));
+ renameLocalDirectoryDialog.setLocation(
+ (int) (idropParentGui.getLocation().getX() + idropParentGui.getWidth() / 2),
+ (int) (idropParentGui.getLocation().getY() + idropParentGui.getHeight() / 2));
renameLocalDirectoryDialog.setVisible(true);
}
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/LocalTreeTransferHandler.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/LocalTreeTransferHandler.java
index 479cf2b..57893b2 100644
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/LocalTreeTransferHandler.java
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/LocalTreeTransferHandler.java
@@ -16,15 +16,17 @@ import javax.swing.JComponent;
import javax.swing.JOptionPane;
import javax.swing.JTree;
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.irods.jargon.core.exception.JargonException;
import org.irods.jargon.core.pub.io.IRODSFile;
-import org.irods.jargon.idrop.desktop.systraygui.IDROPDesktop;
+import org.irods.jargon.idrop.desktop.systraygui.iDrop;
import org.irods.jargon.idrop.exceptions.IdropException;
import org.irods.jargon.idrop.exceptions.IdropRuntimeException;
+import org.openide.util.Exceptions;
import org.slf4j.LoggerFactory;
/**
@@ -35,8 +37,7 @@ import org.slf4j.LoggerFactory;
public class LocalTreeTransferHandler extends TransferHandler {
public static org.slf4j.Logger log = LoggerFactory.getLogger(LocalTreeTransferHandler.class);
-
- public final IDROPDesktop idropGui;
+ public final iDrop idropGui;
@Override
public boolean canImport(TransferSupport support) {
@@ -62,8 +63,7 @@ public class LocalTreeTransferHandler extends TransferHandler {
tree.setDirtyRegion(firstRowRect);
g.setColor(tree.getHighlightColor());
- g.fillRect((int) tree.getDirtyRegion().getX(), (int) tree.getDirtyRegion().getY(), (int) tree
- .getDirtyRegion().getWidth(), (int) tree.getDirtyRegion().getHeight());
+ g.fillRect((int) tree.getDirtyRegion().getX(), (int) tree.getDirtyRegion().getY(), (int) tree.getDirtyRegion().getWidth(), (int) tree.getDirtyRegion().getHeight());
tree.setHighlightedRow(closestRow);
}
}
@@ -125,8 +125,7 @@ public class LocalTreeTransferHandler extends TransferHandler {
} else if (flavor.getMimeType().equals(
"application/x-java-jvm-local-objectref; class=javax.swing.tree.TreeSelectionModel")) {
log.info("process drop as serialized object");
- processDropFromSerializedObjectType(transferable, nodeThatWasDropTargetAsFile, flavor,
- ts.getUserDropAction());
+ processDropFromSerializedObjectType(transferable, nodeThatWasDropTargetAsFile, flavor, ts.getUserDropAction());
imported = true;
break;
} else {
@@ -178,8 +177,7 @@ public class LocalTreeTransferHandler extends TransferHandler {
}
// default icon, custom title
- int n = JOptionPane.showConfirmDialog(idropGui.mainFrame, sb.toString(), "Confirm a Get ",
- JOptionPane.YES_NO_OPTION);
+ int n = JOptionPane.showConfirmDialog(idropGui, sb.toString(), "Confirm a Get ", JOptionPane.YES_NO_OPTION);
if (n == JOptionPane.YES_OPTION) {
@@ -195,10 +193,8 @@ public class LocalTreeTransferHandler extends TransferHandler {
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());
+ idropGui.getiDropCore().getTransferManager().enqueueAGet(transferFile.getAbsolutePath(), tempTargetLocalFileAbsolutePath,
+ "", idropGui.getIrodsAccount());
} else {
log.info("process a local to local move with source...not yet implemented : {}",
transferFile.getAbsolutePath());
@@ -218,12 +214,10 @@ public class LocalTreeTransferHandler extends TransferHandler {
/**
* Drop from local file tree onto local file tree for copy/move operation
- *
* @param transferable
- * @param parent
+ * @param parent
*/
- private void processDropFromSerializedObjectType(Transferable transferable, File parent, DataFlavor flavor,
- int userDropAction) {
+ private void processDropFromSerializedObjectType(Transferable transferable, File parent, DataFlavor flavor, int userDropAction) {
log.info("process as drop of file list to target:{}", parent.getAbsolutePath());
@@ -277,8 +271,7 @@ public class LocalTreeTransferHandler extends TransferHandler {
LocalFileNode parentNode = (LocalFileNode) sourceNode.getParent();
parentNode.remove(sourceNode);
}
- fileSystemModel.notifyFileShouldBeAdded(idropGui.getFileTree(), effectiveTarget.getAbsolutePath()
- + "/" + sourceFile.getName());
+ fileSystemModel.notifyFileShouldBeAdded(idropGui.getFileTree(), effectiveTarget.getAbsolutePath() + "/" + sourceFile.getName());
}
@@ -296,9 +289,10 @@ public class LocalTreeTransferHandler extends TransferHandler {
throw new IdropRuntimeException(ex);
}
+
}
- public LocalTreeTransferHandler(final IDROPDesktop idropGui) {
+ public LocalTreeTransferHandler(final iDrop idropGui) {
super("selectionModel");
if (idropGui == null) {
throw new IllegalArgumentException("null idropGui");
diff --git a/idrop-swing/src/main/resources/idrop.properties b/idrop-swing/src/main/resources/idrop.properties
index 335a928..b4b728f 100644
--- a/idrop-swing/src/main/resources/idrop.properties
+++ b/idrop-swing/src/main/resources/idrop.properties
@@ -1,6 +1,7 @@
policy.aware=false
login.preset=false
force.mode=false
+force.no.synch=true
advanced.view=true
transfer.database=transferDatabase
login.preset.host=diamond.ils.unc.edu
diff --git a/idrop-swing/src/test/java/org/irods/jargon/idrop/desktop/systraygui/services/IdropConfigurationServiceImplTest.java b/idrop-swing/src/test/java/org/irods/jargon/idrop/desktop/systraygui/services/IdropConfigurationServiceImplTest.java
index 1b1cd58..2ae6ab9 100644
--- a/idrop-swing/src/test/java/org/irods/jargon/idrop/desktop/systraygui/services/IdropConfigurationServiceImplTest.java
+++ b/idrop-swing/src/test/java/org/irods/jargon/idrop/desktop/systraygui/services/IdropConfigurationServiceImplTest.java
@@ -4,11 +4,10 @@
*/
package org.irods.jargon.idrop.desktop.systraygui.services;
-import java.io.File;
import java.util.Properties;
import junit.framework.Assert;
-
+import junit.framework.TestCase;
import org.irods.jargon.testutils.TestingPropertiesHelper;
import org.irods.jargon.testutils.filemanip.ScratchFileUtils;
import org.irods.jargon.transfer.TransferServiceFactoryImpl;
@@ -41,8 +40,7 @@ public class IdropConfigurationServiceImplTest {
testingProperties = testingPropertiesLoader.getTestProperties();
scratchFileUtils = new ScratchFileUtils(testingProperties);
scratchFileUtils.clearAndReinitializeScratchDirectory(TESTING_SUBDIR);
- File f = new File(scratchFileUtils.createAndReturnAbsoluteScratchPath(TESTING_SUBDIR), "idrop.properties");
- idropConfigurationService = new IdropConfigurationServiceImpl(f);
+ idropConfigurationService = new IdropConfigurationServiceImpl(scratchFileUtils.createAndReturnAbsoluteScratchPath(TESTING_SUBDIR));
TransferServiceFactoryImpl transferServiceFactory = new TransferServiceFactoryImpl();
configurationService = transferServiceFactory.instanceConfigurationService();
}