summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Reilly <jdr0887@renci.org>2011-07-05 14:06:53 (GMT)
committer Jason Reilly <jdr0887@renci.org>2011-07-05 14:06:53 (GMT)
commitfdfe7790123941f8e66d9564ccbb687c877256bb (patch)
tree2015c7a5829ed0751e8c64a1f01e7a149b754128
parent4a280fc1b84cd5a56f75448c23cfd47f332d767c (diff)
parent90c8a0f23b1d2aeee79c42860215175b2d8b34a3 (diff)
downloadQCG-Data-fdfe7790123941f8e66d9564ccbb687c877256bb.zip
QCG-Data-fdfe7790123941f8e66d9564ccbb687c877256bb.tar.gz
QCG-Data-fdfe7790123941f8e66d9564ccbb687c877256bb.tar.bz2
Merge branch 'jdr0887-55-227' into jdr0887-55-227-merge
Conflicts: idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/DeleteIRODSDialog.java idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/DeleteLocalFileDialog.java idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/IDROPDesktop.java idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/MoveOrCopyiRODSDialog.java idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/StartupSequencer.java idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/IRODSOutlineModel.java idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/LocalFileTree.java idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/LocalTreeTransferHandler.java
-rw-r--r--idrop-swing/pom.xml17
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/ChangePasswordDialog.java10
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/Constants.java38
-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.java15
-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/IDROPDesktop.java (renamed from idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/iDrop.java)448
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/IDROPSplashWindow.java506
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/IDropSplashWindow.java92
-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.java6
-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/components/RemoteFSChooserListCellRenderer.java55
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/components/RemoteFileChooserDialogLookInComboBoxRender.java35
-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/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.java78
-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/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/util/MessageUtil.java33
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/utils/IDropUtils.java (renamed from idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/utils/iDropUtils.java)2
-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.java77
-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.java6
-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/org/irods/jargon/idrop/editSynchronizationDialog.xml85
-rw-r--r--idrop-swing/src/main/resources/org/irods/jargon/idrop/editSynchronizationsDialog.xml63
-rw-r--r--idrop-swing/src/main/resources/org/irods/jargon/idrop/loginDialog.xml70
-rw-r--r--idrop-swing/src/main/resources/org/irods/jargon/idrop/preferencesDialog.xml86
-rw-r--r--idrop-swing/src/main/resources/org/irods/jargon/idrop/remoteFileChooserDialog.xml102
-rw-r--r--idrop-swing/src/main/resources/org/irods/jargon/idrop/splashWindow.xml18
-rw-r--r--pom.xml5
88 files changed, 3705 insertions, 1130 deletions
diff --git a/idrop-swing/pom.xml b/idrop-swing/pom.xml
index afd7435..8b94388 100644
--- a/idrop-swing/pom.xml
+++ b/idrop-swing/pom.xml
@@ -107,7 +107,22 @@
<scope>runtime</scope>
</dependency>
-->
-
+ <dependency>
+ <groupId>com.jgoodies</groupId>
+ <artifactId>validation</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>cookxml</groupId>
+ <artifactId>cookswing</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>cookxml</groupId>
+ <artifactId>cookxml</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>cookxml</groupId>
+ <artifactId>cookswing</artifactId>
+ </dependency>
<dependency>
<groupId>org.irods.jargon</groupId>
<artifactId>jargon-data-utils</artifactId>
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
index 61a01cb..6f2b60b 100644
--- 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
@@ -25,13 +25,13 @@ import org.slf4j.LoggerFactory;
*/
public class ChangePasswordDialog extends javax.swing.JDialog {
- private final iDrop idrop;
+ private final IDROPDesktop 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);
+ public ChangePasswordDialog(final IDROPDesktop idrop, boolean modal) {
+ super(idrop.mainFrame, modal);
this.idrop = idrop;
initComponents();
}
@@ -150,7 +150,7 @@ public class ChangePasswordDialog extends javax.swing.JDialog {
}
if (passwdNewPassword.getPassword().length == 0 || passwdConfirmPassword.getPassword().length == 0) {
- JOptionPane.showMessageDialog(idrop, "New or confirm password is missing");
+ JOptionPane.showMessageDialog(idrop.mainFrame, "New or confirm password is missing");
return;
}
@@ -162,7 +162,7 @@ public class ChangePasswordDialog extends javax.swing.JDialog {
} else {
passwdNewPassword.setBackground(Color.red);
passwdConfirmPassword.setBackground(Color.red);
- JOptionPane.showMessageDialog(idrop, "New and confirm password do not match");
+ JOptionPane.showMessageDialog(idrop.mainFrame, "New and confirm password do not match");
return;
}
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
new file mode 100644
index 0000000..05de3ed
--- /dev/null
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/Constants.java
@@ -0,0 +1,38 @@
+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 PREF_LOGIN_PORT = "login.port";
+
+ public static final String PREF_LOGIN_HOST = "login.host";
+
+ public static final String PREF_LOGIN_ZONE = "login.zone";
+
+ public static final String PREF_LOGIN_RESOURCE = "login.resource";
+
+ public static final String PREF_LOGIN_USERNAME = "login.username";
+
+}
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 9bbb448..ec41e01 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,16 +35,20 @@ import org.slf4j.LoggerFactory;
*/
public class DeleteIRODSDialog extends javax.swing.JDialog {
- private final iDrop idrop;
+ private final IDROPDesktop 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 iDrop parent, final boolean modal, final IRODSTree irodsTree,
+ public DeleteIRODSDialog(final IDROPDesktop parent, final boolean modal, final IRODSTree irodsTree,
final IRODSNode deletedNode) {
- super(parent, modal);
+ super(parent.mainFrame, modal);
this.idrop = parent;
this.irodsTree = irodsTree;
this.deletedNode = deletedNode;
@@ -64,9 +68,9 @@ public class DeleteIRODSDialog extends javax.swing.JDialog {
}
/** Creates new form NewIRODSDirectoryDialog */
- public DeleteIRODSDialog(final iDrop parent, final boolean modal, final IRODSTree irodsTree,
+ public DeleteIRODSDialog(final IDROPDesktop parent, final boolean modal, final IRODSTree irodsTree,
final List<IRODSNode> deletedNodes) {
- super(parent, modal);
+ super(parent.mainFrame, modal);
this.idrop = parent;
this.irodsTree = irodsTree;
this.deletedNodes = deletedNodes;
@@ -251,7 +255,8 @@ 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();
@@ -280,8 +285,11 @@ 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) {
@@ -337,7 +345,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 11841e3..9656fac 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,17 +36,22 @@ import org.slf4j.LoggerFactory;
*/
public class DeleteLocalFileDialog extends javax.swing.JDialog {
- private final iDrop idrop;
+ private final IDROPDesktop 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 iDrop parent, final boolean modal, final String directoryToDelete,
+ public DeleteLocalFileDialog(final IDROPDesktop parent, final boolean modal, final String directoryToDelete,
final LocalFileTree localFileTree, final LocalFileNode deletedNode) {
- super(parent, modal);
+ super(parent.mainFrame, modal);
this.idrop = parent;
this.directoryToDelete = directoryToDelete;
this.localFileTree = localFileTree;
@@ -59,8 +64,8 @@ public class DeleteLocalFileDialog extends javax.swing.JDialog {
}
/** Creates new form to delete a local file */
- public DeleteLocalFileDialog(final iDrop parent, final boolean modal,
- final LocalFileTree localFileTree, final List<LocalFileNode> deletedNodes) {
+ public DeleteLocalFileDialog(final iDrop parent, final boolean modal, final LocalFileTree localFileTree,
+ final List<LocalFileNode> deletedNodes) {
super(parent, modal);
this.idrop = parent;
this.directoryToDelete = null;
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 0c85975..4da4459 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,14 +21,6 @@ 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;
@@ -39,6 +31,14 @@ 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,12 +83,10 @@ 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/iDrop.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/IDROPDesktop.java
index a698eb7..b346776 100644
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/iDrop.java
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/IDROPDesktop.java
@@ -8,6 +8,7 @@ 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;
@@ -23,23 +24,28 @@ 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.JList;
import javax.swing.JOptionPane;
+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;
@@ -54,10 +60,33 @@ 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.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.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;
import org.irods.jargon.idrop.desktop.systraygui.utils.TreeUtils;
-import org.irods.jargon.idrop.desktop.systraygui.utils.iDropUtils;
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;
@@ -80,73 +109,143 @@ import org.irods.jargon.usertagging.domain.TagQuerySearchResult;
import org.netbeans.swing.outline.Outline;
import org.slf4j.LoggerFactory;
+import cookxml.cookswing.CookSwing;
+
/**
* Main system tray and GUI. Create system tray menu, start timer process for queue.
*
* @author Mike Conway - DICE (www.irods.org)
*/
-public class iDrop extends javax.swing.JFrame implements ActionListener, ItemListener, TransferManagerCallbackListener {
+public class IDROPDesktop implements ActionListener, ItemListener, TransferManagerCallbackListener {
- private static final long serialVersionUID = 1L;
+ public JFrame mainFrame;
private LocalFileSystemModel localFileModel = null;
- private static final org.slf4j.Logger log = LoggerFactory.getLogger(iDrop.class);
+ private static final org.slf4j.Logger log = LoggerFactory.getLogger(IDROPDesktop.class);
private boolean formShown = false;
+ private CookSwing cookSwing = null;
+
private LocalFileTree fileTree = null;
private IRODSTree irodsTree = null;
private QueueManagerDialog queueManagerDialog = null;
- private IDROPCore iDropCore = new IDROPCore();
+ private IDROPCore iDropCore;
- private CheckboxMenuItem pausedItem = null;
+ public 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 JList editSynchronizationsDialogList, remoteFileChooserDialogList;
- public static JDialog newPreferencesDialog;
+ public JTextField editSynchronizationDialogLocalPathTextField, editSynchronizationDialogNameTextField,
+ editSynchronizationDialogRemotePathTextField, remoteFileChooserDialogFileNameTextField,
+ preferencesDialogDefaultLocalDirectoryTextField, editSynchronizationDialogDeviceNameTextField,
+ preferencesDialogDeviceNameTextField;
- public JCheckBox showGUICheckBox;
+ public JDialog editSynchronizationsDialog, editSynchronizationDialog, remoteFileChooserDialog, preferencesDialog;
- public JButton preferencesDialogOKButton;
+ public JCheckBox preferencesDialogShowUICheckBox, preferencesDialogShowHiddenFilesCheckBox,
+ preferencesDialogShowPreferencesCheckBox;
- private static SimpleDateFormat SDF = new SimpleDateFormat("MM-dd-yyyy");
+ public DefaultListModel editSynchronizationsDialogListModel, remoteFileChooserDialogListModel;
- public iDrop(final IDROPCore idropCore) {
+ public JButton preferencesDialogOKButton, editSynchronizationsDialogNewButton,
+ editSynchronizationsDialogEditButton, editSynchronizationsDialogDeleteButton,
+ editSynchronizationsDialogRunNowButton, editSynchronizationDialogSaveButton,
+ editSynchronizationDialogCancelButton, editSynchronizationDialogRemotePathBrowseButton,
+ editSynchronizationDialogLocalPathBrowseButton, remoteFileChooserDialogNewFolderButton,
+ remoteFileChooserDialogUpFolderButton, remoteFileChooserDialogHomeFolderButton,
+ remoteFileChooserDialogListViewButton, remoteFileChooserDialogDetailsViewButton,
+ remoteFileChooserDialogOpenButton, remoteFileChooserDialogCancelButton;
+ 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 iDrop() {
+ public IDROPDesktop() {
}
+ public final ActionListener editSynchronizationsDialogNewActionListener = new EditSynchronizationsDialogNewActionListener(
+ this);
+
+ public final ActionListener editSynchronizationsDialogEditActionListener = new EditSynchronizationsDialogEditActionListener(
+ this);
+
+ public final ActionListener editSynchronizationsDialogDeleteActionListener = new EditSynchronizationsDialogDeleteActionListener(
+ 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);
+
protected void buildIdropGuiComponents() throws IdropRuntimeException, HeadlessException {
initComponents();
this.pnlLocalTreeArea.setVisible(false);
@@ -155,7 +254,7 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
try {
pnlIrodsInfo.setTransferHandler(new InfoPanelTransferHandler(this));
} catch (IdropException ex) {
- Logger.getLogger(iDrop.class.getName()).log(Level.SEVERE, null, ex);
+ Logger.getLogger(IDROPDesktop.class.getName()).log(Level.SEVERE, null, ex);
throw new IdropRuntimeException("error setting up infoPanelTransferHandler", ex);
}
@@ -165,22 +264,13 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
tableSearchResults.addMouseListener(popupListener);
tableSearchResults.getTableHeader().addMouseListener(popupListener);
- Toolkit t = getToolkit();
- int width = t.getScreenSize().width;
- int height = t.getScreenSize().height;
+ // for (FrequencyType ft : FrequencyType.values()) {
+ // this.editSynchronizationDialogFrequencyComboBox.addItem(ft.getReadableName());
+ // }
- // FIXME: don't build prefs panel here
+ this.remoteFileChooserDialogList.setCellRenderer(new RemoteFSChooserListCellRenderer());
+ this.remoteFileChooserDialogLookInComboBox.setRenderer(new RemoteFileChooserDialogLookInComboBoxRender());
- 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);
}
@@ -192,34 +282,42 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
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);
+ 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
@@ -244,8 +342,6 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
*/
@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);
@@ -259,7 +355,7 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
+ ts.getTotalFilesToTransfer());
lblTransferByteCounts.setText("Current File (kb):" + (ts.getBytesTransfered() / 1024) + " / "
+ (ts.getTotalSize() / 1024));
- lblCurrentFile.setText(iDropUtils.abbreviateFileName(ts.getSourceFileAbsolutePath()));
+ lblCurrentFile.setText(IDropUtils.abbreviateFileName(ts.getSourceFileAbsolutePath()));
}
});
@@ -283,7 +379,7 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
((LocalFileSystemModel) getFileTree().getModel()).notifyCompletionOfOperation(getFileTree(), ts);
}
} catch (IdropException ex) {
- Logger.getLogger(iDrop.class.getName()).log(Level.SEVERE, null, ex);
+ Logger.getLogger(IDROPDesktop.class.getName()).log(Level.SEVERE, null, ex);
this.showIdropException(ex);
}
@@ -297,7 +393,7 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
+ ts.getTotalFilesToTransfer());
lblTransferByteCounts.setText("Bytes (kb):" + (ts.getBytesTransfered() / 1024) + " / "
+ (ts.getTotalSize() / 1024));
- lblCurrentFile.setText(iDropUtils.abbreviateFileName(ts.getSourceFileAbsolutePath()));
+ lblCurrentFile.setText(IDropUtils.abbreviateFileName(ts.getSourceFileAbsolutePath()));
}
});
@@ -309,8 +405,8 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
* @param idropException
*/
public void showIdropException(Exception idropException) {
- JOptionPane
- .showMessageDialog(this, idropException.getMessage(), "iDROP Exception", JOptionPane.WARNING_MESSAGE);
+ JOptionPane.showMessageDialog(mainFrame, idropException.getMessage(), "iDROP Exception",
+ JOptionPane.WARNING_MESSAGE);
}
/**
@@ -320,12 +416,12 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
*/
public void showMessageFromOperation(final String messageFromOperation) {
- final iDrop thisIdropGui = this;
+ final IDROPDesktop thisIdropGui = this;
java.awt.EventQueue.invokeLater(new Runnable() {
@Override
public void run() {
- JOptionPane.showMessageDialog(thisIdropGui, messageFromOperation, "iDROP Message",
+ JOptionPane.showMessageDialog(mainFrame, messageFromOperation, "iDROP Message",
JOptionPane.INFORMATION_MESSAGE);
}
});
@@ -438,7 +534,7 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
/** 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 = iDrop.class.getResource(path);
+ URL imageURL = IDROPDesktop.class.getResource(path);
if (imageURL == null) {
System.err.println("Resource not found: " + path);
@@ -478,7 +574,7 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
@Override
public void actionPerformed(ActionEvent e) {
- Toolkit toolkit = getToolkit();
+ Toolkit toolkit = Toolkit.getDefaultToolkit();
if (e.getActionCommand().equals("Exit")) {
getiDropCore().getQueueTimer().cancel();
@@ -493,21 +589,21 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
log.warn("no account, exiting");
System.exit(0);
} else {
- this.setVisible(false);
+ mainFrame.setVisible(false);
}
} else if (e.getActionCommand().equals("About")) {
- AboutDialog aboutDialog = new AboutDialog(this, true);
+ AboutDialog aboutDialog = new AboutDialog(mainFrame, 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")) {
- showGUICheckBox.setSelected(getiDropCore().getPreferences().getBoolean("showGUI", true));
- newPreferencesDialog.setVisible(true);
+ ActionEvent ae = new ActionEvent(mainFrame, ActionEvent.ACTION_PERFORMED, "");
+ preferencesMenuActionListener.actionPerformed(ae);
} else if (e.getActionCommand().equals("Synch")) {
- synchSetupDialog = new SynchSetupDialog(this, getiDropCore(), getiDropCore().getIrodsFileSystem());
- synchSetupDialog.setVisible(true);
+ ActionEvent ae = new ActionEvent(mainFrame, ActionEvent.ACTION_PERFORMED, "");
+ editSynchronizationsMenuActionListener.actionPerformed(ae);
} else if (e.getActionCommand().equals("Change Password")) {
if (changePasswordDialog == null) {
@@ -526,17 +622,14 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
} else {
if (!this.formShown) {
-
showIdropGui();
-
} else {
// refresh the tree when setting visible again, the account may have changed.
-
buildTargetTree();
- this.setVisible(true);
}
- this.toFront();
+ mainFrame.setVisible(true);
+ mainFrame.toFront();
}
}
@@ -550,7 +643,7 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
queueManagerDialog.refreshTableView(QueueManagerDialog.ViewType.RECENT);
}
} catch (IdropException ex) {
- Logger.getLogger(iDrop.class.getName()).log(Level.SEVERE, null, ex);
+ Logger.getLogger(IDROPDesktop.class.getName()).log(Level.SEVERE, null, ex);
this.showIdropException(ex);
return true;
}
@@ -587,7 +680,8 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
sb.append(targetPath);
// default icon, custom title
- int n = JOptionPane.showConfirmDialog(this, sb.toString(), "Transfer Confirmaiton", JOptionPane.YES_NO_OPTION);
+ int n = JOptionPane.showConfirmDialog(mainFrame, sb.toString(), "Transfer Confirmaiton",
+ JOptionPane.YES_NO_OPTION);
return n;
}
@@ -600,7 +694,7 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
// default icon, custom title
int n = JOptionPane
.showConfirmDialog(
- this,
+ 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);
@@ -657,7 +751,7 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
iDropCore.getTransferManager().resume();
}
} catch (Exception ex) {
- Logger.getLogger(iDrop.class.getName()).log(Level.SEVERE, null, ex);
+ Logger.getLogger(IDROPDesktop.class.getName()).log(Level.SEVERE, null, ex);
}
}
@@ -668,7 +762,7 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
* synch
*/
private void handleInfoPanelShowOrHide() {
- final iDrop idropGuiReference = this;
+ final IDROPDesktop idropGuiReference = this;
java.awt.EventQueue.invokeLater(new Runnable() {
@Override
@@ -703,7 +797,7 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
}
log.info("building tree to look at local file system");
- final iDrop gui = this;
+ final IDROPDesktop gui = this;
java.awt.EventQueue.invokeLater(new Runnable() {
@@ -783,7 +877,7 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
*/
public void buildTargetTree() {
log.info("building tree to look at staging resource");
- final iDrop gui = this;
+ final IDROPDesktop gui = this;
java.awt.EventQueue.invokeLater(new Runnable() {
@@ -844,7 +938,7 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
* irodsTree.setSelectionRow(0);
*/
} catch (Exception ex) {
- Logger.getLogger(iDrop.class.getName()).log(Level.SEVERE, null, ex);
+ Logger.getLogger(IDROPDesktop.class.getName()).log(Level.SEVERE, null, ex);
throw new IdropRuntimeException(ex);
}
@@ -873,19 +967,14 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
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() {
-
-
try {
- idropGui.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
+ 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()
@@ -908,7 +997,7 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
throw new IdropRuntimeException(e);
} finally {
getiDropCore().getIrodsFileSystem().closeAndEatExceptions(getIrodsAccount());
- idropGui.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
+ mainFrame.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
}
}
@@ -934,13 +1023,12 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
}
this.lastCachedInfoItem = dataObject;
- final iDrop idropGui = this;
java.awt.EventQueue.invokeLater(new Runnable() {
@Override
public void run() {
- idropGui.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
+ mainFrame.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
lblFileOrCollectionName.setText(dataObject.getDataName());
txtParentPath.setText(dataObject.getCollectionName());
@@ -957,17 +1045,17 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
pnlInfoIcon.removeAll();
pnlInfoIcon.add(IconHelper.getFileIcon());
pnlInfoIcon.validate();
- lblInfoCreatedAtValue.setText(df.format(dataObject.getCreatedAt()));
- lblInfoUpdatedAtValue.setText(df.format(dataObject.getUpdatedAt()));
+ lblInfoCreatedAtValue.setText(Constants.df.format(dataObject.getCreatedAt()));
+ lblInfoUpdatedAtValue.setText(Constants.df.format(dataObject.getUpdatedAt()));
lblInfoLengthValue.setText(String.valueOf(dataObject.getDataSize()));
lblInfoLengthValue.setVisible(true);
lblInfoLength.setVisible(true);
} catch (JargonException ex) {
- Logger.getLogger(iDrop.class.getName()).log(Level.SEVERE, null, ex);
+ Logger.getLogger(IDROPDesktop.class.getName()).log(Level.SEVERE, null, ex);
throw new IdropRuntimeException(ex);
} finally {
getiDropCore().getIrodsFileSystem().closeAndEatExceptions(getIrodsAccount());
- idropGui.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
+ mainFrame.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
}
}
});
@@ -993,14 +1081,13 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
}
this.lastCachedInfoItem = collection;
- final iDrop idropGui = this;
java.awt.EventQueue.invokeLater(new Runnable() {
@Override
public void run() {
- idropGui.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
+ mainFrame.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
lblFileOrCollectionName.setText(collection.getCollectionLastPathComponent());
txtParentPath.setText(collection.getCollectionParentName());
@@ -1017,16 +1104,16 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
pnlInfoIcon.removeAll();
pnlInfoIcon.add(IconHelper.getFolderIcon());
pnlInfoIcon.validate();
- lblInfoCreatedAtValue.setText(df.format(collection.getCreatedAt()));
- lblInfoUpdatedAtValue.setText(df.format(collection.getModifiedAt()));
+ lblInfoCreatedAtValue.setText(Constants.df.format(collection.getCreatedAt()));
+ lblInfoUpdatedAtValue.setText(Constants.df.format(collection.getModifiedAt()));
lblInfoLengthValue.setVisible(false);
lblInfoLength.setVisible(false);
} catch (JargonException ex) {
- Logger.getLogger(iDrop.class.getName()).log(Level.SEVERE, null, ex);
+ Logger.getLogger(IDROPDesktop.class.getName()).log(Level.SEVERE, null, ex);
throw new IdropRuntimeException(ex);
} finally {
getiDropCore().getIrodsFileSystem().closeAndEatExceptions(getIrodsAccount());
- idropGui.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
+ mainFrame.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
}
}
});
@@ -1149,6 +1236,15 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
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);
+
+ 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();
@@ -1162,10 +1258,12 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
});
searchTablePopupMenu.add(menuItemShowInHierarchy);
- 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() {
+ 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() {
public void windowClosed(java.awt.event.WindowEvent evt) {
formWindowClosed(evt);
}
@@ -1244,7 +1342,7 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
pnlIrodsDetailsToggleSizer.setLayout(new java.awt.BorderLayout());
toggleIrodsDetails.setToolTipText("Browse the local file system.");
- toggleIrodsDetails.setLabel("iRODS Info >>>>");
+ toggleIrodsDetails.setText("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));
@@ -1265,7 +1363,7 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
iDropToolbar.add(pnlToolbarSizer, java.awt.BorderLayout.NORTH);
- getContentPane().add(iDropToolbar, java.awt.BorderLayout.NORTH);
+ mainFrame.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));
@@ -1303,7 +1401,7 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
pnlRefreshButton.setMinimumSize(new java.awt.Dimension(0, 0));
pnlRefreshButton.setPreferredSize(new java.awt.Dimension(101, 30));
- btnRefreshLocalDrives.setLabel("Refresh");
+ btnRefreshLocalDrives.setText("Refresh");
btnRefreshLocalDrives.setMaximumSize(new java.awt.Dimension(200, 50));
btnRefreshLocalDrives.setMinimumSize(new java.awt.Dimension(0, 0));
btnRefreshLocalDrives.addActionListener(new java.awt.event.ActionListener() {
@@ -1649,7 +1747,7 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
pnlIdropMain.add(jSplitPanelLocalRemote);
- getContentPane().add(pnlIdropMain, java.awt.BorderLayout.CENTER);
+ mainFrame.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");
@@ -1749,7 +1847,7 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
gridBagConstraints.gridy = 1;
pnlIdropBottom.add(transferQueueToolbarPanel, gridBagConstraints);
- getContentPane().add(pnlIdropBottom, java.awt.BorderLayout.SOUTH);
+ mainFrame.getContentPane().add(pnlIdropBottom, java.awt.BorderLayout.SOUTH);
jMenuFile.setMnemonic('f');
jMenuFile.setText("File");
@@ -1768,6 +1866,10 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
jMenuEdit.setMnemonic('E');
jMenuEdit.setText("Edit");
+
+ jMenuEdit.add(jMenuItemEditSynchronizations);
+ jMenuEdit.add(jMenuItemPreferences);
+
jMenuBar1.add(jMenuEdit);
jMenuView.setMnemonic('V');
@@ -1795,9 +1897,20 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
jMenuBar1.add(jMenuView);
- setJMenuBar(jMenuBar1);
+ 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);
- pack();
}// </editor-fold>//GEN-END:initComponents
private void btnShowTransferManagerActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_btnShowTransferManagerActionPerformed
@@ -1821,31 +1934,12 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
iDropCore.getTransferManager().resume();
}
} catch (Exception ex) {
- Logger.getLogger(iDrop.class.getName()).log(Level.SEVERE, null, ex);
+ Logger.getLogger(IDROPDesktop.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
- this.setVisible(false);
+ mainFrame.setVisible(false);
this.formShown = false;
}// GEN-LAST:event_formWindowClosed
@@ -1886,7 +1980,7 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
}// GEN-LAST:event_jCheckBoxMenuItemShowSourceTreeActionPerformed
private void jMenuItemExitActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_jMenuItemExitActionPerformed
- this.setVisible(false);
+ mainFrame.setVisible(false);
}// GEN-LAST:event_jMenuItemExitActionPerformed
/**
@@ -1921,7 +2015,7 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
final Enumeration<TreePath> pathsToExpand = currentPaths;
fileTree.expandTreeNodesBasedOnListOfPreviouslyExpandedNodes(pathsToExpand);
} catch (IdropException ex) {
- Logger.getLogger(iDrop.class.getName()).log(Level.SEVERE, null, ex);
+ Logger.getLogger(IDROPDesktop.class.getName()).log(Level.SEVERE, null, ex);
throw new IdropRuntimeException("exception expanding tree nodes", ex);
}
@@ -2040,8 +2134,15 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
throw new IdropRuntimeException("unknown type of object displayed in info area");
}
- replicationDialog.setLocation((int) (this.getLocation().getX() + replicationDialog.getWidth() / 2), (int) (this
- .getLocation().getY() + replicationDialog.getHeight() / 2));
+ 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.setVisible(true);
}// GEN-LAST:event_btnReplicationActionPerformed
@@ -2069,8 +2170,15 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
throw new IdropRuntimeException("unknown type of object displayed in info area");
}
- metadataViewDialog.setLocation((int) (this.getLocation().getX() + metadataViewDialog.getWidth() / 2),
- (int) (this.getLocation().getY() + metadataViewDialog.getHeight() / 2));
+ 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.setVisible(true);
}// GEN-LAST:event_btnViewMetadataActionPerformed
@@ -2084,7 +2192,7 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
// initialize a variable with the last item visible to the runnable
final Object lastCachedItemToProcessTagsFor = this.lastCachedInfoItem;
- final iDrop idropGui = this;
+ final IDROPDesktop idropGui = this;
java.awt.EventQueue.invokeLater(new Runnable() {
@@ -2122,13 +2230,13 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
} catch (JargonException ex) {
idropGui.showIdropException(ex);
- Logger.getLogger(iDrop.class.getName()).log(Level.SEVERE, null, ex);
+ Logger.getLogger(IDROPDesktop.class.getName()).log(Level.SEVERE, null, ex);
throw new IdropRuntimeException(ex);
} finally {
try {
getiDropCore().getIrodsFileSystem().close(getIrodsAccount());
} catch (JargonException ex) {
- Logger.getLogger(iDrop.class.getName()).log(Level.SEVERE, null, ex);
+ Logger.getLogger(IDROPDesktop.class.getName()).log(Level.SEVERE, null, ex);
// logged and ignored
}
idropGui.setNormalCursor();
@@ -2159,7 +2267,7 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
try {
selPath = TreeUtils.buildTreePathForIrodsAbsolutePath(irodsTree, entry.getFormattedAbsolutePath());
} catch (IdropException ex) {
- Logger.getLogger(iDrop.class.getName()).log(Level.SEVERE, null, ex);
+ Logger.getLogger(IDROPDesktop.class.getName()).log(Level.SEVERE, null, ex);
this.showMessageFromOperation("That collection or file is not visible in the context of the current tree");
return;
}
@@ -2191,6 +2299,8 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
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.JMenu jMenuFile;
private javax.swing.JMenuItem jMenuItemExit;
private javax.swing.JMenu jMenuView;
@@ -2265,7 +2375,7 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
private javax.swing.JTable tableSearchResults;
private javax.swing.JToggleButton toggleIrodsDetails;
private javax.swing.JToggleButton toggleLocalFiles;
- private javax.swing.JToggleButton togglePauseTransfer;
+ public javax.swing.JToggleButton togglePauseTransfer;
private javax.swing.JToolBar toolBarInfo;
private javax.swing.JPanel transferQueueToolbarPanel;
private javax.swing.JProgressBar transferStatusProgressBar;
@@ -2287,7 +2397,6 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
}
final String searchTerms = searchText.trim();
- final iDrop idropGui = this;
java.awt.EventQueue.invokeLater(new Runnable() {
@@ -2295,7 +2404,7 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
public void run() {
try {
- idropGui.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
+ mainFrame.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
CollectionAndDataObjectListAndSearchAO collectionAndDataObjectListAndSearchAO = iDropCore
.getIRODSAccessObjectFactory().getCollectionAndDataObjectListAndSearchAO(
iDropCore.getIrodsAccount());
@@ -2305,11 +2414,11 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
tableSearchResults.setModel(irodsSearchTableModel);
tabIrodsViews.setSelectedComponent(pnlTabSearch);
} catch (Exception e) {
- idropGui.showIdropException(e);
+ showIdropException(e);
return;
} finally {
iDropCore.closeAllIRODSConnections();
- idropGui.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
+ mainFrame.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
}
}
});
@@ -2322,7 +2431,6 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
}
final String searchTerms = searchText.trim();
- final iDrop idropGui = this;
java.awt.EventQueue.invokeLater(new Runnable() {
@@ -2330,7 +2438,7 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
public void run() {
try {
- idropGui.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
+ mainFrame.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
FreeTaggingService freeTaggingService = FreeTaggingServiceImpl.instance(
iDropCore.getIRODSAccessObjectFactory(), getIrodsAccount());
TagQuerySearchResult result = freeTaggingService.searchUsingFreeTagString(searchTerms);
@@ -2339,11 +2447,11 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
tableSearchResults.setModel(irodsSearchTableModel);
tabIrodsViews.setSelectedComponent(pnlTabSearch);
} catch (Exception e) {
- idropGui.showIdropException(e);
+ showIdropException(e);
return;
} finally {
iDropCore.closeIRODSConnectionForLoggedInAccount();
- idropGui.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
+ mainFrame.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
}
}
});
@@ -2379,11 +2487,11 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
}
public void setBusyCursor() {
- this.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
+ mainFrame.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
}
public void setNormalCursor() {
- this.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
+ mainFrame.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
}
public LocalFileTree getFileTree() {
@@ -2393,4 +2501,18 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
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/IDROPSplashWindow.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/IDROPSplashWindow.java
new file mode 100644
index 0000000..a70d26c
--- /dev/null
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/IDROPSplashWindow.java
@@ -0,0 +1,506 @@
+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_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 static org.irods.jargon.idrop.desktop.systraygui.Constants.PREFERENCE_KEY_FIRST_TIME_RUN;
+import static org.irods.jargon.idrop.desktop.systraygui.Constants.PREF_LOGIN_HOST;
+import static org.irods.jargon.idrop.desktop.systraygui.Constants.PREF_LOGIN_PORT;
+import static org.irods.jargon.idrop.desktop.systraygui.Constants.PREF_LOGIN_RESOURCE;
+import static org.irods.jargon.idrop.desktop.systraygui.Constants.PREF_LOGIN_USERNAME;
+import static org.irods.jargon.idrop.desktop.systraygui.Constants.PREF_LOGIN_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.Toolkit;
+import java.awt.event.ActionListener;
+import java.awt.event.KeyListener;
+import java.awt.event.MouseListener;
+import java.awt.event.WindowListener;
+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.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.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 JCheckBox preferencesDialogShowHiddenFilesCheckBox, preferencesDialogShowUICheckBox,
+ preferencesDialogShowPreferencesCheckBox, preferencesDialogShowSplashScreenCheckBox;
+
+ public JList remoteFileChooserDialogList;
+
+ public JTextField loginDialogHostTextField, loginDialogZoneTextField, loginDialogResourceTextField,
+ loginDialogPortTextField, loginDialogUsernameTextField, preferencesDialogDeviceNameTextField,
+ preferencesDialogDefaultLocalDirectoryTextField;
+
+ public JPasswordField loginDialogPasswordPasswordField;
+
+ public JTextField editSynchronizationDialogLocalPathTextField, editSynchronizationDialogNameTextField,
+ editSynchronizationDialogRemotePathTextField, remoteFileChooserDialogFileNameTextField,
+ editSynchronizationDialogDeviceNameTextField;
+
+ public JDialog preferencesDialog, loginDialog, editSynchronizationDialog, remoteFileChooserDialog;
+
+ public DefaultListModel remoteFileChooserDialogListModel;
+
+ public JButton editSynchronizationDialogSaveButton, editSynchronizationDialogCancelButton,
+ editSynchronizationDialogRemotePathBrowseButton, editSynchronizationDialogLocalPathBrowseButton,
+ remoteFileChooserDialogNewFolderButton, remoteFileChooserDialogUpFolderButton,
+ remoteFileChooserDialogHomeFolderButton, remoteFileChooserDialogListViewButton,
+ remoteFileChooserDialogDetailsViewButton, remoteFileChooserDialogOpenButton,
+ remoteFileChooserDialogCancelButton, loginDialogOKButton, preferencesDialogDefaultLocalDirectoryButton;
+
+ public JFileChooser editSynchronizationDialogLocalPathFileChooser, editSynchronizationDialogRemotePathFileChooser,
+ preferencesDialogDefaultLocalDirectoryFileChooser;
+
+ public JComboBox remoteFileChooserDialogFileTypeComboBox, remoteFileChooserDialogLookInComboBox;
+
+ public IDROPSplashWindow() {
+ super();
+ try {
+ init();
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ /**
+ * 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);
+ 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
+ */
+
+ setStatus("Checking preferences...", ++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) {
+ java.util.logging.Logger.getLogger(IDROPSplashWindow.class.getName()).log(Level.SEVERE, null, ex);
+ throw new IdropRuntimeException(ex);
+ }
+
+ log.info("config properties derived...");
+ idropCore.setIdropConfig(new IdropConfig(derivedProperties));
+ idropCore.getIdropConfig().setUpLogging();
+
+ log.info("logging in in splash background thread");
+ setStatus("Logging in...", ++count);
+
+
+ String host = idropCore.getPreferences().get(PREF_LOGIN_HOST, null);
+ if (StringUtils.isNotEmpty(host)) {
+ loginDialogHostTextField.setText(host);
+ }
+
+ String zone = idropCore.getPreferences().get(PREF_LOGIN_ZONE, null);
+ if (StringUtils.isNotEmpty(zone)) {
+ loginDialogZoneTextField.setText(zone);
+ }
+
+ String resource = idropCore.getPreferences().get(PREF_LOGIN_RESOURCE, null);
+ if (StringUtils.isNotEmpty(resource)) {
+ loginDialogResourceTextField.setText(resource);
+ }
+
+ String username = idropCore.getPreferences().get(PREF_LOGIN_USERNAME, null);
+ if (StringUtils.isNotEmpty(username)) {
+ loginDialogUsernameTextField.setText(username);
+ }
+
+ String port = idropCore.getPreferences().get(PREF_LOGIN_PORT, null);
+ if (StringUtils.isNotEmpty(port)) {
+ loginDialogPortTextField.setText(port);
+ }
+
+ 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();
+
+ // 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());
+
+ prefs.putBoolean(PREFERENCE_KEY_FIRST_TIME_RUN, false);
+
+ super.done();
+
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see java.lang.Runnable#run()
+ */
+ public void run() {
+ Task t = new Task();
+ try {
+ t.execute();
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ /**
+ *
+ * @param msg
+ * @param value
+ */
+ 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;
+ }
+
+ /**
+ * @param desktop
+ * the desktop to set
+ */
+ public void setDesktop(IDROPDesktop desktop) {
+ this.desktop = desktop;
+ }
+
+}
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
deleted file mode 100644
index a65342b..0000000
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/IDropSplashWindow.java
+++ /dev/null
@@ -1,92 +0,0 @@
-package org.irods.jargon.idrop.desktop.systraygui;
-
-import java.awt.BorderLayout;
-import java.awt.Toolkit;
-
-import javax.swing.ImageIcon;
-import javax.swing.JLabel;
-import javax.swing.JProgressBar;
-import javax.swing.JWindow;
-
-import org.irods.jargon.idrop.exceptions.IdropRuntimeException;
-import org.slf4j.LoggerFactory;
-
-/**
- *
- * @author jdr0887
- */
-public class IDropSplashWindow extends JWindow {
-
- /**
- *
- */
- private static final long serialVersionUID = 1L;
-
- private final org.slf4j.Logger log = LoggerFactory.getLogger(IDropSplashWindow.class);
-
- private ImageIcon splashImage = new ImageIcon(IDropSplashWindow.class.getClassLoader().getResource(
- "org/irods/jargon/idrop/desktop/images/iDrop.png"));
-
- private JLabel jlblImage = new JLabel();
-
- private JProgressBar jProgressBar1 = new JProgressBar();
-
- private iDrop iDrop;
-
- public IDropSplashWindow(iDrop iDrop) {
- super(iDrop);
- this.iDrop = iDrop;
- try {
- init();
- } catch (Exception e) {
- log.error("error initializing iDrop splash window", e);
- throw new IdropRuntimeException(e);
- }
- }
-
- /**
- * This method stores all initialization commands for the window.
- */
- private void init() throws Exception {
- // 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
- * 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) {
-
- java.awt.EventQueue.invokeLater(new Runnable() {
-
- @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 81aeda3..7660fe9 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 iDrop iDrop = null;
+ private IDROPDesktop iDrop = null;
public static org.slf4j.Logger log = LoggerFactory.getLogger(LoginDialog.class);
- public LoginDialog(iDrop iDrop) {
- super(iDrop, true);
+ public LoginDialog(IDROPDesktop iDrop) {
+ super(iDrop.mainFrame, true);
this.iDrop = iDrop;
initComponents();
@@ -59,7 +59,7 @@ public class LoginDialog extends JDialog {
}
- private void loginNormally(org.irods.jargon.idrop.desktop.systraygui.iDrop iDrop) {
+ private void loginNormally(org.irods.jargon.idrop.desktop.systraygui.IDROPDesktop 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 522817d..473464b 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 iDrop idropGui;
+ private final IDROPDesktop 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 iDrop idropGui, final IRODSAccount irodsAccount, final String absolutePath) {
- super(idropGui, true);
+ public MetadataViewDialog(final IDROPDesktop idropGui, final IRODSAccount irodsAccount, final String absolutePath) {
+ super(idropGui.mainFrame, 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 iDrop idropGui, final IRODSAccount irodsAccount, final String absolutePath,
+ public MetadataViewDialog(final IDROPDesktop idropGui, final IRODSAccount irodsAccount, final String absolutePath,
final String fileName) {
- super(idropGui, true);
+ super(idropGui.mainFrame, 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 4f8f5bd..1a677ea 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,20 +37,28 @@ import org.slf4j.LoggerFactory;
*/
public class MoveOrCopyiRODSDialog extends javax.swing.JDialog {
- private final iDrop idrop;
+ private final IDROPDesktop 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 iDrop parent, final boolean modal, final IRODSNode targetNode,
+ public MoveOrCopyiRODSDialog(final IDROPDesktop parent, final boolean modal, final IRODSNode targetNode,
final IRODSTree stagingViewTree, final IRODSFile sourceFile, final String targetAbsolutePath,
final boolean isCopy) {
- super(parent, modal);
+ super(parent.mainFrame, modal);
this.idrop = parent;
this.targetNode = targetNode;
this.stagingViewTree = stagingViewTree;
@@ -62,10 +70,10 @@ public class MoveOrCopyiRODSDialog extends javax.swing.JDialog {
initializeDialog();
}
- public MoveOrCopyiRODSDialog(final iDrop parent, final boolean modal, final IRODSNode targetNode,
+ public MoveOrCopyiRODSDialog(final IDROPDesktop parent, final boolean modal, final IRODSNode targetNode,
final IRODSTree stagingViewTree, final List<IRODSFile> sourceFiles, final String targetAbsolutePath,
final boolean isCopy) {
- super(parent, modal);
+ super(parent.mainFrame, modal);
this.idrop = parent;
this.targetNode = targetNode;
this.stagingViewTree = stagingViewTree;
@@ -314,7 +322,8 @@ 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));
@@ -399,7 +408,8 @@ 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();
@@ -411,8 +421,9 @@ 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) {
@@ -434,8 +445,10 @@ 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 2991a8c..8e3c099 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 iDrop idrop;
+ private final IDROPDesktop idrop;
private String parentDirectory = "";
@@ -58,9 +58,9 @@ public class NewIRODSDirectoryDialog extends javax.swing.JDialog {
}
/** Creates new form NewIRODSDirectoryDialog */
- public NewIRODSDirectoryDialog(final iDrop parent, final boolean modal, final String parentDirectory,
+ public NewIRODSDirectoryDialog(final IDROPDesktop parent, final boolean modal, final String parentDirectory,
final IRODSTree stagingViewTree, final IRODSNode parentNode) {
- super(parent, modal);
+ super(parent.mainFrame, 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 c0b9324..089dc89 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 iDrop idrop;
+ private final IDROPDesktop idrop;
private String parentDirectory = "";
@@ -44,9 +44,9 @@ public class NewLocalDirectoryDialog extends javax.swing.JDialog {
}
/** Creates new form NewIRODSDirectoryDialog */
- public NewLocalDirectoryDialog(final iDrop parent, final boolean modal, final String parentDirectory,
+ public NewLocalDirectoryDialog(final IDROPDesktop parent, final boolean modal, final String parentDirectory,
final LocalFileTree localFileTree, final LocalFileNode parentNode) {
- super(parent, modal);
+ super(parent.mainFrame, 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 cbaf3cc..ccc8f00 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 iDrop iDropParent = null;
+ private IDROPDesktop 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 iDrop iDropParent, final TransferManager transferManager, final ViewType viewType)
+ public QueueManagerDialog(final IDROPDesktop 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(iDrop.class.getName()).log(Level.SEVERE, null, ex);
+ Logger.getLogger(IDROPDesktop.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 7f07d2f..b4ba595 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(iDrop.class);
+ private final org.slf4j.Logger logger = LoggerFactory.getLogger(IDROPDesktop.class);
- private iDrop iDrop;
+ private IDROPDesktop iDrop;
- public QueueTimerTaskThread(iDrop iDrop) {
+ public QueueTimerTaskThread(IDROPDesktop iDrop) {
super();
this.iDrop = iDrop;
}
@@ -23,7 +23,7 @@ public class QueueTimerTaskThread extends Thread {
try {
QueueSchedulerTimerTask queueTimerTask = new QueueSchedulerTimerTask(iDrop.getiDropCore()
- .getTransferManager(), iDrop);
+ .getTransferManager(), iDrop.mainFrame);
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 40c7bf7..b57cf6c 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
@@ -38,7 +38,7 @@ import org.slf4j.LoggerFactory;
*/
public class RenameIRODSDirectoryDialog extends javax.swing.JDialog {
- private final iDrop idrop;
+ private final IDROPDesktop idrop;
private final String currentAbsolutePath;
@@ -49,9 +49,9 @@ public class RenameIRODSDirectoryDialog extends javax.swing.JDialog {
public static org.slf4j.Logger log = LoggerFactory.getLogger(RenameIRODSDirectoryDialog.class);
/** Creates new form NewIRODSDirectoryDialog */
- public RenameIRODSDirectoryDialog(final iDrop parent, final boolean modal, final String currentAbsolutePath,
+ public RenameIRODSDirectoryDialog(final IDROPDesktop parent, final boolean modal, final String currentAbsolutePath,
final IRODSTree stagingViewTree, final IRODSNode currentNode) {
- super(parent, modal);
+ super(parent.mainFrame, modal);
this.idrop = parent;
this.currentAbsolutePath = currentAbsolutePath;
this.stagingViewTree = stagingViewTree;
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 89bce61..af9ba8a 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 iDrop idrop;
+ private final IDROPDesktop 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 iDrop parent, final boolean modal, final String currentAbsolutePath,
+ public RenameLocalDirectoryDialog(final IDROPDesktop parent, final boolean modal, final String currentAbsolutePath,
final LocalFileTree localFileTree, final LocalFileNode currentNode) {
- super(parent, modal);
+ super(parent.mainFrame, 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 f3ae4f8..b2683da 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 iDrop idropParentGui;
+ private final IDROPDesktop 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(iDrop idropParentGui, boolean modal, String seriesAbsolutePath) {
- super(idropParentGui, modal);
+ public ReplicationDialog(IDROPDesktop idropParentGui, boolean modal, String seriesAbsolutePath) {
+ super(idropParentGui.mainFrame, 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(iDrop idropParentGui, boolean modal, String fileAbsolutePath, String fileName) {
- super(idropParentGui, modal);
+ public ReplicationDialog(IDROPDesktop idropParentGui, boolean modal, String fileAbsolutePath, String fileName) {
+ super(idropParentGui.mainFrame, 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
deleted file mode 100644
index a92068f..0000000
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/StartupSequencer.java
+++ /dev/null
@@ -1,243 +0,0 @@
-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
deleted file mode 100644
index 09e2c57..0000000
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/SynchSetupDialog.form
+++ /dev/null
@@ -1,153 +0,0 @@
-<?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
deleted file mode 100644
index 6981b9e..0000000
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/SynchSetupDialog.java
+++ /dev/null
@@ -1,272 +0,0 @@
-/*
- * 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/components/RemoteFSChooserListCellRenderer.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/components/RemoteFSChooserListCellRenderer.java
new file mode 100644
index 0000000..f6dcb6d
--- /dev/null
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/components/RemoteFSChooserListCellRenderer.java
@@ -0,0 +1,55 @@
+package org.irods.jargon.idrop.desktop.systraygui.components;
+
+import static org.irods.jargon.core.query.CollectionAndDataObjectListingEntry.ObjectType.DATA_OBJECT;
+
+import java.awt.Component;
+
+import javax.swing.DefaultListCellRenderer;
+import javax.swing.Icon;
+import javax.swing.JLabel;
+import javax.swing.JList;
+import javax.swing.UIManager;
+
+import org.irods.jargon.core.query.CollectionAndDataObjectListingEntry;
+
+/**
+ *
+ * @author jdr0887
+ *
+ */
+public class RemoteFSChooserListCellRenderer extends DefaultListCellRenderer {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1L;
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see javax.swing.DefaultListCellRenderer#getListCellRendererComponent(javax.swing.JList, java.lang.Object, int,
+ * boolean, boolean)
+ */
+ @Override
+ public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected,
+ boolean hasFocus) {
+
+ JLabel label = (JLabel) super.getListCellRendererComponent(list, value, index, isSelected, hasFocus);
+ if (value instanceof CollectionAndDataObjectListingEntry) {
+ CollectionAndDataObjectListingEntry entry = (CollectionAndDataObjectListingEntry) value;
+
+ Icon icon = null;
+ if (!DATA_OBJECT.equals(entry.getObjectType())) {
+ icon = UIManager.getIcon("FileView.directoryIcon");
+ } else {
+ icon = UIManager.getIcon("FileView.fileIcon");
+ }
+
+ label.setIcon(icon);
+ } else {
+ label.setIcon(null);
+ }
+ return (label);
+ }
+
+}
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/components/RemoteFileChooserDialogLookInComboBoxRender.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/components/RemoteFileChooserDialogLookInComboBoxRender.java
new file mode 100644
index 0000000..f69a35d
--- /dev/null
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/components/RemoteFileChooserDialogLookInComboBoxRender.java
@@ -0,0 +1,35 @@
+package org.irods.jargon.idrop.desktop.systraygui.components;
+
+import java.awt.Component;
+
+import javax.swing.BorderFactory;
+import javax.swing.DefaultListCellRenderer;
+import javax.swing.Icon;
+import javax.swing.JLabel;
+import javax.swing.JList;
+import javax.swing.UIManager;
+
+/**
+ *
+ * @author jdr0887
+ *
+ */
+public class RemoteFileChooserDialogLookInComboBoxRender extends DefaultListCellRenderer {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1L;
+
+ public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected,
+ boolean hasFocus) {
+ JLabel label = (JLabel) super.getListCellRendererComponent(list, value, index, isSelected, hasFocus);
+ if (value != null && value instanceof String) {
+ Icon icon = UIManager.getIcon("FileView.directoryIcon");
+ label.setIcon(icon);
+ label.setBorder(BorderFactory.createEmptyBorder(0, index * 8, 0, 0));
+ }
+ return (label);
+ }
+
+}
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
new file mode 100644
index 0000000..fb07f82
--- /dev/null
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/EditSynchronizationDialogCancelActionListener.java
@@ -0,0 +1,23 @@
+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
new file mode 100644
index 0000000..af5cf65
--- /dev/null
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/EditSynchronizationDialogLocalPathBrowseActionListener.java
@@ -0,0 +1,54 @@
+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
new file mode 100644
index 0000000..6b5d315
--- /dev/null
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/EditSynchronizationDialogRemotePathBrowseActionListener.java
@@ -0,0 +1,58 @@
+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
new file mode 100644
index 0000000..5e4e164
--- /dev/null
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/EditSynchronizationDialogSaveActionListener.java
@@ -0,0 +1,105 @@
+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
new file mode 100644
index 0000000..3164a24
--- /dev/null
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/EditSynchronizationsDialogDeleteActionListener.java
@@ -0,0 +1,48 @@
+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
new file mode 100644
index 0000000..600a3e5
--- /dev/null
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/EditSynchronizationsDialogEditActionListener.java
@@ -0,0 +1,62 @@
+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
new file mode 100644
index 0000000..37e2d77
--- /dev/null
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/EditSynchronizationsDialogNewActionListener.java
@@ -0,0 +1,31 @@
+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/EditSynchronizationsMenuActionListener.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/EditSynchronizationsMenuActionListener.java
new file mode 100644
index 0000000..b3a1250
--- /dev/null
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/EditSynchronizationsMenuActionListener.java
@@ -0,0 +1,49 @@
+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
new file mode 100644
index 0000000..723e51d
--- /dev/null
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/LoginCancelActionListener.java
@@ -0,0 +1,29 @@
+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
new file mode 100644
index 0000000..cf5e7fe
--- /dev/null
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/LoginDialogEnterKeyListener.java
@@ -0,0 +1,31 @@
+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
new file mode 100644
index 0000000..d4b0741
--- /dev/null
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/LoginDialogWindowListener.java
@@ -0,0 +1,14 @@
+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
new file mode 100644
index 0000000..e6239f8
--- /dev/null
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/LoginOKActionListener.java
@@ -0,0 +1,146 @@
+package org.irods.jargon.idrop.desktop.systraygui.listeners;
+
+import static org.irods.jargon.idrop.desktop.systraygui.Constants.PREF_LOGIN_HOST;
+import static org.irods.jargon.idrop.desktop.systraygui.Constants.PREF_LOGIN_PORT;
+import static org.irods.jargon.idrop.desktop.systraygui.Constants.PREF_LOGIN_RESOURCE;
+import static org.irods.jargon.idrop.desktop.systraygui.Constants.PREF_LOGIN_USERNAME;
+import static org.irods.jargon.idrop.desktop.systraygui.Constants.PREF_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(PREF_LOGIN_HOST, host);
+ splash.getDesktop().getiDropCore().getPreferences().put(PREF_LOGIN_ZONE, zone);
+ splash.getDesktop().getiDropCore().getPreferences().put(PREF_LOGIN_RESOURCE, resource);
+ splash.getDesktop().getiDropCore().getPreferences().put(PREF_LOGIN_USERNAME, username);
+ splash.getDesktop().getiDropCore().getPreferences().put(PREF_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
new file mode 100644
index 0000000..224aebe
--- /dev/null
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/PreferencesDialogCancelActionListener.java
@@ -0,0 +1,26 @@
+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
new file mode 100644
index 0000000..26aada9
--- /dev/null
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/PreferencesDialogDefaultLocalDirectoryActionListener.java
@@ -0,0 +1,57 @@
+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
new file mode 100644
index 0000000..8b3301d
--- /dev/null
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/PreferencesDialogSaveActionListener.java
@@ -0,0 +1,78 @@
+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 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);
+
+ 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);
+
+ // if (!showHiddenFiles && StringUtils.isNotEmpty(defaultLocalDir)) {
+ // desktop.localFSTreeTableModel = new LocalFSTreeTableModel(new File(defaultLocalDir),
+ // desktop.hiddenFileFilenameFilter);
+ // }
+ //
+ // if (showHiddenFiles && StringUtils.isNotEmpty(defaultLocalDir)) {
+ // desktop.localFSTreeTableModel = new LocalFSTreeTableModel(new File(defaultLocalDir));
+ // }
+ //
+ // if (!showHiddenFiles && StringUtils.isEmpty(defaultLocalDir)) {
+ // desktop.localFSTreeTableModel = new LocalFSTreeTableModel(desktop.hiddenFileFilenameFilter);
+ // }
+ //
+ // if (showHiddenFiles && StringUtils.isEmpty(defaultLocalDir)) {
+ // desktop.localFSTreeTableModel = new LocalFSTreeTableModel();
+ // }
+
+ // desktop.localFSTreeTable.setModel(new TreeTableModelAdapter(desktop.localFSTreeTableModel,
+ // new TreeTableCellRenderer(desktop.localFSTreeTable, desktop.localFSTreeTableModel)));
+ //
+ // desktop.localFSTreeTable = new LocalFSTreeTable(desktop);
+ //
+ // desktop.localFSTreeTable.setDragEnabled(true);
+ // desktop.localFSTreeTable.setDropMode(DropMode.INSERT_ROWS);
+ // desktop.localFSTreeTable.setSelectionMode(ListSelectionModel.SINGLE_INTERVAL_SELECTION);
+ // TransferHandler handler = new LocalFSTreeTableTransferHandler(desktop);
+ // desktop.localFSTreeTable.setTransferHandler(handler);
+ //
+ // desktop.localFSTreeTable.getColumn("Name").setPreferredWidth(230);
+ // desktop.localFSTreeTable.getColumn("Size").setPreferredWidth(70);
+ // desktop.localFSTreeTable.getColumn("Type").setPreferredWidth(65);
+ // desktop.localFSTreeTable.getColumn("Modified").setPreferredWidth(95);
+ //
+ // desktop.localFSTreeTable.setFillsViewportHeight(true);
+ // desktop.localFSTreeTableScrollPane.getViewport().removeAll();
+ // desktop.localFSTreeTableScrollPane.getViewport().add(desktop.localFSTreeTable);
+
+ 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
new file mode 100644
index 0000000..275ea03
--- /dev/null
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/PreferencesMenuActionListener.java
@@ -0,0 +1,57 @@
+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.preferencesDialogShowPreferencesCheckBox.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
new file mode 100644
index 0000000..02a4aa6
--- /dev/null
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/RemoteFileChooserDialogCancelActionListener.java
@@ -0,0 +1,23 @@
+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
new file mode 100644
index 0000000..4e116e4
--- /dev/null
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/RemoteFileChooserDialogDetailsViewActionListener.java
@@ -0,0 +1,23 @@
+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
new file mode 100644
index 0000000..356d38e
--- /dev/null
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/RemoteFileChooserDialogFileTypeActionListener.java
@@ -0,0 +1,23 @@
+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
new file mode 100644
index 0000000..c0f1f07
--- /dev/null
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/RemoteFileChooserDialogHomeFolderActionListener.java
@@ -0,0 +1,23 @@
+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
new file mode 100644
index 0000000..ac560cd
--- /dev/null
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/RemoteFileChooserDialogListMouseListener.java
@@ -0,0 +1,101 @@
+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
new file mode 100644
index 0000000..e21ddbd
--- /dev/null
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/RemoteFileChooserDialogListViewActionListener.java
@@ -0,0 +1,23 @@
+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
new file mode 100644
index 0000000..aaef165
--- /dev/null
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/RemoteFileChooserDialogLookInActionListener.java
@@ -0,0 +1,58 @@
+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
new file mode 100644
index 0000000..b71f9c0
--- /dev/null
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/RemoteFileChooserDialogNewFolderActionListener.java
@@ -0,0 +1,23 @@
+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
new file mode 100644
index 0000000..a9c968b
--- /dev/null
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/RemoteFileChooserDialogOpenActionListener.java
@@ -0,0 +1,23 @@
+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
new file mode 100644
index 0000000..1a61bf3
--- /dev/null
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/RemoteFileChooserDialogUpFolderActionListener.java
@@ -0,0 +1,84 @@
+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
new file mode 100644
index 0000000..d1b90c4
--- /dev/null
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/StartupEditSynchronizationDialogCancelActionListener.java
@@ -0,0 +1,23 @@
+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);
+ System.exit(0);
+ }
+
+}
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
new file mode 100644
index 0000000..e67dbfb
--- /dev/null
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/StartupEditSynchronizationDialogLocalPathBrowseActionListener.java
@@ -0,0 +1,54 @@
+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
new file mode 100644
index 0000000..bc91e71
--- /dev/null
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/StartupEditSynchronizationDialogRemotePathBrowseActionListener.java
@@ -0,0 +1,58 @@
+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
new file mode 100644
index 0000000..de32f05
--- /dev/null
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/StartupEditSynchronizationDialogSaveActionListener.java
@@ -0,0 +1,146 @@
+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
new file mode 100644
index 0000000..2fe6d51
--- /dev/null
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/StartupPreferencesDialogCancelActionListener.java
@@ -0,0 +1,28 @@
+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
new file mode 100644
index 0000000..b0f8c2f
--- /dev/null
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/StartupPreferencesDialogDefaultLocalDirectoryActionListener.java
@@ -0,0 +1,57 @@
+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
new file mode 100644
index 0000000..d1edf0b
--- /dev/null
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/StartupPreferencesDialogSaveActionListener.java
@@ -0,0 +1,55 @@
+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
new file mode 100644
index 0000000..b35c9cd
--- /dev/null
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/StartupRemoteFileChooserDialogCancelActionListener.java
@@ -0,0 +1,23 @@
+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
new file mode 100644
index 0000000..e445fba
--- /dev/null
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/StartupRemoteFileChooserDialogDetailsViewActionListener.java
@@ -0,0 +1,23 @@
+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
new file mode 100644
index 0000000..5eb47a5
--- /dev/null
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/StartupRemoteFileChooserDialogFileTypeActionListener.java
@@ -0,0 +1,23 @@
+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
new file mode 100644
index 0000000..e9ed4e6
--- /dev/null
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/StartupRemoteFileChooserDialogHomeFolderActionListener.java
@@ -0,0 +1,23 @@
+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
new file mode 100644
index 0000000..9f7bd6a
--- /dev/null
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/StartupRemoteFileChooserDialogListMouseListener.java
@@ -0,0 +1,101 @@
+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
new file mode 100644
index 0000000..c74ab0e
--- /dev/null
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/StartupRemoteFileChooserDialogListViewActionListener.java
@@ -0,0 +1,23 @@
+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
new file mode 100644
index 0000000..234a931
--- /dev/null
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/StartupRemoteFileChooserDialogLookInActionListener.java
@@ -0,0 +1,58 @@
+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
new file mode 100644
index 0000000..5f7d3cb
--- /dev/null
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/StartupRemoteFileChooserDialogNewFolderActionListener.java
@@ -0,0 +1,23 @@
+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
new file mode 100644
index 0000000..cb8c419
--- /dev/null
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/StartupRemoteFileChooserDialogOpenActionListener.java
@@ -0,0 +1,23 @@
+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
new file mode 100644
index 0000000..9cb5969
--- /dev/null
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/listeners/StartupRemoteFileChooserDialogUpFolderActionListener.java
@@ -0,0 +1,85 @@
+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 3ef4935..595746b 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.iDrop;
+import org.irods.jargon.idrop.desktop.systraygui.IDROPDesktop;
import org.irods.jargon.transfer.engine.TransferManager;
/**
@@ -14,9 +14,9 @@ public class IconManager {
private TransferManager.RunningStatus runningStatus = null;
- private final iDrop idropGui;
+ private final IDROPDesktop idropGui;
- public IconManager(final iDrop idropClient) {
+ public IconManager(final IDROPDesktop idropClient) {
this.idropGui = idropClient;
}
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 3c7de2c..850adfd 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,11 +1,12 @@
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.iDrop;
+import org.irods.jargon.idrop.desktop.systraygui.util.MessageUtil;
import org.irods.jargon.idrop.exceptions.IdropException;
import org.irods.jargon.transfer.engine.TransferManager;
import org.slf4j.LoggerFactory;
@@ -17,28 +18,23 @@ 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, iDrop idropGui) throws IdropException {
+ public QueueSchedulerTimerTask(TransferManager transferManager, Component parent) throws IdropException {
super();
if (transferManager == null) {
throw new IdropException("null transfer manager");
}
- if (idropGui == null) {
- throw new IdropException("null idropGui");
- }
-
this.transferManager = transferManager;
- this.idropGui = idropGui;
-
+ this.parent = parent;
}
@Override
@@ -55,7 +51,7 @@ public class QueueSchedulerTimerTask extends TimerTask {
transferManager.processNextInQueueIfIdle();
} catch (JargonException ex) {
Logger.getLogger(QueueSchedulerTimerTask.class.getName()).log(Level.SEVERE, null, ex);
- idropGui.showIdropException(ex);
+ MessageUtil.showError(parent, ex.getMessage(), "Error starting queue");
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 8a56e91..29bb7de 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.iDrop;
+import org.irods.jargon.idrop.desktop.systraygui.IDROPDesktop;
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 iDrop idropGui;
+ private final IDROPDesktop idropGui;
private IRODSRuleExecResult execResult = null;
- public RuleExecutionWorker(final iDrop idropGui, final String irodsTargetAbsolutePath, final String targetResource,
+ public RuleExecutionWorker(final IDROPDesktop 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/util/MessageUtil.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/util/MessageUtil.java
new file mode 100644
index 0000000..a9fc160
--- /dev/null
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/util/MessageUtil.java
@@ -0,0 +1,33 @@
+package org.irods.jargon.idrop.desktop.systraygui.util;
+
+import java.awt.Component;
+
+import javax.swing.JOptionPane;
+
+/**
+ *
+ * @author jdr0887
+ *
+ */
+public class MessageUtil {
+
+ public static void showError(Component rootComponent, String message, String title) {
+ JOptionPane.showMessageDialog(rootComponent, message, title, JOptionPane.ERROR_MESSAGE);
+ }
+
+ public static void showWarning(Component rootComponent, String message, String title) {
+ JOptionPane.showMessageDialog(rootComponent, message, title, JOptionPane.WARNING_MESSAGE);
+ }
+
+ public static void showMessage(Component rootComponent, String message, String title) {
+ JOptionPane.showMessageDialog(rootComponent, message, title, JOptionPane.INFORMATION_MESSAGE);
+ }
+
+ public static int showConfirm(Component rootComponent, String message, String title) {
+ return showConfirm(rootComponent, message, title, JOptionPane.OK_CANCEL_OPTION, JOptionPane.INFORMATION_MESSAGE);
+ }
+
+ public static int showConfirm(Component rootComponent, String message, String title, int optionType, int messageType) {
+ return JOptionPane.showConfirmDialog(rootComponent, message, title, optionType, messageType);
+ }
+}
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/utils/iDropUtils.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/utils/IDropUtils.java
index df0320c..59d42f4 100644
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/utils/iDropUtils.java
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/utils/IDropUtils.java
@@ -5,7 +5,7 @@ package org.irods.jargon.idrop.desktop.systraygui.utils;
*
* @author Mike Conway - DICE (www.irods.org)
*/
-public class iDropUtils {
+public class IDropUtils {
/**
* Given a file name, return the name up to 100 chars, otherwise, redact and abbreviate
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 fedf4d1..2985e15 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.iDrop;
+import org.irods.jargon.idrop.desktop.systraygui.IDROPDesktop;
/**
* 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 = iDrop.class.getResource(path);
+ URL imageURL = IDROPDesktop.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 8fc829a..a73e12b 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.iDrop;
+import org.irods.jargon.idrop.desktop.systraygui.IDROPDesktop;
import org.irods.jargon.idrop.desktop.systraygui.utils.TreeUtils;
import org.irods.jargon.idrop.exceptions.IdropException;
import org.irods.jargon.idrop.exceptions.IdropRuntimeException;
@@ -32,67 +32,65 @@ import org.slf4j.LoggerFactory;
public class IRODSOutlineModel extends DefaultOutlineModel {
public static final org.slf4j.Logger log = LoggerFactory.getLogger(IRODSOutlineModel.class);
+
private final IRODSFileSystemModel treeModel;
- private iDrop idrop;
-
- public IRODSOutlineModel(iDrop idrop, TreeModel tm, TableModel tm1, boolean bln, String string) {
+ private IDROPDesktop idrop;
+
+ public IRODSOutlineModel(IDROPDesktop idrop, TreeModel tm, TableModel tm1, boolean bln, String string) {
super(tm, tm1, bln, string);
this.treeModel = (IRODSFileSystemModel) tm;
this.idrop = idrop;
}
- public IRODSOutlineModel(iDrop idrop, TreeModel tm, RowModel rm, boolean bln, String string) {
+ public IRODSOutlineModel(IDROPDesktop 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 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);
-
-
- //parent.forceReloadOfChildrenOfThisNode();
- //treeModel.nodeChanged(deletedNode);
- //treeModel.nodeChanged(parent);
-
- //treeModel.nodeChanged(parent);
-
- //stagingViewTree.highlightPath(path);
-
-
-
+
+ // thisModel.getTreePathSupport().removePath(path);
+ parent.remove(deletedNode);
+
+ // parent.forceReloadOfChildrenOfThisNode();
+ // treeModel.nodeChanged(deletedNode);
+ // treeModel.nodeChanged(parent);
+
+ // treeModel.nodeChanged(parent);
+
+ // stagingViewTree.highlightPath(path);
+
}
});
}
@@ -110,7 +108,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());
-
+
}
}
@@ -126,25 +124,28 @@ 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: {}",
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 3dfa3eb..720380c 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.iDrop;
+import org.irods.jargon.idrop.desktop.systraygui.IDROPDesktop;
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 iDrop idropParentGui = null;
+ protected IDROPDesktop idropParentGui = null;
protected JPopupMenu m_popup = null;
@@ -68,7 +68,7 @@ public class IRODSTree extends Outline implements TreeWillExpandListener, TreeEx
}
}
- public IRODSTree(TreeModel newModel, iDrop idropParentGui) {
+ public IRODSTree(TreeModel newModel, IDROPDesktop 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(iDrop idropParentGui) {
+ public IRODSTree(IDROPDesktop 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.getLocation().getX() + idropParentGui.getWidth() / 2),
- (int) (idropParentGui.getLocation().getY() + idropParentGui.getHeight() / 2));
+ (int) (idropParentGui.mainFrame.getLocation().getX() + idropParentGui.mainFrame.getWidth() / 2),
+ (int) (idropParentGui.mainFrame.getLocation().getY() + idropParentGui.mainFrame.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.getLocation().getX() + idropParentGui.getWidth() / 2),
- (int) (idropParentGui.getLocation().getY() + idropParentGui.getHeight() / 2));
+ deleteDialog.setLocation((int) (idropParentGui.mainFrame.getLocation().getX() + idropParentGui.mainFrame.getWidth() / 2),
+ (int) (idropParentGui.mainFrame.getLocation().getY() + idropParentGui.mainFrame.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.getLocation().getX() + idropParentGui.getWidth() / 2),
- (int) (idropParentGui.getLocation().getY() + idropParentGui.getHeight() / 2));
+ renameDialog.setLocation((int) (idropParentGui.mainFrame.getLocation().getX() + idropParentGui.mainFrame.getWidth() / 2),
+ (int) (idropParentGui.mainFrame.getLocation().getY() + idropParentGui.mainFrame.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 7d15a84..4d74203 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.iDrop;
+import org.irods.jargon.idrop.desktop.systraygui.IDROPDesktop;
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 iDrop idropGui;
+ public final IDROPDesktop idropGui;
- public IRODSTreeTransferHandler(final iDrop idropGui, final String string) {
+ public IRODSTreeTransferHandler(final IDROPDesktop 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, sb.toString(), "Confirm a Put to iRODS ",
+ int n = JOptionPane.showConfirmDialog(idropGui.mainFrame, 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.getLocation().getX() + idropGui.getWidth() / 2),
- (int) (idropGui.getLocation().getY() + idropGui.getHeight() / 2));
+ moveIRODSFileOrDirectoryDialog.setLocation((int) (idropGui.mainFrame.getLocation().getX() + idropGui.mainFrame.getWidth() / 2),
+ (int) (idropGui.mainFrame.getLocation().getY() + idropGui.mainFrame.getHeight() / 2));
moveIRODSFileOrDirectoryDialog.setVisible(true);
}
@@ -400,7 +400,7 @@ public class IRODSTreeTransferHandler extends TransferHandler {
}
// default icon, custom title
- int n = JOptionPane.showConfirmDialog(idropGui, sb.toString(), "Confirm a Put to iRODS ",
+ int n = JOptionPane.showConfirmDialog(idropGui.mainFrame, 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.getLocation().getX() + idropGui.getWidth() / 2),
- (int) (idropGui.getLocation().getY() + idropGui.getHeight() / 2));
+ moveIRODSFileOrDirectoryDialog.setLocation((int) (idropGui.mainFrame.getLocation().getX() + idropGui.mainFrame.getWidth() / 2),
+ (int) (idropGui.mainFrame.getLocation().getY() + idropGui.mainFrame.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 e676151..de467a8 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.iDrop;
+import org.irods.jargon.idrop.desktop.systraygui.IDROPDesktop;
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 iDrop idropGui;
+ private final IDROPDesktop idropGui;
- public InfoPanelTransferHandler(final iDrop idropGui) throws IdropException {
+ public InfoPanelTransferHandler(final IDROPDesktop 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 a2584af..f5fd148 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
@@ -17,7 +17,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.iDrop;
+import org.irods.jargon.idrop.desktop.systraygui.IDROPDesktop;
import org.irods.jargon.idrop.exceptions.IdropException;
import org.irods.jargon.idrop.exceptions.IdropRuntimeException;
import org.slf4j.LoggerFactory;
@@ -34,11 +34,11 @@ public class IrodsSelectionListenerForBuildingInfoPanel implements ListSelection
public static org.slf4j.Logger log = LoggerFactory.getLogger(IrodsSelectionListenerForBuildingInfoPanel.class);
- private final iDrop idrop;
+ private final IDROPDesktop idrop;
private IRODSOutlineModel irodsOutlineModel = null;
- public IrodsSelectionListenerForBuildingInfoPanel(final iDrop idrop) throws IdropException {
+ public IrodsSelectionListenerForBuildingInfoPanel(final IDROPDesktop 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/IrodsTreeListenerForBuildingInfoPanel.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/IrodsTreeListenerForBuildingInfoPanel.java
index 0261d8b..336b1be 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.iDrop;
+import org.irods.jargon.idrop.desktop.systraygui.IDROPDesktop;
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 iDrop idrop;
+ private final IDROPDesktop idrop;
- public IrodsTreeListenerForBuildingInfoPanel(final iDrop idrop) throws IdropException {
+ public IrodsTreeListenerForBuildingInfoPanel(final IDROPDesktop 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 26911ac..f73d2b4 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.iDrop;
+import org.irods.jargon.idrop.desktop.systraygui.IDROPDesktop;
import org.irods.jargon.idrop.exceptions.IdropException;
import org.slf4j.LoggerFactory;
@@ -40,13 +40,21 @@ import org.slf4j.LoggerFactory;
public class LocalFileTree extends JTree implements TreeWillExpandListener {
public static org.slf4j.Logger log = LoggerFactory.getLogger(LocalFileTree.class);
- private iDrop idropParentGui = null;
+
+ private IDROPDesktop 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() {
@@ -73,7 +81,7 @@ public class LocalFileTree extends JTree implements TreeWillExpandListener {
this.highlightedRow = highlightedRow;
}
- public LocalFileTree(TreeModel newModel, iDrop idropParentGui) {
+ public LocalFileTree(TreeModel newModel, IDROPDesktop idropParentGui) {
super(newModel);
this.idropParentGui = idropParentGui;
setDragEnabled(true);
@@ -249,8 +257,10 @@ public class LocalFileTree extends JTree implements TreeWillExpandListener {
NewLocalDirectoryDialog newLocalDirectoryDialog = new NewLocalDirectoryDialog(idropParentGui,
true, parentFile.getAbsolutePath(), thisTree, parentNode);
newLocalDirectoryDialog.setLocation(
- (int) (idropParentGui.getLocation().getX() + idropParentGui.getWidth() / 2),
- (int) (idropParentGui.getLocation().getY() + idropParentGui.getHeight() / 2));
+ (int) (idropParentGui.mainFrame.getLocation().getX() + idropParentGui.mainFrame
+ .getWidth() / 2),
+ (int) (idropParentGui.mainFrame.getLocation().getY() + idropParentGui.mainFrame
+ .getHeight() / 2));
newLocalDirectoryDialog.setVisible(true);
}
@@ -276,22 +286,29 @@ 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);
}
- deleteDialog.setLocation((int) (idropParentGui.getLocation().getX() + idropParentGui.getWidth() / 2),
- (int) (idropParentGui.getLocation().getY() + idropParentGui.getHeight() / 2));
+ 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.setVisible(true);
}
@@ -309,9 +326,11 @@ public class LocalFileTree extends JTree implements TreeWillExpandListener {
RenameLocalDirectoryDialog renameLocalDirectoryDialog = new RenameLocalDirectoryDialog(idropParentGui,
true, parentFile.getAbsolutePath(), thisTree, parentNode);
- renameLocalDirectoryDialog.setLocation(
- (int) (idropParentGui.getLocation().getX() + idropParentGui.getWidth() / 2),
- (int) (idropParentGui.getLocation().getY() + idropParentGui.getHeight() / 2));
+ renameLocalDirectoryDialog
+ .setLocation((int) (idropParentGui.mainFrame.getLocation().getX() + idropParentGui.mainFrame
+ .getWidth() / 2),
+ (int) (idropParentGui.mainFrame.getLocation().getY() + idropParentGui.mainFrame
+ .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 57893b2..479cf2b 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,17 +16,15 @@ 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.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.iDrop;
+import org.irods.jargon.idrop.desktop.systraygui.IDROPDesktop;
import org.irods.jargon.idrop.exceptions.IdropException;
import org.irods.jargon.idrop.exceptions.IdropRuntimeException;
-import org.openide.util.Exceptions;
import org.slf4j.LoggerFactory;
/**
@@ -37,7 +35,8 @@ import org.slf4j.LoggerFactory;
public class LocalTreeTransferHandler extends TransferHandler {
public static org.slf4j.Logger log = LoggerFactory.getLogger(LocalTreeTransferHandler.class);
- public final iDrop idropGui;
+
+ public final IDROPDesktop idropGui;
@Override
public boolean canImport(TransferSupport support) {
@@ -63,7 +62,8 @@ 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,7 +125,8 @@ 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 {
@@ -177,7 +178,8 @@ public class LocalTreeTransferHandler extends TransferHandler {
}
// default icon, custom title
- int n = JOptionPane.showConfirmDialog(idropGui, sb.toString(), "Confirm a Get ", JOptionPane.YES_NO_OPTION);
+ int n = JOptionPane.showConfirmDialog(idropGui.mainFrame, sb.toString(), "Confirm a Get ",
+ JOptionPane.YES_NO_OPTION);
if (n == JOptionPane.YES_OPTION) {
@@ -193,8 +195,10 @@ 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());
@@ -214,10 +218,12 @@ 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());
@@ -271,7 +277,8 @@ 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());
}
@@ -289,10 +296,9 @@ public class LocalTreeTransferHandler extends TransferHandler {
throw new IdropRuntimeException(ex);
}
-
}
- public LocalTreeTransferHandler(final iDrop idropGui) {
+ public LocalTreeTransferHandler(final IDROPDesktop idropGui) {
super("selectionModel");
if (idropGui == null) {
throw new IllegalArgumentException("null idropGui");
diff --git a/idrop-swing/src/main/resources/org/irods/jargon/idrop/editSynchronizationDialog.xml b/idrop-swing/src/main/resources/org/irods/jargon/idrop/editSynchronizationDialog.xml
new file mode 100644
index 0000000..e7aa55a
--- /dev/null
+++ b/idrop-swing/src/main/resources/org/irods/jargon/idrop/editSynchronizationDialog.xml
@@ -0,0 +1,85 @@
+<dialog var="editSynchronizationDialog" title="Synchronization" size="520,270" defaultcloseoperation="HIDE_ON_CLOSE"
+ locationrelativeto="mainFrame" modal="true" resizable="false">
+ <panel>
+ <borderlayout>
+ <constraint location="Center">
+ <panel>
+ <titledborder title="Synchronization" titlejustification="LEFT" titleposition="CENTER" titlefont="SansSerif,bold,14">
+ <etchedborder type="LOWERED" />
+ </titledborder>
+ <gridbaglayout>
+ <gridbagconstraints id="gbc1" gridx="0" gridy="0" weightx="0.1" weighty="0.001" fill="BOTH" insets="4,4,4,4">
+ <panel>
+ <gridbaglayout>
+ <gridbagconstraints id="gbc2" gridx="0" gridy="0" weightx="0.03" weighty="0.1" anchor="EAST">
+ <label text="Name:" font="SansSerif,bold,12" />
+ </gridbagconstraints>
+ <idref ctor="gbc2" gridx="1" gridy="0" weightx="0.07" weighty="0.1" anchor="WEST">
+ <textfield var="editSynchronizationDialogNameTextField" columns="15" font="SansSerif,plain,12" />
+ </idref>
+ <idref ctor="gbc2" gridx="0" gridy="1" weightx="0.03" anchor="EAST">
+ <label text="Device Name:" font="SansSerif,bold,12" />
+ </idref>
+ <idref ctor="gbc2" gridx="1" gridy="1" weightx="0.05" anchor="WEST">
+ <textfield var="editSynchronizationDialogDeviceNameTextField" columns="25" font="SansSerif,plain,12" />
+ </idref>
+ <idref ctor="gbc2" gridx="0" gridy="2" weightx="0.03" anchor="EAST">
+ <label text="Local Path:" font="SansSerif,bold,12" />
+ </idref>
+ <idref ctor="gbc2" gridx="1" gridy="2" weightx="0.05" anchor="WEST">
+ <textfield var="editSynchronizationDialogLocalPathTextField" columns="25" font="SansSerif,plain,12" />
+ </idref>
+ <idref ctor="gbc2" gridx="2" gridy="2" weightx="0.02" anchor="WEST">
+ <button var="editSynchronizationDialogLocalPathBrowseButton" text="Browse"
+ actionlistener="editSynchronizationDialogLocalPathBrowseActionListener" font="SansSerif,plain,12" />
+ </idref>
+ <idref ctor="gbc2" gridx="0" gridy="3" weightx="0.03" anchor="EAST">
+ <label text="Remote Path:" font="SansSerif,bold,12" />
+ </idref>
+ <idref ctor="gbc2" gridx="1" gridy="3" weightx="0.05" anchor="WEST">
+ <textfield var="editSynchronizationDialogRemotePathTextField" columns="25" font="SansSerif,plain,12" />
+ </idref>
+ <idref ctor="gbc2" gridx="2" gridy="3" weightx="0.02" anchor="WEST">
+ <button var="editSynchronizationDialogRemotePathBrowseButton" text="Browse"
+ actionlistener="editSynchronizationDialogRemotePathBrowseActionListener" font="SansSerif,plain,12" />
+ </idref>
+ <!-- <idref ctor="gbc2" gridx="0" gridy="4" weightx="0.03" anchor="EAST"> -->
+ <!-- <label text="Frequency:" font="SansSerif,bold,12" /> -->
+ <!-- </idref> -->
+ <!-- <idref ctor="gbc2" gridx="1" gridy="5" weightx="0.07" anchor="WEST"> -->
+ <!-- <combobox var="editSynchronizationDialogFrequencyComboBox" font="SansSerif,plain,12"> -->
+ <!-- <string text="Select" /> -->
+ <!-- </combobox> -->
+ <!-- </idref> -->
+ </gridbaglayout>
+ </panel>
+ </gridbagconstraints>
+ </gridbaglayout>
+ </panel>
+ </constraint>
+ <constraint location="South">
+ <panel>
+ <gridbaglayout>
+ <gridbagconstraints id="gbc_button" gridx="0" gridy="0" weightx="0.0" weighty="0.1" insets="2,2,2,2">
+ <panel>
+ <gridbaglayout>
+ <gridbagconstraints id="gbc_button_form" gridx="0" gridy="0" weightx="0.1" weighty="0.1" insets="2,2,2,2">
+ <button text="Save" var="editSynchronizationDialogSaveButton" actionlistener="editSynchronizationDialogSaveActionListener"
+ font="SansSerif,bold,14" />
+ </gridbagconstraints>
+ <idref ctor="gbc_button_form" gridx="1" gridy="0">
+ <button text="Cancel" var="editSynchronizationDialogCancelButton" actionlistener="editSynchronizationDialogCancelActionListener"
+ font="SansSerif,bold,14" />
+ </idref>
+ </gridbaglayout>
+ </panel>
+ </gridbagconstraints>
+ </gridbaglayout>
+ </panel>
+ </constraint>
+ </borderlayout>
+ </panel>
+ <noadd>
+ <filechooser var="editSynchronizationDialogLocalPathFileChooser" />
+ </noadd>
+</dialog>
diff --git a/idrop-swing/src/main/resources/org/irods/jargon/idrop/editSynchronizationsDialog.xml b/idrop-swing/src/main/resources/org/irods/jargon/idrop/editSynchronizationsDialog.xml
new file mode 100644
index 0000000..758d362
--- /dev/null
+++ b/idrop-swing/src/main/resources/org/irods/jargon/idrop/editSynchronizationsDialog.xml
@@ -0,0 +1,63 @@
+<dialog var="editSynchronizationsDialog" title="Synchronizations" defaultcloseoperation="HIDE_ON_CLOSE" modal="true" size="400,320"
+ resizable="false" locationrelativeto="mainFrame">
+ <panel>
+ <borderlayout>
+ <constraint location="Center">
+ <panel>
+ <titledborder title="Synchronizations" titlejustification="LEFT" titleposition="CENTER" titlefont="SansSerif,bold,14">
+ <etchedborder type="LOWERED" />
+ </titledborder>
+ <gridbaglayout>
+ <gridbagconstraints id="gbc1" gridx="0" gridy="0" weightx="0.1" weighty="0.1" fill="BOTH" insets="4,4,4,4">
+ <panel>
+ <gridbaglayout>
+ <gridbagconstraints id="gbc2" gridx="0" gridy="0" weightx="0.1" weighty="0.1" fill="BOTH">
+ <scrollpane>
+ <list var="editSynchronizationsDialogList" selectionmode="MULTIPLE_INTERVAL_SELECTION">
+ <defaultlistmodel var="editSynchronizationsDialogListModel" setas="model" />
+ </list>
+ </scrollpane>
+ </gridbagconstraints>
+ </gridbaglayout>
+ </panel>
+ </gridbagconstraints>
+ <idref ctor="gbc1" gridx="1" gridy="0" weightx="0.01" weighty="0.1">
+ <panel>
+ <gridbaglayout>
+ <gridbagconstraints id="gbc3" gridx="0" gridy="0" weightx="0.1" weighty="0.1">
+ <button text="New" var="editSynchronizationsNewButton" actionlistener="editSynchronizationsDialogNewActionListener"
+ font="SansSerif,bold,14" />
+ </gridbagconstraints>
+ <idref ctor="gbc3" gridy="1" weighty="0.1">
+ <button text="Edit" var="editSynchronizationsEditButton" actionlistener="editSynchronizationsDialogEditActionListener"
+ font="SansSerif,bold,14" />
+ </idref>
+ <idref ctor="gbc3" gridy="2" weighty="0.1">
+ <button text="Delete" var="editSynchronizationsDeleteButton" actionlistener="editSynchronizationsDialogDeleteActionListener"
+ font="SansSerif,bold,14" />
+ </idref>
+ </gridbaglayout>
+ </panel>
+ </idref>
+ </gridbaglayout>
+ </panel>
+ </constraint>
+ <constraint location="South">
+ <panel>
+ <gridbaglayout>
+ <gridbagconstraints id="gbc_button" gridx="0" gridy="0" weightx="0.0" weighty="0.1" insets="2,2,2,2">
+ <panel>
+ <gridbaglayout>
+ <gridbagconstraints id="gbc_button_form" gridx="0" gridy="0" weightx="0.1" weighty="0.1" insets="2,2,2,2">
+ <button text="Run Now" var="editSynchronizationsRunNowButton" actionlistener="editSynchronizationsRunNowActionListener"
+ font="SansSerif,bold,14" />
+ </gridbagconstraints>
+ </gridbaglayout>
+ </panel>
+ </gridbagconstraints>
+ </gridbaglayout>
+ </panel>
+ </constraint>
+ </borderlayout>
+ </panel>
+</dialog> \ No newline at end of file
diff --git a/idrop-swing/src/main/resources/org/irods/jargon/idrop/loginDialog.xml b/idrop-swing/src/main/resources/org/irods/jargon/idrop/loginDialog.xml
new file mode 100644
index 0000000..48a351e
--- /dev/null
+++ b/idrop-swing/src/main/resources/org/irods/jargon/idrop/loginDialog.xml
@@ -0,0 +1,70 @@
+<dialog var="loginDialog" title="Login" windowlistener="loginDialogWindowListener" modal="true" size="400,340" resizable="false">
+ <panel>
+ <borderlayout>
+ <constraint location="Center">
+ <panel>
+ <titledborder title="iDrop Login" titlejustification="LEFT" titleposition="CENTER" titlefont="SansSerif,bold,14">
+ <etchedborder type="LOWERED" />
+ </titledborder>
+ <gridbaglayout>
+ <gridbagconstraints id="gbc" gridx="0" gridy="0" weightx="0.1" weighty="0.0" anchor="EAST" insets="2,2,2,2"
+ ipadx="5" ipady="5">
+ <label text="Username:" font="SansSerif,bold,12" />
+ </gridbagconstraints>
+ <idref ctor="gbc" gridx="1" gridy="0" anchor="WEST">
+ <textfield var="loginDialogUsernameTextField" columns="15" font="SansSerif,plain,12" keylistener="loginDialogEnterKeyListener" />
+ </idref>
+ <idref ctor="gbc" gridx="0" gridy="1" anchor="EAST">
+ <label text="Password:" font="SansSerif,bold,12" />
+ </idref>
+ <idref ctor="gbc" gridx="1" gridy="1" anchor="WEST">
+ <passwordfield var="loginDialogPasswordPasswordField" columns="15" font="SansSerif,plain,12" keylistener="loginDialogEnterKeyListener" />
+ </idref>
+ <idref ctor="gbc" gridx="0" gridy="2" anchor="EAST">
+ <label text="Host:" font="SansSerif,bold,12" />
+ </idref>
+ <idref ctor="gbc" gridx="1" gridy="2" anchor="WEST">
+ <textfield var="loginDialogHostTextField" columns="15" font="SansSerif,plain,12" keylistener="loginDialogEnterKeyListener" />
+ </idref>
+ <idref ctor="gbc" gridx="0" gridy="3" anchor="EAST">
+ <label text="Port:" font="SansSerif,bold,12" />
+ </idref>
+ <idref ctor="gbc" gridx="1" gridy="3" anchor="WEST">
+ <textfield var="loginDialogPortTextField" columns="15" font="SansSerif,plain,12" keylistener="loginDialogEnterKeyListener" />
+ </idref>
+ <idref ctor="gbc" gridx="0" gridy="4" anchor="EAST">
+ <label text="Zone:" font="SansSerif,bold,12" />
+ </idref>
+ <idref ctor="gbc" gridx="1" gridy="4" anchor="WEST">
+ <textfield var="loginDialogZoneTextField" columns="15" font="SansSerif,plain,12" keylistener="loginDialogEnterKeyListener" />
+ </idref>
+ <idref ctor="gbc" gridx="0" gridy="5" anchor="EAST">
+ <label text="Resource:" font="SansSerif,bold,12" />
+ </idref>
+ <idref ctor="gbc" gridx="1" gridy="5" anchor="WEST">
+ <textfield var="loginDialogResourceTextField" columns="15" font="SansSerif,plain,12" keylistener="loginDialogEnterKeyListener" />
+ </idref>
+ </gridbaglayout>
+ </panel>
+ </constraint>
+ <constraint location="South">
+ <panel>
+ <gridbaglayout>
+ <gridbagconstraints id="gbc_button" gridx="0" gridy="0" weightx="0.0" weighty="0.1" insets="2,2,2,2">
+ <panel>
+ <gridbaglayout>
+ <gridbagconstraints id="gbc_button_form" gridx="0" gridy="0" weightx="0.1" weighty="0.1" insets="2,2,2,2">
+ <button text="OK" var="loginDialogOKButton" actionlistener="loginDialogOKActionListener" font="SansSerif,bold,14" />
+ </gridbagconstraints>
+ <idref ctor="gbc_button_form" gridx="1">
+ <button text="Cancel" var="loginDialogCancelButton" actionlistener="loginDialogCancelActionListener" font="SansSerif,bold,14" />
+ </idref>
+ </gridbaglayout>
+ </panel>
+ </gridbagconstraints>
+ </gridbaglayout>
+ </panel>
+ </constraint>
+ </borderlayout>
+ </panel>
+</dialog> \ No newline at end of file
diff --git a/idrop-swing/src/main/resources/org/irods/jargon/idrop/preferencesDialog.xml b/idrop-swing/src/main/resources/org/irods/jargon/idrop/preferencesDialog.xml
index 1e5879c..1cdd80d 100644
--- a/idrop-swing/src/main/resources/org/irods/jargon/idrop/preferencesDialog.xml
+++ b/idrop-swing/src/main/resources/org/irods/jargon/idrop/preferencesDialog.xml
@@ -1,42 +1,83 @@
-<dialog ctor="var:iDrop" var="preferencesDialog" title="Preferences" defaultcloseoperation="DISPOSE_ON_CLOSE"
- modal="true" locationrelativeto="iDrop" size="400,200" resizable="false">
+<dialog var="preferencesDialog" title="Preferences" defaultcloseoperation="DISPOSE_ON_CLOSE" modal="true" size="540,340" resizable="false">
<panel>
<gridbaglayout>
- <gridbagconstraints id="gbc" gridx="0" gridy="0" weightx="0.1" weighty="0.1" fill="BOTH">
+ <gridbagconstraints id="gbc" gridx="0" gridy="0" weightx="1.0" weighty="0.9" fill="BOTH">
<panel>
- <titledborder title="Preferences" titlejustification="LEFT" titleposition="CENTER" titlefont="SansSerif,bold,14">
- <etchedborder type="LOWERED" />
- </titledborder>
<gridbaglayout>
- <gridbagconstraints id="gbc_props" gridx="0" gridy="0" weightx="0.1" weighty="0.0"
- anchor="WEST">
+ <gridbagconstraints id="gbc1" gridx="0" gridy="0" weightx="1.0" weighty="1.0" fill="BOTH">
<panel>
+ <titledborder title="General Preferences" titlejustification="LEFT" titleposition="CENTER" titlefont="SansSerif,bold,14">
+ <etchedborder type="LOWERED" />
+ </titledborder>
<gridbaglayout>
- <gridbagconstraints id="gbc_props_form" gridx="0" gridy="0" weightx="0.1" weighty="0.0"
- insets="0,2,2,2" anchor="WEST">
- <panel>
- <checkbox var="showGUICheckBox" />
- <label text="Show iDrop User Interface on startup" font="SansSerif,bold,12" />
- </panel>
+ <gridbagconstraints id="gbc2" gridx="0" gridy="0" weightx="0.05" weighty="0.1" anchor="EAST" insets="2,2,2,2">
+ <label text="Device Name:" font="SansSerif,bold,12" />
</gridbagconstraints>
+ <idref ctor="gbc2" gridx="1" gridy="0" anchor="WEST">
+ <textfield var="preferencesDialogDeviceNameTextField" columns="25" font="SansSerif,plain,12" />
+ </idref>
+ <idref ctor="gbc2" gridx="0" gridy="1" anchor="EAST">
+ <label text="Show Hidden Files:" font="SansSerif,bold,12" />
+ </idref>
+ <idref ctor="gbc2" gridx="1" gridy="1" anchor="WEST">
+ <checkbox var="preferencesDialogShowHiddenFilesCheckBox" />
+ </idref>
+ <idref ctor="gbc2" gridx="0" gridy="2" weightx="0.04" anchor="EAST">
+ <label text="Default Local Directory:" font="SansSerif,bold,12" />
+ </idref>
+ <idref ctor="gbc2" gridx="1" gridy="2" anchor="WEST">
+ <textfield var="preferencesDialogDefaultLocalDirectoryTextField" columns="25" font="SansSerif,plain,12" />
+ </idref>
+ <idref ctor="gbc2" gridx="2" gridy="2" weightx="0.02" anchor="WEST">
+ <button var="preferencesDialogDefaultLocalDirectoryButton" text="Browse"
+ actionlistener="preferencesDialogDefaultLocalDirectoryActionListener" font="SansSerif,plain,12" />
+ </idref>
</gridbaglayout>
</panel>
</gridbagconstraints>
+ <idref ctor="gbc1" gridy="1" weighty="1.0">
+ <panel>
+ <titledborder title="Startup Preferences" titlejustification="LEFT" titleposition="CENTER" titlefont="SansSerif,bold,14">
+ <etchedborder type="LOWERED" />
+ </titledborder>
+ <gridbaglayout>
+ <gridbagconstraints id="gbc2" gridx="0" gridy="0" weightx="0.0275" weighty="1.0" anchor="EAST" insets="2,2,2,2">
+ <label text="Show iDrop:" font="SansSerif,bold,12" />
+ </gridbagconstraints>
+ <idref ctor="gbc2" gridx="1" gridy="0" weightx="0.29" anchor="WEST">
+ <checkbox var="preferencesDialogShowUICheckBox" />
+ </idref>
+ <idref ctor="gbc2" gridx="0" gridy="1" weightx="0.0275" anchor="EAST">
+ <label text="Show splash screen:" font="SansSerif,bold,12" />
+ </idref>
+ <idref ctor="gbc2" gridx="1" gridy="1" weightx="0.29" anchor="WEST">
+ <checkbox var="preferencesDialogShowSplashScreenCheckBox" />
+ </idref>
+ <idref ctor="gbc2" gridx="0" gridy="2" weightx="0.0275" anchor="EAST">
+ <label text="Show preferences:" font="SansSerif,bold,12" />
+ </idref>
+ <idref ctor="gbc2" gridx="1" gridy="2" weightx="0.29" anchor="WEST">
+ <checkbox var="preferencesDialogShowPreferencesCheckBox" />
+ </idref>
+ </gridbaglayout>
+ </panel>
+ </idref>
</gridbaglayout>
</panel>
</gridbagconstraints>
- <idref ctor="gbc" gridy="1" weighty="0.05">
+ <idref ctor="gbc" gridy="1" weighty="0.1">
<panel>
<gridbaglayout>
- <gridbagconstraints id="gbc_button" gridx="0" gridy="0" weightx="0.0" weighty="0.1"
- insets="2,2,2,2">
+ <gridbagconstraints id="gbc_button" gridx="0" gridy="0" weightx="0.0" weighty="0.1" insets="2,2,2,2">
<panel>
<gridbaglayout>
- <gridbagconstraints id="gbc_button_form" gridx="0" gridy="0" weightx="0.1" weighty="0.1"
- insets="2,2,2,2">
- <button text="OK" var="preferencesDialogOKButton" actionlistener="okButtonPreferencesDialogActionListener"
- font="SansSerif,bold,14" />
+ <gridbagconstraints id="gbc_button" gridx="0" gridy="0" weightx="0.1" weighty="0.1" insets="2,2,2,2">
+ <button text="Save" var="preferencesDialogSaveButton" actionlistener="preferencesDialogSaveActionListener" font="SansSerif,bold,14" />
</gridbagconstraints>
+ <idref ctor="gbc_button" gridx="1">
+ <button text="Cancel" var="preferencesDialogCancelButton" actionlistener="preferencesDialogCancelActionListener"
+ font="SansSerif,bold,14" />
+ </idref>
</gridbaglayout>
</panel>
</gridbagconstraints>
@@ -45,4 +86,7 @@
</idref>
</gridbaglayout>
</panel>
+ <noadd>
+ <filechooser var="preferencesDialogDefaultLocalDirectoryFileChooser" />
+ </noadd>
</dialog> \ No newline at end of file
diff --git a/idrop-swing/src/main/resources/org/irods/jargon/idrop/remoteFileChooserDialog.xml b/idrop-swing/src/main/resources/org/irods/jargon/idrop/remoteFileChooserDialog.xml
new file mode 100644
index 0000000..688d8dc
--- /dev/null
+++ b/idrop-swing/src/main/resources/org/irods/jargon/idrop/remoteFileChooserDialog.xml
@@ -0,0 +1,102 @@
+<dialog var="remoteFileChooserDialog" title="Remote File Chooser" defaultcloseoperation="DISPOSE_ON_CLOSE" modal="true" size="500,350"
+ resizable="false">
+ <panel>
+ <gridbaglayout>
+ <gridbagconstraints id="gbc1" gridx="0" gridy="0" weightx="0.1" weighty="0.005" insets="8,8,8,8" fill="BOTH">
+ <panel>
+ <gridbaglayout>
+ <gridbagconstraints id="gbc2" gridx="0" gridy="0" weightx="0.02" weighty="0.1">
+ <label text="Look In:" />
+ </gridbagconstraints>
+ <idref ctor="gbc2" gridx="1" gridy="0" weightx="0.47" fill="HORIZONTAL">
+ <combobox var="remoteFileChooserDialogLookInComboBox" font="SansSerif,plain,12" itemlistener="remoteFileChooserDialogLookInItemListener" />
+ </idref>
+ <idref ctor="gbc2" gridx="2" gridy="0" weightx="0.01" fill="NONE">
+ <button var="remoteFileChooserDialogUpFolderButton" preferredsize="25,25" actionlistener="remoteFileChooserDialogUpFolderActionListener" />
+ </idref>
+ <idref ctor="gbc2" gridx="3" gridy="0" weightx="0.01">
+ <button var="remoteFileChooserDialogHomeFolderButton" preferredsize="25,25" actionlistener="remoteFileChooserDialogHomeFolderActionListener"
+ enabled="false" />
+ </idref>
+ <idref ctor="gbc2" gridx="4" gridy="0" weightx="0.01">
+ <button var="remoteFileChooserDialogNewFolderButton" preferredsize="25,25" actionlistener="remoteFileChooserDialogNewFolderActionListener" />
+ </idref>
+ <idref ctor="gbc2" gridx="5" gridy="0" weightx="0.00001">
+ <button var="remoteFileChooserDialogListViewButton" preferredsize="25,25" actionlistener="remoteFileChooserDialogListViewActionListener" />
+ </idref>
+ <idref ctor="gbc2" gridx="6" gridy="0" weightx="0.00001">
+ <button var="remoteFileChooserDialogDetailsViewButton" preferredsize="25,25" actionlistener="remoteFileChooserDialogDetailsViewActionListener" />
+ </idref>
+ </gridbaglayout>
+ </panel>
+ </gridbagconstraints>
+ <idref ctor="gbc1" gridx="0" gridy="1" weighty="0.089" insets="0,8,0,8">
+ <panel>
+ <gridbaglayout>
+ <gridbagconstraints id="gbc2" gridx="0" gridy="0" weightx="0.1" weighty="0.1" fill="BOTH">
+ <panel>
+ <gridbaglayout>
+ <gridbagconstraints id="gbc3" gridx="0" gridy="0" weightx="0.1" weighty="0.1" fill="BOTH">
+ <scrollpane>
+ <list var="remoteFileChooserDialogList" selectionmode="SINGLE_SELECTION" layoutorientation="VERTICAL_WRAP"
+ visiblerowcount="7" mouselistener="remoteFileChooserDialogListMouseListener" listselectionlistener="remoteFileChooserDialogListSelectionListener">
+ <defaultlistmodel var="remoteFileChooserDialogListModel" setas="model" />
+ </list>
+ </scrollpane>
+ </gridbagconstraints>
+ </gridbaglayout>
+ </panel>
+ </gridbagconstraints>
+ </gridbaglayout>
+ </panel>
+ </idref>
+ <idref ctor="gbc1" gridx="0" gridy="2" weighty="0.005" insets="8,8,8,8">
+ <panel>
+ <gridbaglayout>
+ <gridbagconstraints id="gbc2" gridx="0" gridy="0" weightx="0.1" weighty="0.1" fill="BOTH">
+ <panel>
+ <gridbaglayout>
+ <gridbagconstraints id="gbc3" gridx="0" gridy="0" weightx="0.015" weighty="0.1" fill="BOTH">
+ <label text="File Name:" />
+ </gridbagconstraints>
+ <idref ctor="gbc3" gridx="1" gridy="0" weightx="0.085">
+ <textfield var="remoteFileChooserDialogFileNameTextField" columns="30" />
+ </idref>
+ <idref ctor="gbc3" gridx="0" gridy="1" weightx="0.015">
+ <label text="Files of Type:" />
+ </idref>
+ <idref ctor="gbc3" gridx="1" gridy="1" weightx="0.085">
+ <combobox var="remoteFileChooserDialogFileTypeComboBox" font="SansSerif,plain,12" itemlistener="remoteFileChooserDialogFileTypeItemListener">
+ <string text="" />
+ <string text="All Files" />
+ </combobox>
+ </idref>
+ </gridbaglayout>
+ </panel>
+ </gridbagconstraints>
+ </gridbaglayout>
+ </panel>
+ </idref>
+ <idref ctor="gbc1" gridx="0" gridy="3" weighty="0.0001">
+ <panel>
+ <gridbaglayout>
+ <gridbagconstraints id="gbc2" gridx="0" gridy="0" weightx="0.1" weighty="0.1" fill="BOTH">
+ <panel>
+ <gridbaglayout>
+ <gridbagconstraints id="gbc3" gridx="0" gridy="0" weightx="0.0985" weighty="0.1" anchor="EAST">
+ <button text="Open" var="remoteFileChooserDialogOpenButton" actionlistener="remoteFileChooserDialogOpenActionListener"
+ font="SansSerif,bold,14" />
+ </gridbagconstraints>
+ <idref ctor="gbc3" gridx="1" weightx="0.0015">
+ <button text="Cancel" var="remoteFileChooserDialogCancelButton" actionlistener="remoteFileChooserDialogCancelActionListener"
+ font="SansSerif,bold,14" />
+ </idref>
+ </gridbaglayout>
+ </panel>
+ </gridbagconstraints>
+ </gridbaglayout>
+ </panel>
+ </idref>
+ </gridbaglayout>
+ </panel>
+</dialog> \ No newline at end of file
diff --git a/idrop-swing/src/main/resources/org/irods/jargon/idrop/splashWindow.xml b/idrop-swing/src/main/resources/org/irods/jargon/idrop/splashWindow.xml
new file mode 100644
index 0000000..ceff841
--- /dev/null
+++ b/idrop-swing/src/main/resources/org/irods/jargon/idrop/splashWindow.xml
@@ -0,0 +1,18 @@
+<window size="420,315" alwaysontop="false">
+ <borderlayout>
+ <constraint location="Center">
+ <label>
+ <imageicon src="org/irods/jargon/idrop/desktop/images/iDrop.png" setas="icon" />
+ </label>
+ </constraint>
+ <constraint location="South">
+ <progressbar var="startupProgressBar" stringpainted="true" minimum="0" maximum="6" value="0"/>
+ </constraint>
+ </borderlayout>
+ <noadd>
+ <include ctor="org/irods/jargon/idrop/loginDialog.xml" />
+ <include ctor="org/irods/jargon/idrop/editSynchronizationDialog.xml" />
+ <include ctor="org/irods/jargon/idrop/remoteFileChooserDialog.xml" />
+ <include ctor="org/irods/jargon/idrop/preferencesDialog.xml" />
+ </noadd>
+</window> \ No newline at end of file
diff --git a/pom.xml b/pom.xml
index 28b7dd3..e22ab7b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -320,6 +320,11 @@
<artifactId>cookxml</artifactId>
<version>3.0.1</version>
</dependency>
+ <dependency>
+ <groupId>com.jgoodies</groupId>
+ <artifactId>validation</artifactId>
+ <version>2.0.0</version>
+ </dependency>
</dependencies>
</dependencyManagement>
<dependencies>