summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore7
-rw-r--r--README14
-rw-r--r--deps/LICENSE.txt1858
-rw-r--r--deps/README.txt7
-rw-r--r--deps/org-netbeans-swing-outline.jarbin0 -> 184123 bytes
-rw-r--r--idrop-swing/pom.xml51
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/AboutDialog.java3
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/ChangePasswordDialog.java12
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/DeleteIRODSDialog.java106
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/DeleteLocalFileDialog.java6
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/IDROPCore.java104
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/IDropSplashWindow.java139
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/LoginDialog.java6
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/MessageManager.java2
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/MetadataViewDialog.java11
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/MoveOrCopyiRODSDialog.form (renamed from idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/MoveIRODSFileToNewIRODSLocationDialog.form)0
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/MoveOrCopyiRODSDialog.java (renamed from idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/MoveIRODSFileToNewIRODSLocationDialog.java)103
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/NewIRODSDirectoryDialog.java67
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/NewLocalDirectoryDialog.java37
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/QueueManagerDialog.form61
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/QueueManagerDialog.java651
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/QueueTimerTaskThread.java (renamed from idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/QueueThread.java)4
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/RenameIRODSDirectoryDialog.java8
-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.java23
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/StartupSequencer.java232
-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.java226
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/iDrop.form1051
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/iDrop.java1312
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/services/IRODSClientDelegate.java85
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/services/IdropConfigurationService.java25
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/services/IdropConfigurationServiceImpl.java150
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/services/RuleExecutionWorker.java2
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/utils/IconHelper.java3
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/utils/IdropConfig.java22
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/utils/IdropPropertiesHelper.java2
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/utils/TreeUtils.java236
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/utils/iDropUtils.java36
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/DefaultFileRepresentationPanel.form135
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/DefaultFileRepresentationPanel.java600
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/FileDragGestureListener.java33
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/FileSystemModel.java3
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/IRODSFileSystemModel.java57
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/IRODSNode.java11
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/IRODSOutlineModel.java206
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/IRODSRowModel.java72
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/IRODSSearchTableModel.java2
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/IRODSTree.java417
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/IRODSTreeTransferHandler.java393
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/IRODSTreeTransferable.java11
-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.java161
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/IrodsTreeListenerForBuildingInfoPanel.java13
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/LocalFileNode.java18
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/LocalFileSystemModel.java43
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/LocalFileTree.java330
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/LocalTreeTransferHandler.java233
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/RoundedBorder.java33
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/TagCloudListModel.java63
-rw-r--r--idrop-swing/src/main/java/org/irods/jargon/idrop/exceptions/IdropAlreadyRunningException.java24
-rw-r--r--idrop-swing/src/main/resources/idrop.properties2
-rw-r--r--idrop-swing/src/main/resources/log4j.properties7
-rw-r--r--idrop-swing/src/main/resources/org/irods/jargon/idrop/statusBarPanel.xml32
-rw-r--r--idrop-swing/src/test/java/org/irods/jargon/idrop/desktop/systraygui/services/IRODSFileServiceTest.java272
-rw-r--r--idrop-swing/src/test/java/org/irods/jargon/idrop/desktop/systraygui/services/IdropConfigurationServiceImplTest.java86
-rw-r--r--idrop-swing/src/test/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/IRODSSearchTableModelTest.java18
-rw-r--r--idrop-swing/src/test/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/LocalFileSystemModelTest.java4
-rw-r--r--idrop-swing/src/test/java/org/irods/jargon/idrop/desktop/unittest/AllTests.java27
-rw-r--r--idrop-swing/src/test/resources/testing.properties6
-rw-r--r--idrop-swing/todo.txt86
-rw-r--r--idrop-web/.gitignore2
-rw-r--r--idrop-web/LICENSE.txt20
-rw-r--r--idrop-web/application.properties12
-rw-r--r--idrop-web/designnotes.txt2
-rw-r--r--idrop-web/grails-app/conf/Config.groovy102
-rw-r--r--idrop-web/grails-app/conf/UrlMappings.groovy12
-rw-r--r--idrop-web/grails-app/conf/spring/resources.groovy12
-rw-r--r--idrop-web/grails-app/conf/spring/resources.xml4
-rw-r--r--idrop-web/grails-app/controllers/org/irods/mydrop/controller/BrowseController.groovy26
-rw-r--r--idrop-web/grails-app/controllers/org/irods/mydrop/controller/FileController.groovy159
-rw-r--r--idrop-web/grails-app/controllers/org/irods/mydrop/controller/IdropLiteController.groovy50
-rw-r--r--idrop-web/grails-app/controllers/org/irods/mydrop/controller/LoginController.groovy3
-rw-r--r--idrop-web/grails-app/controllers/org/irods/mydrop/controller/MetadataController.groovy76
-rw-r--r--idrop-web/grails-app/controllers/org/irods/mydrop/controller/SearchController.groovy1
-rw-r--r--idrop-web/grails-app/controllers/org/irods/mydrop/controller/SharingController.groovy241
-rw-r--r--idrop-web/grails-app/controllers/org/irods/mydrop/controller/TagsController.groovy46
-rw-r--r--idrop-web/grails-app/views/browse/browseDetails.gsp123
-rw-r--r--idrop-web/grails-app/views/browse/collectionInfo.gsp66
-rw-r--r--idrop-web/grails-app/views/browse/dataObjectInfo.gsp70
-rw-r--r--idrop-web/grails-app/views/browse/pulldownDataDetails.gsp22
-rw-r--r--idrop-web/grails-app/views/common/_messages.gsp4
-rw-r--r--idrop-web/grails-app/views/common/_panelmessages.gsp3
-rw-r--r--idrop-web/grails-app/views/common/_secondarymain.gsp13
-rw-r--r--idrop-web/grails-app/views/common/_topbar.gsp63
-rw-r--r--idrop-web/grails-app/views/error.gsp56
-rw-r--r--idrop-web/grails-app/views/file/uploadDialog.gsp30
-rw-r--r--idrop-web/grails-app/views/file/uploadDialogDone.gsp8
-rw-r--r--idrop-web/grails-app/views/home/index.gsp180
-rw-r--r--idrop-web/grails-app/views/idropLite/appletLoader.gsp11
-rw-r--r--idrop-web/grails-app/views/index.gsp100
-rw-r--r--idrop-web/grails-app/views/layouts/main.gsp26
-rw-r--r--idrop-web/grails-app/views/login/login.gsp3
-rw-r--r--idrop-web/grails-app/views/metadata/metadataDetails.gsp59
-rw-r--r--idrop-web/grails-app/views/search/searchResult.gsp31
-rw-r--r--idrop-web/grails-app/views/sharing/aclDetails.gsp86
-rw-r--r--idrop-web/grails-app/views/sharing/aclDialog.gsp32
-rw-r--r--idrop-web/grails-app/views/sharing/userPanel.gsp20
-rw-r--r--idrop-web/grails-app/views/tags/tagCloud.gsp2
-rw-r--r--idrop-web/pom.xml2
-rw-r--r--idrop-web/release_notes.txt108
-rw-r--r--idrop-web/src/templates/scaffolding/create.gsp61
-rw-r--r--idrop-web/src/templates/scaffolding/edit.gsp64
-rw-r--r--idrop-web/src/templates/scaffolding/list.gsp61
-rw-r--r--idrop-web/src/templates/scaffolding/show.gsp64
-rw-r--r--idrop-web/test/unit/org/irods/mydrop/controller/BrowseControllerTests.groovy23
-rw-r--r--idrop-web/test/unit/org/irods/mydrop/controller/FileControllerTests.groovy102
-rw-r--r--idrop-web/test/unit/org/irods/mydrop/controller/IdropLiteControllerTests.groovy47
-rw-r--r--idrop-web/test/unit/org/irods/mydrop/controller/MetadataControllerTests.groovy91
-rw-r--r--idrop-web/test/unit/org/irods/mydrop/controller/SharingControllerTests.groovy179
-rw-r--r--idrop-web/web-app/WEB-INF/applicationContext.xml2
-rw-r--r--idrop-web/web-app/css/jqcloud.css59
-rwxr-xr-xidrop-web/web-app/css/jquery.fileupload-ui.css81
-rw-r--r--idrop-web/web-app/css/main.css226
-rw-r--r--idrop-web/web-app/css/reset-fonts-grids.css4
-rw-r--r--idrop-web/web-app/images/ajax-loader-bar.gifbin0 -> 10819 bytes
-rwxr-xr-xidrop-web/web-app/images/pbar-ani.gifbin0 -> 3323 bytes
-rw-r--r--idrop-web/web-app/js/jqcloud-0.1.5.min.js11
-rw-r--r--idrop-web/web-app/js/jqcloud-0.1.6.js104
-rw-r--r--idrop-web/web-app/js/jquery-1.5.2.min.js16
-rw-r--r--idrop-web/web-app/js/jquery-ui-13.js142
-rwxr-xr-xidrop-web/web-app/js/jquery.fileupload-ui.js322
-rwxr-xr-xidrop-web/web-app/js/jquery.fileupload.js642
-rw-r--r--idrop-web/web-app/js/jquery.jeditable.mini.js38
-rw-r--r--idrop-web/web-app/js/mydrop/home.js396
-rw-r--r--idrop-web/web-app/js/mydrop/lingo_common.js385
-rw-r--r--idrop-web/web-app/js/mydrop/main.js58
-rw-r--r--idrop-web/web-app/js/mydrop/search.js62
-rw-r--r--pom.xml27
139 files changed, 10453 insertions, 4925 deletions
diff --git a/.gitignore b/.gitignore
index 5ddaecd..8af2533 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,10 @@
+.metadata
.project
.settings
target
+*.log
+*.war
+Servers
+.DS_Store
+nbactions.xml
+idrop-web/web-app/WEB-INF/classes/
diff --git a/README b/README
index 1016837..4c26675 100644
--- a/README
+++ b/README
@@ -1,8 +1,14 @@
+To run iDrop from the command line & after a Maven build, run the following
+ cd idrop-swing
+ mvn clean install
+ mvn exec:java -Dexec.mainClass=org.irods.jargon.idrop.desktop.systraygui.StartupSequencer
-To run iDrop from the command line & after a Maven build, run the following
-cd idrop-swing
-mvn clean install
-mvn exec:java -Dexec.mainClass=org.irods.jargon.idrop.desktop.systraygui.iDrop
+To skip tests when building:
+
+ cd idrop-swing
+ mvn clean install -Dmaven.test.skip=true
+ mvn exec:java -Dexec.mainClass=org.irods.jargon.idrop.desktop.systraygui.StartupSequencer
+
diff --git a/deps/LICENSE.txt b/deps/LICENSE.txt
new file mode 100644
index 0000000..683e51c
--- /dev/null
+++ b/deps/LICENSE.txt
@@ -0,0 +1,1858 @@
+NETBEANS IDE 7.0 ("Product")
+
+Oracle licenses NetBeans IDE under the CDDL v 1.0 (CDDL) or
+GNU General Public License version 2 (GPL), both of which
+are identified below. You may choose either license to govern
+your use of NetBeans IDE only upon the condition that you
+accept all of the terms of either the CDDL or GPL. Read
+the terms carefully. If you are not willing to be bound by
+these terms, do not download or use NetBeans IDE.
+
+Third party technology that may be necessary for use with
+NetBeans IDE is specified in THIRDPARTYLICENSE.txt. Such
+third party technology is licensed to you under the terms
+of the third party technology license agreement specified
+and not under either the CDDL or GPL.
+
+Please review the list of libraries and licenses provided
+for use. This license file contains five distinct licenses.
+
+Unless specified below, the use of NetBeans IDE and
+components from the GlassFish runtime are governed by the
+terms of either the GNU General Public License Version 2
+with Classpath Exception ("GPLv2 with Classpath Exception")
+or the Common Development and Distribution License ("CDDL").
+The Product also contains components which are governed
+exclusively by the terms of the GPLv2 with Classpath
+Exception (e.g. components from OpenJDK) .
+
+LICENSE #1: GPLv2 with Classpath Exception.
+
+LICENSE #2: CDDL.
+
+LICENSE #3: The use of the Oracle Java Wireless Toolkit 2.5.2
+for CLDC in the Java ME pack is subject to this Software
+License Agreement and Entitlement.
+
+LICENSE #4: The use of the Java ME SDK 3.0 is subject to
+this Software License Agreement and Entitlement.
+
+LICENSE #5: The use of Oracle JDBC drivers is subject to
+this software License Agreement and Entitlement
+
+LICENSE #6: The use of Java Card Development Kit 3.0.2 is
+subject to this software License Agreement and Entitlement
+
+************************************************************
+
+LICENSE #1:
+
+The GNU General Public License (GPL) Version 2, June 1991
+
+Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+
+59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+Everyone is permitted to copy and distribute verbatim copies
+of this license document, but changing it is not allowed.
+
+Preamble
+
+The licenses for most software are designed to take away
+your freedom to share and change it. By contrast, the GNU
+General Public License is intended to guarantee your freedom
+to share and change free software--to make sure the software
+is free for all its users. This General Public License
+applies to most of the Free Software Foundation's software
+and to any other program whose authors commit to using it.
+(Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.) You can
+apply it to your programs, too. When we speak of free
+software, we are referring to freedom, not price. Our
+General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and
+charge for this service if you wish), that you receive
+source code or can get it if you want it, that you can
+change the software or use pieces of it in new free
+programs; and that you know you can do these things. To
+protect your rights, we need to make restrictions that
+forbid anyone to deny you these rights or to ask you to
+surrender the rights. These restrictions translate to
+certain responsibilities for you if you distribute copies of
+the software, or if you modify it.
+
+For example, if you distribute copies of such a program,
+whether gratis or for a fee, you must give the recipients
+all the rights that you have. You must make sure that they,
+too, receive or can get the source code. And you must show
+them these terms so they know their rights.
+
+We protect your rights with two steps: (1) copyright the
+software, and (2) offer you this license which gives you
+legal permission to copy, distribute and/or modify the
+software.
+
+Also, for each author's protection and ours, we want to make
+certain that everyone understands that there is no warranty
+for this free software. If the software is modified by
+someone else and passed on, we want its recipients to know
+that what they have is not the original, so that any
+problems introduced by others will not reflect on the
+original authors' reputations.
+
+Finally, any free program is threatened constantly by
+software patents. We wish to avoid the danger that
+redistributors of a free program will individually obtain
+patent licenses, in effect making the program proprietary.
+To prevent this, we have made it clear that any patent must
+be licensed for everyone's free use or not licensed at all.
+
+The precise terms and conditions for copying, distribution
+and modification follow. TERMS AND CONDITIONS FOR COPYING,
+DISTRIBUTION AND MODIFICATION 0. This License applies to any
+program or other work which contains a notice placed by the
+copyright holder saying it may be distributed under the
+terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the
+Program" means either the Program or any derivative work
+under copyright law: that is to say, a work containing the
+Program or a portion of it, either verbatim or with
+modifications and/or translated into another language.
+(Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as
+"you".
+
+Activities other than copying, distribution and modification
+are not covered by this License; they are outside its scope.
+The act of running the Program is not restricted, and the
+output from the Program is covered only if its contents
+constitute a work based on the Program (independent of
+having been made by running the Program). Whether that is
+true depends on what the Program does.
+
+1. You may copy and distribute verbatim copies of the
+Program's source code as you receive it, in any medium,
+provided that you conspicuously and appropriately publish on
+each copy an appropriate copyright notice and disclaimer of
+warranty; keep intact all the notices that refer to this
+License and to the absence of any warranty; and give any
+other recipients of the Program a copy of this License along
+with the Program.
+
+You may charge a fee for the physical act of transferring a
+copy, and you may at your option offer warranty protection
+in exchange for a fee.
+
+2. You may modify your copy or copies of the Program or any
+portion of it, thus forming a work based on the Program, and
+copy and distribute such modifications or work under the
+terms of Section 1 above, provided that you also meet all of
+these conditions:
+
+a) You must cause the modified files to carry prominent
+notices stating that you changed the files and the date of
+any change.
+
+b) You must cause any work that you distribute or publish,
+that in whole or in part contains or is derived from the
+Program or any part thereof, to be licensed as a whole at no
+charge to all third parties under the terms of this License.
+
+c) If the modified program normally reads commands
+interactively when run, you must cause it, when started
+running for such interactive use in the most ordinary way,
+to print or display an announcement including an appropriate
+copyright notice and a notice that there is no warranty (or
+else, saying that you provide a warranty) and that users may
+redistribute the program under these conditions, and telling
+the user how to view a copy of this License. (Exception: if
+the Program itself is interactive but does not normally
+print such an announcement, your work based on the Program
+is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the
+Program, and can be reasonably considered independent and
+separate works in themselves, then this License, and its
+terms, do not apply to those sections when you distribute
+them as separate works. But when you distribute the same
+sections as part of a whole which is a work based on the
+Program, the distribution of the whole must be on the terms
+of this License, whose permissions for other licensees
+extend to the entire whole, and thus to each and every part
+regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights
+or contest your rights to work written entirely by you;
+rather, the intent is to exercise the right to control the
+distribution of derivative or collective works based on the
+Program. In addition, mere aggregation of another work not
+based on the Program with the Program (or with a work based
+on the Program) on a volume of a storage or distribution
+medium does not bring the other work under the scope of this
+License.
+
+3. You may copy and distribute the Program (or a work based
+on it, under Section 2) in object code or executable form
+under the terms of Sections 1 and 2 above provided that you
+also do one of the following:
+
+a) Accompany it with the complete corresponding
+machine-readable source code, which must be distributed
+under the terms of Sections 1 and 2 above on a medium
+customarily used for software interchange; or,
+
+b) Accompany it with a written offer, valid for at least
+three years, to give any third party, for a charge no more
+than your cost of physically performing source distribution,
+a complete machine-readable copy of the corresponding source
+code, to be distributed under the terms of Sections 1 and 2
+above on a medium customarily used for software interchange;
+or,
+
+c) Accompany it with the information you received as to the
+offer to distribute corresponding source code. (This
+alternative is allowed only for noncommercial distribution
+and only if you received the program in object code or
+executable form with such an offer, in accord with
+Subsection b above.)
+
+The source code for a work means the preferred form of the
+work for making modifications to it. For an executable work,
+complete source code means all the source code for all
+modules it contains, plus any associated interface
+definition files, plus the scripts used to control
+compilation and installation of the executable. However, as
+a special exception, the source code distributed need not
+include anything that is normally distributed (in either
+source or binary form) with the major components (compiler,
+kernel, and so on) of the operating system on which the
+executable runs, unless that component itself accompanies
+the executable. If distribution of executable or object code
+is made by offering access to copy from a designated place,
+then offering equivalent access to copy the source code from
+the same place counts as distribution of the source code,
+even though third parties are not compelled to copy the
+source along with the object code.
+
+4. You may not copy, modify, sublicense, or distribute the
+Program except as expressly provided under this License. Any
+attempt otherwise to copy, modify, sublicense or distribute
+the Program is void, and will automatically terminate your
+rights under this License. However, parties who have
+received copies, or rights, from you under this License will
+not have their licenses terminated so long as such parties
+remain in full compliance.
+
+5. You are not required to accept this License, since you
+have not signed it. However, nothing else grants you
+permission to modify or distribute the Program or its
+derivative works. These actions are prohibited by law if you
+do not accept this License. Therefore, by modifying or
+distributing the Program (or any work based on the Program),
+you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or
+modifying the Program or works based on it.
+
+6. Each time you redistribute the Program (or any work based
+on the Program), the recipient automatically receives a
+license from the original licensor to copy, distribute or
+modify the Program subject to these terms and conditions.
+You may not impose any further restrictions on the
+recipients' exercise of the rights granted herein. You are
+not responsible for enforcing compliance by third parties to
+this License.
+
+7. If, as a consequence of a court judgment or allegation of
+patent infringement or for any other reason (not limited to
+patent issues), conditions are imposed on you (whether by
+court order, agreement or otherwise) that contradict the
+conditions of this License, they do not excuse you from the
+conditions of this License. If you cannot distribute so as
+to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a
+consequence you may not distribute the Program at all. For
+example, if a patent license would not permit royalty-free
+redistribution of the Program by all those who receive
+copies directly or indirectly through you, then the only way
+you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or
+unenforceable under any particular circumstance, the balance
+of the section is intended to apply and the section as a
+whole is intended to apply in other circumstances. It is not
+the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest
+validity of any such claims; this section has the sole
+purpose of protecting the integrity of the free software
+distribution system, which is implemented by public license
+practices. Many people have made generous contributions to
+the wide range of software distributed through that system
+in reliance on consistent application of that system; it is
+up to the author/donor to decide if he or she is willing to
+distribute software through any other system and a licensee
+cannot impose that choice.
+
+This section is intended to make thoroughly clear what is
+believed to be a consequence of the rest of this License.
+
+8. If the distribution and/or use of the Program is
+restricted in certain countries either by patents or by
+copyrighted interfaces, the original copyright holder who
+places the Program under this License may add an explicit
+geographical distribution limitation excluding those
+countries, so that distribution is permitted only in or
+among countries not thus excluded. In such case, this
+License incorporates the limitation as if written in the
+body of this License.
+
+9. The Free Software Foundation may publish revised and/or
+new versions of the General Public License from time to
+time. Such new versions will be similar in spirit to the
+present version, but may differ in detail to address new
+problems or concerns.
+
+Each version is given a distinguishing version number. If
+the Program specifies a version number of this License which
+applies to it and "any later version", you have the option
+of following the terms and conditions either of that version
+or of any later version published by the Free Software
+Foundation. If the Program does not specify a version number
+of this License, you may choose any version ever published
+by the Free Software Foundation.
+
+10. If you wish to incorporate parts of the Program into
+other free programs whose distribution conditions are
+different, write to the author to ask for permission. For
+software which is copyrighted by the Free Software
+Foundation, write to the Free Software Foundation; we
+sometimes make exceptions for this. Our decision will be
+guided by the two goals of preserving the free status of all
+derivatives of our free software and of promoting the
+sharing and reuse of software generally.
+
+NO WARRANTY
+
+11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS
+NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
+APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE
+COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM
+"AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR
+IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE
+OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE
+DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED
+TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY
+WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED
+ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL,
+SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF
+THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT
+LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR
+LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE
+PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH
+HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGES.
+
+END OF TERMS AND CONDITIONS
+
+How to Apply These Terms to Your New Programs
+
+If you develop a new program, and you want it to be of the
+greatest possible use to the public, the best way to achieve
+this is to make it free software which everyone can
+redistribute and change under these terms.
+
+To do so, attach the following notices to the program. It is
+safest to attach them to the start of each source file to
+most effectively convey the exclusion of warranty; and each
+file should have at least the "copyright" line and a pointer
+to where the full notice is found.
+
+One line to give the program's name and a brief idea of what
+it does.
+
+Copyright (C) <year> <name of author>
+
+This program is free software; you can redistribute it
+and/or modify it under the terms of the GNU General Public
+License as published by the Free Software Foundation; either
+version 2 of the License, or (at your option) any later
+version. This program is distributed in the hope that it
+will be useful, but WITHOUT ANY WARRANTY; without even the
+implied warranty of MERCHANTABILITY or FITNESS FOR A
+PARTICULAR PURPOSE. See the GNU General Public License for
+more details. You should have received a copy of the GNU
+General Public License along with this program; if not,
+write to the Free Software Foundation, Inc., 59 Temple
+Place, Suite 330, Boston, MA 02111-1307 USA
+
+Also add information on how to contact you by electronic and
+paper mail.
+
+If the program is interactive, make it output a short notice
+like this when it starts in an interactive mode:
+
+Gnomovision version 69, Copyright (C) year name of author
+Gnomovision comes with ABSOLUTELY NO WARRANTY; for details
+type `show w'. This is free software, and you are welcome to
+redistribute it under certain conditions; type `show c' for
+details. The hypothetical commands `show w' and `show c'
+should show the appropriate parts of the General Public
+License. Of course, the commands you use may be called
+something other than `show w' and `show c'; they could even
+be mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a
+programmer) or your school, if any, to sign a "copyright
+disclaimer" for the program, if necessary. Here is a sample;
+alter the names:
+
+Yoyodyne, Inc., hereby disclaims all copyright interest in
+the program `Gnomovision' (which makes passes at compilers)
+written by James Hacker.
+
+signature of Ty Coon, 1 April 1989
+Ty Coon, President of Vice
+
+This General Public License does not permit incorporating
+your program into proprietary programs. If your program is a
+subroutine library, you may consider it more useful to
+permit linking proprietary applications with the library. If
+this is what you want to do, use the GNU Library General
+Public License instead of this License.
+
+"CLASSPATH" EXCEPTION TO THE GPL VERSION 2
+
+Certain source files distributed by Oracle America, Inc.
+are subject to the following clarification and special
+exception to the GPL Version 2, but only where Oracle has
+expressly included in the particular source file's header
+the words: "Oracle designates this particular file as
+subject to the "Classpath" exception as provided by Oracle
+in the License file that accompanied this code."
+
+Linking this library statically or dynamically with other
+modules is making a combined work based on this library.
+Thus, the terms and conditions of the GNU General Public
+License Version 2 cover the whole combination.
+
+As a special exception, the copyright holders of this
+library give you permission to link this library with
+independent modules to produce an executable, regardless of
+the license terms of these independent modules, and to copy
+and distribute the resulting executable under terms of your
+choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license
+of that module. An independent module is a module which is
+not derived from or based on this library. If you modify
+this library, you may extend this exception to your version
+of the library, but you are not obligated to do so. If you
+do not wish to do so, delete this exception statement from
+your version.
+
+************************************************************
+
+LICENSE #2:
+
+COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL)
+ Version 1.0
+
+1. Definitions.
+
+1.1. "Contributor" means each individual or entity that
+creates or contributes to the creation of Modifications.
+
+1.2. "Contributor Version" means the combination of the
+Original Software, prior Modifications used by a Contributor
+(if any), and the Modifications made by that particular
+Contributor.
+
+1.3. "Covered Software" means (a) the Original Software, or
+(b) Modifications, or (c) the combination of files
+containing Original Software with files containing
+Modifications, in each case including portions thereof.
+
+1.4. "Executable" means the Covered Software in any form
+other than Source Code.
+
+1.5. "Initial Developer" means the individual or entity that
+first makes Original Software available under this License.
+
+1.6. "Larger Work" means a work which combines Covered
+Software or portions thereof with code not governed by the
+terms of this License.
+
+1.7. "License" means this document.
+
+1.8. "Licensable" means having the right to grant, to the
+maximum extent possible, whether at the time of the initial
+grant or subsequently acquired, any and all of the rights
+conveyed herein.
+
+1.9. "Modifications" means the Source Code and Executable
+form of any of the following:
+
+A. Any file that results from an addition to, deletion from
+or modification of the contents of a file containing
+Original Software or previous Modifications;
+
+B. Any new file that contains any part of the Original
+Software or previous Modification; or
+
+C. Any new file that is contributed or otherwise made
+available under the terms of this License.
+
+1.10. "Original Software" means the Source Code and
+Executable form of computer software code that is originally
+released under this License.
+
+1.11. "Patent Claims" means any patent claim(s), now owned
+or hereafter acquired, including without limitation, method,
+process, and apparatus claims, in any patent Licensable by
+grantor.
+
+1.12. "Source Code" means (a) the common form of computer
+software code in which modifications are made and (b)
+associated documentation included in or with such code.
+
+1.13. "You" (or "Your") means an individual or a legal
+entity exercising rights under, and complying with all of
+the terms of, this License. For legal entities, "You"
+includes any entity which controls, is controlled by, or is
+under common control with You. For purposes of this
+definition, "control" means (a) the power, direct or
+indirect, to cause the direction or management of such
+entity, whether by contract or otherwise, or (b) ownership
+of more than fifty percent (50%) of the outstanding shares
+or beneficial ownership of such entity.
+
+2. License Grants.
+
+2.1. The Initial Developer Grant. Conditioned upon Your
+compliance with Section 3.1 below and subject to third party
+intellectual property claims, the Initial Developer hereby
+grants You a world-wide, royalty-free, non-exclusive
+license:
+
+(a) under intellectual property rights (other than patent or
+trademark) Licensable by Initial Developer, to use,
+reproduce, modify, display, perform, sublicense and
+distribute the Original Software (or portions thereof), with
+or without Modifications, and/or as part of a Larger Work;
+and
+
+(b) under Patent Claims infringed by the making, using or
+selling of Original Software, to make, have made, use,
+practice, sell, and offer for sale, and/or otherwise dispose
+of the Original Software (or portions thereof).
+
+(c) The licenses granted in Sections 2.1(a) and (b) are
+effective on the date Initial Developer first distributes or
+otherwise makes the Original Software available to a third
+party under the terms of this License.
+
+(d) Notwithstanding Section 2.1(b) above, no patent license
+is granted: (1) for code that You delete from the Original
+Software, or (2) for infringements caused by: (i) the
+modification of the Original Software, or (ii) the
+combination of the Original Software with other software or
+devices.
+
+2.2. Contributor Grant. Conditioned upon Your compliance
+with Section 3.1 below and subject to third party
+intellectual property claims, each Contributor hereby grants
+You a world-wide, royalty-free, non-exclusive license:
+
+(a) under intellectual property rights (other than patent or
+trademark) Licensable by Contributor to use, reproduce,
+modify, display, perform, sublicense and distribute the
+Modifications created by such Contributor (or portions
+thereof), either on an unmodified basis, with other
+Modifications, as Covered Software and/or as part of a
+Larger Work; and
+
+(b) under Patent Claims infringed by the making, using, or
+selling of Modifications made by that Contributor either
+alone and/or in combination with its Contributor Version (or
+portions of such combination), to make, use, sell, offer for
+sale, have made, and/or otherwise dispose of: (1)
+Modifications made by that Contributor (or portions
+thereof); and (2) the combination of Modifications made by
+that Contributor with its Contributor Version (or portions
+of such combination).
+
+(c) The licenses granted in Sections 2.2(a) and 2.2(b) are
+effective on the date Contributor first distributes or
+otherwise makes the Modifications available to a third
+party.
+
+(d) Notwithstanding Section 2.2(b) above, no patent license
+is granted: (1) for any code that Contributor has deleted
+from the Contributor Version; (2) for infringements caused
+by: (i) third party modifications of Contributor Version, or
+(ii) the combination of Modifications made by that
+Contributor with other software (except as part of the
+Contributor Version) or other devices; or (3) under Patent
+Claims infringed by Covered Software in the absence of
+Modifications made by that Contributor.
+
+3. Distribution Obligations.
+
+3.1. Availability of Source Code.
+
+Any Covered Software that You distribute or otherwise make
+available in Executable form must also be made available in
+Source Code form and that Source Code form must be
+distributed only under the terms of this License. You must
+include a copy of this License with every copy of the Source
+Code form of the Covered Software You distribute or
+otherwise make available. You must inform recipients of any
+such Covered Software in Executable form as to how they can
+obtain such Covered Software in Source Code form in a
+reasonable manner on or through a medium customarily used
+for software exchange.
+
+3.2. Modifications.
+
+The Modifications that You create or to which You contribute
+are governed by the terms of this License. You represent
+that You believe Your Modifications are Your original
+creation(s) and/or You have sufficient rights to grant the
+rights conveyed by this License.
+
+3.3. Required Notices.
+
+You must include a notice in each of Your Modifications that
+identifies You as the Contributor of the Modification. You
+may not remove or alter any copyright, patent or trademark
+notices contained within the Covered Software, or any
+notices of licensing or any descriptive text giving
+attribution to any Contributor or the Initial Developer.
+
+3.4. Application of Additional Terms.
+
+You may not offer or impose any terms on any Covered
+Software in Source Code form that alters or restricts the
+applicable version of this License or the recipients' rights
+hereunder. You may choose to offer, and to charge a fee for,
+warranty, support, indemnity or liability obligations to one
+or more recipients of Covered Software. However, you may do
+so only on Your own behalf, and not on behalf of the Initial
+Developer or any Contributor. You must make it absolutely
+clear that any such warranty, support, indemnity or
+liability obligation is offered by You alone, and You hereby
+agree to indemnify the Initial Developer and every
+Contributor for any liability incurred by the Initial
+Developer or such Contributor as a result of warranty,
+support, indemnity or liability terms You offer.
+
+3.5. Distribution of Executable Versions.
+
+You may distribute the Executable form of the Covered
+Software under the terms of this License or under the terms
+of a license of Your choice, which may contain terms
+different from this License, provided that You are in
+compliance with the terms of this License and that the
+license for the Executable form does not attempt to limit or
+alter the recipient's rights in the Source Code form from
+the rights set forth in this License. If You distribute the
+Covered Software in Executable form under a different
+license, You must make it absolutely clear that any terms
+which differ from this License are offered by You alone, not
+by the Initial Developer or Contributor. You hereby agree to
+indemnify the Initial Developer and every Contributor for
+any liability incurred by the Initial Developer or such
+Contributor as a result of any such terms You offer.
+
+3.6. Larger Works.
+
+You may create a Larger Work by combining Covered Software
+with other code not governed by the terms of this License
+and distribute the Larger Work as a single product. In such
+a case, You must make sure the requirements of this License
+are fulfilled for the Covered Software.
+
+4. Versions of the License.
+
+4.1. New Versions.
+
+Oracle Corporation is the initial license steward and
+may publish revised and/or new versions of this License from
+time to time. Each version will be given a distinguishing
+version number. Except as provided in Section 4.3, no one
+other than the license steward has the right to modify this
+License.
+
+4.2. Effect of New Versions.
+
+You may always continue to use, distribute or otherwise make
+the Covered Software available under the terms of the
+version of the License under which You originally received
+the Covered Software. If the Initial Developer includes a
+notice in the Original Software prohibiting it from being
+distributed or otherwise made available under any subsequent
+version of the License, You must distribute and make the
+Covered Software available under the terms of the version of
+the License under which You originally received the Covered
+Software. Otherwise, You may also choose to use, distribute
+or otherwise make the Covered Software available under the
+terms of any subsequent version of the License published by
+the license steward.
+
+4.3. Modified Versions.
+
+When You are an Initial Developer and You want to create a
+new license for Your Original Software, You may create and
+use a modified version of this License if You: (a) rename
+the license and remove any references to the name of the
+license steward (except to note that the license differs
+from this License); and (b) otherwise make it clear that the
+license contains terms which differ from this License.
+
+5. DISCLAIMER OF WARRANTY.
+
+COVERED SOFTWARE IS PROVIDED UNDER THIS LICENSE ON AN "AS
+IS" BASIS, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR
+IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES THAT THE
+COVERED SOFTWARE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A
+PARTICULAR PURPOSE OR NON-INFRINGING. THE ENTIRE RISK AS TO
+THE QUALITY AND PERFORMANCE OF THE COVERED SOFTWARE IS WITH
+YOU. SHOULD ANY COVERED SOFTWARE PROVE DEFECTIVE IN ANY
+RESPECT, YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER
+CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY SERVICING,
+REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY
+CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF ANY
+COVERED SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS
+DISCLAIMER.
+
+6. TERMINATION.
+
+6.1. This License and the rights granted hereunder will
+terminate automatically if You fail to comply with terms
+herein and fail to cure such breach within 30 days of
+becoming aware of the breach. Provisions which, by their
+nature, must remain in effect beyond the termination of this
+License shall survive.
+
+6.2. If You assert a patent infringement claim (excluding
+declaratory judgment actions) against Initial Developer or a
+Contributor (the Initial Developer or Contributor against
+whom You assert such claim is referred to as "Participant")
+alleging that the Participant Software (meaning the
+Contributor Version where the Participant is a Contributor
+or the Original Software where the Participant is the
+Initial Developer) directly or indirectly infringes any
+patent, then any and all rights granted directly or
+indirectly to You by such Participant, the Initial Developer
+(if the Initial Developer is not the Participant) and all
+Contributors under Sections 2.1 and/or 2.2 of this License
+shall, upon 60 days notice from Participant terminate
+prospectively and automatically at the expiration of such 60
+day notice period, unless if within such 60 day period You
+withdraw Your claim with respect to the Participant Software
+against such Participant either unilaterally or pursuant to
+a written agreement with Participant.
+
+6.3. In the event of termination under Sections 6.1 or 6.2
+above, all end user licenses that have been validly granted
+by You or any distributor hereunder prior to termination
+(excluding licenses granted to You by any distributor) shall
+survive termination.
+
+7. LIMITATION OF LIABILITY.
+
+UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER
+TORT (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL
+YOU, THE INITIAL DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY
+DISTRIBUTOR OF COVERED SOFTWARE, OR ANY SUPPLIER OF ANY OF
+SUCH PARTIES, BE LIABLE TO ANY PERSON FOR ANY INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY
+CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOST
+PROFITS, LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER FAILURE
+OR MALFUNCTION, OR ANY AND ALL OTHER COMMERCIAL DAMAGES OR
+LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF THE
+POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF LIABILITY
+SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY
+RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT
+APPLICABLE LAW PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS
+DO NOT ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL OR
+CONSEQUENTIAL DAMAGES, SO THIS EXCLUSION AND LIMITATION MAY
+NOT APPLY TO YOU.
+
+8. U.S. GOVERNMENT END USERS.
+
+The Covered Software is a "commercial item," as that term is
+defined in 48 C.F.R. 2.101 (Oct. 1995), consisting of
+"commercial computer software" (as that term is defined at
+48 C.F.R. 252.227-7014(a)(1)) and "commercial computer
+software documentation" as such terms are used in 48 C.F.R.
+12.212 (Sept. 1995). Consistent with 48 C.F.R. 12.212 and 48
+C.F.R. 227.7202-1 through 227.7202-4 (June 1995), all U.S.
+Government End Users acquire Covered Software with only
+those rights set forth herein. This U.S. Government Rights
+clause is in lieu of, and supersedes, any other FAR, DFAR,
+or other clause or provision that addresses Government
+rights in computer software under this License.
+
+9. MISCELLANEOUS.
+
+This License represents the complete agreement concerning
+subject matter hereof. If any provision of this License is
+held to be unenforceable, such provision shall be reformed
+only to the extent necessary to make it enforceable. This
+License shall be governed by the law of the jurisdiction
+specified in a notice contained within the Original Software
+(except to the extent applicable law, if any, provides
+otherwise), excluding such jurisdiction's conflict-of-law
+provisions. Any litigation relating to this License shall be
+subject to the jurisdiction of the courts located in the
+jurisdiction and venue specified in a notice contained
+within the Original Software, with the losing party
+responsible for costs, including, without limitation, court
+costs and reasonable attorneys' fees and expenses. The
+application of the United Nations Convention on Contracts
+for the International Sale of Goods is expressly excluded.
+Any law or regulation which provides that the language of a
+contract shall be construed against the drafter shall not
+apply to this License. You agree that You alone are
+responsible for compliance with the United States export
+administration regulations (and the export control laws and
+regulation of any other countries) when You use, distribute
+or otherwise make available any Covered Software.
+
+10. RESPONSIBILITY FOR CLAIMS.
+
+As between Initial Developer and the Contributors, each
+party is responsible for claims and damages arising,
+directly or indirectly, out of its utilization of rights
+under this License and You agree to work with Initial
+Developer and Contributors to distribute such responsibility
+on an equitable basis. Nothing herein is intended or shall
+be deemed to constitute any admission of liability.
+
+************************************************************
+
+LICENSE #3:
+
+SUN JAVA WIRELESS TOOLKIT 2.5.2 FOR CLDC
+
+Sun Microsystems, Inc. ("Sun") ENTITLEMENT for SOFTWARE
+
+Licensee/Company: Entity receiving Software.
+
+Effective Date: Date of delivery of the Software to You.
+
+Software:
+-Sun Java Wireless Toolkit 2.5.2 for CLDC
+-SVG Renderer Library
+
+License Term: Perpetual (subject to termination under the
+SLA).
+
+Licensed Unit: Software Copy.
+
+Licensed unit Count: Unlimited.
+
+Permitted Uses:
+
+1. You may reproduce and use the Software for Your own
+Individual, Commercial and Research and Instructional Use
+only for the purposes of designing, developing, testing,
+and running Your applets and applications ("Programs").
+
+2. Subject to the terms and conditions of this Agreement and
+restrictions and exceptions set forth in the Software's
+documentation, You may reproduce and distribute portions of
+Software identified as a redistributable in the
+documentation (each a "Redistributable"), provided that You
+comply with the following (note that You may be entitled to
+reproduce and distribute other portions of the Software not
+defined in the documentation as a Redistributable under
+certain other licenses as described in the
+THIRDPARTYLICENSEREADME, if applicable):
+
+(a) You distribute Redistributable complete and unmodified
+and only bundled as part of Your Programs,
+
+(b) Your Programs add significant and primary functionality
+to the Redistributable,
+
+(c) You distribute Redistributable for the sole purpose of
+running Your Programs,
+
+(d) You do not distribute additional software intended to
+replace any component(s) of the Redistributable,
+
+(e) You do not remove or alter any proprietary legends or
+notices contained in or on the Redistributable.
+
+(f) You only distribute the Redistributable subject to a
+license agreement that protects Sun's interests consistent
+with the terms contained in this Agreement, and
+
+(g) You agree to defend and indemnify Sun and its licensors
+from and against any damages, costs, liabilities,
+settlement amounts and/or expenses (including attorneys'
+fees) incurred in connection with any claim, lawsuit or
+action by any third party that arises or results from the
+use or distribution of any and all Programs and/or
+Redistributable.
+
+3. Java Technology Restrictions. You may not create,
+modify, or change the behavior of, or authorize Your
+licensees to create, modify, or change the behavior of,
+classes, interfaces, or subpackages that are in any way
+identified as "java", "javax", "sun" or similar convention
+as specified by Sun in any naming convention designation.
+
+
+Sun Microsystems, Inc. ("Sun") SOFTWARE LICENSE AGREEMENT
+
+READ THE TERMS OF THIS AGREEMENT ("AGREEMENT") CAREFULLY
+BEFORE OPENING SOFTWARE MEDIA PACKAGE. BY OPENING SOFTWARE
+MEDIA PACKAGE, YOU AGREE TO THE TERMS OF THIS AGREEMENT. IF
+YOU DO NOT AGREE TO ALL OF THE TERMS, PROMPTLY RETURN THE
+UNUSED SOFTWARE TO YOUR PLACE OF PURCHASE FOR A REFUND. IF
+YOU HAVE SEPARATELY AGREED TO LICENSE TERMS ("MASTER TERMS")
+FOR YOUR LICENSE TO THIS SOFTWARE, THEN SECTIONS 1-6 OF THIS
+AGREEMENT ("SUPPLEMENTAL LICENSE TERMS") SHALL SUPPLEMENT
+AND SUPERSEDE THE MASTER TERMS IN RELATION TO THIS SOFTWARE.
+
+1. Definitions.
+
+(a) "Entitlement" means the collective set of applicable
+documents authorized by Sun evidencing your obligation to
+pay associated fees (if any) for the license, associated
+Services, and the authorized scope of use of Software under
+this Agreement.
+
+(b) "Licensed Unit" means the unit of measure by which
+your use of Software and/or Service is licensed, as
+described in your Entitlement.
+
+(c) "Permitted Use" means the licensed Software use(s)
+authorized in this Agreement as specified in your
+Entitlement. The Permitted Use for any bundled Sun software
+not specified in your Entitlement will be evaluation use as
+provided in Section 3.
+
+(d) "Service" means the service(s) that Sun or its
+delegate will provide, if any, as selected in your
+Entitlement and as further described in the applicable
+service listings at www.sun.com/service/servicelist.
+
+(e) "Software" means the Sun software described in your
+Entitlement. Also, certain software may be included for
+evaluation use under Section 3.
+
+(f) "You" and "Your" means the individual or legal
+entity specified in the Entitlement, or for evaluation
+purposes, the entity performing the evaluation.
+
+2. License Grant and Entitlement.
+
+Subject to the terms of your Entitlement, Sun grants you a
+nonexclusive, nontransferable limited license to use
+Software for its Permitted Use for the license term. Your
+Entitlement will specify (a) Software licensed, (b) the
+Permitted Use, (c) the license term, and (d) the Licensed
+Units.
+
+Additionally, if your Entitlement includes Services, then it
+will also specify the (e) Service and (f) service term.
+
+If your rights to Software or Services are limited in
+duration and the date such rights begin is other than the
+purchase date, your Entitlement will provide that beginning
+date(s).
+
+The Entitlement may be delivered to you in various ways
+depending on the manner in which you obtain Software and
+Services, for example, the Entitlement may be provided in
+your receipt, invoice or your contract with Sun or
+authorized Sun reseller. It may also be in electronic format
+if you download Software.
+
+3. Permitted Use.
+
+As selected in your Entitlement, one or more of the
+following Permitted Uses will apply to your use of Software.
+Unless you have an Entitlement that expressly permits it,
+you may not use Software for any of the other Permitted
+Uses. If you don't have an Entitlement, or if your
+Entitlement doesn't cover additional software delivered to
+you, then such software is for your Evaluation Use.
+
+(a) Evaluation Use. You may evaluate Software internally for
+a period of 90 days from your first use.
+
+(b) Research and Instructional Use. You may use Software
+internally to design, develop and test, and also to provide
+instruction on such uses.
+
+(c) Individual Use. You may use Software internally for
+personal, individual use.
+
+(d) Commercial Use. You may use Software internally for your
+own commercial purposes.
+
+(e) Service Provider Use. You may make Software
+functionality accessible (but not by providing Software
+itself or through outsourcing services) to your end users in
+an extranet deployment, but not to your affiliated companies
+or to government agencies.
+
+4. Licensed Units.
+
+Your Permitted Use is limited to the number of Licensed
+Units stated in your Entitlement. If you require additional
+Licensed Units, you will need additional Entitlement(s).
+
+5. Restrictions.
+
+(a) The copies of Software provided to you under this
+Agreement is licensed, not sold, to you by Sun. Sun reserves
+all rights not expressly granted. (b) You may make a single
+archival copy of Software, but otherwise may not copy,
+modify, or distribute Software. However if the Sun
+documentation accompanying Software lists specific portions
+of Software, such as header files, class libraries,
+reference source code, and/or redistributable files, that
+may be handled differently, you may do so only as provided
+in the Sun documentation. (c) You may not rent, lease, lend
+or encumber Software. (d) Unless enforcement is prohibited
+by applicable law, you may not decompile, or reverse
+engineer Software. (e) The terms and conditions of this
+Agreement will apply to any Software updates, provided to
+you at Sun's discretion, that replace and/or supplement the
+original Software, unless such update contains a separate
+license. (f) You may not publish or provide the results of
+any benchmark or comparison tests run on Software to any
+third party without the prior written consent of Sun. (g)
+Software is confidential and copyrighted. (h) Unless
+otherwise specified, if Software is delivered with embedded
+or bundled software that enables functionality of Software,
+you may not use such software on a stand-alone basis or use
+any portion of such software to interoperate with any
+program(s) other than Software. (i) Software may contain
+programs that perform automated collection of system data
+and/or automated software updating services. System data
+collected through such programs may be used by Sun, its
+subcontractors, and its service delivery partners for the
+purpose of providing you with remote system services and/or
+improving Sun's software and systems. (j) Software is not
+designed, licensed or intended for use in the design,
+construction, operation or maintenance of any nuclear
+facility and Sun and its licensors disclaim any express or
+implied warranty of fitness for such uses. (k) No right,
+title or interest in or to any trademark, service mark, logo
+or trade name of Sun or its licensors is granted under this
+Agreement.
+
+6. Java Compatibility and Open Source.
+
+Software may contain Java technology. You may not create
+additional classes to, or modifications of, the Java
+technology, except under compatibility requirements
+available under a separate agreement available at
+www.java.net.
+
+Sun supports and benefits from the global community of open
+source developers, and thanks the community for its
+important contributions and open standards- based
+technology, which Sun has adopted into many of its products.
+
+Please note that portions of Software may be provided with
+notices and open source licenses from such communities and
+third parties that govern the use of those portions, and any
+licenses granted hereunder do not alter any rights and
+obligations you may have under such open source licenses,
+however, the disclaimer of warranty and limitation of
+liability provisions in this Agreement will apply to all
+Software in this distribution.
+
+7. Term and Termination.
+
+The license and service term are set forth in your
+Entitlement(s). Your rights under this Agreement will
+terminate immediately without notice from Sun if you
+materially breach it or take any action in derogation of
+Sun's and/or its licensors' rights to Software. Sun may
+terminate this Agreement should any Software become, or in
+Sun's reasonable opinion likely to become, the subject of a
+claim of intellectual property infringement or trade secret
+misappropriation. Upon termination, you will cease use of,
+and destroy, Software and confirm compliance in writing to
+Sun. Sections 1, 5, 6, 7, and 9-15 will survive termination
+of the Agreement.
+
+8. Limited Warranty.
+
+Sun warrants to you that for a period of 90 days from the
+date of purchase, as evidenced by a copy of the receipt, the
+media on which Software is furnished (if any) will be free
+of defects in materials and workmanship under normal use.
+Except for the foregoing, Software is provided "AS IS". Your
+exclusive remedy and Sun's entire liability under this
+limited warranty will be at Sun's option to replace Software
+media or refund the fee paid for Software. Some states do
+not allow limitations on certain implied warranties, so the
+above may not apply to you. This limited warranty gives you
+specific legal rights. You may have others, which vary from
+state to state.
+
+9. Disclaimer of Warranty.
+
+UNLESS SPECIFIED IN THIS AGREEMENT, ALL EXPRESS OR IMPLIED
+CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING ANY
+IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+PARTICULAR PURPOSE OR NON-INFRINGEMENT ARE DISCLAIMED,
+EXCEPT TO THE EXTENT THAT THESE DISCLAIMERS ARE HELD TO BE
+LEGALLY INVALID.
+
+10. Limitation of Liability.
+
+TO THE EXTENT NOT PROHIBITED BY LAW, IN NO EVENT WILL SUN OR
+ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR
+DATA, OR FOR SPECIAL, INDIRECT, CONSEQUENTIAL, INCIDENTAL OR
+PUNITIVE DAMAGES, HOWEVER CAUSED REGARDLESS OF THE THEORY OF
+LIABILITY, ARISING OUT OF OR RELATED TO THE USE OF OR
+INABILITY TO USE SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF
+THE POSSIBILITY OF SUCH DAMAGES. In no event will Sun's
+liability to you, whether in contract, tort (including
+negligence), or otherwise, exceed the amount paid by you for
+Software under this Agreement. The foregoing limitations
+will apply even if the above stated warranty fails of its
+essential purpose. Some states do not allow the exclusion of
+incidental or consequential damages, so some of the terms
+above may not be applicable to you.
+
+11. Export Regulations.
+
+All Software, documents, technical data, and any other
+materials delivered under this Agreement are subject to U.S.
+export control laws and may be subject to export or import
+regulations in other countries. You agree to comply strictly
+with these laws and regulations and acknowledge that you
+have the responsibility to obtain any licenses to export,
+re-export, or import as may be required after delivery to
+you.
+
+12. U.S. Government Restricted Rights.
+
+If Software is being acquired by or on behalf of the U.S.
+Government or by a U.S. Government prime contractor or
+subcontractor (at any tier), then the Government's rights
+in Software and accompanying documentation will be only as
+set forth in this Agreement; this is in accordance with 48
+CFR 227.7201 through 227.7202-4 (for Department of Defense
+(DOD) acquisitions) and with 48 CFR 2.101 and 12.212 (for
+non-DOD acquisitions).
+
+13. Governing Law.
+
+Any action related to this Agreement will be governed by
+California law and controlling U.S. federal law. No choice
+of law rules of any jurisdiction will apply.
+
+14. Severability.
+
+If any provision of this Agreement is held to be
+unenforceable, this Agreement will remain in effect with
+the provision omitted, unless omission would frustrate the
+intent of the parties, in which case this Agreement will
+immediately terminate.
+
+15. Integration.
+
+This Agreement, including any terms contained in your
+Entitlement, is the entire agreement between you and Sun
+relating to its subject matter. It supersedes all prior or
+contemporaneous oral or written communications, proposals,
+representations and warranties and prevails over any
+conflicting or additional terms of any quote, order,
+acknowledgment, or other communication between the parties
+relating to its subject matter during the term of this
+Agreement. No modification of this Agreement will be
+binding, unless in writing and signed by an authorized
+representative of each party.
+
+Please contact Sun Microsystems, Inc. 4150 Network Circle,
+Santa Clara, California 95054 if you have questions.
+
+************************************************************
+
+LICENSE #4:
+
+JAVA PLATFORM, MICRO EDITION SOFTWARE DEVELOPMENT KIT 3.0
+
+Sun Microsystems, Inc. ("Sun") ENTITLEMENT for SOFTWARE
+
+Licensee/Company: Entity receiving Software.
+
+Effective Date: Date of delivery of the Software to You.
+
+Software: Java Platform, Micro Edition Software Development
+Kit 3.0.
+
+License Term: Perpetual (subject to termination under the
+SLA).
+
+Licensed Unit: Software Copy.
+
+Licensed unit Count: Unlimited.
+
+Permitted Uses:
+
+1. You may reproduce and use the Software for Your own
+Individual, Commercial and Research and Instructional Use
+only for the purposes of designing, developing, testing, and
+running Your and applications.
+
+2. Java Technology Restrictions. You may not create,
+modify, or change the behavior of, or authorize Your
+licensees to create, modify, or change the behavior of,
+classes, interfaces, or subpackages that are in any way
+identified as "java", "javax", "sun" or similar convention
+as specified by Sun in any naming convention designation.
+
+3. In no event will Sun's or its licensor's liability to
+You, whether in contract, tort (including negligence), or
+otherwise, exceed the amount paid by You for Software under
+this Agreement. The foregoing limitations will apply even
+if the below stated warranty fails of its essential purpose.
+
+
+Sun Microsystems, Inc. ("Sun")
+SOFTWARE LICENSE AGREEMENT
+
+READ THE TERMS OF THIS AGREEMENT ("AGREEMENT") CAREFULLY
+BEFORE OPENING SOFTWARE MEDIA PACKAGE. BY OPENING SOFTWARE
+MEDIA PACKAGE, YOU AGREE TO THE TERMS OF THIS AGREEMENT. IF
+YOU ARE ACCESSING SOFTWARE ELECTRONICALLY, INDICATE YOUR
+ACCEPTANCE OF THESE TERMS BY SELECTING THE "ACCEPT" BUTTON
+AT THE END OF THIS AGREEMENT. IF YOU DO NOT AGREE TO ALL OF
+THE TERMS, PROMPTLY RETURN THE UNUSED SOFTWARE TO YOUR PLACE
+OF PURCHASE FOR A REFUND OR, IF SOFTWARE IS ACCESSED
+ELECTRONICALLY, SELECT THE "DECLINE" (OR "EXIT") BUTTON AT
+THE END OF THIS AGREEMENT. IF YOU HAVE SEPARATELY AGREED TO
+LICENSE TERMS ("MASTER TERMS") FOR YOUR LICENSE TO THIS
+SOFTWARE, THEN SECTIONS 1-6 OF THIS AGREEMENT ("SUPPLEMENTAL
+LICENSE TERMS") SHALL SUPPLEMENT AND SUPERSEDE THE MASTER
+TERMS IN RELATION TO THIS SOFTWARE.
+
+1. Definitions.
+
+(a) "Entitlement" means the collective set of applicable
+documents authorized by Sun evidencing your obligation to
+pay associated fees (if any) for the license, associated
+Services, and the authorized scope of use of Software under
+this Agreement.
+
+(b) "Licensed Unit" means the unit of measure by which
+your use of Software and/or Service is licensed, as
+described in your Entitlement.
+
+(c) "Permitted Use" means the licensed Software use(s)
+authorized in this Agreement as specified in your
+Entitlement. The Permitted Use for any bundled Sun software
+not specified in your Entitlement will be evaluation use as
+provided in Section 3.
+
+(d) "Service" means the service(s) that Sun or its
+delegate will provide, if any, as selected in your
+Entitlement and as further described in the applicable
+service listings at www.sun.com/service/servicelist.
+
+(e) "Software" means the Sun software described in your
+Entitlement. Also, certain software may be included for
+evaluation use under Section 3.
+
+(f) "You" and "Your" means the individual or legal
+entity specified in the Entitlement, or for evaluation
+purposes, the entity performing the evaluation.
+
+2. License Grant and Entitlement.
+
+Subject to the terms of your Entitlement, Sun grants you a
+nonexclusive, nontransferable limited license to use
+Software for its Permitted Use for the license term. Your
+Entitlement will specify (a) Software licensed, (b) the
+Permitted Use, (c) the license term, and (d) the Licensed
+Units.
+
+Additionally, if your Entitlement includes Services, then it
+will also specify the (e) Service and (f) service term.
+
+If your rights to Software or Services are limited in
+duration and the date such rights begin is other than the
+purchase date, your Entitlement will provide that beginning
+date(s).
+
+The Entitlement may be delivered to you in various ways
+depending on the manner in which you obtain Software and
+Services, for example, the Entitlement may be provided in
+your receipt, invoice or your contract with Sun or
+authorized Sun reseller. It may also be in electronic format
+if you download Software.
+
+3. Permitted Use.
+
+As selected in your Entitlement, one or more of the
+following Permitted Uses will apply to your use of Software.
+Unless you have an Entitlement that expressly permits it,
+you may not use Software for any of the other Permitted
+Uses. If you don't have an Entitlement, or if your
+Entitlement doesn't cover additional software delivered to
+you, then such software is for your Evaluation Use.
+
+(a) Evaluation Use. You may evaluate Software internally for
+a period of 90 days from your first use.
+
+(b) Research and Instructional Use. You may use Software
+internally to design, develop and test, and also to provide
+instruction on such uses.
+
+(c) Individual Use. You may use Software internally for
+personal, individual use.
+
+(d) Commercial Use. You may use Software internally for your
+own commercial purposes.
+
+(e) Service Provider Use. You may make Software
+functionality accessible (but not by providing Software
+itself or through outsourcing services) to your end users in
+an extranet deployment, but not to your affiliated companies
+or to government agencies.
+
+4. Licensed Units.
+
+Your Permitted Use is limited to the number of Licensed
+Units stated in your Entitlement. If you require additional
+Licensed Units, you will need additional Entitlement(s).
+
+5. Restrictions.
+
+(a) The copies of Software provided to you under this
+Agreement are licensed, not sold, to you by Sun. Sun
+reserves all rights not expressly granted. (b) You may make
+a single archival copy of Software, but otherwise may not
+copy, modify, or distribute Software. However if the Sun
+documentation accompanying Software lists specific portions
+of Software, such as header files, class libraries,
+reference source code, and/or redistributable files, that
+may be handled differently, you may do so only as provided
+in the Sun documentation. (c) You may not rent, lease, lend
+or encumber Software. (d) Unless enforcement is prohibited
+by applicable law, you may not decompile, or reverse
+engineer Software. (e) The terms and conditions of this
+Agreement will apply to any Software updates, provided to
+you at Sun's discretion, that replace and/or supplement the
+original Software, unless such update contains a separate
+license. (f) You may not publish or provide the results of
+any benchmark or comparison tests run on Software to any
+third party without the prior written consent of Sun. (g)
+Software is confidential and copyrighted. (h) Unless
+otherwise specified, if Software is delivered with embedded
+or bundled software that enables functionality of Software,
+you may not use such software on a stand-alone basis or use
+any portion of such software to interoperate with any
+program(s) other than Software. (i) Software may contain
+programs that perform automated collection of system data
+and/or automated software updating services. System data
+collected through such programs may be used by Sun, its
+subcontractors, and its service delivery partners for the
+purpose of providing you with remote system services and/or
+improving Sun's software and systems. (j) Software is not
+designed, licensed or intended for use in the design,
+construction, operation or maintenance of any nuclear
+facility and Sun and its licensors disclaim any express or
+implied warranty of fitness for such uses. (k) No right,
+title or interest in or to any trademark, service mark, logo
+or trade name of Sun or its licensors is granted under this
+Agreement.
+
+6. Java Compatibility and Open Source.
+
+Software may contain Java technology. You may not create
+additional classes to, or modifications of, the Java
+technology, except under compatibility requirements
+available under a separate agreement available at
+www.java.net.
+
+Sun supports and benefits from the global community of open
+source developers, and thanks the community for its
+important contributions and open standards-based technology,
+which Sun has adopted into many of its products.
+
+Please note that portions of Software may be provided with
+notices and open source licenses from such communities and
+third parties that govern the use of those portions, and any
+licenses granted hereunder do not alter any rights and
+obligations you may have under such open source licenses,
+however, the disclaimer of warranty and limitation of
+liability provisions in this Agreement will apply to all
+Software in this distribution.
+
+7. Term and Termination.
+
+The license and service term are set forth in your
+Entitlement(s). Your rights under this Agreement will
+terminate immediately without notice from Sun if you
+materially breach it or take any action in derogation of
+Sun's and/or its licensors' rights to Software. Sun may
+terminate this Agreement should any Software become, or in
+Sun's reasonable opinion likely to become, the subject of a
+claim of intellectual property infringement or trade secret
+misappropriation. Upon termination, you will cease use of,
+and destroy, Software and confirm compliance in writing to
+Sun. Sections 1, 5, 6, 7, and 9-15 will survive termination
+of the Agreement.
+
+
+8. Limited Warranty.
+
+Sun warrants to you that for a period of 90 days from the
+date of purchase, as evidenced by a copy of the receipt, the
+media on which Software is furnished (if any) will be free
+of defects in materials and workmanship under normal use.
+Except for the foregoing, Software is provided "AS IS". Your
+exclusive remedy and Sun's entire liability under this
+limited warranty will be at Sun's option to replace Software
+media or refund the fee paid for Software. Some states do
+not allow limitations on certain implied warranties, so the
+above may not apply to you. This limited warranty gives you
+specific legal rights. You may have others, which vary from
+state to state.
+
+9. Disclaimer of Warranty.
+
+UNLESS SPECIFIED IN THIS AGREEMENT, ALL EXPRESS OR IMPLIED
+CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING ANY
+IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+PARTICULAR PURPOSE OR NON-INFRINGEMENT ARE DISCLAIMED,
+EXCEPT TO THE EXTENT THAT THESE DISCLAIMERS ARE HELD TO BE
+LEGALLY INVALID.
+
+10. Limitation of Liability.
+
+TO THE EXTENT NOT PROHIBITED BY LAW, IN NO EVENT WILL SUN OR
+ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR
+DATA, OR FOR SPECIAL, INDIRECT, CONSEQUENTIAL, INCIDENTAL OR
+PUNITIVE DAMAGES, HOWEVER CAUSED REGARDLESS OF THE THEORY OF
+LIABILITY, ARISING OUT OF OR RELATED TO THE USE OF OR
+INABILITY TO USE SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF
+THE POSSIBILITY OF SUCH DAMAGES. In no event will Sun's
+liability to you, whether in contract, tort (including
+negligence), or otherwise, exceed the amount paid by you for
+Software under this Agreement. The foregoing limitations
+will apply even if the above stated warranty fails of its
+essential purpose. Some states do not allow the exclusion of
+incidental or consequential damages, so some of the terms
+above may not be applicable to you.
+
+11. Export Regulations.
+
+All Software, documents, technical data, and any other
+materials delivered under this Agreement are subject to U.S.
+export control laws and may be subject to export or import
+regulations in other countries. You agree to comply strictly
+with these laws and regulations and acknowledge that you
+have the responsibility to obtain any licenses to export,
+re-export, or import as may be required after delivery to
+you.
+
+12. U.S. Government Restricted Rights.
+
+If Software is being acquired by or on behalf of the U.S.
+Government or by a U.S. Government prime contractor or
+subcontractor (at any tier), then the Government's rights in
+Software and accompanying documentation will be only as set
+forth in this Agreement; this is in accordance with 48 CFR
+227.7201 through 227.7202-4 (for Department of Defense (DOD)
+acquisitions) and with 48 CFR 2.101 and 12.212 (for non-DOD
+acquisitions).
+
+13. Governing Law.
+
+Any action related to this Agreement will be governed by
+California law and controlling U.S. federal law. No choice
+of law rules of any jurisdiction will apply.
+
+14. Severability.
+
+If any provision of this Agreement is held to be
+unenforceable, this Agreement will remain in effect with the
+provision omitted, unless omission would frustrate the
+intent of the parties, in which case this Agreement will
+immediately terminate.
+
+15. Integration.
+
+This Agreement, including any terms contained in your
+Entitlement, is the entire agreement between you and Sun
+relating to its subject matter. It supersedes all prior or
+contemporaneous oral or written communications, proposals,
+representations and warranties and prevails over any
+conflicting or additional terms of any quote, order,
+acknowledgment, or other communication between the parties
+relating to its subject matter during the term of this
+Agreement. No modification of this Agreement will be
+binding, unless in writing and signed by an authorized
+representative of each party.
+
+Please contact Sun Microsystems, Inc. 4150 Network Circle,
+Santa Clara, California 95054 if you have questions.
+
+************************************************************
+
+LICENSE #5:
+
+Oracle JDBC Drivers are made available under the terms of
+the Oracle Technology Network Development and Distribution
+License Terms:
+The License and entitlements are detailed on the following
+web page:
+http://www.oracle.com/technetwork/licenses/distribution-license-152002.html
+
+************************************************************
+
+LICENSE #6:
+
+License Agreement for Java Card Development Kit 3.0.2 Revenue
+Release
+
+Sun Microsystems, Inc. ("Sun") ENTITLEMENT for SOFTWARE
+Licensee/Company: Entity receiving Software.
+Effective Date: Date of delivery of the Software to You.
+Software: Java Card Development Kit 3.0.2.
+License Term: Perpetual (subject to termination under the SLA).
+Licensed Unit: Software Copy.
+Licensed unit Count: Unlimited.
+Permitted Uses:
+
+1. You may reproduce and use the Software for Research and
+Instructional Use only for the purposes of designing, developing,
+testing, and running Your applets and applications ("Programs").
+
+2. Subject to the terms and conditions of this Agreement and
+restrictions and exceptions set forth in the Software's
+documentation, You may reproduce and distribute portions of
+Software identified as a redistributable in the documentation
+("Redistributable"), provided that:
+
+(a) You distribute Redistributable complete and unmodified
+and only bundled as part of Your Programs,
+
+(b) Your Programs add significant and primary functionality
+to the Redistributable,
+
+(c) You do not distribute additional software intended to
+replace any component(s) of the Redistributable,
+
+(d) You do not remove or alter any proprietary legends or
+notices contained in or on the Redistributable.
+
+(e) You only distribute the Redistributable subject to a
+license agreement that protects Sun's interests consistent
+with the terms contained in this Agreement, and
+
+(f) You agree to defend and indemnify Sun and its licensors
+from and against any damages, costs, liabilities, settlement
+amounts and/or expenses (including attorneys' fees) incurred
+in connection with any claim, lawsuit or action by any third
+party that arises or results from the use or distribution of
+any and all Programs and/or Redistributable.
+
+3. Java Technology Restrictions. You may not create, modify,
+or change the behavior of, or authorize Your licensees to
+create, modify, or change the behavior of, classes,
+interfaces, or subpackages that are in any way identified
+as "java", "javax", "sun" or similar convention as specified
+by Sun in any naming convention designation.
+
+Sun Microsystems, Inc. ("Sun")
+
+SOFTWARE LICENSE AGREEMENT
+
+READ THE TERMS OF THIS AGREEMENT ("AGREEMENT") CAREFULLY
+BEFORE OPENING SOFTWARE MEDIA PACKAGE. BY OPENING SOFTWARE
+MEDIA PACKAGE, YOU AGREE TO THE TERMS OF THIS AGREEMENT. IF
+YOU ARE ACCESSING SOFTWARE ELECTRONICALLY, INDICATE YOUR
+ACCEPTANCE OF THESE TERMS BY SELECTING THE "ACCEPT" BUTTON
+AT THE END OF THIS AGREEMENT. IF YOU DO NOT AGREE TO ALL OF
+THE TERMS, PROMPTLY RETURN THE UNUSED SOFTWARE TO YOUR PLACE
+OF PURCHASE FOR A REFUND OR, IF SOFTWARE IS ACCESSED
+ELECTRONICALLY, SELECT THE "DECLINE" (OR "EXIT") BUTTON AT
+THE END OF THIS AGREEMENT. IF YOU HAVE SEPARATELY AGREED TO
+LICENSE TERMS ("MASTER TERMS") FOR YOUR LICENSE TO THIS
+SOFTWARE, THEN SECTIONS 1-6 OF THIS AGREEMENT ("SUPPLEMENTAL
+LICENSE TERMS") SHALL SUPPLEMENT AND SUPERSEDE THE MASTER
+TERMS IN RELATION TO THIS SOFTWARE.
+
+1. Definitions.
+
+(a) "Entitlement" means the collective set of applicable
+documents authorized by Sun evidencing your obligation to
+pay associated fees (if any) for the license, associated
+Services, and the authorized scope of use of Software under
+this Agreement.
+
+(b) "Licensed Unit" means the unit of measure by which your
+use of Software and/or Service is licensed, as described in
+your Entitlement.
+
+(c) "Permitted Use" means the licensed Software use(s)
+authorized in this Agreement as specified in your Entitlement.
+The Permitted Use for any bundled Sun software not specified
+in your Entitlement will be evaluation use as provided in
+Section 3.
+
+(d) "Service" means the service(s) that Sun or its delegate
+will provide, if any, as selected in your Entitlement and
+as further described in the applicable service listings
+at www.sun.com/service/servicelist.
+
+(e) "Software" means the Sun software described in your
+Entitlement. Also, certain software may be included for
+evaluation use under Section 3.
+
+(f) "You" and "Your" means the individual or legal entity
+specified in the Entitlement, or for evaluation purposes,
+the entity performing the evaluation.
+
+2. License Grant and Entitlement.
+
+Subject to the terms of your Entitlement, Sun grants you
+a nonexclusive, nontransferable limited license to use
+Software for its Permitted Use for the license term. Your
+Entitlement will specify (a) Software licensed, (b) the
+Permitted Use, (c) the license term, and (d) the Licensed
+Units.
+
+Additionally, if your Entitlement includes Services, then
+it will also specify the (e) Service and (f) service term.
+
+If your rights to Software or Services are limited in
+duration and the date such rights begin is other than the
+purchase date, your Entitlement will provide that beginning
+date(s).
+
+The Entitlement may be delivered to you in various ways
+depending on the manner in which you obtain Software and
+Services, for example, the Entitlement may be provided in
+your receipt, invoice or your contract with Sun or authorized
+Sun reseller. It may also be in electronic format if you
+download Software.
+
+3. Permitted Use.
+
+As selected in your Entitlement, one or more of the following
+Permitted Uses will apply to your use of Software. Unless you
+have an Entitlement that expressly permits it, you may not
+use Software for any of the other Permitted Uses. If you
+don't have an Entitlement, or if your Entitlement doesn't
+cover additional software delivered to you, then such
+software is for your Evaluation Use.
+
+(a) Evaluation Use. You may evaluate Software internally for
+a period of 90 days from your first use.
+
+(b) Research and Instructional Use. You may use Software
+internally to design, develop and test, and also to provide
+instruction on such uses.
+
+(c) Individual Use. You may use Software internally for
+personal, individual use.
+
+(d) Commercial Use. You may use Software internally for
+your own commercial purposes.
+
+(e) Service Provider Use. You may make Software functionality
+accessible (but not by providing Software itself or through
+outsourcing services) to your end users in an extranet
+deployment, but not to your affiliated companies or to
+government agencies.
+
+4. Licensed Units.
+
+Your Permitted Use is limited to the number of Licensed
+Units stated in your Entitlement. If you require additional
+Licensed Units, you will need additional Entitlement(s).
+
+5. Restrictions.
+
+(a) The copies of Software provided to you under this
+Agreement are licensed, not sold, to you by Sun. Sun
+reserves all rights not expressly granted. (b) You may make
+a single archival copy of Software, but otherwise may not
+copy, modify, or distribute Software. However if the Sun
+documentation accompanying Software lists specific portions
+of Software, such as header files, class libraries,
+reference source code, and/or redistributable files, that
+may be handled differently, you may do so only as provided
+in the Sun documentation. (c) You may not rent, lease, lend
+or encumber Software. (d) Unless enforcement is prohibited
+by applicable law, you may not decompile, or reverse
+engineer Software. (e) The terms and conditions of this
+Agreement will apply to any Software updates, provided to
+you at Sun's discretion, that replace and/or supplement the
+original Software, unless such update contains a separate
+license. (f) You may not publish or provide the results of
+any benchmark or comparison tests run on Software to any
+third party without the prior written consent of Sun. (g)
+Software is confidential and copyrighted. (h) Unless
+otherwise specified, if Software is delivered with embedded
+or bundled software that enables functionality of Software,
+you may not use such software on a stand-alone basis or use
+any portion of such software to interoperate with any
+program(s) other than Software. (i) Software may contain
+programs that perform automated collection of system data
+and/or automated software updating services. System data
+collected through such programs may be used by Sun, its
+subcontractors, and its service delivery partners for the
+purpose of providing you with remote system services and/or
+improving Sun's software and systems. (j) Software is not
+designed, licensed or intended for use in the design,
+construction, operation or maintenance of any nuclear
+facility and Sun and its licensors disclaim any express or
+implied warranty of fitness for such uses. (k) No right,
+title or interest in or to any trademark, service mark, logo
+or trade name of Sun or its licensors is granted under this
+Agreement.
+
+6. Java Compatibility and Open Source.
+
+Software may contain Java technology. You may not create
+additional classes to, or modifications of, the Java
+technology, except under compatibility requirements
+available under a separate agreement available at
+www.java.net.
+
+Sun supports and benefits from the global community of open
+source developers, and thanks the community for its
+important contributions and open standards-based technology,
+which Sun has adopted into many of its products.
+
+Please note that portions of Software may be provided with
+notices and open source licenses from such communities and
+third parties that govern the use of those portions, and any
+licenses granted hereunder do not alter any rights and
+obligations you may have under such open source licenses,
+however, the disclaimer of warranty and limitation of
+liability provisions in this Agreement will apply to all
+Software in this distribution.
+
+7. Term and Termination.
+
+The license and service term are set forth in your
+Entitlement(s). Your rights under this Agreement will
+terminate immediately without notice from Sun if you
+materially breach it or take any action in derogation of
+Sun's and/or its licensors' rights to Software. Sun may
+terminate this Agreement should any Software become, or in
+Sun's reasonable opinion likely to become, the subject of a
+claim of intellectual property infringement or trade secret
+misappropriation. Upon termination, you will cease use of,
+and destroy, Software and confirm compliance in writing to
+Sun. Sections 1, 5, 6, 7, and 9-15 will survive termination
+of the Agreement.
+
+8. Limited Warranty.
+
+Sun warrants to you that for a period of 90 days from the
+date of purchase, as evidenced by a copy of the receipt, the
+media on which Software is furnished (if any) will be free
+of defects in materials and workmanship under normal use.
+Except for the foregoing, Software is provided "AS IS". Your
+exclusive remedy and Sun's entire liability under this
+limited warranty will be at Sun's option to replace Software
+media or refund the fee paid for Software. Some states do
+not allow limitations on certain implied warranties, so the
+above may not apply to you. This limited warranty gives you
+specific legal rights. You may have others, which vary from
+state to state.
+
+9. Disclaimer of Warranty.
+
+UNLESS SPECIFIED IN THIS AGREEMENT, ALL EXPRESS OR IMPLIED
+CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING ANY
+IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+PARTICULAR PURPOSE OR NON-INFRINGEMENT ARE DISCLAIMED,
+EXCEPT TO THE EXTENT THAT THESE DISCLAIMERS ARE HELD TO BE
+LEGALLY INVALID.
+
+10. Limitation of Liability.
+
+TO THE EXTENT NOT PROHIBITED BY LAW, IN NO EVENT WILL SUN OR
+ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR
+DATA, OR FOR SPECIAL, INDIRECT, CONSEQUENTIAL, INCIDENTAL OR
+PUNITIVE DAMAGES, HOWEVER CAUSED REGARDLESS OF THE THEORY OF
+LIABILITY, ARISING OUT OF OR RELATED TO THE USE OF OR
+INABILITY TO USE SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF
+THE POSSIBILITY OF SUCH DAMAGES. In no event will Sun's
+liability to you, whether in contract, tort (including
+negligence), or otherwise, exceed the amount paid by you for
+Software under this Agreement. The foregoing limitations
+will apply even if the above stated warranty fails of its
+essential purpose. Some states do not allow the exclusion of
+incidental or consequential damages, so some of the terms
+above may not be applicable to you.
+
+11. Export Regulations.
+
+All Software, documents, technical data, and any other
+materials delivered under this Agreement are subject to U.S.
+export control laws and may be subject to export or import
+regulations in other countries. You agree to comply strictly
+with these laws and regulations and acknowledge that you
+have the responsibility to obtain any licenses to export,
+re-export, or import as may be required after delivery to
+you.
+
+12. U.S. Government Restricted Rights.
+
+If Software is being acquired by or on behalf of the U.S.
+Government or by a U.S. Government prime contractor or
+subcontractor (at any tier), then the Government's rights in
+Software and accompanying documentation will be only as set
+forth in this Agreement; this is in accordance with 48 CFR
+227.7201 through 227.7202-4 (for Department of Defense (DOD)
+acquisitions) and with 48 CFR 2.101 and 12.212 (for non-DOD
+acquisitions).
+
+13. Governing Law.
+
+Any action related to this Agreement will be governed by
+California law and controlling U.S. federal law. No choice
+of law rules of any jurisdiction will apply.
+
+14. Severability.
+
+If any provision of this Agreement is held to be
+unenforceable, this Agreement will remain in effect with the
+provision omitted, unless omission would frustrate the
+intent of the parties, in which case this Agreement will
+immediately terminate.
+
+15. Integration.
+
+This Agreement, including any terms contained in your
+Entitlement, is the entire agreement between you and Sun
+relating to its subject matter. It supersedes all prior or
+contemporaneous oral or written communications, proposals,
+representations and warranties and prevails over any
+conflicting or additional terms of any quote, order,
+acknowledgment, or other communication between the parties
+relating to its subject matter during the term of this
+Agreement. No modification of this Agreement will be
+binding, unless in writing and signed by an authorized
+representative of each party.
+
+Please contact Sun Microsystems, Inc. 4150 Network Circle,
+Santa Clara, California 95054 if you have questions.
diff --git a/deps/README.txt b/deps/README.txt
new file mode 100644
index 0000000..6bd93f3
--- /dev/null
+++ b/deps/README.txt
@@ -0,0 +1,7 @@
+the swing tree table jar must be manually installed in your local mvn repository for this dependency:
+
+ <groupId>org.netbeans.api</groupId>
+ <artifactId>org-netbeans-swing-outline</artifactId>
+ <version>RELEASE70</version>
+ <type>jar</type>
+ </dependency> \ No newline at end of file
diff --git a/deps/org-netbeans-swing-outline.jar b/deps/org-netbeans-swing-outline.jar
new file mode 100644
index 0000000..b56dabd
--- /dev/null
+++ b/deps/org-netbeans-swing-outline.jar
Binary files differ
diff --git a/idrop-swing/pom.xml b/idrop-swing/pom.xml
index 8a9bd17..9602306 100644
--- a/idrop-swing/pom.xml
+++ b/idrop-swing/pom.xml
@@ -43,7 +43,7 @@
<!-- used to automatically identify the jar containing the main class. -->
<!-- this is perhaps going to change -->
- <mainClass>org.irods.jargon.idrop.desktop.systraygui.iDrop</mainClass>
+ <mainClass>org.irods.jargon.idrop.desktop.systraygui.StartupSequencer</mainClass>
</jnlp>
<!-- SIGNING -->
@@ -96,21 +96,54 @@
</plugins>
</build>
<dependencies>
- <dependency>
- <groupId>org.swinglabs</groupId>
- <artifactId>swing-layout</artifactId>
+ <!--
+ Sun's JnlpDownladServlet takes the template JNLP file and inserts
+ relevant values for $$codebase and other parameters
+ -->
+ <!-- <dependency>
+ <groupId>com.sun.java.jnlp</groupId>
+ <artifactId>jnlp-servlet</artifactId>
+ <version>5.0</version>
+ <scope>runtime</scope>
</dependency>
+ -->
+
<dependency>
- <groupId>cookxml</groupId>
- <artifactId>cookswing</artifactId>
+ <groupId>org.irods.jargon</groupId>
+ <artifactId>jargon-data-utils</artifactId>
+ <scope>compile</scope>
</dependency>
<dependency>
- <groupId>cookxml</groupId>
- <artifactId>cookxml</artifactId>
+ <groupId>org.irods.jargon</groupId>
+ <artifactId>jargon-test</artifactId>
+ <scope>compile</scope>
</dependency>
<dependency>
<groupId>org.irods.jargon</groupId>
- <artifactId>jargon-security</artifactId>
+ <artifactId>jargon-user-tagging</artifactId>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.irods.jargon.transfer</groupId>
+ <artifactId>jargon-transfer-engine</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.8.2</version>
+ <scope>test</scope>
+ <type>jar</type>
+ </dependency>
+ <dependency>
+ <groupId>org.netbeans.api</groupId>
+ <artifactId>org-netbeans-swing-outline</artifactId>
+ <version>RELEASE70</version>
+ <type>jar</type>
+ </dependency>
+ <dependency>
+ <groupId>org.swinglabs</groupId>
+ <artifactId>swing-layout</artifactId>
+ <version>1.0.3</version>
</dependency>
</dependencies>
</project>
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/AboutDialog.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/AboutDialog.java
index 56f3e91..7f6f46e 100644
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/AboutDialog.java
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/AboutDialog.java
@@ -47,7 +47,8 @@ public class AboutDialog extends javax.swing.JDialog {
btnOK.setMnemonic('O');
btnOK.setText("OK");
btnOK.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent evt) {
+ @Override
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
btnOKPressed(evt);
}
});
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 dfdbd0d..08851d9 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
@@ -60,7 +60,8 @@ public class ChangePasswordDialog extends javax.swing.JDialog {
setMinimumSize(new java.awt.Dimension(551, 400));
tabPreferences.addChangeListener(new javax.swing.event.ChangeListener() {
- public void stateChanged(javax.swing.event.ChangeEvent evt) {
+ @Override
+ public void stateChanged(javax.swing.event.ChangeEvent evt) {
tabPreferencesStateChanged(evt);
}
});
@@ -109,7 +110,8 @@ public class ChangePasswordDialog extends javax.swing.JDialog {
btnUpdatePassword.setText("Update Password");
btnUpdatePassword.setToolTipText("Change the current password to the new values");
btnUpdatePassword.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent evt) {
+ @Override
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
btnUpdatePasswordActionPerformed(evt);
}
});
@@ -167,7 +169,7 @@ public class ChangePasswordDialog extends javax.swing.JDialog {
try {
log.info("check queue for any jobs for the account, these have the old password.");
IRODSAccount irodsAccount = idrop.getIrodsAccount();
- List<LocalIRODSTransfer> recentQueue = idrop.getTransferManager().getRecentQueue();
+ List<LocalIRODSTransfer> recentQueue = idrop.getiDropCore().getTransferManager().getRecentQueue();
for (LocalIRODSTransfer localIRODSTransfer : recentQueue) {
if (localIRODSTransfer.getTransferHost().equals(irodsAccount.getHost())
&& localIRODSTransfer.getTransferZone().equals(irodsAccount.getZone())
@@ -181,7 +183,7 @@ public class ChangePasswordDialog extends javax.swing.JDialog {
// }
}
}
- UserAO userAO = idrop.getIrodsFileSystem().getIRODSAccessObjectFactory().getUserAO(idrop.getIrodsAccount());
+ UserAO userAO = idrop.getiDropCore().getIrodsFileSystem().getIRODSAccessObjectFactory().getUserAO(idrop.getIrodsAccount());
userAO.changeAUserPasswordByThatUser(irodsAccount.getUserName(), irodsAccount.getPassword(), newPassword);
log.info("password changed, resetting iRODS Account");
IRODSAccount newAccount = new IRODSAccount(
@@ -201,7 +203,7 @@ public class ChangePasswordDialog extends javax.swing.JDialog {
} catch (JargonException ex) {
Logger.getLogger(ChangePasswordDialog.class.getName()).log(Level.SEVERE, null, ex);
} finally {
- idrop.getIrodsFileSystem().closeAndEatExceptions(idrop.getIrodsAccount());
+ idrop.getiDropCore().closeIRODSConnection(idrop.getiDropCore().getIrodsAccount());
}
}//GEN-LAST:event_btnUpdatePasswordActionPerformed
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 de0a9fc..e1c9fc0 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
@@ -14,13 +14,14 @@ import java.util.logging.Logger;
import javax.swing.AbstractAction;
import javax.swing.JComponent;
import javax.swing.KeyStroke;
+import javax.swing.SwingWorker;
import org.irods.jargon.core.exception.JargonException;
import org.irods.jargon.core.pub.io.IRODSFile;
import org.irods.jargon.core.pub.io.IRODSFileFactory;
import org.irods.jargon.core.query.CollectionAndDataObjectListingEntry;
-import org.irods.jargon.idrop.desktop.systraygui.services.IRODSFileService;
import org.irods.jargon.idrop.desktop.systraygui.viscomponents.IRODSFileSystemModel;
import org.irods.jargon.idrop.desktop.systraygui.viscomponents.IRODSNode;
+import org.irods.jargon.idrop.desktop.systraygui.viscomponents.IRODSOutlineModel;
import org.irods.jargon.idrop.desktop.systraygui.viscomponents.IRODSTree;
import org.irods.jargon.idrop.exceptions.IdropException;
import org.irods.jargon.idrop.exceptions.IdropRuntimeException;
@@ -36,7 +37,7 @@ public class DeleteIRODSDialog extends javax.swing.JDialog {
private final IRODSTree irodsTree;
private final IRODSNode deletedNode;
private final List<IRODSNode> deletedNodes;
- public static org.slf4j.Logger log = LoggerFactory.getLogger(NewIRODSDirectoryDialog.class);
+ 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, final IRODSNode deletedNode) {
@@ -54,9 +55,9 @@ public class DeleteIRODSDialog extends javax.swing.JDialog {
sb.append('/');
sb.append(entry.getPathOrName());
}
-
+
initialize();
- txtAreaFileToDelete.setText(sb.toString());
+ txtAreaFileToDelete.setText(sb.toString());
}
/** Creates new form NewIRODSDirectoryDialog */
@@ -93,7 +94,7 @@ public class DeleteIRODSDialog extends javax.swing.JDialog {
}
}
};
-
+
btnOK.registerKeyboardAction(enterAction, enter,
JComponent.WHEN_IN_FOCUSED_WINDOW);
@@ -165,7 +166,8 @@ public class DeleteIRODSDialog extends javax.swing.JDialog {
btnCancel.setText("Cancel");
btnCancel.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent evt) {
+ @Override
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
btnCancelActionPerformed(evt);
}
});
@@ -173,7 +175,8 @@ public class DeleteIRODSDialog extends javax.swing.JDialog {
btnOK.setText("OK");
btnOK.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent evt) {
+ @Override
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
btnOKActionPerformed(evt);
}
});
@@ -212,40 +215,13 @@ public class DeleteIRODSDialog extends javax.swing.JDialog {
private void processDelete() throws IdropException {
log.info("delete folder named:{}", txtAreaFileToDelete.getText());
final DeleteIRODSDialog thisDialog = this;
+
java.awt.EventQueue.invokeLater(new Runnable() {
@Override
public void run() {
-
thisDialog.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
-
- try {
-
- IRODSFileFactory irodsFileFactory = idrop.getIrodsFileSystem().getIRODSFileFactory(idrop.getIrodsAccount());
- if (deletedNode != null) {
- log.info("deleting a single node");
- deleteASingleFile(irodsFileFactory, deletedNode);
- } else if (deletedNodes != null) {
- log.info("deleting multiple nodes");
- for (IRODSNode deletedNodeEntry : deletedNodes) {
- deleteASingleFile(irodsFileFactory, deletedNodeEntry);
- }
- }
-
- } catch (JargonException ex) {
- Logger.getLogger(IRODSFileService.class.getName()).log(Level.SEVERE, null, ex);
- idrop.showIdropException(ex);
- } catch (IdropException ex) {
- Logger.getLogger(NewIRODSDirectoryDialog.class.getName()).log(Level.SEVERE, null, ex);
- idrop.showIdropException(ex);
- } finally {
- idrop.getIrodsFileSystem().closeAndEatExceptions(idrop.getIrodsAccount());
- thisDialog.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
- }
-
- idrop.showMessageFromOperation("delete successful");
- thisDialog.dispose();
-
+ (new DeleteWorker(thisDialog)).execute();
}
});
}
@@ -269,12 +245,66 @@ public class DeleteIRODSDialog extends javax.swing.JDialog {
try {
fileToDelete = irodsFileFactory.instanceIRODSFile(sb.toString());
fileToDelete.delete();
- final IRODSFileSystemModel irodsFileSystemModel = (IRODSFileSystemModel) irodsTree.getModel();
- irodsFileSystemModel.removeNodeFromParent(deletedNode);
+ final IRODSOutlineModel irodsFileSystemModel = (IRODSOutlineModel) irodsTree.getModel();
+
+ irodsFileSystemModel.notifyFileShouldBeRemoved(deletedNode);
} catch (JargonException ex) {
Logger.getLogger(DeleteIRODSDialog.class.getName()).log(Level.SEVERE, null, ex);
throw new IdropException(ex);
+ } finally {
+ idrop.getiDropCore().closeIRODSConnectionForLoggedInAccount();
+ }
+
+ }
+
+ 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) {
+ if (dialog == null) {
+ throw new IllegalArgumentException("null dialog");
+ }
+
+ this.dialog = dialog;
+
+ }
+
+ @Override
+ public String doInBackground() {
+
+ try {
+
+ IRODSFileFactory irodsFileFactory = idrop.getiDropCore().getIRODSFileFactoryForLoggedInAccount();
+ if (deletedNode != null) {
+ log.info("deleting a single node");
+ deleteASingleFile(irodsFileFactory, deletedNode);
+ } else if (deletedNodes != null) {
+ log.info("deleting multiple nodes");
+ for (IRODSNode deletedNodeEntry : deletedNodes) {
+ deleteASingleFile(irodsFileFactory, deletedNodeEntry);
+ }
+ }
+ message = DELETE_SUCCESSFUL;
+ } catch (Exception ex) {
+ Logger.getLogger(NewIRODSDirectoryDialog.class.getName()).log(Level.SEVERE, null, ex);
+ idrop.showIdropException(ex);
+ message = DELETE_ERRORS;
+ } finally {
+ idrop.getiDropCore().closeAllIRODSConnections();
+ }
+
+ return null;
}
+ @Override
+ protected void done() {
+ dialog.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
+ dialog.dispose();
+ idrop.showMessageFromOperation(message);
+ }
}
}
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 fec6902..6afdce3 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
@@ -130,7 +130,8 @@ public class DeleteLocalFileDialog extends javax.swing.JDialog {
btnCancel.setText("Cancel");
btnCancel.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent evt) {
+ @Override
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
btnCancelActionPerformed(evt);
}
});
@@ -138,7 +139,8 @@ public class DeleteLocalFileDialog extends javax.swing.JDialog {
btnOK.setText("OK");
btnOK.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent evt) {
+ @Override
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
btnOKActionPerformed(evt);
}
});
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 6658f20..a3b6969 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
@@ -1,17 +1,34 @@
package org.irods.jargon.idrop.desktop.systraygui;
import java.util.Timer;
+import java.util.logging.Level;
+import java.util.logging.Logger;
import java.util.prefs.Preferences;
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.io.IRODSFileFactory;
import org.irods.jargon.idrop.desktop.systraygui.services.IconManager;
import org.irods.jargon.idrop.desktop.systraygui.utils.IdropConfig;
+import org.irods.jargon.idrop.exceptions.IdropRuntimeException;
import org.irods.jargon.transfer.engine.TransferManager;
public class IDROPCore {
private IRODSAccount irodsAccount = null;
+ 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;
@@ -66,12 +83,99 @@ public class IDROPCore {
this.queueTimer = queueTimer;
}
+ @Deprecated
public Preferences getPreferences() {
return preferences;
}
+ @Deprecated
public void setPreferences(Preferences preferences) {
this.preferences = preferences;
}
+ /**
+ * Handy method that delegates the process of getting an <code>IRODSAccessObjectFactory</code>.
+ * @return {@link IRODSAccessObjectFactory}
+ */
+ public IRODSAccessObjectFactory getIRODSAccessObjectFactory() {
+ if (irodsFileSystem == null) {
+ throw new IdropRuntimeException("No IRODSFileSystem set, cannot obtain the IRODSAccessObjectFactory");
+ }
+ try {
+ return irodsFileSystem.getIRODSAccessObjectFactory();
+ } catch (JargonException ex) {
+ Logger.getLogger(IDROPCore.class.getName()).log(Level.SEVERE, null, ex);
+ throw new IdropRuntimeException("exception getting IRODSAccessObjectFactory");
+ }
+ }
+
+ /**
+ * Method to close any iRODS connections in the current thread. This delegates to the <code>IRODSFileSystem</code>.
+ */
+ public void closeAllIRODSConnections() {
+ if (irodsFileSystem == null) {
+ throw new IdropRuntimeException("No IRODSFileSystem set, cannot obtain the IRODSAccessObjectFactory");
+ }
+ irodsFileSystem.closeAndEatExceptions();
+ }
+
+ /**
+ * Method to close iRODS connection denoted by the logged in <code>IRODSAccount</code>.
+ */
+ public void closeIRODSConnectionForLoggedInAccount() {
+ if (irodsFileSystem == null) {
+ throw new IdropRuntimeException("No IRODSFileSystem set, cannot obtain the IRODSAccessObjectFactory");
+ }
+ irodsFileSystem.closeAndEatExceptions(irodsAccount);
+ }
+
+ /**
+ * Method to close iRODS connection denoted by the given <code>IRODSAccount</code> in the current thread. This delegates to the <code>IRODSFileSystem</code>.
+ */
+ public void closeIRODSConnection(final IRODSAccount irodsAccount) {
+ if (irodsFileSystem == null) {
+ throw new IdropRuntimeException("No IRODSFileSystem set, cannot obtain the IRODSAccessObjectFactory");
+ }
+ irodsFileSystem.closeAndEatExceptions(irodsAccount);
+ }
+ /**
+ * Get the <code>IRODSFileFactory</code> for the given account
+ * @return {@link IRODSFileFactory} associated with the account currently logged in
+ */
+ public IRODSFileFactory getIRODSFileFactory(final IRODSAccount irodsAccount) {
+ if (irodsFileSystem == null) {
+ throw new IdropRuntimeException("No IRODSFileSystem set, cannot obtain the IRODSAccessObjectFactory");
+ }
+ if (irodsAccount == null) {
+ throw new IdropRuntimeException("No IRODSAccount set, cannot obtain the IRODSAccessObjectFactory");
+ }
+ try {
+ return irodsFileSystem.getIRODSFileFactory(irodsAccount);
+ } catch (JargonException ex) {
+ Logger.getLogger(IDROPCore.class.getName()).log(Level.SEVERE, null, ex);
+ throw new IdropRuntimeException("Exception getting iRODS file factory", ex);
+ }
+
+ }
+
+ /**
+ * Get the <code>IRODSFileFactory</code> for the current logged-in account.
+ * @return {@link IRODSFileFactory} associated with the account currently logged in
+ */
+ public IRODSFileFactory getIRODSFileFactoryForLoggedInAccount() {
+ if (irodsFileSystem == null) {
+ throw new IdropRuntimeException("No IRODSFileSystem set, cannot obtain the IRODSAccessObjectFactory");
+ }
+ if (irodsAccount == null) {
+ throw new IdropRuntimeException("No IRODSAccount set, cannot obtain the IRODSAccessObjectFactory");
+ }
+ try {
+ return irodsFileSystem.getIRODSFileFactory(irodsAccount);
+ } catch (JargonException ex) {
+ Logger.getLogger(IDROPCore.class.getName()).log(Level.SEVERE, null, ex);
+ throw new IdropRuntimeException("Exception getting iRODS file factory", ex);
+ }
+
+ }
+
}
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/IDropSplashWindow.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/IDropSplashWindow.java
index 098cb8c..4132ecd 100644
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/IDropSplashWindow.java
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/IDropSplashWindow.java
@@ -2,41 +2,28 @@ 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 javax.swing.SwingWorker;
-
-import org.irods.jargon.core.exception.JargonException;
-import org.irods.jargon.idrop.desktop.systraygui.services.IconManager;
-import org.irods.jargon.idrop.desktop.systraygui.utils.IdropConfig;
-import org.irods.jargon.idrop.exceptions.IdropException;
-import org.irods.jargon.transfer.engine.TransferManager;
-import org.irods.jargon.transfer.engine.TransferManagerImpl;
+import org.irods.jargon.idrop.exceptions.IdropRuntimeException;
import org.slf4j.LoggerFactory;
/**
*
* @author jdr0887
*/
-public class IDropSplashWindow extends JWindow implements Runnable {
+public class IDropSplashWindow extends JWindow {
/**
*
*/
private static final long serialVersionUID = 1L;
-
- private final org.slf4j.Logger logger = LoggerFactory.getLogger(IDropSplashWindow.class);
-
+ 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) {
@@ -45,7 +32,8 @@ public class IDropSplashWindow extends JWindow implements Runnable {
try {
init();
} catch (Exception e) {
- e.printStackTrace();
+ log.error("error initializing iDrop splash window", e);
+ throw new IdropRuntimeException(e);
}
}
@@ -56,7 +44,7 @@ public class IDropSplashWindow extends JWindow implements Runnable {
// jlblImage.setText("jLabel1");
jlblImage.setIcon(splashImage);
jProgressBar1.setMinimum(1);
- jProgressBar1.setMaximum(4);
+ jProgressBar1.setMaximum(7);
jProgressBar1.setStringPainted(true);
this.getContentPane().add(jlblImage, BorderLayout.CENTER);
this.getContentPane().add(jProgressBar1, BorderLayout.SOUTH);
@@ -73,15 +61,6 @@ public class IDropSplashWindow extends JWindow implements Runnable {
this.pack();
}
- /*
- * (non-Javadoc)
- *
- * @see java.lang.Runnable#run()
- */
- public void run() {
- new LauncherTask().run();
- }
-
/**
* Sets the text of the progress bar and its value
*
@@ -90,109 +69,17 @@ public class IDropSplashWindow extends JWindow implements Runnable {
* @param theVal
* An integer value from 0 to 100
*/
- public void setStatus(String msg, int value) {
- jProgressBar1.setString(msg);
- jProgressBar1.setValue(value);
- }
-
- class LauncherTask extends SwingWorker<Void, Void> {
+ public void setStatus(final String msg, final int value) {
- /*
- * (non-Javadoc)
- *
- * @see javax.swing.SwingWorker#done()
- */
- @Override
- protected void done() {
- super.done();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see javax.swing.SwingWorker#doInBackground()
- */
- @Override
- protected Void doInBackground() throws Exception {
+ java.awt.EventQueue.invokeLater(new Runnable() {
- int count = 0;
+ @Override
+ public void run() {
+ jProgressBar1.setString(msg);
+ jProgressBar1.setValue(value);
- try {
- Thread.sleep(200);
- } catch (InterruptedException e) {
- e.printStackTrace();
}
+ });
- setStatus("Initializing...", ++count);
-
- try {
- // load the properties
- IdropConfig config = new IdropConfig();
- config.setUpLogging();
- iDrop.getiDropCore().setIdropConfig(config);
- iDrop.getiDropCore().setIconManager(new IconManager(iDrop));
- } catch (IdropException ex) {
- logger.error(ex.getMessage());
- MessageManager.showError(IDropSplashWindow.this, ex.getMessage(), "Failed to load iDrop configuration");
- System.exit(1);
- }
-
- try {
- Thread.sleep(200);
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
-
- setStatus("Logging in...", ++count);
-
- final LoginDialog loginDialog = new LoginDialog(iDrop);
- Toolkit tk = getToolkit();
- int x = (tk.getScreenSize().width - loginDialog.getWidth()) / 2;
- int y = (tk.getScreenSize().height - loginDialog.getHeight()) / 2;
- loginDialog.setLocation(x, y);
- IDropSplashWindow.this.toBack();
- loginDialog.setAlwaysOnTop(true);
- loginDialog.toFront();
- loginDialog.setVisible(true);
-
- try {
- Thread.sleep(200);
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
-
- setStatus("Starting DB...", ++count);
-
- try {
- /*
- * the transfer manager is the central control for the data transfer queue, as well as the maintainer of
- * the status of the queue. This app listens to the TransferManager to receive updates about what the
- * queue is doing.
- */
- TransferManager transferManager = new TransferManagerImpl(iDrop, iDrop.getiDropCore().getIdropConfig()
- .isLogSuccessfulTransfers());
- iDrop.getiDropCore().setTransferManager(transferManager);
- } catch (JargonException e1) {
- logger.error(e1.getMessage());
- MessageManager.showError(IDropSplashWindow.this, e1.getMessage(), "Failed to start Transfer Engine");
- System.exit(1);
- }
-
- setStatus("Starting Queue...", ++count);
-
- QueueThread queueThread = new QueueThread(iDrop);
- queueThread.start();
-
- try {
- Thread.sleep(500);
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
-
- iDrop.getiDropCore().getTransferManager().getCurrentQueue();
- dispose();
- return null;
- }
}
-
}
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 dd7b481..ea1f8a4 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
@@ -330,7 +330,8 @@ public class LoginDialog extends JDialog {
btnOK.setMnemonic('o');
btnOK.setText("OK");
btnOK.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent evt) {
+ @Override
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
btnOKActionPerformed(evt);
}
});
@@ -339,7 +340,8 @@ public class LoginDialog extends JDialog {
btnCancel.setMnemonic('c');
btnCancel.setText("Cancel");
btnCancel.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent evt) {
+ @Override
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
btnCancelActionPerformed(evt);
}
});
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/MessageManager.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/MessageManager.java
index c99274c..548825e 100644
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/MessageManager.java
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/MessageManager.java
@@ -10,6 +10,8 @@ import javax.swing.JOptionPane;
*
*/
public class MessageManager {
+
+ public static final String TITLE_MESSAGE = "iDrop Message";
public static void showError(Component rootComponent, String message, String title) {
JOptionPane.showMessageDialog(rootComponent, message, title, JOptionPane.ERROR_MESSAGE);
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 beee3ef..dc0cfca 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
@@ -122,7 +122,8 @@ public class MetadataViewDialog extends javax.swing.JDialog {
btnCancel.setText("Cancel");
btnCancel.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent evt) {
+ @Override
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
btnCancelActionPerformed(evt);
}
});
@@ -130,7 +131,8 @@ public class MetadataViewDialog extends javax.swing.JDialog {
btnOK.setText("OK");
btnOK.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent evt) {
+ @Override
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
btnOKActionPerformed(evt);
}
});
@@ -153,9 +155,10 @@ public class MetadataViewDialog extends javax.swing.JDialog {
private void initializeMetadata() {
java.awt.EventQueue.invokeLater(new Runnable() {
- public void run() {
+ @Override
+ public void run() {
try {
- IRODSFileService irodsFileService = new IRODSFileService(irodsAccount, idropGui.getIrodsFileSystem());
+ IRODSFileService irodsFileService = new IRODSFileService(irodsAccount, idropGui.getiDropCore().getIrodsFileSystem());
MetadataTableModel metadataTableModel;
if (collection) {
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/MoveIRODSFileToNewIRODSLocationDialog.form b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/MoveOrCopyiRODSDialog.form
index 41eb651..41eb651 100644
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/MoveIRODSFileToNewIRODSLocationDialog.form
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/MoveOrCopyiRODSDialog.form
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/MoveIRODSFileToNewIRODSLocationDialog.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/MoveOrCopyiRODSDialog.java
index 4979559..8230245 100644
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/MoveIRODSFileToNewIRODSLocationDialog.java
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/MoveOrCopyiRODSDialog.java
@@ -21,10 +21,10 @@ import org.irods.jargon.core.exception.JargonException;
import org.irods.jargon.core.exception.JargonFileOrCollAlreadyExistsException;
import org.irods.jargon.core.pub.DataTransferOperations;
import org.irods.jargon.core.pub.io.IRODSFile;
-import org.irods.jargon.idrop.desktop.systraygui.services.IRODSFileService;
import org.irods.jargon.idrop.desktop.systraygui.utils.TreeUtils;
import org.irods.jargon.idrop.desktop.systraygui.viscomponents.IRODSFileSystemModel;
import org.irods.jargon.idrop.desktop.systraygui.viscomponents.IRODSNode;
+import org.irods.jargon.idrop.desktop.systraygui.viscomponents.IRODSOutlineModel;
import org.irods.jargon.idrop.desktop.systraygui.viscomponents.IRODSTree;
import org.irods.jargon.idrop.exceptions.IdropException;
import org.irods.jargon.idrop.exceptions.IdropRuntimeException;
@@ -34,40 +34,51 @@ import org.slf4j.LoggerFactory;
* Dialog to confirm and process the move of a file to a new iRODS location (phymove gesture)
* @author mikeconway
*/
-public class MoveIRODSFileToNewIRODSLocationDialog extends javax.swing.JDialog {
+public class MoveOrCopyiRODSDialog extends javax.swing.JDialog {
private final iDrop idrop;
private final IRODSTree stagingViewTree;
+ private final IRODSOutlineModel irodsFileSystemModel;
private final IRODSNode targetNode;
private final String targetAbsolutePath;
private final IRODSFile sourceFile;
private final List<IRODSFile> sourceFiles;
- public static org.slf4j.Logger log = LoggerFactory.getLogger(MoveIRODSFileToNewIRODSLocationDialog.class);
+ public static org.slf4j.Logger log = LoggerFactory.getLogger(MoveOrCopyiRODSDialog.class);
+ private final boolean isCopy;
- public MoveIRODSFileToNewIRODSLocationDialog(final iDrop parent, final boolean modal, final IRODSNode targetNode, final IRODSTree stagingViewTree, final IRODSFile sourceFile, final String targetAbsolutePath) {
+ public MoveOrCopyiRODSDialog(final iDrop parent, final boolean modal, final IRODSNode targetNode, final IRODSTree stagingViewTree, final IRODSFile sourceFile, final String targetAbsolutePath, final boolean isCopy) {
super(parent, modal);
this.idrop = parent;
this.targetNode = targetNode;
this.stagingViewTree = stagingViewTree;
+ this.irodsFileSystemModel = (IRODSOutlineModel) stagingViewTree.getOutlineModel();
this.targetAbsolutePath = targetAbsolutePath;
this.sourceFile = sourceFile;
this.sourceFiles = null;
+ this.isCopy = isCopy;
initializeDialog();
}
- public MoveIRODSFileToNewIRODSLocationDialog(final iDrop parent, final boolean modal, final IRODSNode targetNode, final IRODSTree stagingViewTree, final List<IRODSFile> sourceFiles, final String targetAbsolutePath) {
+ public MoveOrCopyiRODSDialog(final iDrop parent, final boolean modal, final IRODSNode targetNode, final IRODSTree stagingViewTree, final List<IRODSFile> sourceFiles, final String targetAbsolutePath, final boolean isCopy) {
super(parent, modal);
this.idrop = parent;
this.targetNode = targetNode;
this.stagingViewTree = stagingViewTree;
+ this.irodsFileSystemModel = (IRODSOutlineModel) stagingViewTree.getModel();
this.targetAbsolutePath = targetAbsolutePath;
this.sourceFile = null;
this.sourceFiles = sourceFiles;
+ this.isCopy = isCopy;
initializeDialog();
}
private void initializeDialog() {
initComponents();
+ if (isCopy) {
+ lblTitle.setText("Do you wish to copy the iRODS file to the new iRODS location?");
+ } else {
+ lblTitle.setText("Do you wish to move the iRODS file to the new iRODS location?");
+ }
txtNewLocation.setText(targetAbsolutePath);
if (sourceFile != null) {
@@ -161,14 +172,16 @@ public class MoveIRODSFileToNewIRODSLocationDialog extends javax.swing.JDialog {
btnCancel.setText("Cancel");
btnCancel.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent evt) {
+ @Override
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
btnCancelActionPerformed(evt);
}
});
btnOK.setText("OK");
btnOK.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent evt) {
+ @Override
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
btnOKActionPerformed(evt);
}
});
@@ -202,13 +215,13 @@ public class MoveIRODSFileToNewIRODSLocationDialog extends javax.swing.JDialog {
.addContainerGap(61, Short.MAX_VALUE))
.add(org.jdesktop.layout.GroupLayout.TRAILING, pnlFolderDataLayout.createSequentialGroup()
.addContainerGap(134, Short.MAX_VALUE)
- .add(pnlBottom, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 622, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
+ .add(pnlBottom, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.addContainerGap())
);
pnlFolderDataLayout.setVerticalGroup(
pnlFolderDataLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(pnlFolderDataLayout.createSequentialGroup()
- .add(pnlCurrentParent, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 250, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
+ .add(pnlCurrentParent, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
.add(pnlBottom, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
@@ -236,7 +249,7 @@ public class MoveIRODSFileToNewIRODSLocationDialog extends javax.swing.JDialog {
}//GEN-LAST:event_btnCancelActionPerformed
private void btnOKActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnOKActionPerformed
- processMove();
+ processMoveOrCopy();
}//GEN-LAST:event_btnOKActionPerformed
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton btnCancel;
@@ -253,10 +266,10 @@ public class MoveIRODSFileToNewIRODSLocationDialog extends javax.swing.JDialog {
private javax.swing.JTextArea txtNewLocation;
// End of variables declaration//GEN-END:variables
- private void processMove() {
+ private void processMoveOrCopy() {
// add the new folder to irods, add to the tree, and scroll the tree into view
- final MoveIRODSFileToNewIRODSLocationDialog thisDialog = this;
- log.info("processing move");
+ final MoveOrCopyiRODSDialog thisDialog = this;
+ log.info("processing move or copy");
java.awt.EventQueue.invokeLater(new Runnable() {
@Override
@@ -267,9 +280,9 @@ public class MoveIRODSFileToNewIRODSLocationDialog extends javax.swing.JDialog {
DataTransferOperations dataTransferOperations;
try {
- dataTransferOperations = idrop.getIrodsFileSystem().getIRODSAccessObjectFactory().getDataTransferOperations(idrop.getIrodsAccount());
+ dataTransferOperations = idrop.getiDropCore().getIRODSAccessObjectFactory().getDataTransferOperations(idrop.getIrodsAccount());
} catch (Exception e) {
- idrop.getIrodsFileSystem().closeAndEatExceptions(idrop.getIrodsAccount());
+ idrop.getiDropCore().closeIRODSConnection(idrop.getIrodsAccount());
thisDialog.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
throw new IdropRuntimeException(e);
}
@@ -277,11 +290,15 @@ public class MoveIRODSFileToNewIRODSLocationDialog extends javax.swing.JDialog {
List<IRODSFile> filesThatHadOverwriteError = new ArrayList<IRODSFile>();
if (sourceFile != null) {
- log.info("processing the move for one file:{}", sourceFile);
+ log.info("processing the move/copy for one file:{}", sourceFile);
try {
- processAMoveOfAnIndividualFile(dataTransferOperations, sourceFile, targetAbsolutePath);
+ if (isCopy) {
+ processACopyOfAnIndividualFile(dataTransferOperations, sourceFile, targetAbsolutePath);
+ } else {
+ processAMoveOfAnIndividualFile(dataTransferOperations, sourceFile, targetAbsolutePath);
+ }
} catch (JargonFileOrCollAlreadyExistsException ex) {
- Logger.getLogger(MoveIRODSFileToNewIRODSLocationDialog.class.getName()).log(Level.SEVERE, null, ex);
+ Logger.getLogger(MoveOrCopyiRODSDialog.class.getName()).log(Level.SEVERE, null, ex);
filesThatHadOverwriteError.add(sourceFile);
} catch (JargonException je) {
if (je.getMessage().indexOf("-834000") > -1 || je.getMessage().indexOf("-833000") > -1) {
@@ -291,13 +308,17 @@ public class MoveIRODSFileToNewIRODSLocationDialog extends javax.swing.JDialog {
}
}
} else if (sourceFiles != null) {
- log.info("processing move of multiple files");
+ log.info("processing move/copy of multiple files");
for (IRODSFile sourceFileEntry : sourceFiles) {
try {
- processAMoveOfAnIndividualFile(dataTransferOperations, sourceFileEntry, targetAbsolutePath);
+ if (isCopy) {
+ processACopyOfAnIndividualFile(dataTransferOperations, sourceFile, targetAbsolutePath);
+ } else {
+ processAMoveOfAnIndividualFile(dataTransferOperations, sourceFile, targetAbsolutePath);
+ }
} catch (JargonFileOrCollAlreadyExistsException ex) {
// FIXME: fix in jargon core to differentiate!
- Logger.getLogger(MoveIRODSFileToNewIRODSLocationDialog.class.getName()).log(Level.SEVERE, null, ex);
+ Logger.getLogger(MoveOrCopyiRODSDialog.class.getName()).log(Level.SEVERE, null, ex);
filesThatHadOverwriteError.add(sourceFile);
} catch (JargonException je) {
if (je.getMessage().indexOf("-834000") > -1 || je.getMessage().indexOf("-833000") > -1) {
@@ -310,13 +331,10 @@ public class MoveIRODSFileToNewIRODSLocationDialog extends javax.swing.JDialog {
}
log.debug("move done");
- IRODSFileSystemModel irodsFileSystemModel = (IRODSFileSystemModel) stagingViewTree.getModel();
- targetNode.forceReloadOfChildrenOfThisNode();
- irodsFileSystemModel.reload(targetNode);
if (filesThatHadOverwriteError.isEmpty()) {
- idrop.showMessageFromOperation("irods move processed");
+ idrop.showMessageFromOperation("irods move/copy processed");
} else {
- idrop.showMessageFromOperation("irods move processed, some files were not moved as files of the same name already existed");
+ idrop.showMessageFromOperation("irods move/copy processed, some files were not moved as files of the same name already existed");
}
thisDialog.dispose();
@@ -326,7 +344,7 @@ public class MoveIRODSFileToNewIRODSLocationDialog extends javax.swing.JDialog {
return;
} finally {
thisDialog.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
- idrop.getIrodsFileSystem().closeAndEatExceptions(idrop.getIrodsAccount());
+ idrop.getiDropCore().closeIRODSConnection(idrop.getIrodsAccount());
}
}
});
@@ -338,9 +356,21 @@ public class MoveIRODSFileToNewIRODSLocationDialog extends javax.swing.JDialog {
if (sourceFile.isFile()) {
log.debug("source file is a file, do a move");
dataTransferOperations.move(sourceFile.getAbsolutePath(), targetAbsolutePath);
+
+ IRODSFile targetFile = idrop.getiDropCore().getIRODSFileFactoryForLoggedInAccount().instanceIRODSFile(targetAbsolutePath);
+ String targetPathForNotify = null;
+ if (targetFile.isDirectory()) {
+ targetPathForNotify = targetFile.getAbsolutePath() + "/" + sourceFile.getName();
+ } else {
+ targetPathForNotify = targetFile.getAbsolutePath();
+ }
+
+ irodsFileSystemModel.notifyFileShouldBeAdded(stagingViewTree, targetPathForNotify);
+
} else {
log.debug("source file is a collection, reparent it");
dataTransferOperations.moveTheSourceCollectionUnderneathTheTargetCollectionUsingSourceParentCollectionName(sourceFile.getAbsolutePath(), targetAbsolutePath);
+ irodsFileSystemModel.notifyFileShouldBeAdded(stagingViewTree, targetAbsolutePath);
}
} catch (JargonFileOrCollAlreadyExistsException fcae) {
throw fcae;
@@ -349,10 +379,23 @@ public class MoveIRODSFileToNewIRODSLocationDialog extends javax.swing.JDialog {
}
TreePath sourceNodePath = TreeUtils.buildTreePathForIrodsAbsolutePath(stagingViewTree, sourceFile.getAbsolutePath());
+ if (sourceNodePath == null) {
+ log.info("could not find tree path for source node, ignore");
+ return;
+ }
IRODSNode sourceNode = (IRODSNode) sourceNodePath.getLastPathComponent();
- IRODSFileSystemModel irodsFileSystemModel = (IRODSFileSystemModel) stagingViewTree.getModel();
- irodsFileSystemModel.removeNodeFromParent(sourceNode);
+ irodsFileSystemModel.notifyFileShouldBeRemoved(sourceNode);
+ }
+ private void processACopyOfAnIndividualFile(DataTransferOperations dataTransferOperations, IRODSFile sourceFile, String targetAbsolutePath) throws IdropException {
+ try {
+ 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);
+ throw new IdropException("unable to copy file due to JargonException", ex);
+ }
+
+ // notifications are done at completion of transfer using status callbacks
}
/**
@@ -365,7 +408,7 @@ public class MoveIRODSFileToNewIRODSLocationDialog extends javax.swing.JDialog {
@Override
public void actionPerformed(ActionEvent e) {
- processMove();
+ processMoveOrCopy();
}
};
btnOK.registerKeyboardAction(enterAction, enter,
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 ca1ddf8..500245b 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
@@ -8,7 +8,7 @@
*
* Created on Sep 3, 2010, 9:52:12 AM
*/
-package org.irods.jargon.idrop.desktop.systraygui;
+package org.irods.jargon.idrop.desktop.systraygui;
import java.awt.Color;
import java.awt.Cursor;
@@ -19,13 +19,16 @@ import javax.swing.AbstractAction;
import javax.swing.Action;
import javax.swing.JComponent;
import javax.swing.KeyStroke;
+import javax.swing.tree.TreePath;
import org.irods.jargon.core.query.CollectionAndDataObjectListingEntry;
import org.irods.jargon.idrop.desktop.systraygui.services.IRODSFileService;
import org.irods.jargon.idrop.desktop.systraygui.utils.TreeUtils;
import org.irods.jargon.idrop.desktop.systraygui.viscomponents.IRODSFileSystemModel;
import org.irods.jargon.idrop.desktop.systraygui.viscomponents.IRODSNode;
+import org.irods.jargon.idrop.desktop.systraygui.viscomponents.IRODSOutlineModel;
import org.irods.jargon.idrop.desktop.systraygui.viscomponents.IRODSTree;
import org.irods.jargon.idrop.exceptions.IdropException;
+import org.irods.jargon.idrop.exceptions.IdropRuntimeException;
import org.slf4j.LoggerFactory;
/**
@@ -143,7 +146,8 @@ public class NewIRODSDirectoryDialog extends javax.swing.JDialog {
btnCancel.setText("Cancel");
btnCancel.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent evt) {
+ @Override
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
btnCancelActionPerformed(evt);
}
});
@@ -151,7 +155,8 @@ public class NewIRODSDirectoryDialog extends javax.swing.JDialog {
btnOK.setText("OK");
btnOK.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent evt) {
+ @Override
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
btnOKActionPerformed(evt);
}
});
@@ -167,7 +172,7 @@ public class NewIRODSDirectoryDialog extends javax.swing.JDialog {
}//GEN-LAST:event_btnCancelActionPerformed
private void btnOKActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnOKActionPerformed
- processNew();
+ processNew();
}//GEN-LAST:event_btnOKActionPerformed
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton btnCancel;
@@ -183,7 +188,7 @@ public class NewIRODSDirectoryDialog extends javax.swing.JDialog {
private javax.swing.JTextField txtNewFolder;
// End of variables declaration//GEN-END:variables
- private void processNew() {
+ private void processNew() {
// add the new folder to irods, add to the tree, and scroll the tree into view
if (txtNewFolder.getText().isEmpty()) {
@@ -198,10 +203,20 @@ public class NewIRODSDirectoryDialog extends javax.swing.JDialog {
@Override
public void run() {
- log.info("adding new folder named:{}", txtNewFolder.getText());
- thisDialog.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
try {
- IRODSFileService irodsFileService = new IRODSFileService(idrop.getIrodsAccount(), idrop.getIrodsFileSystem());
+ log.info("adding new folder named:{}", txtNewFolder.getText());
+ thisDialog.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
+
+ IRODSFileService irodsFileService;
+ try {
+ irodsFileService = new IRODSFileService(idrop.getIrodsAccount(), idrop.getiDropCore().getIrodsFileSystem());
+ } catch (IdropException ex) {
+ Logger.getLogger(NewIRODSDirectoryDialog.class.getName()).log(Level.SEVERE, null, ex);
+ throw new IdropRuntimeException(ex);
+ } finally {
+ thisDialog.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
+
+ }
StringBuilder sb = new StringBuilder();
sb.append(parentDirectory);
@@ -211,13 +226,12 @@ public class NewIRODSDirectoryDialog extends javax.swing.JDialog {
boolean created = irodsFileService.createNewFolder(newDirPath);
- IRODSFileSystemModel irodsFileSystemModel = (IRODSFileSystemModel) stagingViewTree.getModel();
+ IRODSOutlineModel irodsOutlineModel = (IRODSOutlineModel) stagingViewTree.getModel();
if (!created) {
log.info("could not create new folder in:{}", newDirPath);
idrop.showMessageFromOperation("directory could not be created");
thisDialog.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
-
return;
}
@@ -226,34 +240,37 @@ public class NewIRODSDirectoryDialog extends javax.swing.JDialog {
entry.setObjectType(CollectionAndDataObjectListingEntry.ObjectType.COLLECTION);
entry.setParentPath(parentDirectory);
entry.setPathOrName(newDirPath);
- IRODSNode newNode = new IRODSNode(entry, idrop.getIrodsAccount(), idrop.getIrodsFileSystem(), idrop.getIrodsTree());
- //newNode.setParent(parentNode);
+ IRODSNode newNode = new IRODSNode(entry, idrop.getIrodsAccount(), idrop.getiDropCore().getIrodsFileSystem(), idrop.getIrodsTree());
log.info("inserting node at 0");
- //parentNode.insertChildAt(0, newNode);
if (parentNode.isCached()) {
- irodsFileSystemModel.insertNodeInto(newNode, parentNode, 0);
+ parentNode.insert(newNode, parentNode.getChildCount());
} else {
parentNode.forceReloadOfChildrenOfThisNode();
- irodsFileSystemModel.reload(parentNode);
- stagingViewTree.expandPath(TreeUtils.buildTreePathForIrodsAbsolutePath(stagingViewTree, entry.getParentPath()));
}
- thisDialog.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
+ try {
+ TreePath path = TreeUtils.buildTreePathForIrodsAbsolutePath(stagingViewTree, entry.getParentPath());
+ stagingViewTree.collapsePath(path);
+ stagingViewTree.expandPath(path);
+ } catch (IdropException ex) {
+ Logger.getLogger(NewIRODSDirectoryDialog.class.getName()).log(Level.SEVERE, null, ex);
+ idrop.showIdropException(ex);
+ } finally {
+ thisDialog.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
+ }
+
idrop.showMessageFromOperation("new folder created");
- }
- catch (IdropException ex) {
+ thisDialog.dispose();
+ } catch (IdropException ex) {
Logger.getLogger(NewIRODSDirectoryDialog.class.getName()).log(Level.SEVERE, null, ex);
- idrop.showIdropException(ex);
+ throw new IdropRuntimeException(ex);
}
-
- thisDialog.dispose();
}
});
- }
-
+ }
- /**
+ /**
* Register a listener for the enter event, so login can occur.
*/
private void registerKeystrokeListener() {
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 782ec63..d716c14 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
@@ -1,4 +1,3 @@
-
package org.irods.jargon.idrop.desktop.systraygui;
import java.awt.Color;
@@ -132,7 +131,8 @@ public class NewLocalDirectoryDialog extends javax.swing.JDialog {
btnCancel.setText("Cancel");
btnCancel.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent evt) {
+ @Override
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
btnCancelActionPerformed(evt);
}
});
@@ -140,7 +140,8 @@ public class NewLocalDirectoryDialog extends javax.swing.JDialog {
btnOK.setText("OK");
btnOK.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent evt) {
+ @Override
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
btnOKActionPerformed(evt);
}
});
@@ -156,7 +157,7 @@ public class NewLocalDirectoryDialog extends javax.swing.JDialog {
}//GEN-LAST:event_btnCancelActionPerformed
private void btnOKActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnOKActionPerformed
- processNew();
+ processNew();
}//GEN-LAST:event_btnOKActionPerformed
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton btnCancel;
@@ -172,8 +173,8 @@ public class NewLocalDirectoryDialog extends javax.swing.JDialog {
private javax.swing.JTextField txtNewFolder;
// End of variables declaration//GEN-END:variables
-private void processNew() {
- // add the new folder to irods, add to the tree, and scroll the tree into view
+ private void processNew() {
+ // add the new folder to irods, add to the tree, and scroll the tree into view
if (txtNewFolder.getText().isEmpty()) {
txtNewFolder.setBackground(Color.red);
@@ -211,20 +212,22 @@ private void processNew() {
}
log.info("new file was created, adding as a node in the local tree");
-
- LocalFileNode newLocalNode = new LocalFileNode(newDir);
- LocalFileSystemModel localFileSystemModel = (LocalFileSystemModel) localFileTree.getModel();
- localFileSystemModel.insertNodeInto(newLocalNode, parentNode, 0);
-
-
+ LocalFileNode newLocalNode = new LocalFileNode(newDir);
+ LocalFileSystemModel localFileSystemModel = (LocalFileSystemModel) localFileTree.getModel();
+ if (parentNode.isCached()) {
+ localFileSystemModel.insertNodeInto(newLocalNode, parentNode, parentNode.getChildCount());
+ } else {
+ parentNode.lazyLoadOfChildrenOfThisNode();
+ }
+
TreePath scrollToPath = new TreePath(newLocalNode.getPath());
+ localFileTree.expandPath(scrollToPath);
- localFileTree.scrollPathToVisible(scrollToPath);
+ localFileTree.scrollPathToVisible(scrollToPath);
thisDialog.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
idrop.showMessageFromOperation("new local folder created");
- }
- catch (Exception ex) {
+ } catch (Exception ex) {
Logger.getLogger(NewLocalDirectoryDialog.class.getName()).log(Level.SEVERE, null, ex);
idrop.showIdropException(ex);
}
@@ -232,9 +235,9 @@ private void processNew() {
thisDialog.dispose();
}
});
-}
+ }
-/**
+ /**
* Register a listener for the enter event, so login can occur.
*/
private void registerKeystrokeListener() {
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/QueueManagerDialog.form b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/QueueManagerDialog.form
index ad4e49c..9bc346c 100644
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/QueueManagerDialog.form
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/QueueManagerDialog.form
@@ -387,26 +387,35 @@
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<Group type="103" groupAlignment="0" attributes="0">
- <Group type="103" groupAlignment="0" attributes="0">
- <Group type="102" alignment="1" attributes="0">
- <EmptySpace min="-2" pref="88" max="-2" attributes="0"/>
- <Component id="lblTransferStatusLabel" min="-2" pref="112" max="-2" attributes="0"/>
- <EmptySpace max="-2" attributes="0"/>
- <Component id="lblTransferStatus" min="-2" pref="177" max="-2" attributes="1"/>
- <EmptySpace min="-2" pref="88" max="-2" attributes="0"/>
- <Component id="lblErrorStatusLabel" min="-2" max="-2" attributes="0"/>
- <EmptySpace type="separate" max="-2" attributes="0"/>
- <Component id="lblErrorStatus" min="-2" pref="181" max="-2" attributes="0"/>
- <EmptySpace min="-2" pref="31" max="-2" attributes="0"/>
- <Component id="lblTransferDateLabel" min="-2" max="-2" attributes="0"/>
- <EmptySpace max="-2" attributes="0"/>
- <Component id="lblTransferDate" min="-2" pref="163" max="-2" attributes="0"/>
+ <Group type="102" attributes="0">
+ <Group type="103" groupAlignment="0" max="-2" attributes="0">
+ <Group type="102" alignment="1" attributes="0">
+ <EmptySpace min="-2" pref="88" max="-2" attributes="0"/>
+ <Component id="lblTransferStatusLabel" min="-2" pref="112" max="-2" attributes="0"/>
+ <EmptySpace max="-2" attributes="0"/>
+ <Component id="lblTransferStatus" min="-2" pref="177" max="-2" attributes="1"/>
+ <EmptySpace min="-2" pref="88" max="-2" attributes="0"/>
+ <Component id="lblErrorStatusLabel" min="-2" max="-2" attributes="0"/>
+ </Group>
+ <Group type="102" alignment="0" attributes="1">
+ <EmptySpace min="-2" pref="99" max="-2" attributes="0"/>
+ <Component id="lblTransferTypeLabel" min="-2" max="-2" attributes="0"/>
+ <EmptySpace type="separate" max="-2" attributes="0"/>
+ <Component id="lblTransferType" min="-2" pref="119" max="-2" attributes="1"/>
+ <EmptySpace max="32767" attributes="0"/>
+ <Component id="lblResourceLabel" min="-2" max="-2" attributes="0"/>
+ </Group>
</Group>
- <Group type="102" alignment="0" attributes="0">
- <EmptySpace min="-2" pref="99" max="-2" attributes="0"/>
- <Component id="lblTransferTypeLabel" min="-2" max="-2" attributes="0"/>
- <EmptySpace type="separate" max="-2" attributes="0"/>
- <Component id="lblTransferType" min="-2" pref="119" max="-2" attributes="1"/>
+ <EmptySpace type="separate" max="-2" attributes="0"/>
+ <Group type="103" groupAlignment="0" attributes="0">
+ <Group type="102" attributes="0">
+ <Component id="lblErrorStatus" min="-2" pref="181" max="-2" attributes="0"/>
+ <EmptySpace min="-2" pref="31" max="-2" attributes="0"/>
+ <Component id="lblTransferDateLabel" min="-2" max="-2" attributes="0"/>
+ <EmptySpace max="-2" attributes="0"/>
+ <Component id="lblTransferDate" min="-2" pref="163" max="-2" attributes="0"/>
+ </Group>
+ <Component id="lblResource" min="-2" pref="181" max="-2" attributes="0"/>
</Group>
</Group>
<Group type="102" alignment="0" attributes="0">
@@ -434,7 +443,7 @@
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="9" max="-2" attributes="0"/>
<Component id="pnlProgress" min="-2" pref="1016" max="-2" attributes="1"/>
- <EmptySpace pref="111" max="32767" attributes="0"/>
+ <EmptySpace max="32767" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
@@ -454,6 +463,8 @@
<Group type="103" groupAlignment="3" attributes="0">
<Component id="lblTransferTypeLabel" alignment="3" min="-2" pref="21" max="-2" attributes="0"/>
<Component id="lblTransferType" alignment="3" min="-2" pref="21" max="-2" attributes="0"/>
+ <Component id="lblResourceLabel" alignment="3" min="-2" pref="21" max="-2" attributes="0"/>
+ <Component id="lblResource" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="103" groupAlignment="1" attributes="0">
<Group type="102" alignment="0" attributes="0">
@@ -744,6 +755,16 @@
</Component>
</SubComponents>
</Container>
+ <Component class="javax.swing.JLabel" name="lblResourceLabel">
+ <Properties>
+ <Property name="text" type="java.lang.String" value="Resource:"/>
+ </Properties>
+ </Component>
+ <Component class="javax.swing.JLabel" name="lblResource">
+ <Properties>
+ <Property name="text" type="java.lang.String" value="jLabel1"/>
+ </Properties>
+ </Component>
</SubComponents>
</Container>
</SubComponents>
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 29c09d2..f0f753e 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
@@ -36,21 +36,15 @@ public class QueueManagerDialog extends javax.swing.JDialog implements ListSelec
private static final long serialVersionUID = 1L;
public enum ViewType {
+
RECENT, ERROR, WARNING, CURRENT
}
-
private final TransferManager transferManager;
-
private ViewType viewType = null;
-
private iDrop iDropParent = null;
-
private RefreshQueueManagerTimerTask refreshQueueManagerTimerTask = null;
-
private Timer refreshQueueTimer = null;
-
private LocalIRODSTransfer selectedMasterTableObject = null;
-
public static org.slf4j.Logger log = LoggerFactory.getLogger(QueueManagerDialog.class);
private int showResubmitConfirm(LocalIRODSTransfer selectedTransfer) {
@@ -174,6 +168,8 @@ public class QueueManagerDialog extends javax.swing.JDialog implements ListSelec
lblTransferredOutOf = new javax.swing.JLabel();
lblCountOutOf = new javax.swing.JLabel();
progressBarQueueDetails = new javax.swing.JProgressBar();
+ lblResourceLabel = new javax.swing.JLabel();
+ lblResource = new javax.swing.JLabel();
pnlTrnasferDetailsTable = new javax.swing.JPanel();
jScrollPaneDetails = new javax.swing.JScrollPane();
jTableDetails = new javax.swing.JTable();
@@ -206,7 +202,8 @@ public class QueueManagerDialog extends javax.swing.JDialog implements ListSelec
btnPurgeAll.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
btnPurgeAll.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
btnPurgeAll.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent evt) {
+ @Override
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
btnPurgeAllActionPerformed(evt);
}
});
@@ -298,19 +295,17 @@ public class QueueManagerDialog extends javax.swing.JDialog implements ListSelec
org.jdesktop.layout.GroupLayout pnlTopLayout = new org.jdesktop.layout.GroupLayout(pnlTop);
pnlTop.setLayout(pnlTopLayout);
- pnlTopLayout.setHorizontalGroup(pnlTopLayout
- .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
- .add(lblHeader, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 1115,
- org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
- .add(toolbarQueueManagement, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 1115,
- org.jdesktop.layout.GroupLayout.PREFERRED_SIZE));
- pnlTopLayout.setVerticalGroup(pnlTopLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING).add(
- pnlTopLayout
- .createSequentialGroup()
- .add(lblHeader)
- .add(toolbarQueueManagement, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
- org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
- org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)));
+ pnlTopLayout.setHorizontalGroup(
+ pnlTopLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
+ .add(lblHeader, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 1115, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
+ .add(toolbarQueueManagement, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 1115, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
+ );
+ pnlTopLayout.setVerticalGroup(
+ pnlTopLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
+ .add(pnlTopLayout.createSequentialGroup()
+ .add(lblHeader)
+ .add(toolbarQueueManagement, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
+ );
pnlCenter.setMinimumSize(new java.awt.Dimension(800, 200));
@@ -322,9 +317,17 @@ public class QueueManagerDialog extends javax.swing.JDialog implements ListSelec
jScrollPaneMaster.setPreferredSize(new java.awt.Dimension(454, 300));
jScrollPaneMaster.setRequestFocusEnabled(false);
- jTableMaster.setModel(new javax.swing.table.DefaultTableModel(new Object[][] { { null, null, null, null },
- { null, null, null, null }, { null, null, null, null }, { null, null, null, null } }, new String[] {
- "Title 1", "Title 2", "Title 3", "Title 4" }));
+ jTableMaster.setModel(new javax.swing.table.DefaultTableModel(
+ new Object [][] {
+ {null, null, null, null},
+ {null, null, null, null},
+ {null, null, null, null},
+ {null, null, null, null}
+ },
+ new String [] {
+ "Title 1", "Title 2", "Title 3", "Title 4"
+ }
+ ));
jTableMaster.setAutoCreateRowSorter(true);
jTableMaster.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
jScrollPaneMaster.setViewportView(jTableMaster);
@@ -400,31 +403,27 @@ public class QueueManagerDialog extends javax.swing.JDialog implements ListSelec
org.jdesktop.layout.GroupLayout pnlErrorMessageLayout = new org.jdesktop.layout.GroupLayout(pnlErrorMessage);
pnlErrorMessage.setLayout(pnlErrorMessageLayout);
- pnlErrorMessageLayout.setHorizontalGroup(pnlErrorMessageLayout.createParallelGroup(
- org.jdesktop.layout.GroupLayout.LEADING).add(
- pnlErrorMessageLayout
- .createSequentialGroup()
- .add(69, 69, 69)
+ pnlErrorMessageLayout.setHorizontalGroup(
+ pnlErrorMessageLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
+ .add(pnlErrorMessageLayout.createSequentialGroup()
+ .add(69, 69, 69)
+ .add(jLabel1)
+ .add(42, 42, 42)
+ .add(scrollErrorMessage, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 667, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
+ .addContainerGap(126, Short.MAX_VALUE))
+ );
+ pnlErrorMessageLayout.setVerticalGroup(
+ pnlErrorMessageLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
+ .add(pnlErrorMessageLayout.createSequentialGroup()
+ .addContainerGap(24, Short.MAX_VALUE)
+ .add(pnlErrorMessageLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
+ .add(org.jdesktop.layout.GroupLayout.TRAILING, pnlErrorMessageLayout.createSequentialGroup()
+ .add(scrollErrorMessage, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 72, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
+ .addContainerGap())
+ .add(org.jdesktop.layout.GroupLayout.TRAILING, pnlErrorMessageLayout.createSequentialGroup()
.add(jLabel1)
- .add(42, 42, 42)
- .add(scrollErrorMessage, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 667,
- org.jdesktop.layout.GroupLayout.PREFERRED_SIZE).addContainerGap(126, Short.MAX_VALUE)));
- pnlErrorMessageLayout.setVerticalGroup(pnlErrorMessageLayout.createParallelGroup(
- org.jdesktop.layout.GroupLayout.LEADING).add(
- pnlErrorMessageLayout
- .createSequentialGroup()
- .addContainerGap(24, Short.MAX_VALUE)
- .add(pnlErrorMessageLayout
- .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
- .add(org.jdesktop.layout.GroupLayout.TRAILING,
- pnlErrorMessageLayout
- .createSequentialGroup()
- .add(scrollErrorMessage,
- org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 72,
- org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
- .addContainerGap())
- .add(org.jdesktop.layout.GroupLayout.TRAILING,
- pnlErrorMessageLayout.createSequentialGroup().add(jLabel1).add(29, 29, 29)))));
+ .add(29, 29, 29))))
+ );
pnlProgress.setBackground(javax.swing.UIManager.getDefaults().getColor("TabbedPane.shadow"));
@@ -438,200 +437,164 @@ public class QueueManagerDialog extends javax.swing.JDialog implements ListSelec
org.jdesktop.layout.GroupLayout pnlProgressLayout = new org.jdesktop.layout.GroupLayout(pnlProgress);
pnlProgress.setLayout(pnlProgressLayout);
- pnlProgressLayout.setHorizontalGroup(pnlProgressLayout
- .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
- .add(pnlProgressLayout
- .createSequentialGroup()
- .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
- .add(lblTransferred)
- .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
- .add(lblCountSoFar, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 96,
- org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
- .add(27, 27, 27)
- .add(lblTransferredOutOf)
- .add(18, 18, 18)
- .add(lblCountOutOf, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 96,
- org.jdesktop.layout.GroupLayout.PREFERRED_SIZE).add(648, 648, 648))
- .add(pnlProgressLayout
- .createSequentialGroup()
- .addContainerGap()
- .add(progressBarQueueDetails, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 901,
- org.jdesktop.layout.GroupLayout.PREFERRED_SIZE).addContainerGap()));
- pnlProgressLayout.setVerticalGroup(pnlProgressLayout.createParallelGroup(
- org.jdesktop.layout.GroupLayout.LEADING).add(
- pnlProgressLayout
- .createSequentialGroup()
- .addContainerGap()
- .add(pnlProgressLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
- .add(lblTransferred).add(lblTransferredOutOf).add(lblCountOutOf).add(lblCountSoFar))
- .add(18, 18, 18)
- .add(progressBarQueueDetails, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
- org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
- org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
- .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));
+ pnlProgressLayout.setHorizontalGroup(
+ pnlProgressLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
+ .add(pnlProgressLayout.createSequentialGroup()
+ .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+ .add(lblTransferred)
+ .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
+ .add(lblCountSoFar, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 96, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
+ .add(27, 27, 27)
+ .add(lblTransferredOutOf)
+ .add(18, 18, 18)
+ .add(lblCountOutOf, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 96, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
+ .add(648, 648, 648))
+ .add(pnlProgressLayout.createSequentialGroup()
+ .addContainerGap()
+ .add(progressBarQueueDetails, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 901, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
+ .addContainerGap())
+ );
+ pnlProgressLayout.setVerticalGroup(
+ pnlProgressLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
+ .add(pnlProgressLayout.createSequentialGroup()
+ .addContainerGap()
+ .add(pnlProgressLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
+ .add(lblTransferred)
+ .add(lblTransferredOutOf)
+ .add(lblCountOutOf)
+ .add(lblCountSoFar))
+ .add(18, 18, 18)
+ .add(progressBarQueueDetails, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
+ .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
+ );
+
+ lblResourceLabel.setText("Resource:");
+
+ lblResource.setText("jLabel1");
org.jdesktop.layout.GroupLayout pnlTransferInfoLayout = new org.jdesktop.layout.GroupLayout(pnlTransferInfo);
pnlTransferInfo.setLayout(pnlTransferInfoLayout);
- pnlTransferInfoLayout.setHorizontalGroup(pnlTransferInfoLayout
- .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
- .add(pnlTransferInfoLayout
- .createSequentialGroup()
- .add(pnlTransferInfoLayout
- .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
- .add(pnlTransferInfoLayout
- .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
- .add(org.jdesktop.layout.GroupLayout.TRAILING,
- pnlTransferInfoLayout
- .createSequentialGroup()
- .add(88, 88, 88)
- .add(lblTransferStatusLabel,
- org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 112,
- org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
- .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
- .add(lblTransferStatus,
- org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 177,
- org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
- .add(88, 88, 88)
- .add(lblErrorStatusLabel)
- .add(18, 18, 18)
- .add(lblErrorStatus,
- org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 181,
- org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
- .add(31, 31, 31)
- .add(lblTransferDateLabel)
- .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
- .add(lblTransferDate,
- org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 163,
- org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
- .add(pnlTransferInfoLayout
- .createSequentialGroup()
- .add(99, 99, 99)
- .add(lblTransferTypeLabel)
- .add(18, 18, 18)
- .add(lblTransferType, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
- 119, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))
- .add(pnlTransferInfoLayout
- .createSequentialGroup()
- .add(58, 58, 58)
- .add(pnlTransferInfoLayout
- .createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
- .add(lblLastGoodPathLabel,
- org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 164,
- org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
- .add(lblTargetPathLabel,
- org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 142,
- org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
- .add(lblSourcePathLabel,
- org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 99,
- org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
- .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
- .add(pnlTransferInfoLayout
- .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false)
- .add(jScrollPane1)
- .add(jScrollPaneTargetPath, 0, 0, Short.MAX_VALUE)
- .add(jScrollPaneSourcePath,
- org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 669,
- Short.MAX_VALUE))))
- .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
- .add(org.jdesktop.layout.GroupLayout.TRAILING,
- pnlTransferInfoLayout
- .createSequentialGroup()
- .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
- .add(pnlErrorMessage, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
- org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
- org.jdesktop.layout.GroupLayout.PREFERRED_SIZE).add(112, 112, 112))
- .add(pnlTransferInfoLayout
- .createSequentialGroup()
- .add(9, 9, 9)
- .add(pnlProgress, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 1016,
- org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
- .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));
- pnlTransferInfoLayout.setVerticalGroup(pnlTransferInfoLayout.createParallelGroup(
- org.jdesktop.layout.GroupLayout.LEADING).add(
- pnlTransferInfoLayout
- .createSequentialGroup()
- .addContainerGap()
- .add(pnlTransferInfoLayout
- .createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
- .add(lblTransferStatusLabel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 21,
- org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
- .add(lblTransferStatus, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 21,
- org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
- .add(lblErrorStatusLabel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 21,
- org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
- .add(lblErrorStatus)
- .add(lblTransferDateLabel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 21,
- org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
- .add(lblTransferDate, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 26,
- org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
+ pnlTransferInfoLayout.setHorizontalGroup(
+ pnlTransferInfoLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
+ .add(pnlTransferInfoLayout.createSequentialGroup()
+ .add(pnlTransferInfoLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
+ .add(pnlTransferInfoLayout.createSequentialGroup()
+ .add(pnlTransferInfoLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false)
+ .add(org.jdesktop.layout.GroupLayout.TRAILING, pnlTransferInfoLayout.createSequentialGroup()
+ .add(88, 88, 88)
+ .add(lblTransferStatusLabel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 112, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
+ .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
+ .add(lblTransferStatus, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 177, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
+ .add(88, 88, 88)
+ .add(lblErrorStatusLabel))
+ .add(pnlTransferInfoLayout.createSequentialGroup()
+ .add(99, 99, 99)
+ .add(lblTransferTypeLabel)
+ .add(18, 18, 18)
+ .add(lblTransferType, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 119, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
+ .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+ .add(lblResourceLabel)))
+ .add(18, 18, 18)
+ .add(pnlTransferInfoLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
+ .add(pnlTransferInfoLayout.createSequentialGroup()
+ .add(lblErrorStatus, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 181, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
+ .add(31, 31, 31)
+ .add(lblTransferDateLabel)
+ .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
+ .add(lblTransferDate, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 163, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
+ .add(lblResource, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 181, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))
+ .add(pnlTransferInfoLayout.createSequentialGroup()
+ .add(58, 58, 58)
+ .add(pnlTransferInfoLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
+ .add(lblLastGoodPathLabel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 164, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
+ .add(lblTargetPathLabel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 142, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
+ .add(lblSourcePathLabel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 99, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
+ .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
+ .add(pnlTransferInfoLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false)
+ .add(jScrollPane1)
+ .add(jScrollPaneTargetPath, 0, 0, Short.MAX_VALUE)
+ .add(jScrollPaneSourcePath, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 669, Short.MAX_VALUE))))
+ .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
+ .add(org.jdesktop.layout.GroupLayout.TRAILING, pnlTransferInfoLayout.createSequentialGroup()
+ .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+ .add(pnlErrorMessage, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
+ .add(112, 112, 112))
+ .add(pnlTransferInfoLayout.createSequentialGroup()
+ .add(9, 9, 9)
+ .add(pnlProgress, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 1016, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
+ .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
+ );
+ pnlTransferInfoLayout.setVerticalGroup(
+ pnlTransferInfoLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
+ .add(pnlTransferInfoLayout.createSequentialGroup()
+ .addContainerGap()
+ .add(pnlTransferInfoLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
+ .add(lblTransferStatusLabel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 21, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
+ .add(lblTransferStatus, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 21, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
+ .add(lblErrorStatusLabel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 21, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
+ .add(lblErrorStatus)
+ .add(lblTransferDateLabel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 21, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
+ .add(lblTransferDate, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 26, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
+ .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
+ .add(pnlTransferInfoLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
+ .add(lblTransferTypeLabel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 21, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
+ .add(lblTransferType, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 21, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
+ .add(lblResourceLabel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 21, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
+ .add(lblResource))
+ .add(pnlTransferInfoLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
+ .add(org.jdesktop.layout.GroupLayout.LEADING, pnlTransferInfoLayout.createSequentialGroup()
+ .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
+ .add(jScrollPaneSourcePath, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 48, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
+ .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
+ .add(jScrollPaneTargetPath, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 46, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
- .add(pnlTransferInfoLayout
- .createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
- .add(lblTransferTypeLabel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 21,
- org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
- .add(lblTransferType, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 21,
- org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
- .add(pnlTransferInfoLayout
- .createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
- .add(org.jdesktop.layout.GroupLayout.LEADING,
- pnlTransferInfoLayout
- .createSequentialGroup()
- .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
- .add(jScrollPaneSourcePath,
- org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 48,
- org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
- .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
- .add(jScrollPaneTargetPath,
- org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 46,
- org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
- .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
- .add(jScrollPane1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 46,
- org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
- .add(pnlTransferInfoLayout
- .createSequentialGroup()
- .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
- .add(lblSourcePathLabel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 42,
- org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
- .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
- .add(lblTargetPathLabel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 40,
- org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
- .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
- .add(lblLastGoodPathLabel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 35,
- org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))
- .add(32, 32, 32)
- .add(pnlProgress, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 85,
- org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
+ .add(jScrollPane1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 46, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
+ .add(pnlTransferInfoLayout.createSequentialGroup()
+ .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
+ .add(lblSourcePathLabel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 42, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
+ .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
+ .add(lblTargetPathLabel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 40, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
- .add(pnlErrorMessage, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
- org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
- org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
- .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));
-
- org.jdesktop.layout.GroupLayout pnlTransferDetailsSummaryLayout = new org.jdesktop.layout.GroupLayout(
- pnlTransferDetailsSummary);
+ .add(lblLastGoodPathLabel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 35, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))
+ .add(32, 32, 32)
+ .add(pnlProgress, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 85, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
+ .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
+ .add(pnlErrorMessage, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
+ .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
+ );
+
+ org.jdesktop.layout.GroupLayout pnlTransferDetailsSummaryLayout = new org.jdesktop.layout.GroupLayout(pnlTransferDetailsSummary);
pnlTransferDetailsSummary.setLayout(pnlTransferDetailsSummaryLayout);
- pnlTransferDetailsSummaryLayout.setHorizontalGroup(pnlTransferDetailsSummaryLayout.createParallelGroup(
- org.jdesktop.layout.GroupLayout.LEADING).add(
- pnlTransferDetailsSummaryLayout.createSequentialGroup().add(36, 36, 36)
- .add(pnlTransferInfo, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 1034, Short.MAX_VALUE)
- .addContainerGap()));
- pnlTransferDetailsSummaryLayout.setVerticalGroup(pnlTransferDetailsSummaryLayout.createParallelGroup(
- org.jdesktop.layout.GroupLayout.LEADING).add(
- pnlTransferDetailsSummaryLayout
- .createSequentialGroup()
- .addContainerGap()
- .add(pnlTransferInfo, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 481,
- org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
- .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));
-
- tabDetails.addTab("TransferSummary", null, pnlTransferDetailsSummary,
- "Summary information about the selected transfer");
+ pnlTransferDetailsSummaryLayout.setHorizontalGroup(
+ pnlTransferDetailsSummaryLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
+ .add(pnlTransferDetailsSummaryLayout.createSequentialGroup()
+ .add(36, 36, 36)
+ .add(pnlTransferInfo, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 1034, Short.MAX_VALUE)
+ .addContainerGap())
+ );
+ pnlTransferDetailsSummaryLayout.setVerticalGroup(
+ pnlTransferDetailsSummaryLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
+ .add(pnlTransferDetailsSummaryLayout.createSequentialGroup()
+ .addContainerGap()
+ .add(pnlTransferInfo, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 481, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
+ .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
+ );
+
+ tabDetails.addTab("TransferSummary", null, pnlTransferDetailsSummary, "Summary information about the selected transfer");
jScrollPaneDetails.setPreferredSize(new java.awt.Dimension(454, 200));
- jTableDetails.setModel(new javax.swing.table.DefaultTableModel(new Object[][] { { null, null, null, null },
- { null, null, null, null }, { null, null, null, null }, { null, null, null, null } }, new String[] {
- "Title 1", "Title 2", "Title 3", "Title 4" }));
+ jTableDetails.setModel(new javax.swing.table.DefaultTableModel(
+ new Object [][] {
+ {null, null, null, null},
+ {null, null, null, null},
+ {null, null, null, null},
+ {null, null, null, null}
+ },
+ new String [] {
+ "Title 1", "Title 2", "Title 3", "Title 4"
+ }
+ ));
jTableDetails.setAutoCreateRowSorter(true);
jTableDetails.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
jScrollPaneDetails.setViewportView(jTableDetails);
@@ -657,44 +620,45 @@ public class QueueManagerDialog extends javax.swing.JDialog implements ListSelec
org.jdesktop.layout.GroupLayout pnlViewRadioLayout = new org.jdesktop.layout.GroupLayout(pnlViewRadio);
pnlViewRadio.setLayout(pnlViewRadioLayout);
- pnlViewRadioLayout.setHorizontalGroup(pnlViewRadioLayout.createParallelGroup(
- org.jdesktop.layout.GroupLayout.LEADING).add(
- pnlViewRadioLayout.createSequentialGroup().add(9, 9, 9).add(radioShowAll).add(5, 5, 5)
- .add(radioShowError)
- .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));
- pnlViewRadioLayout.setVerticalGroup(pnlViewRadioLayout.createParallelGroup(
- org.jdesktop.layout.GroupLayout.LEADING).add(
- pnlViewRadioLayout
- .createSequentialGroup()
- .add(5, 5, 5)
- .add(pnlViewRadioLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
- .add(radioShowAll).add(radioShowError))));
-
- org.jdesktop.layout.GroupLayout pnlTrnasferDetailsTableLayout = new org.jdesktop.layout.GroupLayout(
- pnlTrnasferDetailsTable);
+ pnlViewRadioLayout.setHorizontalGroup(
+ pnlViewRadioLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
+ .add(pnlViewRadioLayout.createSequentialGroup()
+ .add(9, 9, 9)
+ .add(radioShowAll)
+ .add(5, 5, 5)
+ .add(radioShowError)
+ .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
+ );
+ pnlViewRadioLayout.setVerticalGroup(
+ pnlViewRadioLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
+ .add(pnlViewRadioLayout.createSequentialGroup()
+ .add(5, 5, 5)
+ .add(pnlViewRadioLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
+ .add(radioShowAll)
+ .add(radioShowError)))
+ );
+
+ org.jdesktop.layout.GroupLayout pnlTrnasferDetailsTableLayout = new org.jdesktop.layout.GroupLayout(pnlTrnasferDetailsTable);
pnlTrnasferDetailsTable.setLayout(pnlTrnasferDetailsTableLayout);
- pnlTrnasferDetailsTableLayout.setHorizontalGroup(pnlTrnasferDetailsTableLayout
- .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
- .add(org.jdesktop.layout.GroupLayout.TRAILING,
- pnlTrnasferDetailsTableLayout
- .createSequentialGroup()
- .addContainerGap(401, Short.MAX_VALUE)
- .add(pnlViewRadio, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
- org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
- org.jdesktop.layout.GroupLayout.PREFERRED_SIZE).add(367, 367, 367))
- .add(pnlTrnasferDetailsTableLayout.createSequentialGroup().add(20, 20, 20)
- .add(jScrollPaneDetails, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 1070, Short.MAX_VALUE)));
- pnlTrnasferDetailsTableLayout.setVerticalGroup(pnlTrnasferDetailsTableLayout.createParallelGroup(
- org.jdesktop.layout.GroupLayout.LEADING).add(
- pnlTrnasferDetailsTableLayout
- .createSequentialGroup()
- .add(22, 22, 22)
- .add(pnlViewRadio, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 43,
- org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
- .add(18, 18, 18)
- .add(jScrollPaneDetails, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 451,
- org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
- .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));
+ pnlTrnasferDetailsTableLayout.setHorizontalGroup(
+ pnlTrnasferDetailsTableLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
+ .add(org.jdesktop.layout.GroupLayout.TRAILING, pnlTrnasferDetailsTableLayout.createSequentialGroup()
+ .addContainerGap(401, Short.MAX_VALUE)
+ .add(pnlViewRadio, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
+ .add(367, 367, 367))
+ .add(pnlTrnasferDetailsTableLayout.createSequentialGroup()
+ .add(20, 20, 20)
+ .add(jScrollPaneDetails, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 1070, Short.MAX_VALUE))
+ );
+ pnlTrnasferDetailsTableLayout.setVerticalGroup(
+ pnlTrnasferDetailsTableLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
+ .add(pnlTrnasferDetailsTableLayout.createSequentialGroup()
+ .add(22, 22, 22)
+ .add(pnlViewRadio, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 43, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
+ .add(18, 18, 18)
+ .add(jScrollPaneDetails, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 451, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
+ .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
+ );
tabDetails.addTab("Transfer Details", pnlTrnasferDetailsTable);
@@ -702,19 +666,20 @@ public class QueueManagerDialog extends javax.swing.JDialog implements ListSelec
org.jdesktop.layout.GroupLayout pnlCenterLayout = new org.jdesktop.layout.GroupLayout(pnlCenter);
pnlCenter.setLayout(pnlCenterLayout);
- pnlCenterLayout.setHorizontalGroup(pnlCenterLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
- .add(pnlCenterLayout
- .createSequentialGroup()
- .addContainerGap()
- .add(splitQueueTableMasterAndDetail, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 1115,
- org.jdesktop.layout.GroupLayout.PREFERRED_SIZE).addContainerGap(33, Short.MAX_VALUE)));
- pnlCenterLayout.setVerticalGroup(pnlCenterLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
- .add(pnlCenterLayout
- .createSequentialGroup()
- .addContainerGap()
- .add(splitQueueTableMasterAndDetail, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 766,
- org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
- .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));
+ pnlCenterLayout.setHorizontalGroup(
+ pnlCenterLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
+ .add(pnlCenterLayout.createSequentialGroup()
+ .addContainerGap()
+ .add(splitQueueTableMasterAndDetail, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 1115, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
+ .addContainerGap(33, Short.MAX_VALUE))
+ );
+ pnlCenterLayout.setVerticalGroup(
+ pnlCenterLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
+ .add(pnlCenterLayout.createSequentialGroup()
+ .addContainerGap()
+ .add(splitQueueTableMasterAndDetail, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 766, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
+ .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
+ );
jMenu1.setText("File");
jMenuBar1.add(jMenu1);
@@ -770,25 +735,21 @@ public class QueueManagerDialog extends javax.swing.JDialog implements ListSelec
org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
- layout.setHorizontalGroup(layout
- .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
- .add(pnlTop, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
- org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
- .add(layout
- .createSequentialGroup()
- .add(20, 20, 20)
- .add(pnlCenter, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
- org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
- org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)));
- layout.setVerticalGroup(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING).add(
- layout.createSequentialGroup()
- .add(pnlTop, 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(pnlCenter, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
- org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
- org.jdesktop.layout.GroupLayout.PREFERRED_SIZE).addContainerGap()));
+ layout.setHorizontalGroup(
+ layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
+ .add(pnlTop, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
+ .add(layout.createSequentialGroup()
+ .add(20, 20, 20)
+ .add(pnlCenter, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
+ );
+ layout.setVerticalGroup(
+ layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
+ .add(layout.createSequentialGroup()
+ .add(pnlTop, 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(pnlCenter, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
+ .addContainerGap())
+ );
pack();
}// </editor-fold>//GEN-END:initComponents
@@ -826,7 +787,7 @@ public class QueueManagerDialog extends javax.swing.JDialog implements ListSelec
private void btnPurgeAllActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_btnPurgeAllActionPerformed
try {
- iDropParent.getTransferManager().purgeAllTransfers();
+ iDropParent.getiDropCore().getTransferManager().purgeAllTransfers();
refreshTableView(viewType);
resetDisplayFieldsAndStatus();
} catch (Exception ex) {
@@ -837,7 +798,7 @@ public class QueueManagerDialog extends javax.swing.JDialog implements ListSelec
private void btnPurgeSuccessfulActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_btnPurgeSuccessfulActionPerformed
try {
- iDropParent.getTransferManager().purgeSuccessfulTransfers();
+ iDropParent.getiDropCore().getTransferManager().purgeSuccessfulTransfers();
refreshTableView(viewType);
resetDisplayFieldsAndStatus();
@@ -1091,134 +1052,72 @@ public class QueueManagerDialog extends javax.swing.JDialog implements ListSelec
});
}
-
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton btnCancelSelected;
-
private javax.swing.JButton btnDeleteSelected;
-
private javax.swing.ButtonGroup btnGroupDetailsDisplay;
-
private javax.swing.JButton btnPurgeAll;
-
private javax.swing.JButton btnPurgeSuccessful;
-
private javax.swing.JButton btnRefreshView;
-
private javax.swing.JButton btnRestartSelected;
-
private javax.swing.JButton btnResubmitSelected;
-
private javax.swing.JLabel jLabel1;
-
private javax.swing.JMenu jMenu1;
-
private javax.swing.JMenu jMenu2;
-
private javax.swing.JMenuBar jMenuBar1;
-
private javax.swing.JMenuItem jMenuCurrent;
-
private javax.swing.JMenuItem jMenuError;
-
private javax.swing.JMenuItem jMenuRecent;
-
private javax.swing.JMenu jMenuView;
-
private javax.swing.JMenuItem jMenuWarning;
-
private javax.swing.JScrollPane jScrollPane1;
-
private javax.swing.JScrollPane jScrollPaneDetails;
-
private javax.swing.JScrollPane jScrollPaneMaster;
-
private javax.swing.JScrollPane jScrollPaneSourcePath;
-
private javax.swing.JScrollPane jScrollPaneTargetPath;
-
private javax.swing.JToolBar.Separator jSeparator1;
-
private javax.swing.JToolBar.Separator jSeparator2;
-
private javax.swing.JToolBar.Separator jSeparator3;
-
private javax.swing.JTable jTableDetails;
-
private javax.swing.JTable jTableMaster;
-
private javax.swing.JLabel lblCountOutOf;
-
private javax.swing.JLabel lblCountSoFar;
-
private javax.swing.JLabel lblErrorStatus;
-
private javax.swing.JLabel lblErrorStatusLabel;
-
private javax.swing.JLabel lblHeader;
-
private javax.swing.JLabel lblLastGoodPathLabel;
-
+ private javax.swing.JLabel lblResource;
+ private javax.swing.JLabel lblResourceLabel;
private javax.swing.JLabel lblSourcePathLabel;
-
private javax.swing.JLabel lblTargetPathLabel;
-
private javax.swing.JLabel lblTransferDate;
-
private javax.swing.JLabel lblTransferDateLabel;
-
private javax.swing.JLabel lblTransferStatus;
-
private javax.swing.JLabel lblTransferStatusLabel;
-
private javax.swing.JLabel lblTransferType;
-
private javax.swing.JLabel lblTransferTypeLabel;
-
private javax.swing.JLabel lblTransferred;
-
private javax.swing.JLabel lblTransferredOutOf;
-
private javax.swing.JPanel pnlCenter;
-
private javax.swing.JPanel pnlErrorMessage;
-
private javax.swing.JPanel pnlProgress;
-
private javax.swing.JPanel pnlTop;
-
private javax.swing.JPanel pnlTransferDetailsSummary;
-
private javax.swing.JPanel pnlTransferInfo;
-
private javax.swing.JPanel pnlTrnasferDetailsTable;
-
private javax.swing.JPanel pnlViewRadio;
-
private javax.swing.JProgressBar progressBarQueueDetails;
-
private javax.swing.JRadioButton radioShowAll;
-
private javax.swing.JRadioButton radioShowError;
-
private javax.swing.JScrollPane scrollErrorMessage;
-
private javax.swing.JSplitPane splitQueueTableMasterAndDetail;
-
private javax.swing.JTabbedPane tabDetails;
-
private javax.swing.JToggleButton toggleAutoRefresh;
-
private javax.swing.JToolBar toolbarQueueManagement;
-
private javax.swing.JTextArea txtAreaErrorMessage;
-
private javax.swing.JTextArea txtLastGoodPath;
-
private javax.swing.JTextArea txtSourcePath;
-
private javax.swing.JTextArea txtTargetPath;
-
// End of variables declaration//GEN-END:variables
public JLabel getLblHeader() {
@@ -1246,8 +1145,7 @@ public class QueueManagerDialog extends javax.swing.JDialog implements ListSelec
}
private void adjustDetails() {
- final LocalIRODSTransfer localIRODSTransfer = ((QueueManagerMasterTableModel) jTableMaster.getModel())
- .getTransferAtRow(jTableMaster.getSelectedRow());
+ final LocalIRODSTransfer localIRODSTransfer = ((QueueManagerMasterTableModel) jTableMaster.getModel()).getTransferAtRow(jTableMaster.getSelectedRow());
log.info("selected transfer:{}", localIRODSTransfer);
final boolean showAll = radioShowAll.isSelected();
@@ -1260,6 +1158,7 @@ public class QueueManagerDialog extends javax.swing.JDialog implements ListSelec
lblTransferDate.setText(localIRODSTransfer.getTransferStart().toString());
lblTransferStatus.setText(localIRODSTransfer.getTransferState().toString());
lblErrorStatus.setText(localIRODSTransfer.getTransferStatus().toString());
+ lblResource.setText(localIRODSTransfer.getTransferResource());
// set source and target properly based on activity (put, get, etc)
switch (localIRODSTransfer.getTransferType()) {
@@ -1275,6 +1174,10 @@ public class QueueManagerDialog extends javax.swing.JDialog implements ListSelec
txtSourcePath.setText(localIRODSTransfer.getIrodsAbsolutePath());
txtTargetPath.setText("");
break;
+ case COPY:
+ txtSourcePath.setText(localIRODSTransfer.getIrodsAbsolutePath());
+ txtTargetPath.setText(localIRODSTransfer.getIrodsAbsolutePath());
+ break;
default:
log.error("unable to build details for transfer with transfer type of:{}",
localIRODSTransfer.getTransferType());
@@ -1306,11 +1209,9 @@ public class QueueManagerDialog extends javax.swing.JDialog implements ListSelec
if (showAll) {
log.info("showing all transfers based on radio selection");
- jTableDetails.setModel(new QueueManagerDetailTableModel(transferManager
- .getAllTransferItemsForTransfer(localIRODSTransfer.getId())));
+ jTableDetails.setModel(new QueueManagerDetailTableModel(transferManager.getAllTransferItemsForTransfer(localIRODSTransfer.getId())));
} else {
- jTableDetails.setModel(new QueueManagerDetailTableModel(transferManager
- .getErrorTransferItemsForTransfer(localIRODSTransfer.getId())));
+ jTableDetails.setModel(new QueueManagerDetailTableModel(transferManager.getErrorTransferItemsForTransfer(localIRODSTransfer.getId())));
}
} catch (Exception ex) {
@@ -1383,7 +1284,7 @@ public class QueueManagerDialog extends javax.swing.JDialog implements ListSelec
private void resetDisplayFieldsAndStatus() {
try {
- iDropParent.getTransferManager().resetStatus();
+ iDropParent.getiDropCore().getTransferManager().resetStatus();
} catch (Exception ex) {
Logger.getLogger(QueueManagerDialog.class.getName()).log(Level.SEVERE, null, ex);
// log and continue...not useful to user
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/QueueThread.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/QueueTimerTaskThread.java
index a0dc36a..7f07d2f 100644
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/QueueThread.java
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/QueueTimerTaskThread.java
@@ -4,13 +4,13 @@ import org.irods.jargon.idrop.desktop.systraygui.services.QueueSchedulerTimerTas
import org.irods.jargon.idrop.exceptions.IdropException;
import org.slf4j.LoggerFactory;
-public class QueueThread extends Thread {
+public class QueueTimerTaskThread extends Thread {
private final org.slf4j.Logger logger = LoggerFactory.getLogger(iDrop.class);
private iDrop iDrop;
- public QueueThread(iDrop iDrop) {
+ public QueueTimerTaskThread(iDrop iDrop) {
super();
this.iDrop = iDrop;
}
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 32ddf61..eb0cd41 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
@@ -107,14 +107,16 @@ public class RenameIRODSDirectoryDialog extends javax.swing.JDialog {
btnCancel.setText("Cancel");
btnCancel.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent evt) {
+ @Override
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
btnCancelActionPerformed(evt);
}
});
btnOK.setText("OK");
btnOK.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent evt) {
+ @Override
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
btnOKActionPerformed(evt);
}
});
@@ -251,7 +253,7 @@ public class RenameIRODSDirectoryDialog extends javax.swing.JDialog {
thisDialog.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
try {
- IRODSFileService irodsFileService = new IRODSFileService(idrop.getIrodsAccount(), idrop.getIrodsFileSystem());
+ IRODSFileService irodsFileService = new IRODSFileService(idrop.getIrodsAccount(), idrop.getiDropCore().getIrodsFileSystem());
String newPath = irodsFileService.renameIRODSFileOrDirectory(currentAbsolutePath, txtNewFolder.getText());
log.debug("New path:{}", newPath);
IRODSFileSystemModel irodsFileSystemModel = (IRODSFileSystemModel) stagingViewTree.getModel();
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 d461187..cd8526a 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
@@ -101,14 +101,16 @@ public class RenameLocalDirectoryDialog extends javax.swing.JDialog {
btnCancel.setText("Cancel");
btnCancel.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent evt) {
+ @Override
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
btnCancelActionPerformed(evt);
}
});
btnOK.setText("OK");
btnOK.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent evt) {
+ @Override
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
btnOKActionPerformed(evt);
}
});
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 d92a269..291d3ae 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
@@ -61,7 +61,7 @@ public class ReplicationDialog extends javax.swing.JDialog {
if (isFile) {
IRODSFileService irodsFileService;
try {
- irodsFileService = new IRODSFileService(idropParentGui.getIrodsAccount(), idropParentGui.getIrodsFileSystem());
+ irodsFileService = new IRODSFileService(idropParentGui.getIrodsAccount(), idropParentGui.getiDropCore().getIrodsFileSystem());
currentResources = irodsFileService.getResourcesForDataObject(seriesAbsolutePath, fileName);
}
catch (IdropException ex) {
@@ -106,7 +106,8 @@ public class ReplicationDialog extends javax.swing.JDialog {
btnOK.setText("OK");
btnOK.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent evt) {
+ @Override
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
btnOKActionPerformed(evt);
}
});
@@ -114,7 +115,8 @@ public class ReplicationDialog extends javax.swing.JDialog {
btnCancel.setText("Cancel");
btnCancel.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent evt) {
+ @Override
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
btnCancelActionPerformed(evt);
}
});
@@ -135,7 +137,8 @@ public class ReplicationDialog extends javax.swing.JDialog {
btnReplicate.setText("Replicate");
btnReplicate.setToolTipText("Replicate the given file to selected resources");
btnReplicate.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent evt) {
+ @Override
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
btnReplicateActionPerformed(evt);
}
});
@@ -191,11 +194,11 @@ public class ReplicationDialog extends javax.swing.JDialog {
sb.append("/");
sb.append(fileName);
replicatedCount++;
- idropParentGui.getTransferManager().enqueueAReplicate(sb.toString(), checkBox.getText(), idropParentGui.getIrodsAccount());
+ idropParentGui.getiDropCore().getTransferManager().enqueueAReplicate(sb.toString(), checkBox.getText(), idropParentGui.getIrodsAccount());
} else if (!isFile) {
log.info("this is a collection, do the replication");
replicatedCount++;
- idropParentGui.getTransferManager().enqueueAReplicate(seriesAbsolutePath, checkBox.getText(), idropParentGui.getIrodsAccount());
+ idropParentGui.getiDropCore().getTransferManager().enqueueAReplicate(seriesAbsolutePath, checkBox.getText(), idropParentGui.getIrodsAccount());
}
}
@@ -212,7 +215,8 @@ public class ReplicationDialog extends javax.swing.JDialog {
// now dispose
java.awt.EventQueue.invokeLater(new Runnable() {
- public void run() {
+ @Override
+ public void run() {
if (replicationsDone > 0) {
idropParentGui.showMessageFromOperation("Replication has been placed into the queue for processing");
} else {
@@ -231,9 +235,10 @@ public class ReplicationDialog extends javax.swing.JDialog {
private void setUpDialog() {
java.awt.EventQueue.invokeLater(new Runnable() {
- public void run() {
+ @Override
+ public void run() {
try {
- IRODSFileService irodsFileService = new IRODSFileService(idropParentGui.getIrodsAccount(), idropParentGui.getIrodsFileSystem());
+ IRODSFileService irodsFileService = new IRODSFileService(idropParentGui.getIrodsAccount(), idropParentGui.getiDropCore().getIrodsFileSystem());
List<Resource> resources = irodsFileService.getResources();
boxes = new ArrayList<JCheckBox>();
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/StartupSequencer.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/StartupSequencer.java
new file mode 100644
index 0000000..b624974
--- /dev/null
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/StartupSequencer.java
@@ -0,0 +1,232 @@
+ /*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package org.irods.jargon.idrop.desktop.systraygui;
+
+import java.awt.Component;
+import java.awt.Toolkit;
+import java.sql.SQLException;
+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()) {
+ 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) {
+ Logger.getLogger(StartupSequencer.class.getName()).log(Level.SEVERE, null, ex);
+ throw new IdropRuntimeException("error evaluating current queue", ex);
+ }
+
+ try {
+ Thread.sleep(STARTUP_SEQUENCE_PAUSE_INTERVAL);
+ } catch (InterruptedException e) {
+ throw new IdropRuntimeException(e);
+ }
+
+ idropSplashWindow.setStatus("Starting work queue...", ++count);
+ try {
+ QueueSchedulerTimerTask queueSchedulerTimerTask = new QueueSchedulerTimerTask(idropCore.getTransferManager(), idrop);
+ Timer timer = new Timer();
+ timer.scheduleAtFixedRate(queueSchedulerTimerTask, 10000, 120000);
+ idropCore.setQueueTimer(timer);
+ } catch (IdropException ex) {
+ Logger.getLogger(StartupSequencer.class.getName()).log(Level.SEVERE, null, ex);
+ }
+
+ log.info("signal that the startup sequence is complete");
+ try {
+ idrop.signalIdropCoreReadyAndSplashComplete();
+ idropSplashWindow.setVisible(false);
+ idropSplashWindow = null;
+ } catch (Exception e) {
+ Logger.getLogger(StartupSequencer.class.getName()).log(Level.SEVERE, null, e);
+
+ throw new IdropRuntimeException("error starting idrop gui", e);
+ }
+
+ }
+
+ /**
+ * Start up iDrop as a system tray application. This is the main entry point for iDrop
+ *
+ * @param args
+ * the command line arguments
+ */
+ public static void main(String args[]) throws InterruptedException {
+ StartupSequencer startupSequencer = new StartupSequencer();
+ try {
+ startupSequencer.doStartupSequence();
+ } catch (Exception e) {
+ log.error("unable to start application due to error", e);
+ System.exit(1);
+ }
+ }
+
+ private void doFirstTimeConfigurationWizard() {
+ log.info("doFirstTimeConfigurationWizard()");
+ }
+}
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/SynchSetupDialog.form b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/SynchSetupDialog.form
new file mode 100644
index 0000000..09e2c57
--- /dev/null
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/SynchSetupDialog.form
@@ -0,0 +1,153 @@
+<?xml version="1.1" encoding="UTF-8" ?>
+
+<Form version="1.3" maxVersion="1.7" type="org.netbeans.modules.form.forminfo.JDialogFormInfo">
+ <Properties>
+ <Property name="defaultCloseOperation" type="int" value="2"/>
+ </Properties>
+ <SyntheticProperties>
+ <SyntheticProperty name="formSizePolicy" type="int" value="1"/>
+ </SyntheticProperties>
+ <AuxValues>
+ <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
+ <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
+ <AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/>
+ <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
+ <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
+ <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="2"/>
+ <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
+ <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
+ <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
+ </AuxValues>
+
+ <Layout>
+ <DimensionLayout dim="0">
+ <Group type="103" groupAlignment="0" attributes="0">
+ <Group type="102" alignment="1" attributes="0">
+ <Group type="103" groupAlignment="1" attributes="0">
+ <Group type="102" alignment="1" attributes="0">
+ <EmptySpace max="-2" attributes="0"/>
+ <Component id="btnUpdateTimestamps" min="-2" max="-2" attributes="0"/>
+ </Group>
+ <Group type="102" alignment="1" attributes="0">
+ <EmptySpace min="-2" pref="47" max="-2" attributes="0"/>
+ <Group type="103" groupAlignment="0" attributes="0">
+ <Group type="103" alignment="0" groupAlignment="0" max="-2" attributes="0">
+ <Group type="102" alignment="0" attributes="1">
+ <Component id="lblDeviceName1" min="-2" max="-2" attributes="0"/>
+ <EmptySpace max="32767" attributes="0"/>
+ <Component id="txtIrodsPath" min="-2" pref="394" max="-2" attributes="0"/>
+ </Group>
+ <Group type="102" alignment="0" attributes="0">
+ <Component id="lblDeviceName" min="-2" max="-2" attributes="0"/>
+ <EmptySpace type="separate" max="-2" attributes="0"/>
+ <Component id="txtDeviceName" min="-2" pref="394" max="-2" attributes="0"/>
+ </Group>
+ </Group>
+ <Group type="102" alignment="1" attributes="0">
+ <Component id="lblDeviceName2" min="-2" max="-2" attributes="0"/>
+ <EmptySpace pref="36" max="32767" attributes="0"/>
+ <Group type="103" groupAlignment="0" max="-2" attributes="0">
+ <Group type="102" alignment="0" attributes="1">
+ <Component id="btnAdd" min="-2" max="-2" attributes="0"/>
+ <EmptySpace max="32767" attributes="0"/>
+ <Component id="btnSynch" min="-2" max="-2" attributes="0"/>
+ </Group>
+ <Component id="localPath" alignment="0" min="-2" pref="394" max="-2" attributes="0"/>
+ </Group>
+ </Group>
+ </Group>
+ </Group>
+ </Group>
+ <EmptySpace min="-2" pref="279" max="-2" attributes="0"/>
+ </Group>
+ <Group type="102" alignment="0" attributes="0">
+ <EmptySpace min="-2" pref="67" max="-2" attributes="0"/>
+ <Component id="jLabel1" min="-2" pref="604" max="-2" attributes="0"/>
+ <EmptySpace pref="153" max="32767" attributes="0"/>
+ </Group>
+ </Group>
+ </DimensionLayout>
+ <DimensionLayout dim="1">
+ <Group type="103" groupAlignment="0" attributes="0">
+ <Group type="102" alignment="0" attributes="0">
+ <Component id="jLabel1" min="-2" max="-2" attributes="0"/>
+ <EmptySpace min="-2" pref="4" max="-2" attributes="0"/>
+ <Group type="103" groupAlignment="3" attributes="0">
+ <Component id="lblDeviceName" alignment="3" min="-2" max="-2" attributes="0"/>
+ <Component id="txtDeviceName" alignment="3" min="-2" max="-2" attributes="0"/>
+ </Group>
+ <EmptySpace max="-2" attributes="0"/>
+ <Group type="103" groupAlignment="3" attributes="0">
+ <Component id="lblDeviceName1" alignment="3" min="-2" max="-2" attributes="0"/>
+ <Component id="txtIrodsPath" alignment="3" min="-2" max="-2" attributes="0"/>
+ </Group>
+ <EmptySpace max="-2" attributes="0"/>
+ <Group type="103" groupAlignment="3" attributes="0">
+ <Component id="lblDeviceName2" alignment="3" min="-2" max="-2" attributes="0"/>
+ <Component id="localPath" alignment="3" min="-2" max="-2" attributes="0"/>
+ </Group>
+ <EmptySpace type="separate" max="-2" attributes="0"/>
+ <Group type="103" groupAlignment="3" attributes="0">
+ <Component id="btnAdd" alignment="3" min="-2" max="-2" attributes="0"/>
+ <Component id="btnSynch" alignment="3" min="-2" max="-2" attributes="0"/>
+ </Group>
+ <EmptySpace type="unrelated" max="-2" attributes="0"/>
+ <Component id="btnUpdateTimestamps" min="-2" max="-2" attributes="0"/>
+ <EmptySpace pref="25" max="32767" attributes="0"/>
+ </Group>
+ </Group>
+ </DimensionLayout>
+ </Layout>
+ <SubComponents>
+ <Component class="javax.swing.JLabel" name="lblDeviceName">
+ <Properties>
+ <Property name="text" type="java.lang.String" value="Device Name:"/>
+ </Properties>
+ </Component>
+ <Component class="javax.swing.JTextField" name="txtDeviceName">
+ </Component>
+ <Component class="javax.swing.JLabel" name="lblDeviceName1">
+ <Properties>
+ <Property name="text" type="java.lang.String" value="iRODS Path:"/>
+ </Properties>
+ </Component>
+ <Component class="javax.swing.JTextField" name="txtIrodsPath">
+ </Component>
+ <Component class="javax.swing.JLabel" name="lblDeviceName2">
+ <Properties>
+ <Property name="text" type="java.lang.String" value="Local Path:"/>
+ </Properties>
+ </Component>
+ <Component class="javax.swing.JTextField" name="localPath">
+ </Component>
+ <Component class="javax.swing.JButton" name="btnAdd">
+ <Properties>
+ <Property name="text" type="java.lang.String" value="Add Device"/>
+ </Properties>
+ <Events>
+ <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnAddActionPerformed"/>
+ </Events>
+ </Component>
+ <Component class="javax.swing.JButton" name="btnSynch">
+ <Properties>
+ <Property name="text" type="java.lang.String" value="Synch"/>
+ </Properties>
+ <Events>
+ <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnSynchActionPerformed"/>
+ </Events>
+ </Component>
+ <Component class="javax.swing.JButton" name="btnUpdateTimestamps">
+ <Properties>
+ <Property name="text" type="java.lang.String" value="Update Timestamps"/>
+ </Properties>
+ <Events>
+ <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnUpdateTimestampsActionPerformed"/>
+ </Events>
+ </Component>
+ <Component class="javax.swing.JLabel" name="jLabel1">
+ <Properties>
+ <Property name="text" type="java.lang.String" value="Testing only....."/>
+ </Properties>
+ </Component>
+ </SubComponents>
+</Form>
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/SynchSetupDialog.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/SynchSetupDialog.java
new file mode 100644
index 0000000..6814c66
--- /dev/null
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/SynchSetupDialog.java
@@ -0,0 +1,226 @@
+
+/*
+ * 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/iDrop.form b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/iDrop.form
index 6213df5..4e895ca 100644
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/iDrop.form
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/iDrop.form
@@ -78,16 +78,6 @@
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jCheckBoxMenuItemShowIrodsInfoActionPerformed"/>
</Events>
</MenuItem>
- <MenuItem class="javax.swing.JMenuItem" name="jMenuItemPreferences">
- <Properties>
- <Property name="mnemonic" type="int" value="112"/>
- <Property name="text" type="java.lang.String" value="Preferences"/>
- <Property name="toolTipText" type="java.lang.String" value="Show the preferences panel"/>
- </Properties>
- <Events>
- <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jMenuItemPreferencesActionPerformed"/>
- </Events>
- </MenuItem>
</SubComponents>
</Menu>
</SubComponents>
@@ -513,6 +503,9 @@
</Container>
<Container class="javax.swing.JPanel" name="pnlIrodsArea">
<Properties>
+ <Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
+ <Dimension value="[500, 300]"/>
+ </Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[600, 304]"/>
</Property>
@@ -542,6 +535,9 @@
<SubComponents>
<Container class="javax.swing.JTabbedPane" name="tabIrodsViews">
<Properties>
+ <Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
+ <Dimension value="[200, 129]"/>
+ </Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
<Dimension value="[350, 300]"/>
</Property>
@@ -617,148 +613,6 @@
</Constraints>
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
- <SubComponents>
- <Container class="javax.swing.JPanel" name="pnlTargetTree">
-
- <Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>
- </Container>
- </SubComponents>
- </Container>
- </SubComponents>
- </Container>
- </SubComponents>
- </Container>
- <Container class="javax.swing.JPanel" name="pnlTabTagView">
- <Constraints>
- <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout$JTabbedPaneConstraintsDescription">
- <JTabbedPaneConstraints tabName="Tag View">
- <Property name="tabTitle" type="java.lang.String" value="Tag View"/>
- </JTabbedPaneConstraints>
- </Constraint>
- </Constraints>
-
- <Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>
- <SubComponents>
- <Container class="javax.swing.JPanel" name="pnlTagSearch">
- <Constraints>
- <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
- <BorderConstraints direction="North"/>
- </Constraint>
- </Constraints>
-
- <Layout class="org.netbeans.modules.form.compat2.layouts.DesignBoxLayout">
- <Property name="axis" type="int" value="3"/>
- </Layout>
- <SubComponents>
- <Container class="javax.swing.JPanel" name="pnlTagSearchSearchBox">
-
- <Layout class="org.netbeans.modules.form.compat2.layouts.DesignFlowLayout"/>
- <SubComponents>
- <Component class="javax.swing.JLabel" name="lblSearchTags">
- <Properties>
- <Property name="text" type="java.lang.String" value="Tag name search:"/>
- </Properties>
- </Component>
- <Component class="javax.swing.JTextField" name="txtTagNameSearch">
- <Properties>
- <Property name="columns" type="int" value="15"/>
- <Property name="toolTipText" type="java.lang.String" value="Tag name to filter tag cloud"/>
- </Properties>
- </Component>
- </SubComponents>
- </Container>
- <Component class="javax.swing.JButton" name="btnRefreshTagCloud">
- <Properties>
- <Property name="mnemonic" type="int" value="67"/>
- <Property name="text" type="java.lang.String" value="Refresh Tag Cloud"/>
- </Properties>
- <Events>
- <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnRefreshTagCloudActionPerformed"/>
- </Events>
- </Component>
- </SubComponents>
- </Container>
- <Container class="javax.swing.JPanel" name="pnlTagViewMaster">
- <Events>
- <EventHandler event="componentShown" listener="java.awt.event.ComponentListener" parameters="java.awt.event.ComponentEvent" handler="pnlTagViewMasterComponentShown"/>
- </Events>
- <Constraints>
- <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
- <BorderConstraints direction="Center"/>
- </Constraint>
- </Constraints>
-
- <Layout class="org.netbeans.modules.form.compat2.layouts.DesignGridLayout">
- <Property name="columns" type="int" value="0"/>
- <Property name="rows" type="int" value="1"/>
- </Layout>
- <SubComponents>
- <Container class="javax.swing.JSplitPane" name="splitTagsAndTagResults">
- <Properties>
- <Property name="dividerLocation" type="int" value="100"/>
- </Properties>
-
- <Layout class="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout"/>
- <SubComponents>
- <Container class="javax.swing.JPanel" name="pnlTagListing">
- <Constraints>
- <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout$JSplitPaneConstraintsDescription">
- <JSplitPaneConstraints position="left"/>
- </Constraint>
- </Constraints>
-
- <Layout class="org.netbeans.modules.form.compat2.layouts.DesignGridLayout">
- <Property name="columns" type="int" value="0"/>
- <Property name="rows" type="int" value="1"/>
- </Layout>
- <SubComponents>
- <Container class="javax.swing.JScrollPane" name="scrollPaneTagCloudList">
- <AuxValues>
- <AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
- </AuxValues>
-
- <Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
- <SubComponents>
- <Component class="javax.swing.JList" name="listTagCloudList">
- <Properties>
- <Property name="model" type="javax.swing.ListModel" editor="org.netbeans.modules.form.editors2.ListModelEditor">
- <StringArray count="0"/>
- </Property>
- </Properties>
- <Events>
- <EventHandler event="valueChanged" listener="javax.swing.event.ListSelectionListener" parameters="javax.swing.event.ListSelectionEvent" handler="listTagCloudListValueChanged"/>
- </Events>
- </Component>
- </SubComponents>
- </Container>
- </SubComponents>
- </Container>
- <Container class="javax.swing.JScrollPane" name="scrollTagResults">
- <Properties>
- <Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
- <Dimension value="null"/>
- </Property>
- <Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
- <Dimension value="[0, 0]"/>
- </Property>
- </Properties>
- <Constraints>
- <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout$JSplitPaneConstraintsDescription">
- <JSplitPaneConstraints position="right"/>
- </Constraint>
- </Constraints>
-
- <Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
- <SubComponents>
- <Container class="javax.swing.JPanel" name="pnlTagResultsInner">
-
- <Layout class="org.netbeans.modules.form.compat2.layouts.DesignBoxLayout">
- <Property name="axis" type="int" value="3"/>
- </Layout>
- </Container>
- </SubComponents>
- </Container>
- </SubComponents>
</Container>
</SubComponents>
</Container>
@@ -831,6 +685,9 @@
<EmptyBorder bottom="10" left="15" right="15" top="10"/>
</Border>
</Property>
+ <Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
+ <Dimension value="[300, 708]"/>
+ </Property>
</Properties>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout$JSplitPaneConstraintsDescription">
@@ -838,434 +695,424 @@
</Constraint>
</Constraints>
- <Layout class="org.netbeans.modules.form.compat2.layouts.DesignGridLayout">
- <Property name="columns" type="int" value="0"/>
- <Property name="rows" type="int" value="1"/>
- </Layout>
+ <Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>
<SubComponents>
- <Container class="javax.swing.JScrollPane" name="scrollIrodsInfo">
+ <Container class="javax.swing.JPanel" name="pnlIrodsInfoInner">
<Properties>
- <Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
- <Dimension value="[400, 300]"/>
+ <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
+ <Border info="org.netbeans.modules.form.compat2.border.EmptyBorderInfo">
+ <EmptyBorder bottom="10" left="10" right="10" top="10"/>
+ </Border>
</Property>
+ <Property name="toolTipText" type="java.lang.String" value="Information on selected iRODS file or collection"/>
</Properties>
+ <AccessibilityProperties>
+ <Property name="AccessibleContext.accessibleName" type="java.lang.String" value="info panel"/>
+ </AccessibilityProperties>
+ <Constraints>
+ <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
+ <BorderConstraints direction="Center"/>
+ </Constraint>
+ </Constraints>
- <Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
+ <Layout class="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout"/>
<SubComponents>
- <Container class="javax.swing.JPanel" name="pnlIrodsInfoInner">
+ <Container class="javax.swing.JPanel" name="pnlFileIconSizer">
+ <Properties>
+ <Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
+ <Dimension value="[80, 40]"/>
+ </Property>
+ </Properties>
+ <Constraints>
+ <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
+ <GridBagConstraints gridX="0" gridY="0" gridWidth="1" gridHeight="1" fill="1" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="10" weightX="0.8" weightY="0.0"/>
+ </Constraint>
+ </Constraints>
+
+ <Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>
+ <SubComponents>
+ <Container class="javax.swing.JPanel" name="pnlInfoIcon">
+ <Properties>
+ <Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
+ <Dimension value="[50, 50]"/>
+ </Property>
+ </Properties>
+ <Constraints>
+ <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
+ <BorderConstraints direction="West"/>
+ </Constraint>
+ </Constraints>
+
+ <Layout class="org.netbeans.modules.form.compat2.layouts.DesignGridLayout">
+ <Property name="columns" type="int" value="0"/>
+ <Property name="rows" type="int" value="1"/>
+ </Layout>
+ </Container>
+ </SubComponents>
+ </Container>
+ <Container class="javax.swing.JPanel" name="pnlFileNameAndIcon">
<Properties>
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
- <Border info="org.netbeans.modules.form.compat2.border.EmptyBorderInfo">
- <EmptyBorder bottom="10" left="10" right="10" top="10"/>
+ <Border info="org.netbeans.modules.form.compat2.border.LineBorderInfo">
+ <LineBorder/>
</Border>
</Property>
- <Property name="toolTipText" type="java.lang.String" value="Information on selected iRODS file or collection"/>
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
- <Dimension value="[250, 200]"/>
- </Property>
- <Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
- <Dimension value="[300, 300]"/>
+ <Dimension value="[100, 100]"/>
</Property>
</Properties>
- <AccessibilityProperties>
- <Property name="AccessibleContext.accessibleName" type="java.lang.String" value="info panel"/>
- </AccessibilityProperties>
+ <Constraints>
+ <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
+ <GridBagConstraints gridX="0" gridY="1" gridWidth="1" gridHeight="1" fill="1" ipadX="0" ipadY="0" insetsTop="10" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="21" weightX="0.8" weightY="0.0"/>
+ </Constraint>
+ </Constraints>
- <Layout class="org.netbeans.modules.form.compat2.layouts.DesignGridLayout">
- <Property name="columns" type="int" value="1"/>
- <Property name="horizontalGap" type="int" value="10"/>
- <Property name="rows" type="int" value="0"/>
- <Property name="verticalGap" type="int" value="10"/>
+ <Layout class="org.netbeans.modules.form.compat2.layouts.DesignFlowLayout">
+ <Property name="alignment" type="int" value="0"/>
+ <Property name="horizontalGap" type="int" value="0"/>
</Layout>
<SubComponents>
- <Container class="javax.swing.JPanel" name="pnlFileIconSizer">
+ <Component class="javax.swing.JLabel" name="lblFileOrCollectionName">
<Properties>
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
- <Dimension value="[50, 50]"/>
+ <Dimension value="[80, 16]"/>
</Property>
- <Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
- <Dimension value="[50, 50]"/>
+ </Properties>
+ </Component>
+ </SubComponents>
+ </Container>
+ <Container class="javax.swing.JPanel" name="pnlInfoCollectionParent">
+ <Constraints>
+ <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
+ <GridBagConstraints gridX="0" gridY="2" gridWidth="1" gridHeight="1" fill="1" ipadX="0" ipadY="0" insetsTop="10" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="21" weightX="0.8" weightY="0.0"/>
+ </Constraint>
+ </Constraints>
+
+ <Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>
+ <SubComponents>
+ <Component class="javax.swing.JLabel" name="lblFileParent">
+ <Properties>
+ <Property name="text" type="java.lang.String" value="Parent path of file:"/>
+ </Properties>
+ <AccessibilityProperties>
+ <Property name="AccessibleContext.accessibleDescription" type="java.lang.String" value="The path of the parent of the file or collection"/>
+ </AccessibilityProperties>
+ <Constraints>
+ <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
+ <BorderConstraints direction="North"/>
+ </Constraint>
+ </Constraints>
+ </Component>
+ <Container class="javax.swing.JScrollPane" name="scrollParentPath">
+ <Properties>
+ <Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
+ <Dimension value="[100, 100]"/>
</Property>
</Properties>
+ <AuxValues>
+ <AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
+ </AuxValues>
+ <Constraints>
+ <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
+ <BorderConstraints direction="Center"/>
+ </Constraint>
+ </Constraints>
- <Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>
+ <Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
<SubComponents>
- <Container class="javax.swing.JPanel" name="pnlInfoIcon">
+ <Component class="javax.swing.JTextArea" name="txtParentPath">
<Properties>
+ <Property name="editable" type="boolean" value="false"/>
<Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
- <Dimension value="[50, 50]"/>
+ <Dimension value="null"/>
+ </Property>
+ <Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
+ <Dimension value="[600, 100]"/>
</Property>
- </Properties>
- <Constraints>
- <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
- <BorderConstraints direction="West"/>
- </Constraint>
- </Constraints>
-
- <Layout class="org.netbeans.modules.form.compat2.layouts.DesignGridLayout">
- <Property name="columns" type="int" value="0"/>
- <Property name="rows" type="int" value="1"/>
- </Layout>
- </Container>
- </SubComponents>
- </Container>
- <Container class="javax.swing.JPanel" name="pnlFileNameAndIcon">
-
- <Layout class="org.netbeans.modules.form.compat2.layouts.DesignFlowLayout">
- <Property name="alignment" type="int" value="0"/>
- <Property name="horizontalGap" type="int" value="0"/>
- </Layout>
- <SubComponents>
- <Component class="javax.swing.JLabel" name="lblFileOrCollectionName">
- <Properties>
- <Property name="text" type="java.lang.String" value="jLabel1"/>
</Properties>
</Component>
</SubComponents>
</Container>
- <Container class="javax.swing.JPanel" name="pnlInfoCollectionParent">
+ </SubComponents>
+ </Container>
+ <Container class="javax.swing.JPanel" name="pnlInfoComment">
+ <Constraints>
+ <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
+ <GridBagConstraints gridX="0" gridY="3" gridWidth="1" gridHeight="1" fill="1" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="17" weightX="0.0" weightY="0.0"/>
+ </Constraint>
+ </Constraints>
+
+ <Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>
+ <SubComponents>
+ <Component class="javax.swing.JLabel" name="lblComment">
+ <Properties>
+ <Property name="text" type="java.lang.String" value="Comment:"/>
+ <Property name="toolTipText" type="java.lang.String" value=""/>
+ </Properties>
+ <AccessibilityProperties>
+ <Property name="AccessibleContext.accessibleDescription" type="java.lang.String" value="lable for comment area"/>
+ </AccessibilityProperties>
+ <Constraints>
+ <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
+ <BorderConstraints direction="North"/>
+ </Constraint>
+ </Constraints>
+ </Component>
+ <Container class="javax.swing.JScrollPane" name="scrollComment">
<Properties>
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
- <Dimension value="[65, 39]"/>
+ <Dimension value="null"/>
+ </Property>
+ <Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
+ <Dimension value="[388, 84]"/>
</Property>
</Properties>
+ <AuxValues>
+ <AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
+ </AuxValues>
+ <Constraints>
+ <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
+ <BorderConstraints direction="Center"/>
+ </Constraint>
+ </Constraints>
- <Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>
- <SubComponents>
- <Component class="javax.swing.JLabel" name="lblFileParent">
- <Properties>
- <Property name="text" type="java.lang.String" value="Parent path of file:"/>
- </Properties>
- <AccessibilityProperties>
- <Property name="AccessibleContext.accessibleDescription" type="java.lang.String" value="The path of the parent of the file or collection"/>
- </AccessibilityProperties>
- <Constraints>
- <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
- <BorderConstraints direction="North"/>
- </Constraint>
- </Constraints>
- </Component>
- <Container class="javax.swing.JPanel" name="pnlScrollParentPathSizer">
- <Constraints>
- <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
- <BorderConstraints direction="Center"/>
- </Constraint>
- </Constraints>
-
- <Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>
- <SubComponents>
- <Container class="javax.swing.JScrollPane" name="scrollParentPath">
- <Properties>
- <Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
- <Dimension value="null"/>
- </Property>
- </Properties>
- <AuxValues>
- <AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
- </AuxValues>
- <Constraints>
- <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
- <BorderConstraints direction="West"/>
- </Constraint>
- </Constraints>
-
- <Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
- <SubComponents>
- <Component class="javax.swing.JTextArea" name="txtParentPath">
- <Properties>
- <Property name="columns" type="int" value="32"/>
- <Property name="editable" type="boolean" value="false"/>
- <Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
- <Dimension value="null"/>
- </Property>
- <Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
- <Dimension value="null"/>
- </Property>
- </Properties>
- </Component>
- </SubComponents>
- </Container>
- </SubComponents>
- </Container>
- </SubComponents>
- </Container>
- <Container class="javax.swing.JPanel" name="pnlInfoComment">
-
- <Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>
+ <Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
<SubComponents>
- <Component class="javax.swing.JLabel" name="lblComment">
- <Properties>
- <Property name="text" type="java.lang.String" value="Comment:"/>
- <Property name="toolTipText" type="java.lang.String" value=""/>
- </Properties>
- <AccessibilityProperties>
- <Property name="AccessibleContext.accessibleDescription" type="java.lang.String" value="lable for comment area"/>
- </AccessibilityProperties>
- <Constraints>
- <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
- <BorderConstraints direction="North"/>
- </Constraint>
- </Constraints>
- </Component>
- <Container class="javax.swing.JPanel" name="pnlInfoCommentScrollSizer">
+ <Component class="javax.swing.JTextArea" name="txtComment">
<Properties>
+ <Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
+ <Dimension value="null"/>
+ </Property>
+ <Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
+ <Dimension value="null"/>
+ </Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
- <Dimension value="[388, 84]"/>
+ <Dimension value="null"/>
</Property>
</Properties>
- <Constraints>
- <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
- <BorderConstraints direction="Center"/>
- </Constraint>
- </Constraints>
-
- <Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>
- <SubComponents>
- <Container class="javax.swing.JScrollPane" name="scrollComment">
- <Properties>
- <Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
- <Dimension value="null"/>
- </Property>
- <Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
- <Dimension value="[388, 84]"/>
- </Property>
- </Properties>
- <AuxValues>
- <AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
- </AuxValues>
- <Constraints>
- <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
- <BorderConstraints direction="West"/>
- </Constraint>
- </Constraints>
-
- <Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
- <SubComponents>
- <Component class="javax.swing.JTextArea" name="txtComment">
- <Properties>
- <Property name="columns" type="int" value="32"/>
- <Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
- <Dimension value="null"/>
- </Property>
- <Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
- <Dimension value="null"/>
- </Property>
- </Properties>
- </Component>
- </SubComponents>
- </Container>
- </SubComponents>
- </Container>
+ </Component>
</SubComponents>
</Container>
- <Container class="javax.swing.JPanel" name="pnlInfoTags">
+ </SubComponents>
+ </Container>
+ <Container class="javax.swing.JPanel" name="pnlInfoTags">
+ <Constraints>
+ <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
+ <GridBagConstraints gridX="0" gridY="4" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="21" weightX="0.8" weightY="0.0"/>
+ </Constraint>
+ </Constraints>
- <Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>
- <SubComponents>
- <Component class="javax.swing.JLabel" name="lblTags">
- <Properties>
- <Property name="text" type="java.lang.String" value="Tags:"/>
- <Property name="toolTipText" type="java.lang.String" value=""/>
- </Properties>
- <AccessibilityProperties>
- <Property name="AccessibleContext.accessibleName" type="java.lang.String" value="Tags"/>
- <Property name="AccessibleContext.accessibleDescription" type="java.lang.String" value="Label for free tagging area"/>
- </AccessibilityProperties>
- <Constraints>
- <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
- <BorderConstraints direction="North"/>
- </Constraint>
- </Constraints>
- </Component>
- <Container class="javax.swing.JPanel" name="pnlInfoTagsSizer">
- <Constraints>
- <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
- <BorderConstraints direction="Center"/>
- </Constraint>
- </Constraints>
+ <Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>
+ <SubComponents>
+ <Component class="javax.swing.JLabel" name="lblTags">
+ <Properties>
+ <Property name="text" type="java.lang.String" value="Tags:"/>
+ <Property name="toolTipText" type="java.lang.String" value=""/>
+ </Properties>
+ <AccessibilityProperties>
+ <Property name="AccessibleContext.accessibleName" type="java.lang.String" value="Tags"/>
+ <Property name="AccessibleContext.accessibleDescription" type="java.lang.String" value="Label for free tagging area"/>
+ </AccessibilityProperties>
+ <Constraints>
+ <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
+ <BorderConstraints direction="North"/>
+ </Constraint>
+ </Constraints>
+ </Component>
+ <Component class="javax.swing.JTextField" name="txtTags">
+ <Properties>
+ <Property name="columns" type="int" value="30"/>
+ <Property name="toolTipText" type="java.lang.String" value="Name of file or collection. This field allows editing to rename"/>
+ <Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
+ <Dimension value="null"/>
+ </Property>
+ <Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
+ <Dimension value="null"/>
+ </Property>
+ </Properties>
+ <Events>
+ <EventHandler event="focusLost" listener="java.awt.event.FocusListener" parameters="java.awt.event.FocusEvent" handler="txtTagsFocusLost"/>
+ <EventHandler event="keyPressed" listener="java.awt.event.KeyListener" parameters="java.awt.event.KeyEvent" handler="txtTagsKeyPressed"/>
+ </Events>
+ <Constraints>
+ <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
+ <BorderConstraints direction="Last"/>
+ </Constraint>
+ </Constraints>
+ </Component>
+ </SubComponents>
+ </Container>
+ <Container class="javax.swing.JPanel" name="pnlInfoButton">
+ <Constraints>
+ <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
+ <GridBagConstraints gridX="0" gridY="5" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="22" weightX="0.1" weightY="0.0"/>
+ </Constraint>
+ </Constraints>
- <Layout class="org.netbeans.modules.form.compat2.layouts.DesignFlowLayout">
- <Property name="alignment" type="int" value="0"/>
- <Property name="horizontalGap" type="int" value="0"/>
- </Layout>
- <SubComponents>
- <Component class="javax.swing.JTextField" name="txtTags">
- <Properties>
- <Property name="columns" type="int" value="30"/>
- <Property name="toolTipText" type="java.lang.String" value="Name of file or collection. This field allows editing to rename"/>
- <Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
- <Dimension value="null"/>
- </Property>
- <Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
- <Dimension value="null"/>
- </Property>
- </Properties>
- <Events>
- <EventHandler event="focusLost" listener="java.awt.event.FocusListener" parameters="java.awt.event.FocusEvent" handler="txtTagsFocusLost"/>
- <EventHandler event="keyPressed" listener="java.awt.event.KeyListener" parameters="java.awt.event.KeyEvent" handler="txtTagsKeyPressed"/>
- </Events>
- </Component>
- </SubComponents>
- </Container>
- </SubComponents>
- </Container>
- <Container class="javax.swing.JPanel" name="pnlInfoButton">
+ <Layout class="org.netbeans.modules.form.compat2.layouts.DesignFlowLayout">
+ <Property name="alignment" type="int" value="2"/>
+ </Layout>
+ <SubComponents>
+ <Component class="javax.swing.JButton" name="btnUpdateInfo">
+ <Properties>
+ <Property name="mnemonic" type="int" value="73"/>
+ <Property name="text" type="java.lang.String" value="Update Info"/>
+ <Property name="toolTipText" type="java.lang.String" value="Update information on the info panel such as tags and comment"/>
+ </Properties>
+ <Events>
+ <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnUpdateInfoActionPerformed"/>
+ </Events>
+ </Component>
+ </SubComponents>
+ </Container>
+ <Container class="javax.swing.JPanel" name="pnlInfoDetails">
+ <Properties>
+ <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
+ <Border info="org.netbeans.modules.form.compat2.border.LineBorderInfo">
+ <LineBorder/>
+ </Border>
+ </Property>
+ </Properties>
+ <Constraints>
+ <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
+ <GridBagConstraints gridX="0" gridY="6" gridWidth="1" gridHeight="1" fill="1" ipadX="0" ipadY="0" insetsTop="10" insetsLeft="0" insetsBottom="10" insetsRight="0" anchor="17" weightX="0.8" weightY="0.0"/>
+ </Constraint>
+ </Constraints>
- <Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>
- <SubComponents>
- <Container class="javax.swing.JPanel" name="pnlInfoButtonSizer">
- <Constraints>
- <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
- <BorderConstraints direction="South"/>
- </Constraint>
- </Constraints>
+ <Layout class="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout"/>
+ <SubComponents>
+ <Component class="javax.swing.JLabel" name="lblInfoCreatedAt">
+ <Properties>
+ <Property name="horizontalAlignment" type="int" value="11"/>
+ <Property name="text" type="java.lang.String" value="Created:"/>
+ </Properties>
+ <Constraints>
+ <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
+ <GridBagConstraints gridX="-1" gridY="-1" gridWidth="1" gridHeight="1" fill="1" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="13" weightX="0.0" weightY="0.0"/>
+ </Constraint>
+ </Constraints>
+ </Component>
+ <Component class="javax.swing.JLabel" name="lblInfoCreatedAtValue">
+ <Properties>
+ <Property name="text" type="java.lang.String" value="XXXXXX"/>
+ </Properties>
+ <Constraints>
+ <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
+ <GridBagConstraints gridX="-1" gridY="-1" gridWidth="1" gridHeight="1" fill="1" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="17" weightX="0.0" weightY="0.0"/>
+ </Constraint>
+ </Constraints>
+ </Component>
+ <Component class="javax.swing.JLabel" name="lblInfoUpdatedAt">
+ <Properties>
+ <Property name="horizontalAlignment" type="int" value="11"/>
+ <Property name="text" type="java.lang.String" value="Updated:"/>
+ </Properties>
+ <Constraints>
+ <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
+ <GridBagConstraints gridX="0" gridY="1" gridWidth="1" gridHeight="1" fill="1" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="13" weightX="0.0" weightY="0.0"/>
+ </Constraint>
+ </Constraints>
+ </Component>
+ <Component class="javax.swing.JLabel" name="lblInfoUpdatedAtValue">
+ <Properties>
+ <Property name="text" type="java.lang.String" value="XXXXXX"/>
+ </Properties>
+ <Constraints>
+ <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
+ <GridBagConstraints gridX="1" gridY="1" gridWidth="1" gridHeight="1" fill="1" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="17" weightX="0.0" weightY="0.0"/>
+ </Constraint>
+ </Constraints>
+ </Component>
+ <Component class="javax.swing.JLabel" name="lblInfoLength">
+ <Properties>
+ <Property name="horizontalAlignment" type="int" value="11"/>
+ <Property name="text" type="java.lang.String" value="Length:"/>
+ </Properties>
+ <Constraints>
+ <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
+ <GridBagConstraints gridX="0" gridY="2" gridWidth="1" gridHeight="1" fill="1" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="13" weightX="0.0" weightY="0.0"/>
+ </Constraint>
+ </Constraints>
+ </Component>
+ <Component class="javax.swing.JLabel" name="lblInfoLengthValue">
+ <Properties>
+ <Property name="text" type="java.lang.String" value="XXXXXX"/>
+ </Properties>
+ <Constraints>
+ <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
+ <GridBagConstraints gridX="1" gridY="2" gridWidth="1" gridHeight="1" fill="1" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="17" weightX="0.0" weightY="0.0"/>
+ </Constraint>
+ </Constraints>
+ </Component>
+ </SubComponents>
+ </Container>
+ <Container class="javax.swing.JPanel" name="pnlToolbarInfo">
+ <Properties>
+ <Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
+ <Dimension value="[300, 200]"/>
+ </Property>
+ </Properties>
+ <Constraints>
+ <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
+ <GridBagConstraints gridX="0" gridY="7" gridWidth="1" gridHeight="1" fill="1" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="17" weightX="0.8" weightY="0.0"/>
+ </Constraint>
+ </Constraints>
- <Layout class="org.netbeans.modules.form.compat2.layouts.DesignFlowLayout">
- <Property name="alignment" type="int" value="2"/>
- </Layout>
- <SubComponents>
- <Component class="javax.swing.JButton" name="btnUpdateInfo">
- <Properties>
- <Property name="mnemonic" type="int" value="73"/>
- <Property name="text" type="java.lang.String" value="Update Info"/>
- <Property name="toolTipText" type="java.lang.String" value="Update information on the info panel such as tags and comment"/>
- </Properties>
- <Events>
- <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnUpdateInfoActionPerformed"/>
- </Events>
- </Component>
- </SubComponents>
- </Container>
- </SubComponents>
- </Container>
- <Container class="javax.swing.JPanel" name="pnlInfoDetails">
+ <Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>
+ <SubComponents>
+ <Container class="javax.swing.JToolBar" name="toolBarInfo">
+ <Properties>
+ <Property name="rollover" type="boolean" value="true"/>
+ </Properties>
+ <Constraints>
+ <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
+ <BorderConstraints direction="North"/>
+ </Constraint>
+ </Constraints>
- <Layout class="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout"/>
+ <Layout class="org.netbeans.modules.form.compat2.layouts.DesignBoxLayout"/>
<SubComponents>
- <Component class="javax.swing.JLabel" name="lblInfoCreatedAt">
+ <Component class="javax.swing.JButton" name="btnViewMetadata">
<Properties>
- <Property name="horizontalAlignment" type="int" value="11"/>
- <Property name="text" type="java.lang.String" value="Created:"/>
+ <Property name="text" type="java.lang.String" value="Metadata"/>
+ <Property name="focusable" type="boolean" value="false"/>
+ <Property name="horizontalTextPosition" type="int" value="0"/>
+ <Property name="verticalTextPosition" type="int" value="3"/>
</Properties>
- <Constraints>
- <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
- <GridBagConstraints gridX="-1" gridY="-1" gridWidth="1" gridHeight="1" fill="1" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="13" weightX="0.0" weightY="0.0"/>
- </Constraint>
- </Constraints>
+ <Events>
+ <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnViewMetadataActionPerformed"/>
+ </Events>
</Component>
- <Component class="javax.swing.JLabel" name="lblInfoCreatedAtValue">
+ <Component class="javax.swing.JButton" name="btnReplication">
<Properties>
- <Property name="text" type="java.lang.String" value="XXXXXX"/>
+ <Property name="text" type="java.lang.String" value="Replication"/>
+ <Property name="focusable" type="boolean" value="false"/>
+ <Property name="horizontalTextPosition" type="int" value="0"/>
+ <Property name="verticalTextPosition" type="int" value="3"/>
</Properties>
- <Constraints>
- <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
- <GridBagConstraints gridX="-1" gridY="-1" gridWidth="1" gridHeight="1" fill="1" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="17" weightX="0.0" weightY="0.0"/>
- </Constraint>
- </Constraints>
+ <Events>
+ <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnReplicationActionPerformed"/>
+ </Events>
</Component>
- <Component class="javax.swing.JLabel" name="lblInfoUpdatedAt">
- <Properties>
- <Property name="horizontalAlignment" type="int" value="11"/>
- <Property name="text" type="java.lang.String" value="Updated:"/>
- </Properties>
- <Constraints>
- <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
- <GridBagConstraints gridX="0" gridY="1" gridWidth="1" gridHeight="1" fill="1" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="13" weightX="0.0" weightY="0.0"/>
- </Constraint>
- </Constraints>
- </Component>
- <Component class="javax.swing.JLabel" name="lblInfoUpdatedAtValue">
- <Properties>
- <Property name="text" type="java.lang.String" value="XXXXXX"/>
- </Properties>
- <Constraints>
- <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
- <GridBagConstraints gridX="1" gridY="1" gridWidth="1" gridHeight="1" fill="1" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="17" weightX="0.0" weightY="0.0"/>
- </Constraint>
- </Constraints>
+ <Component class="javax.swing.JToolBar$Separator" name="separator1">
</Component>
- <Component class="javax.swing.JLabel" name="lblInfoLength">
+ <Component class="javax.swing.JButton" name="btnMoveToTrash">
<Properties>
- <Property name="horizontalAlignment" type="int" value="11"/>
- <Property name="text" type="java.lang.String" value="Length:"/>
+ <Property name="text" type="java.lang.String" value="Move to Trash"/>
+ <Property name="focusable" type="boolean" value="false"/>
+ <Property name="horizontalTextPosition" type="int" value="0"/>
+ <Property name="verticalTextPosition" type="int" value="3"/>
</Properties>
- <Constraints>
- <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
- <GridBagConstraints gridX="0" gridY="2" gridWidth="1" gridHeight="1" fill="1" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="13" weightX="0.0" weightY="0.0"/>
- </Constraint>
- </Constraints>
</Component>
- <Component class="javax.swing.JLabel" name="lblInfoLengthValue">
+ <Component class="javax.swing.JToolBar$Separator" name="separator2">
<Properties>
- <Property name="text" type="java.lang.String" value="XXXXXX"/>
+ <Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
+ <Dimension value="[50, 1]"/>
+ </Property>
</Properties>
- <Constraints>
- <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
- <GridBagConstraints gridX="1" gridY="2" gridWidth="1" gridHeight="1" fill="1" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="17" weightX="0.0" weightY="0.0"/>
- </Constraint>
- </Constraints>
</Component>
</SubComponents>
</Container>
- <Container class="javax.swing.JPanel" name="pnlToolbarInfo">
-
- <Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>
- <SubComponents>
- <Container class="javax.swing.JToolBar" name="toolBarInfo">
- <Properties>
- <Property name="rollover" type="boolean" value="true"/>
- </Properties>
- <Constraints>
- <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
- <BorderConstraints direction="North"/>
- </Constraint>
- </Constraints>
-
- <Layout class="org.netbeans.modules.form.compat2.layouts.DesignBoxLayout"/>
- <SubComponents>
- <Component class="javax.swing.JButton" name="btnViewMetadata">
- <Properties>
- <Property name="text" type="java.lang.String" value="Metadata"/>
- <Property name="focusable" type="boolean" value="false"/>
- <Property name="horizontalTextPosition" type="int" value="0"/>
- <Property name="verticalTextPosition" type="int" value="3"/>
- </Properties>
- <Events>
- <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnViewMetadataActionPerformed"/>
- </Events>
- </Component>
- <Component class="javax.swing.JButton" name="btnReplication">
- <Properties>
- <Property name="text" type="java.lang.String" value="Replication"/>
- <Property name="focusable" type="boolean" value="false"/>
- <Property name="horizontalTextPosition" type="int" value="0"/>
- <Property name="verticalTextPosition" type="int" value="3"/>
- </Properties>
- <Events>
- <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnReplicationActionPerformed"/>
- </Events>
- </Component>
- <Component class="javax.swing.JToolBar$Separator" name="separator1">
- </Component>
- <Component class="javax.swing.JButton" name="btnMoveToTrash">
- <Properties>
- <Property name="text" type="java.lang.String" value="Move to Trash"/>
- <Property name="focusable" type="boolean" value="false"/>
- <Property name="horizontalTextPosition" type="int" value="0"/>
- <Property name="verticalTextPosition" type="int" value="3"/>
- </Properties>
- </Component>
- <Component class="javax.swing.JToolBar$Separator" name="separator2">
- <Properties>
- <Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
- <Dimension value="[50, 1]"/>
- </Property>
- </Properties>
- </Component>
- </SubComponents>
- </Container>
- </SubComponents>
- </Container>
</SubComponents>
</Container>
</SubComponents>
@@ -1282,6 +1129,11 @@
</Container>
<Container class="javax.swing.JPanel" name="pnlIdropBottom">
<Properties>
+ <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
+ <Border info="org.netbeans.modules.form.compat2.border.BevelBorderInfo">
+ <BevelBorder bevelType="1"/>
+ </Border>
+ </Property>
<Property name="toolTipText" type="java.lang.String" value="Display area for status and messages"/>
</Properties>
<Constraints>
@@ -1290,15 +1142,172 @@
</Constraint>
</Constraints>
- <Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>
+ <Layout class="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout"/>
<SubComponents>
- <Component class="javax.swing.JLabel" name="lblIdropMessage">
+ <Component class="javax.swing.JLabel" name="userNameLabel">
+ <Properties>
+ <Property name="text" type="java.lang.String" value="usernamelabel"/>
+ </Properties>
<Constraints>
- <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
- <BorderConstraints direction="Center"/>
+ <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
+ <GridBagConstraints gridX="0" gridY="1" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="10" weightX="0.0050" weightY="0.0"/>
</Constraint>
</Constraints>
</Component>
+ <Container class="javax.swing.JPanel" name="pnlTransferOverview">
+ <Constraints>
+ <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
+ <GridBagConstraints gridX="0" gridY="0" gridWidth="35" gridHeight="1" fill="1" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="17" weightX="0.0" weightY="0.0"/>
+ </Constraint>
+ </Constraints>
+
+ <Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>
+ <SubComponents>
+ <Container class="javax.swing.JPanel" name="pnlTransferStatus">
+ <Constraints>
+ <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
+ <BorderConstraints direction="North"/>
+ </Constraint>
+ </Constraints>
+
+ <Layout class="org.netbeans.modules.form.compat2.layouts.DesignFlowLayout"/>
+ <SubComponents>
+ <Container class="javax.swing.JPanel" name="pnlTransferType">
+
+ <Layout class="org.netbeans.modules.form.compat2.layouts.DesignFlowLayout"/>
+ <SubComponents>
+ <Component class="javax.swing.JLabel" name="lblTransferTypeLabel">
+ <Properties>
+ <Property name="text" type="java.lang.String" value="Transfer Type:"/>
+ </Properties>
+ </Component>
+ <Component class="javax.swing.JLabel" name="lblTransferType">
+ <Properties>
+ <Property name="text" type="java.lang.String" value=" "/>
+ </Properties>
+ </Component>
+ </SubComponents>
+ </Container>
+ <Container class="javax.swing.JPanel" name="pnlTransferFileCounts">
+
+ <Layout class="org.netbeans.modules.form.compat2.layouts.DesignFlowLayout"/>
+ <SubComponents>
+ <Component class="javax.swing.JLabel" name="lblTransferFilesCounts">
+ <Properties>
+ <Property name="text" type="java.lang.String" value="Files: xxxxx / xxxxxxx"/>
+ </Properties>
+ </Component>
+ </SubComponents>
+ </Container>
+ <Container class="javax.swing.JPanel" name="pnlTransferByteCounts">
+
+ <Layout class="org.netbeans.modules.form.compat2.layouts.DesignFlowLayout"/>
+ <SubComponents>
+ <Component class="javax.swing.JLabel" name="lblTransferByteCounts">
+ <Properties>
+ <Property name="text" type="java.lang.String" value="Bytes (total): xxxxxx / xxxxxx"/>
+ </Properties>
+ </Component>
+ </SubComponents>
+ </Container>
+ </SubComponents>
+ </Container>
+ <Container class="javax.swing.JPanel" name="pnlTransferFileInfo">
+ <Constraints>
+ <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
+ <BorderConstraints direction="Last"/>
+ </Constraint>
+ </Constraints>
+
+ <Layout class="org.netbeans.modules.form.compat2.layouts.DesignFlowLayout">
+ <Property name="alignment" type="int" value="0"/>
+ </Layout>
+ <SubComponents>
+ <Component class="javax.swing.JLabel" name="lblCurrentFileLabel">
+ <Properties>
+ <Property name="text" type="java.lang.String" value="Current File:"/>
+ </Properties>
+ </Component>
+ <Component class="javax.swing.JLabel" name="lblCurrentFile">
+ </Component>
+ </SubComponents>
+ </Container>
+ </SubComponents>
+ </Container>
+ <Component class="javax.swing.JProgressBar" name="transferStatusProgressBar">
+ <Properties>
+ <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
+ <Border info="org.netbeans.modules.form.compat2.border.BevelBorderInfo">
+ <BevelBorder bevelType="1"/>
+ </Border>
+ </Property>
+ <Property name="stringPainted" type="boolean" value="true"/>
+ </Properties>
+ <Constraints>
+ <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
+ <GridBagConstraints gridX="1" gridY="1" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="17" weightX="8.0" weightY="0.0"/>
+ </Constraint>
+ </Constraints>
+ </Component>
+ <Container class="javax.swing.JPanel" name="transferQueueToolbarPanel">
+ <Properties>
+ <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
+ <Border info="org.netbeans.modules.form.compat2.border.EtchedBorderInfo">
+ <EtchetBorder/>
+ </Border>
+ </Property>
+ </Properties>
+ <Constraints>
+ <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
+ <GridBagConstraints gridX="34" gridY="1" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="10" weightX="0.0" weightY="0.0"/>
+ </Constraint>
+ </Constraints>
+
+ <Layout class="org.netbeans.modules.form.compat2.layouts.DesignFlowLayout"/>
+ <SubComponents>
+ <Container class="javax.swing.JToolBar" name="idropProgressPanelToolbar">
+ <Properties>
+ <Property name="rollover" type="boolean" value="true"/>
+ </Properties>
+
+ <Layout class="org.netbeans.modules.form.compat2.layouts.DesignBoxLayout"/>
+ <SubComponents>
+ <Component class="javax.swing.JButton" name="btnShowTransferManager">
+ <Properties>
+ <Property name="text" type="java.lang.String" value="Manage"/>
+ <Property name="toolTipText" type="java.lang.String" value="Show a panel to manage transfers"/>
+ <Property name="focusable" type="boolean" value="false"/>
+ <Property name="horizontalTextPosition" type="int" value="0"/>
+ <Property name="verticalTextPosition" type="int" value="3"/>
+ </Properties>
+ <Events>
+ <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnShowTransferManagerActionPerformed"/>
+ </Events>
+ </Component>
+ <Component class="javax.swing.JToggleButton" name="togglePauseTransfer">
+ <Properties>
+ <Property name="text" type="java.lang.String" value="Pause"/>
+ <Property name="toolTipText" type="java.lang.String" value="Pause the current transfer"/>
+ <Property name="focusable" type="boolean" value="false"/>
+ <Property name="horizontalTextPosition" type="int" value="0"/>
+ <Property name="verticalTextPosition" type="int" value="3"/>
+ </Properties>
+ <Events>
+ <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="togglePauseTransferActionPerformed"/>
+ </Events>
+ </Component>
+ </SubComponents>
+ </Container>
+ <Container class="javax.swing.JPanel" name="pnlIdropProgressIcon">
+
+ <Layout class="org.netbeans.modules.form.compat2.layouts.DesignFlowLayout"/>
+ <SubComponents>
+ <Component class="javax.swing.JLabel" name="progressIconImageLabel">
+ </Component>
+ </SubComponents>
+ </Container>
+ </SubComponents>
+ </Container>
</SubComponents>
</Container>
</SubComponents>
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/iDrop.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/iDrop.java
index 7a0ef4d..41d2116 100644
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/iDrop.java
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/iDrop.java
@@ -8,8 +8,8 @@ package org.irods.jargon.idrop.desktop.systraygui;
import java.awt.AWTException;
import java.awt.CheckboxMenuItem;
import java.awt.Cursor;
+import java.awt.HeadlessException;
import java.awt.Image;
-import java.awt.Menu;
import java.awt.MenuItem;
import java.awt.PopupMenu;
import java.awt.SystemTray;
@@ -26,7 +26,6 @@ import java.io.File;
import java.net.URL;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
-import java.util.Date;
import java.util.Enumeration;
import java.util.List;
import java.util.logging.Level;
@@ -37,15 +36,10 @@ import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JDialog;
-import javax.swing.JLabel;
import javax.swing.JOptionPane;
-import javax.swing.JPanel;
-import javax.swing.JProgressBar;
import javax.swing.JToggleButton;
-import javax.swing.TransferHandler;
import javax.swing.UIManager;
import javax.swing.UIManager.LookAndFeelInfo;
-import javax.swing.UnsupportedLookAndFeelException;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
import javax.swing.tree.TreePath;
@@ -56,17 +50,14 @@ import org.irods.jargon.core.exception.JargonException;
import org.irods.jargon.core.pub.CollectionAO;
import org.irods.jargon.core.pub.CollectionAndDataObjectListAndSearchAO;
import org.irods.jargon.core.pub.DataObjectAO;
-import org.irods.jargon.core.pub.IRODSFileSystem;
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.core.query.MetaDataAndDomainData.MetadataDomain;
import org.irods.jargon.core.transfer.TransferStatus;
-import org.irods.jargon.idrop.desktop.systraygui.utils.ColorHelper;
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.viscomponents.DefaultFileRepresentationPanel;
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.IRODSSearchTableModel;
@@ -76,24 +67,23 @@ import org.irods.jargon.idrop.desktop.systraygui.viscomponents.IrodsTreeListener
import org.irods.jargon.idrop.desktop.systraygui.viscomponents.LocalFileNode;
import org.irods.jargon.idrop.desktop.systraygui.viscomponents.LocalFileSystemModel;
import org.irods.jargon.idrop.desktop.systraygui.viscomponents.LocalFileTree;
-import org.irods.jargon.idrop.desktop.systraygui.viscomponents.TagCloudListModel;
import org.irods.jargon.idrop.exceptions.IdropException;
import org.irods.jargon.idrop.exceptions.IdropRuntimeException;
-import org.irods.jargon.transfer.engine.TransferManager;
import org.irods.jargon.transfer.engine.TransferManager.ErrorStatus;
import org.irods.jargon.transfer.engine.TransferManager.RunningStatus;
import org.irods.jargon.transfer.engine.TransferManagerCallbackListener;
import org.irods.jargon.usertagging.FreeTaggingService;
import org.irods.jargon.usertagging.FreeTaggingServiceImpl;
-import org.irods.jargon.usertagging.UserTagCloudService;
-import org.irods.jargon.usertagging.UserTagCloudServiceImpl;
import org.irods.jargon.usertagging.domain.IRODSTagGrouping;
-import org.irods.jargon.usertagging.domain.TagCloudEntry;
import org.irods.jargon.usertagging.domain.TagQuerySearchResult;
-import org.irods.jargon.usertagging.domain.UserTagCloudView;
import org.slf4j.LoggerFactory;
-import cookxml.cookswing.CookSwing;
+import org.irods.jargon.idrop.desktop.systraygui.utils.iDropUtils;
+import org.irods.jargon.idrop.desktop.systraygui.viscomponents.IRODSOutlineModel;
+import org.irods.jargon.idrop.desktop.systraygui.viscomponents.IRODSRowModel;
+import org.netbeans.swing.outline.DefaultOutlineModel;
+import org.netbeans.swing.outline.Outline;
+import org.netbeans.swing.outline.OutlineModel;
/**
* Main system tray and GUI. Create system tray menu, start timer process for queue.
@@ -103,59 +93,29 @@ import cookxml.cookswing.CookSwing;
public class iDrop extends javax.swing.JFrame implements ActionListener, ItemListener, TransferManagerCallbackListener {
private static final long serialVersionUID = 1L;
-
private LocalFileSystemModel localFileModel = null;
-
private static final org.slf4j.Logger log = LoggerFactory.getLogger(iDrop.class);
-
private boolean formShown = false;
-
private LocalFileTree fileTree = null;
-
private IRODSTree irodsTree = null;
-
private QueueManagerDialog queueManagerDialog = null;
-
private IDROPCore iDropCore = new IDROPCore();
-
private CheckboxMenuItem pausedItem = null;
-
private TrayIcon trayIcon = null;
-
- private IRODSFileSystem irodsFileSystem = null;
-
private Object lastCachedInfoItem = null;
-
public DateFormat df = DateFormat.getDateInstance(DateFormat.LONG);
-
- private UserTagCloudView userTagCloudView = null;
-
private ChangePasswordDialog changePasswordDialog = null;
-
+ private SynchSetupDialog synchSetupDialog = null;
public static JDialog newPreferencesDialog;
-
public JCheckBox showGUICheckBox;
-
public JButton preferencesDialogOKButton;
-
- public JLabel currentUserNameLabel, queuedTransfersLabel, currentDateLabel;
-
- public JProgressBar queuedTransfersProgressBar;
-
private static SimpleDateFormat SDF = new SimpleDateFormat("MM-dd-yyyy");
- /**
- * Get the IRODSFileSystem that will be the source for all connections and references to access object and file
- * factories. NOTE: there is some legacy code that needs to be converted to use this reference.
- *
- * @return
- */
- public IRODSFileSystem getIrodsFileSystem() {
- return irodsFileSystem;
- }
+ public iDrop(final IDROPCore idropCore) {
- /** Creates new form IDrop */
- public iDrop() {
+ if (idropCore == null) {
+ throw new IllegalArgumentException("null idropCore");
+ }
try {
for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
@@ -164,16 +124,18 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
break;
}
}
- } catch (UnsupportedLookAndFeelException e) {
- // handle exception
- } catch (ClassNotFoundException e) {
- // handle exception
- } catch (InstantiationException e) {
- // handle exception
- } catch (IllegalAccessException e) {
- // handle exception
+ } catch (Exception e) {
+ throw new IdropRuntimeException(e);
}
+ this.iDropCore = idropCore;
+ }
+
+ /** Creates new form IDrop */
+ public iDrop() {
+ }
+
+ protected void buildIdropGuiComponents() throws IdropRuntimeException, HeadlessException {
initComponents();
this.pnlLocalTreeArea.setVisible(false);
this.pnlIrodsInfo.setVisible(false);
@@ -185,32 +147,73 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
throw new IdropRuntimeException("error setting up infoPanelTransferHandler", ex);
}
- try {
- irodsFileSystem = IRODSFileSystem.instance();
- } catch (JargonException ex) {
- Logger.getLogger(iDrop.class.getName()).log(Level.SEVERE, null, ex);
- System.exit(1);
- }
-
tableSearchResults.setModel(new IRODSSearchTableModel());
MouseListener popupListener = new PopupListener();
// add the listener specifically to the header
tableSearchResults.addMouseListener(popupListener);
tableSearchResults.getTableHeader().addMouseListener(popupListener);
- if (trayIcon == null) {
- trayIcon = new TrayIcon(createImage("images/dialog-ok-2.png", "tray icon"));
- }
- trayIcon.setImageAutoSize(true);
Toolkit t = getToolkit();
int width = t.getScreenSize().width;
int height = t.getScreenSize().height;
+ // FIXME: don't build prefs panel here
+
int showX = (width / 2) - (this.getWidth() / 2);
int showY = (height / 2) - (this.getHeight() / 2);
this.setLocation(showX, showY);
+ /*
+ * FIXME: remove cookswing deps for issues
+
+ CookSwing cookSwing = new CookSwing(this);
+ newPreferencesDialog = (JDialog) cookSwing.render("org/irods/jargon/idrop/preferencesDialog.xml");
+ boolean showGUI = getiDropCore().getPreferences().getBoolean("showGUI", true);
+ showGUICheckBox.setSelected(showGUI);
+
+ *
+ */
+ if (!getiDropCore().getIdropConfig().isAdvancedView()) {
+ toolBarInfo.setVisible(false);
+ }
+
+ if (getiDropCore().getIrodsAccount() == null) {
+ log.warn("no account, exiting");
+ System.exit(0);
+ }
+ userNameLabel.setText("User: "
+ + getiDropCore().getIrodsAccount().getUserName());
+
+
+ }
+
+ protected void showIdropGui() {
+
+ 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
@@ -221,15 +224,71 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
@Override
public synchronized void transferManagerRunningStatusUpdate(RunningStatus rs) {
iDropCore.getIconManager().setRunningStatus(rs);
+ if (rs == RunningStatus.PAUSED) {
+ this.setTransferStatePaused();
+ } else {
+ this.setTransferStateUnpaused();
+ }
}
+ /**
+ * Status callback per file, or intra-file, from the transfer manager
+ * @param ts
+ */
@Override
- public void transferStatusCallback(TransferStatus ts) {
- this.queuedTransfersLabel.setText("Queued Transfers: " + ts.getTotalFilesTransferredSoFar() + "/"
- + ts.getTotalFilesToTransfer());
- this.queuedTransfersProgressBar.setMaximum(ts.getTotalFilesToTransfer());
- this.queuedTransfersProgressBar.setValue(ts.getTotalFilesTransferredSoFar());
+ 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);
+
+ java.awt.EventQueue.invokeLater(new Runnable() {
+
+ @Override
+ public void run() {
+ // on initiation, clear and reset the status bar info
+ lblTransferFilesCounts.setText("Files: " + ts.getTotalFilesTransferredSoFar() + " / " + ts.getTotalFilesToTransfer());
+ lblTransferByteCounts.setText("Current File (kb):" + (ts.getBytesTransfered() / 1024) + " / " + (ts.getTotalSize() / 1024));
+ lblCurrentFile.setText(iDropUtils.abbreviateFileName(ts.getSourceFileAbsolutePath()));
+ }
+ });
+
+ }
+
+ /**
+ * Implementation of transfer manager callback. The overall status callback represents the start and
+ * completion of a transfer operation
+ * @param ts
+ */
+ @Override
+ public void overallStatusCallback(final TransferStatus ts) {
+
+ IRODSOutlineModel irodsTreeModel = (IRODSOutlineModel) irodsTree.getModel();
+ try {
+ irodsTreeModel.notifyCompletionOfOperation(irodsTree, ts);
+ // if a get callback on completion, notify the local tree model
+ if (ts.getTransferType() == TransferStatus.TransferType.GET && ts.getTransferState() == TransferStatus.TransferState.OVERALL_COMPLETION) {
+ ((LocalFileSystemModel) getFileTree().getModel()).notifyCompletionOfOperation(getFileTree(), ts);
+ }
+ } catch (IdropException ex) {
+ Logger.getLogger(iDrop.class.getName()).log(Level.SEVERE, null, ex);
+ this.showIdropException(ex);
+ }
+
+
+ java.awt.EventQueue.invokeLater(new Runnable() {
+
+ @Override
+ public void run() {
+ // on initiation, clear and reset the status bar info
+ lblTransferType.setText(ts.getTransferType().name());
+ lblTransferFilesCounts.setText("Files: " + ts.getTotalFilesTransferredSoFar() + " / " + ts.getTotalFilesToTransfer());
+ lblTransferByteCounts.setText("Bytes (kb):" + (ts.getBytesTransfered() / 1024) + " / " + (ts.getTotalSize() / 1024));
+ lblCurrentFile.setText(iDropUtils.abbreviateFileName(ts.getSourceFileAbsolutePath()));
+ }
+ });
+
}
/**
@@ -238,8 +297,7 @@ 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(this, idropException.getMessage(), "iDROP Exception", JOptionPane.WARNING_MESSAGE);
}
/**
@@ -261,75 +319,34 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
}
/**
- * Start up iDrop as a system tray application. This is the main entry point for iDrop
+ * Update the system tray icon based on the current status.
*
- * @param args
- * the command line arguments
+ * @param iconFile
*/
- public static void main(String args[]) {
-
- final iDrop iDropGui = new iDrop();
-
- // splash work has to be done in different thread
- final IDropSplashWindow splash = new IDropSplashWindow(iDropGui);
- new Thread(splash).run();
-
+ public void updateIcon(final String iconFile) {
java.awt.EventQueue.invokeLater(new Runnable() {
+ @Override
public void run() {
- CookSwing cookSwing = new CookSwing(iDropGui);
- newPreferencesDialog = (JDialog) cookSwing.render("org/irods/jargon/idrop/preferencesDialog.xml");
- boolean showGUI = iDropGui.getiDropCore().getPreferences().getBoolean("showGUI", true);
- iDropGui.showGUICheckBox.setSelected(showGUI);
-
- if (!iDropGui.getiDropCore().getIdropConfig().isAdvancedView()) {
- iDropGui.toolBarInfo.setVisible(false);
+ /* listener events may occur at startup before the GUI is fully prepared, ignore these */
+ if (trayIcon == null) {
+ return;
}
- if (iDropGui.getiDropCore().getIrodsAccount() == null) {
- log.warn("no account, exiting");
- System.exit(0);
- }
+ Image newIcon = createImage(iconFile, "icon");
- iDropGui.currentUserNameLabel.setText("User: "
- + iDropGui.getiDropCore().getIrodsAccount().getUserName());
- iDropGui.currentDateLabel.setText("Date : " + SDF.format(new Date()));
+ trayIcon.setImage(newIcon);
- iDropGui.createAndShowSystemTray();
- iDropGui.processQueueStartup();
- // new IDrop().setVisible(true);
+ if (pnlIdropProgressIcon != null) {
+ progressIconImageLabel.setIcon(new ImageIcon(newIcon));
- if (showGUI) {
- iDropGui.setUpLocalFileSelectTree();
- iDropGui.buildTargetTree();
- iDropGui.setVisible(true);
- } else {
- MessageManager.showMessage(iDropGui,
- "iDrop has started.\nCheck your system tray to access the iDrop user interface.",
- "iDrop has started");
}
}
});
}
/**
- * Update the system tray icon based on the current status.
- *
- * @param iconFile
- */
- public void updateIcon(final String iconFile) {
- java.awt.EventQueue.invokeLater(new Runnable() {
-
- public void run() {
- Image newIcon = createImage(iconFile, "icon");
-
- trayIcon.setImage(newIcon);
- }
- });
- }
-
- /**
* Builds the system tray menu and installs the iDrop icon in the system tray. The iDrop GUI is displayed when the
* iDrop menu item is selected from the system tray
*/
@@ -343,21 +360,22 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
final SystemTray tray = SystemTray.getSystemTray();
- // iconManager = IconManager.instance(this);
+ if (trayIcon == null) {
+ trayIcon = new TrayIcon(createImage("images/dialog-ok-2.png", "tray icon"));
+ }
+ trayIcon.setImageAutoSize(true);
// Create a pop-up menu components
MenuItem aboutItem = new MenuItem("About");
MenuItem iDropItem = new MenuItem("iDrop");
MenuItem preferencesItem = new MenuItem("Preferences");
MenuItem changePasswordItem = new MenuItem("Change Password");
+ MenuItem synchItem = new MenuItem("Synch");
iDropItem.addActionListener(this);
- Menu displayMenu = new Menu("Display");
- MenuItem currentItem = new MenuItem("Current");
- MenuItem recentItem = new MenuItem("Recent");
- MenuItem errorItem = new MenuItem("Error");
- MenuItem warningItem = new MenuItem("Warning");
+ MenuItem currentItem = new MenuItem("Show Current and Past Activity");
+
MenuItem logoutItem = new MenuItem("Logout");
pausedItem = new CheckboxMenuItem("Pause");
@@ -365,13 +383,19 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
MenuItem exitItem = new MenuItem("Exit");
exitItem.addActionListener(this);
- recentItem.addActionListener(this);
currentItem.addActionListener(this);
- errorItem.addActionListener(this);
- warningItem.addActionListener(this);
preferencesItem.addActionListener(this);
+ synchItem.addActionListener(this);
changePasswordItem.addActionListener(this);
+ /*
+ * See if I am in a paused state
+ */
+
+ if (this.getiDropCore().getTransferManager().getRunningStatus() == RunningStatus.PAUSED) {
+ this.setTransferStatePaused();
+ }
+
logoutItem.addActionListener(this);
pausedItem.addItemListener(this);
aboutItem.addActionListener(this);
@@ -381,12 +405,9 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
popup.add(iDropItem);
popup.add(preferencesItem);
popup.add(changePasswordItem);
+ popup.add(synchItem);
popup.addSeparator();
- popup.add(displayMenu);
- displayMenu.add(currentItem);
- displayMenu.add(recentItem);
- displayMenu.add(errorItem);
- displayMenu.add(warningItem);
+ popup.add(currentItem);
popup.addSeparator();
popup.add(pausedItem);
popup.addSeparator();
@@ -471,6 +492,9 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
} else if (e.getActionCommand().equals("Preferences")) {
showGUICheckBox.setSelected(getiDropCore().getPreferences().getBoolean("showGUI", true));
newPreferencesDialog.setVisible(true);
+ } else if (e.getActionCommand().equals("Synch")) {
+ synchSetupDialog = new SynchSetupDialog(this, getiDropCore(), getiDropCore().getIrodsFileSystem());
+ synchSetupDialog.setVisible(true);
} else if (e.getActionCommand().equals("Change Password")) {
if (changePasswordDialog == null) {
@@ -481,91 +505,16 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
}
changePasswordDialog.setVisible(true);
- } else if (e.getActionCommand().equals("Recent")) {
+ } else if (e.getActionCommand().equals("Show Current and Past Activity")) {
log.info("showing recent items in queue");
- try {
- if (queueManagerDialog == null) {
- queueManagerDialog = new QueueManagerDialog(this, iDropCore.getTransferManager(),
- QueueManagerDialog.ViewType.RECENT);
- } else {
- queueManagerDialog.refreshTableView(QueueManagerDialog.ViewType.RECENT);
- }
- } catch (IdropException ex) {
- Logger.getLogger(iDrop.class.getName()).log(Level.SEVERE, null, ex);
- this.showIdropException(ex);
- return;
- }
-
- queueManagerDialog.setModal(false);
- queueManagerDialog.setVisible(true);
- queueManagerDialog.toFront();
-
- } else if (e.getActionCommand().equals("Current")) {
-
- log.info("showing current items in queue");
- try {
- if (queueManagerDialog == null) {
- queueManagerDialog = new QueueManagerDialog(this, iDropCore.getTransferManager(),
- QueueManagerDialog.ViewType.CURRENT);
- } else {
- queueManagerDialog.refreshTableView(QueueManagerDialog.ViewType.CURRENT);
- }
- } catch (IdropException ex) {
- Logger.getLogger(iDrop.class.getName()).log(Level.SEVERE, null, ex);
- this.showIdropException(ex);
- return;
- }
- queueManagerDialog.setModal(false);
- queueManagerDialog.setVisible(true);
- queueManagerDialog.toFront();
-
- } else if (e.getActionCommand().equals("Error")) {
-
- log.info("showing error items in queue");
- try {
- if (queueManagerDialog == null) {
- queueManagerDialog = new QueueManagerDialog(this, iDropCore.getTransferManager(),
- QueueManagerDialog.ViewType.ERROR);
- } else {
- queueManagerDialog.refreshTableView(QueueManagerDialog.ViewType.ERROR);
- }
- } catch (IdropException ex) {
- Logger.getLogger(iDrop.class.getName()).log(Level.SEVERE, null, ex);
- this.showIdropException(ex);
- return;
- }
- queueManagerDialog.setModal(false);
- queueManagerDialog.setVisible(true);
- queueManagerDialog.toFront();
-
- } else if (e.getActionCommand().equals("Warning")) {
-
- log.info("showing warning items in queue");
- try {
- if (queueManagerDialog == null) {
- queueManagerDialog = new QueueManagerDialog(this, iDropCore.getTransferManager(),
- QueueManagerDialog.ViewType.WARNING);
- } else {
- queueManagerDialog.refreshTableView(QueueManagerDialog.ViewType.WARNING);
- }
- } catch (IdropException ex) {
- Logger.getLogger(iDrop.class.getName()).log(Level.SEVERE, null, ex);
- this.showIdropException(ex);
- return;
- }
- queueManagerDialog.setModal(false);
- queueManagerDialog.setVisible(true);
- queueManagerDialog.toFront();
+ showQueueManagerDialog();
} else {
if (!this.formShown) {
- this.setUpLocalFileSelectTree();
- this.buildTargetTree();
- this.formShown = true;
- this.setVisible(true);
+ showIdropGui();
} else {
// refresh the tree when setting visible again, the account may have changed.
@@ -579,6 +528,25 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
}
+ private boolean showQueueManagerDialog() {
+ try {
+ if (queueManagerDialog == null) {
+ queueManagerDialog = new QueueManagerDialog(this, iDropCore.getTransferManager(),
+ QueueManagerDialog.ViewType.RECENT);
+ } else {
+ queueManagerDialog.refreshTableView(QueueManagerDialog.ViewType.RECENT);
+ }
+ } catch (IdropException ex) {
+ Logger.getLogger(iDrop.class.getName()).log(Level.SEVERE, null, ex);
+ this.showIdropException(ex);
+ return true;
+ }
+ queueManagerDialog.setModal(false);
+ queueManagerDialog.setVisible(true);
+ queueManagerDialog.toFront();
+ return false;
+ }
+
public TrayIcon getTrayIcon() {
return trayIcon;
}
@@ -617,11 +585,10 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
public int showTransferStartupConfirm() {
// default icon, custom title
- int n = JOptionPane
- .showConfirmDialog(
- this,
- "There are transfers ready to process, should the transfer queue be started? Click NO to pause the transfersf",
- "Begin Transfer Confirmation", JOptionPane.YES_NO_OPTION);
+ int n = JOptionPane.showConfirmDialog(
+ this,
+ "There are transfers ready to process, should the transfer queue be started? Click NO to pause the transfersf",
+ "Begin Transfer Confirmation", JOptionPane.YES_NO_OPTION);
return n;
}
@@ -631,10 +598,37 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
*
* @return <code>JTree</code> visual representation of the remote iRODS resource
*/
- public javax.swing.JTree getTreeStagingResource() {
+ public Outline getTreeStagingResource() {
return irodsTree;
}
+ /**
+ * Indicate that the GUI should reflect a paused state
+ *
+ */
+ public void setTransferStatePaused() {
+ if (pausedItem != null) {
+ pausedItem.setState(true);
+ }
+
+ if (togglePauseTransfer != null) {
+ this.togglePauseTransfer.setSelected(true);
+ }
+ }
+
+ /**
+ * Indicate that the gui should show an unpaused state.
+ */
+ public void setTransferStateUnpaused() {
+ if (pausedItem != null) {
+ pausedItem.setState(false);
+ }
+
+ if (togglePauseTransfer != null) {
+ this.togglePauseTransfer.setSelected(false);
+ }
+ }
+
@Override
public void itemStateChanged(ItemEvent e) {
@@ -656,15 +650,6 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
}
/**
- * Get the transferManager that controls the transfer queue
- *
- * @return <code>TransferManager</code> that controls all transfers via the transfer queue
- */
- public TransferManager getTransferManager() {
- return iDropCore.getTransferManager();
- }
-
- /**
* Show or hide the iRODS info panel and manage the state of the show info menu and toggle so that they remain in
* synch
*/
@@ -679,23 +664,9 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
// if info is being opened, initialize to the first selected item, or the root of the iRODS tree if none
// selected
IRODSNode node;
- if (!(irodsTree.getLastSelectedPathComponent() instanceof IRODSNode)) {
- log.info("last selected is not a Node, using root node");
- node = (IRODSNode) irodsTree.getModel().getRoot();
- } else {
- log.info("initializing with last selected node");
- node = (IRODSNode) irodsTree.getLastSelectedPathComponent();
- }
- try {
- IrodsTreeListenerForBuildingInfoPanel treeBuilder = new IrodsTreeListenerForBuildingInfoPanel(
- idropGuiReference);
- treeBuilder.identifyNodeTypeAndInitializeInfoPanel(node);
- } catch (Exception ex) {
- Logger.getLogger(IrodsTreeListenerForBuildingInfoPanel.class.getName()).log(Level.SEVERE, null, ex);
- throw new IdropRuntimeException("exception processing valueChanged() event for IRODSNode selection");
- }
+
if (pnlIrodsInfo.isVisible()) {
- splitTargetCollections.setDividerLocation(0.5d);
+ splitTargetCollections.setDividerLocation(0.5d);
}
}
});
@@ -727,10 +698,6 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
initializeLocalFileTreeModel(null);
fileTree = new LocalFileTree(localFileModel, gui);
- fileTree.setDragEnabled(true);
- fileTree.setDropMode(javax.swing.DropMode.ON);
- fileTree.setTransferHandler(new TransferHandler("selectionModel"));
- fileTree.getSelectionModel().setSelectionMode(TreeSelectionModel.DISCONTIGUOUS_TREE_SELECTION);
listLocalDrives.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
@Override
@@ -808,16 +775,27 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
@Override
public void run() {
+
+ /*
log.debug("refreshing series panel");
Enumeration<TreePath> currentPaths = null;
+ TreePath firstVisibleRow = null;
TreePath rootPath = null;
-
+
if (getTreeStagingResource() != null) {
- rootPath = getTreeStagingResource().getPathForRow(0);
- currentPaths = getTreeStagingResource().getExpandedDescendants(rootPath);
- log.debug("selected tree node, paths are:{}", currentPaths);
+ TreePath[] expandedPaths = TreeUtils.getPaths(getTreeStagingResource(), true);
+ //FIXME: get this code out of idrop and put into iRODS tree
+ log.info("expanded paths:{}", expandedPaths);
+ rootPath = getTreeStagingResource().get getPathForRow(0);
+ // Rectangle nodeRectangle = scrollIrodsTree.getViewport().getViewRect();
+ // TreeModel treeModel = getTreeStagingResource().getModel();
+ // TreeNode root = (TreeNode) treeModel.getRoot();
+ currentPaths = getTreeStagingResource().getExpandedDescendants(rootPath);
+ //firstVisibleRow = getTreeStagingResource().getClosestPathForLocation(0, 0);
+ log.debug("selected tree node, paths are:{}", currentPaths);
+ log.debug("first visible row is:{}", firstVisibleRow);
}
-
+ */
CollectionAndDataObjectListingEntry root = new CollectionAndDataObjectListingEntry();
if (iDropCore.getIdropConfig().isLoginPreset()) {
@@ -833,47 +811,51 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
log.info("using root path, no login preset");
root.setPathOrName("/");
}
-
+
log.info("building new iRODS tree");
try {
- irodsTree = new IRODSTree(gui);
- IRODSNode rootNode = new IRODSNode(root, getIrodsAccount(), getIrodsFileSystem(), irodsTree);
- irodsTree.setModel(new IRODSFileSystemModel(rootNode, getIrodsAccount()));
- irodsTree.setRefreshingTree(true);
- irodsTree.getSelectionModel().setSelectionMode(TreeSelectionModel.DISCONTIGUOUS_TREE_SELECTION);
- IrodsTreeListenerForBuildingInfoPanel treeListener = new IrodsTreeListenerForBuildingInfoPanel(gui);
+ if (irodsTree == null) {
+ irodsTree = new IRODSTree(gui);
+ IRODSNode rootNode = new IRODSNode(root, getIrodsAccount(), getiDropCore().getIrodsFileSystem(), irodsTree);
+ irodsTree.setRefreshingTree(true);
+ // irodsTree.getSelectionModel().setSelectionMode(TreeSelectionModel.DISCONTIGUOUS_TREE_SELECTION);
+ }
+ IRODSNode rootNode = new IRODSNode(root, getIrodsAccount(), getiDropCore().getIrodsFileSystem(), irodsTree);
+
+ IRODSFileSystemModel irodsFileSystemModel = new IRODSFileSystemModel(rootNode, getIrodsAccount());
+ IRODSOutlineModel mdl = new IRODSOutlineModel(gui,
+ irodsFileSystemModel, new IRODSRowModel(), true, "File System");
+ irodsTree.setModel(mdl);
+
+ /* IrodsTreeListenerForBuildingInfoPanel treeListener = new IrodsTreeListenerForBuildingInfoPanel(gui);
irodsTree.addTreeExpansionListener(treeListener);
irodsTree.addTreeSelectionListener(treeListener);
// preset to display root tree node
irodsTree.setSelectionRow(0);
+ *
+ */
} catch (Exception ex) {
Logger.getLogger(iDrop.class.getName()).log(Level.SEVERE, null, ex);
throw new IdropRuntimeException(ex);
}
scrollIrodsTree.setViewportView(getTreeStagingResource());
-
- TreePath currentPath;
-
+ /* TreePath currentPath;
+
if (currentPaths != null) {
- while (currentPaths.hasMoreElements()) {
- currentPath = (TreePath) currentPaths.nextElement();
- log.debug("expanding tree path:{}", currentPath);
- irodsTree.expandPath(currentPath);
- }
+ while (currentPaths.hasMoreElements()) {
+ currentPath = (TreePath) currentPaths.nextElement();
+ log.debug("expanding tree path:{}", currentPath);
+ irodsTree.expandPath(currentPath);
}
+ }*/
irodsTree.setRefreshingTree(false);
- irodsFileSystem.closeAndEatExceptions(iDropCore.getIrodsAccount());
+
+ getiDropCore().getIrodsFileSystem().closeAndEatExceptions(iDropCore.getIrodsAccount());
}
});
}
- private void processQueueStartup() {
- if (iDropCore.getTransferManager().getRunningStatus() == TransferManager.RunningStatus.PAUSED) {
- pausedItem.setState(true);
- }
- }
-
public void initializeInfoPane(final CollectionAndDataObjectListingEntry collectionAndDataObjectListingEntry)
throws IdropException {
if (!toggleIrodsDetails.isSelected()) {
@@ -898,17 +880,15 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
try {
if (collectionAndDataObjectListingEntry.getObjectType() == CollectionAndDataObjectListingEntry.ObjectType.COLLECTION) {
log.info("looking up collection to build info panel");
- CollectionAO collectionAO = irodsFileSystem.getIRODSAccessObjectFactory().getCollectionAO(
+ CollectionAO collectionAO = getiDropCore().getIrodsFileSystem().getIRODSAccessObjectFactory().getCollectionAO(
getIrodsAccount());
- Collection collection = collectionAO.findByAbsolutePath(collectionAndDataObjectListingEntry
- .getPathOrName());
+ Collection collection = collectionAO.findByAbsolutePath(collectionAndDataObjectListingEntry.getPathOrName());
initializeInfoPanel(collection);
} else {
log.info("looking up data object to build info panel");
- DataObjectAO dataObjectAO = irodsFileSystem.getIRODSAccessObjectFactory().getDataObjectAO(
+ DataObjectAO dataObjectAO = getiDropCore().getIrodsFileSystem().getIRODSAccessObjectFactory().getDataObjectAO(
getIrodsAccount());
- DataObject dataObject = dataObjectAO.findByAbsolutePath(collectionAndDataObjectListingEntry
- .getParentPath() + "/" + collectionAndDataObjectListingEntry.getPathOrName());
+ DataObject dataObject = dataObjectAO.findByAbsolutePath(collectionAndDataObjectListingEntry.getParentPath() + "/" + collectionAndDataObjectListingEntry.getPathOrName());
initializeInfoPanel(dataObject);
}
@@ -917,7 +897,7 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
collectionAndDataObjectListingEntry, e);
throw new IdropRuntimeException(e);
} finally {
- irodsFileSystem.closeAndEatExceptions(getIrodsAccount());
+ getiDropCore().getIrodsFileSystem().closeAndEatExceptions(getIrodsAccount());
idropGui.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
}
@@ -960,9 +940,8 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
try {
FreeTaggingService freeTaggingService = FreeTaggingServiceImpl.instance(
- irodsFileSystem.getIRODSAccessObjectFactory(), getIrodsAccount());
- IRODSTagGrouping irodsTagGrouping = freeTaggingService.getTagsForDataObjectInFreeTagForm(dataObject
- .getCollectionName() + "/" + dataObject.getDataName());
+ getiDropCore().getIrodsFileSystem().getIRODSAccessObjectFactory(), getiDropCore().getIrodsAccount());
+ IRODSTagGrouping irodsTagGrouping = freeTaggingService.getTagsForDataObjectInFreeTagForm(dataObject.getCollectionName() + "/" + dataObject.getDataName());
txtTags.setText(irodsTagGrouping.getSpaceDelimitedTagsForDomain());
pnlInfoIcon.removeAll();
pnlInfoIcon.add(IconHelper.getFileIcon());
@@ -976,7 +955,7 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
Logger.getLogger(iDrop.class.getName()).log(Level.SEVERE, null, ex);
throw new IdropRuntimeException(ex);
} finally {
- irodsFileSystem.closeAndEatExceptions(getIrodsAccount());
+ getiDropCore().getIrodsFileSystem().closeAndEatExceptions(getIrodsAccount());
idropGui.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
}
}
@@ -1020,9 +999,8 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
try {
FreeTaggingService freeTaggingService = FreeTaggingServiceImpl.instance(
- irodsFileSystem.getIRODSAccessObjectFactory(), getIrodsAccount());
- IRODSTagGrouping irodsTagGrouping = freeTaggingService.getTagsForCollectionInFreeTagForm(collection
- .getCollectionName());
+ getiDropCore().getIrodsFileSystem().getIRODSAccessObjectFactory(), getIrodsAccount());
+ IRODSTagGrouping irodsTagGrouping = freeTaggingService.getTagsForCollectionInFreeTagForm(collection.getCollectionName());
txtTags.setText(irodsTagGrouping.getSpaceDelimitedTagsForDomain());
pnlInfoIcon.removeAll();
pnlInfoIcon.add(IconHelper.getFolderIcon());
@@ -1035,7 +1013,7 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
Logger.getLogger(iDrop.class.getName()).log(Level.SEVERE, null, ex);
throw new IdropRuntimeException(ex);
} finally {
- irodsFileSystem.closeAndEatExceptions(getIrodsAccount());
+ getiDropCore().getIrodsFileSystem().closeAndEatExceptions(getIrodsAccount());
idropGui.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
}
}
@@ -1096,27 +1074,12 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
btnRefreshTargetTree = new javax.swing.JButton();
pnlIrodsTreeMaster = new javax.swing.JPanel();
scrollIrodsTree = new javax.swing.JScrollPane();
- pnlTargetTree = new javax.swing.JPanel();
- pnlTabTagView = new javax.swing.JPanel();
- pnlTagSearch = new javax.swing.JPanel();
- pnlTagSearchSearchBox = new javax.swing.JPanel();
- lblSearchTags = new javax.swing.JLabel();
- txtTagNameSearch = new javax.swing.JTextField();
- btnRefreshTagCloud = new javax.swing.JButton();
- pnlTagViewMaster = new javax.swing.JPanel();
- splitTagsAndTagResults = new javax.swing.JSplitPane();
- pnlTagListing = new javax.swing.JPanel();
- scrollPaneTagCloudList = new javax.swing.JScrollPane();
- listTagCloudList = new javax.swing.JList();
- scrollTagResults = new javax.swing.JScrollPane();
- pnlTagResultsInner = new javax.swing.JPanel();
pnlTabSearch = new javax.swing.JPanel();
pnlTabSearchTop = new javax.swing.JPanel();
pnlTabSearchResults = new javax.swing.JPanel();
scrollPaneSearchResults = new javax.swing.JScrollPane();
tableSearchResults = new javax.swing.JTable();
pnlIrodsInfo = new javax.swing.JPanel();
- scrollIrodsInfo = new javax.swing.JScrollPane();
pnlIrodsInfoInner = new javax.swing.JPanel();
pnlFileIconSizer = new javax.swing.JPanel();
pnlInfoIcon = new javax.swing.JPanel();
@@ -1124,20 +1087,16 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
lblFileOrCollectionName = new javax.swing.JLabel();
pnlInfoCollectionParent = new javax.swing.JPanel();
lblFileParent = new javax.swing.JLabel();
- pnlScrollParentPathSizer = new javax.swing.JPanel();
scrollParentPath = new javax.swing.JScrollPane();
txtParentPath = new javax.swing.JTextArea();
pnlInfoComment = new javax.swing.JPanel();
lblComment = new javax.swing.JLabel();
- pnlInfoCommentScrollSizer = new javax.swing.JPanel();
scrollComment = new javax.swing.JScrollPane();
txtComment = new javax.swing.JTextArea();
pnlInfoTags = new javax.swing.JPanel();
lblTags = new javax.swing.JLabel();
- pnlInfoTagsSizer = new javax.swing.JPanel();
txtTags = new javax.swing.JTextField();
pnlInfoButton = new javax.swing.JPanel();
- pnlInfoButtonSizer = new javax.swing.JPanel();
btnUpdateInfo = new javax.swing.JButton();
pnlInfoDetails = new javax.swing.JPanel();
lblInfoCreatedAt = new javax.swing.JLabel();
@@ -1154,7 +1113,26 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
btnMoveToTrash = new javax.swing.JButton();
separator2 = new javax.swing.JToolBar.Separator();
pnlIdropBottom = new javax.swing.JPanel();
- lblIdropMessage = new javax.swing.JLabel();
+ userNameLabel = new javax.swing.JLabel();
+ pnlTransferOverview = new javax.swing.JPanel();
+ pnlTransferStatus = new javax.swing.JPanel();
+ pnlTransferType = new javax.swing.JPanel();
+ lblTransferTypeLabel = new javax.swing.JLabel();
+ lblTransferType = new javax.swing.JLabel();
+ pnlTransferFileCounts = new javax.swing.JPanel();
+ lblTransferFilesCounts = new javax.swing.JLabel();
+ pnlTransferByteCounts = new javax.swing.JPanel();
+ lblTransferByteCounts = new javax.swing.JLabel();
+ pnlTransferFileInfo = new javax.swing.JPanel();
+ lblCurrentFileLabel = new javax.swing.JLabel();
+ lblCurrentFile = new javax.swing.JLabel();
+ transferStatusProgressBar = new javax.swing.JProgressBar();
+ transferQueueToolbarPanel = new javax.swing.JPanel();
+ idropProgressPanelToolbar = new javax.swing.JToolBar();
+ btnShowTransferManager = new javax.swing.JButton();
+ togglePauseTransfer = new javax.swing.JToggleButton();
+ pnlIdropProgressIcon = new javax.swing.JPanel();
+ progressIconImageLabel = new javax.swing.JLabel();
jMenuBar1 = new javax.swing.JMenuBar();
jMenuFile = new javax.swing.JMenu();
jMenuItemExit = new javax.swing.JMenuItem();
@@ -1162,7 +1140,6 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
jMenuView = new javax.swing.JMenu();
jCheckBoxMenuItemShowSourceTree = new javax.swing.JCheckBoxMenuItem();
jCheckBoxMenuItemShowIrodsInfo = new javax.swing.JCheckBoxMenuItem();
- jMenuItemPreferences = new javax.swing.JMenuItem();
menuItemShowInHierarchy.setText("Show in iRODS");
menuItemShowInHierarchy.setToolTipText("Show this file or collection in the iRODS hierarchy");
@@ -1201,8 +1178,7 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
lblMainSearch.setPreferredSize(new java.awt.Dimension(45, 40));
pnlSearchSizer.add(lblMainSearch);
- comboSearchType.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "by name", "by tag",
- "by name and tag" }));
+ comboSearchType.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "by name", "by tag", "by name and tag" }));
comboSearchType.setToolTipText("Select the type of search to be carried out using the supplied search string");
pnlSearchSizer.add(comboSearchType);
@@ -1341,12 +1317,14 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
jSplitPanelLocalRemote.setLeftComponent(pnlLocalTreeArea);
+ pnlIrodsArea.setMinimumSize(new java.awt.Dimension(500, 300));
pnlIrodsArea.setPreferredSize(new java.awt.Dimension(600, 304));
pnlIrodsArea.setLayout(new java.awt.BorderLayout());
splitTargetCollections.setDividerLocation(400);
splitTargetCollections.setMinimumSize(new java.awt.Dimension(0, 0));
+ tabIrodsViews.setMinimumSize(new java.awt.Dimension(200, 129));
tabIrodsViews.setPreferredSize(new java.awt.Dimension(350, 300));
tabIrodsViews.addChangeListener(new javax.swing.event.ChangeListener() {
public void stateChanged(javax.swing.event.ChangeEvent evt) {
@@ -1375,147 +1353,100 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
scrollIrodsTree.setMinimumSize(null);
scrollIrodsTree.setPreferredSize(null);
-
- pnlTargetTree.setLayout(new java.awt.BorderLayout());
- scrollIrodsTree.setViewportView(pnlTargetTree);
-
pnlIrodsTreeMaster.add(scrollIrodsTree, java.awt.BorderLayout.CENTER);
pnlTabHierarchicalView.add(pnlIrodsTreeMaster, java.awt.BorderLayout.CENTER);
tabIrodsViews.addTab("iRODS Tree View", pnlTabHierarchicalView);
- pnlTabTagView.setLayout(new java.awt.BorderLayout());
-
- pnlTagSearch.setLayout(new javax.swing.BoxLayout(pnlTagSearch, javax.swing.BoxLayout.PAGE_AXIS));
-
- lblSearchTags.setText("Tag name search:");
- pnlTagSearchSearchBox.add(lblSearchTags);
-
- txtTagNameSearch.setColumns(15);
- txtTagNameSearch.setToolTipText("Tag name to filter tag cloud");
- pnlTagSearchSearchBox.add(txtTagNameSearch);
-
- pnlTagSearch.add(pnlTagSearchSearchBox);
-
- btnRefreshTagCloud.setMnemonic('C');
- btnRefreshTagCloud.setText("Refresh Tag Cloud");
- btnRefreshTagCloud.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent evt) {
- btnRefreshTagCloudActionPerformed(evt);
- }
- });
- pnlTagSearch.add(btnRefreshTagCloud);
-
- pnlTabTagView.add(pnlTagSearch, java.awt.BorderLayout.NORTH);
-
- pnlTagViewMaster.addComponentListener(new java.awt.event.ComponentAdapter() {
- public void componentShown(java.awt.event.ComponentEvent evt) {
- pnlTagViewMasterComponentShown(evt);
- }
- });
- pnlTagViewMaster.setLayout(new java.awt.GridLayout(1, 0));
-
- splitTagsAndTagResults.setDividerLocation(100);
-
- pnlTagListing.setLayout(new java.awt.GridLayout(1, 0));
-
- listTagCloudList.addListSelectionListener(new javax.swing.event.ListSelectionListener() {
- public void valueChanged(javax.swing.event.ListSelectionEvent evt) {
- listTagCloudListValueChanged(evt);
- }
- });
- scrollPaneTagCloudList.setViewportView(listTagCloudList);
-
- pnlTagListing.add(scrollPaneTagCloudList);
-
- splitTagsAndTagResults.setLeftComponent(pnlTagListing);
-
- scrollTagResults.setMinimumSize(null);
- scrollTagResults.setPreferredSize(new java.awt.Dimension(0, 0));
-
- pnlTagResultsInner.setLayout(new javax.swing.BoxLayout(pnlTagResultsInner, javax.swing.BoxLayout.PAGE_AXIS));
- scrollTagResults.setViewportView(pnlTagResultsInner);
-
- splitTagsAndTagResults.setRightComponent(scrollTagResults);
-
- pnlTagViewMaster.add(splitTagsAndTagResults);
-
- pnlTabTagView.add(pnlTagViewMaster, java.awt.BorderLayout.CENTER);
-
- tabIrodsViews.addTab("Tag View", pnlTabTagView);
-
pnlTabSearch.setToolTipText("Search for files and collections in iRODS and display search results");
pnlTabSearch.setLayout(new java.awt.BorderLayout());
pnlTabSearch.add(pnlTabSearchTop, java.awt.BorderLayout.NORTH);
pnlTabSearchResults.setLayout(new java.awt.GridLayout(1, 0));
- tableSearchResults.setModel(new javax.swing.table.DefaultTableModel(new Object[][] {
- { null, null, null, null }, { null, null, null, null }, { null, null, null, null },
- { null, null, null, null } }, new String[] { "Title 1", "Title 2", "Title 3", "Title 4" }));
+ tableSearchResults.setModel(new javax.swing.table.DefaultTableModel(
+ new Object [][] {
+ {null, null, null, null},
+ {null, null, null, null},
+ {null, null, null, null},
+ {null, null, null, null}
+ },
+ new String [] {
+ "Title 1", "Title 2", "Title 3", "Title 4"
+ }
+ ));
scrollPaneSearchResults.setViewportView(tableSearchResults);
pnlTabSearchResults.add(scrollPaneSearchResults);
pnlTabSearch.add(pnlTabSearchResults, java.awt.BorderLayout.CENTER);
- tabIrodsViews.addTab("Search", null, pnlTabSearch,
- "Search for files and collections in iRODS and display search results");
+ tabIrodsViews.addTab("Search", null, pnlTabSearch, "Search for files and collections in iRODS and display search results");
splitTargetCollections.setLeftComponent(tabIrodsViews);
pnlIrodsInfo.setBorder(javax.swing.BorderFactory.createEmptyBorder(10, 15, 10, 15));
- pnlIrodsInfo.setLayout(new java.awt.GridLayout(1, 0));
-
- scrollIrodsInfo.setPreferredSize(new java.awt.Dimension(400, 300));
+ pnlIrodsInfo.setMinimumSize(new java.awt.Dimension(300, 708));
+ pnlIrodsInfo.setLayout(new java.awt.BorderLayout());
pnlIrodsInfoInner.setBorder(javax.swing.BorderFactory.createEmptyBorder(10, 10, 10, 10));
pnlIrodsInfoInner.setToolTipText("Information on selected iRODS file or collection");
- pnlIrodsInfoInner.setMinimumSize(new java.awt.Dimension(250, 200));
- pnlIrodsInfoInner.setPreferredSize(new java.awt.Dimension(300, 300));
- pnlIrodsInfoInner.setLayout(new java.awt.GridLayout(0, 1, 10, 10));
+ pnlIrodsInfoInner.setLayout(new java.awt.GridBagLayout());
- pnlFileIconSizer.setMinimumSize(new java.awt.Dimension(50, 50));
- pnlFileIconSizer.setPreferredSize(new java.awt.Dimension(50, 50));
+ pnlFileIconSizer.setMinimumSize(new java.awt.Dimension(80, 40));
pnlFileIconSizer.setLayout(new java.awt.BorderLayout());
pnlInfoIcon.setMaximumSize(new java.awt.Dimension(50, 50));
pnlInfoIcon.setLayout(new java.awt.GridLayout(1, 0));
pnlFileIconSizer.add(pnlInfoIcon, java.awt.BorderLayout.WEST);
- pnlIrodsInfoInner.add(pnlFileIconSizer);
+ gridBagConstraints = new java.awt.GridBagConstraints();
+ gridBagConstraints.gridx = 0;
+ gridBagConstraints.gridy = 0;
+ gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
+ gridBagConstraints.weightx = 0.8;
+ pnlIrodsInfoInner.add(pnlFileIconSizer, gridBagConstraints);
+ pnlFileNameAndIcon.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
+ pnlFileNameAndIcon.setMinimumSize(new java.awt.Dimension(100, 100));
pnlFileNameAndIcon.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.LEFT, 0, 5));
- lblFileOrCollectionName.setText("jLabel1");
+ lblFileOrCollectionName.setMinimumSize(new java.awt.Dimension(80, 16));
pnlFileNameAndIcon.add(lblFileOrCollectionName);
- pnlIrodsInfoInner.add(pnlFileNameAndIcon);
+ gridBagConstraints = new java.awt.GridBagConstraints();
+ gridBagConstraints.gridx = 0;
+ gridBagConstraints.gridy = 1;
+ gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
+ gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_START;
+ gridBagConstraints.weightx = 0.8;
+ gridBagConstraints.insets = new java.awt.Insets(10, 0, 0, 0);
+ pnlIrodsInfoInner.add(pnlFileNameAndIcon, gridBagConstraints);
- pnlInfoCollectionParent.setMinimumSize(new java.awt.Dimension(65, 39));
pnlInfoCollectionParent.setLayout(new java.awt.BorderLayout());
lblFileParent.setText("Parent path of file:");
pnlInfoCollectionParent.add(lblFileParent, java.awt.BorderLayout.NORTH);
- lblFileParent.getAccessibleContext().setAccessibleDescription(
- "The path of the parent of the file or collection");
+ lblFileParent.getAccessibleContext().setAccessibleDescription("The path of the parent of the file or collection");
- pnlScrollParentPathSizer.setLayout(new java.awt.BorderLayout());
+ scrollParentPath.setMinimumSize(new java.awt.Dimension(100, 100));
- scrollParentPath.setMinimumSize(null);
-
- txtParentPath.setColumns(32);
txtParentPath.setEditable(false);
txtParentPath.setMaximumSize(null);
- txtParentPath.setMinimumSize(null);
+ txtParentPath.setMinimumSize(new java.awt.Dimension(600, 100));
scrollParentPath.setViewportView(txtParentPath);
- pnlScrollParentPathSizer.add(scrollParentPath, java.awt.BorderLayout.WEST);
-
- pnlInfoCollectionParent.add(pnlScrollParentPathSizer, java.awt.BorderLayout.CENTER);
+ pnlInfoCollectionParent.add(scrollParentPath, java.awt.BorderLayout.CENTER);
- pnlIrodsInfoInner.add(pnlInfoCollectionParent);
+ gridBagConstraints = new java.awt.GridBagConstraints();
+ gridBagConstraints.gridx = 0;
+ gridBagConstraints.gridy = 2;
+ gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
+ gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_START;
+ gridBagConstraints.weightx = 0.8;
+ gridBagConstraints.insets = new java.awt.Insets(10, 0, 0, 0);
+ pnlIrodsInfoInner.add(pnlInfoCollectionParent, gridBagConstraints);
pnlInfoComment.setLayout(new java.awt.BorderLayout());
@@ -1524,22 +1455,22 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
pnlInfoComment.add(lblComment, java.awt.BorderLayout.NORTH);
lblComment.getAccessibleContext().setAccessibleDescription("lable for comment area");
- pnlInfoCommentScrollSizer.setPreferredSize(new java.awt.Dimension(388, 84));
- pnlInfoCommentScrollSizer.setLayout(new java.awt.BorderLayout());
-
scrollComment.setMinimumSize(null);
scrollComment.setPreferredSize(new java.awt.Dimension(388, 84));
- txtComment.setColumns(32);
txtComment.setMaximumSize(null);
txtComment.setMinimumSize(null);
+ txtComment.setPreferredSize(null);
scrollComment.setViewportView(txtComment);
- pnlInfoCommentScrollSizer.add(scrollComment, java.awt.BorderLayout.WEST);
-
- pnlInfoComment.add(pnlInfoCommentScrollSizer, java.awt.BorderLayout.CENTER);
+ pnlInfoComment.add(scrollComment, java.awt.BorderLayout.CENTER);
- pnlIrodsInfoInner.add(pnlInfoComment);
+ gridBagConstraints = new java.awt.GridBagConstraints();
+ gridBagConstraints.gridx = 0;
+ gridBagConstraints.gridy = 3;
+ gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
+ gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
+ pnlIrodsInfoInner.add(pnlInfoComment, gridBagConstraints);
pnlInfoTags.setLayout(new java.awt.BorderLayout());
@@ -1549,8 +1480,6 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
lblTags.getAccessibleContext().setAccessibleName("Tags");
lblTags.getAccessibleContext().setAccessibleDescription("Label for free tagging area");
- pnlInfoTagsSizer.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.LEFT, 0, 5));
-
txtTags.setColumns(30);
txtTags.setToolTipText("Name of file or collection. This field allows editing to rename");
txtTags.setMinimumSize(null);
@@ -1565,15 +1494,17 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
txtTagsKeyPressed(evt);
}
});
- pnlInfoTagsSizer.add(txtTags);
-
- pnlInfoTags.add(pnlInfoTagsSizer, java.awt.BorderLayout.CENTER);
-
- pnlIrodsInfoInner.add(pnlInfoTags);
+ pnlInfoTags.add(txtTags, java.awt.BorderLayout.PAGE_END);
- pnlInfoButton.setLayout(new java.awt.BorderLayout());
+ gridBagConstraints = new java.awt.GridBagConstraints();
+ gridBagConstraints.gridx = 0;
+ gridBagConstraints.gridy = 4;
+ gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
+ gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_START;
+ gridBagConstraints.weightx = 0.8;
+ pnlIrodsInfoInner.add(pnlInfoTags, gridBagConstraints);
- pnlInfoButtonSizer.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.RIGHT));
+ pnlInfoButton.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.RIGHT));
btnUpdateInfo.setMnemonic('I');
btnUpdateInfo.setText("Update Info");
@@ -1583,12 +1514,16 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
btnUpdateInfoActionPerformed(evt);
}
});
- pnlInfoButtonSizer.add(btnUpdateInfo);
+ pnlInfoButton.add(btnUpdateInfo);
- pnlInfoButton.add(pnlInfoButtonSizer, java.awt.BorderLayout.SOUTH);
-
- pnlIrodsInfoInner.add(pnlInfoButton);
+ gridBagConstraints = new java.awt.GridBagConstraints();
+ gridBagConstraints.gridx = 0;
+ gridBagConstraints.gridy = 5;
+ gridBagConstraints.anchor = java.awt.GridBagConstraints.LINE_END;
+ gridBagConstraints.weightx = 0.1;
+ pnlIrodsInfoInner.add(pnlInfoButton, gridBagConstraints);
+ pnlInfoDetails.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
pnlInfoDetails.setLayout(new java.awt.GridBagLayout());
lblInfoCreatedAt.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
@@ -1638,8 +1573,16 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
pnlInfoDetails.add(lblInfoLengthValue, gridBagConstraints);
- pnlIrodsInfoInner.add(pnlInfoDetails);
+ gridBagConstraints = new java.awt.GridBagConstraints();
+ gridBagConstraints.gridx = 0;
+ gridBagConstraints.gridy = 6;
+ gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
+ gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
+ gridBagConstraints.weightx = 0.8;
+ gridBagConstraints.insets = new java.awt.Insets(10, 0, 10, 0);
+ pnlIrodsInfoInner.add(pnlInfoDetails, gridBagConstraints);
+ pnlToolbarInfo.setMinimumSize(new java.awt.Dimension(300, 200));
pnlToolbarInfo.setLayout(new java.awt.BorderLayout());
toolBarInfo.setRollover(true);
@@ -1678,13 +1621,17 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
pnlToolbarInfo.add(toolBarInfo, java.awt.BorderLayout.NORTH);
- pnlIrodsInfoInner.add(pnlToolbarInfo);
+ gridBagConstraints = new java.awt.GridBagConstraints();
+ gridBagConstraints.gridx = 0;
+ gridBagConstraints.gridy = 7;
+ gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
+ gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
+ gridBagConstraints.weightx = 0.8;
+ pnlIrodsInfoInner.add(pnlToolbarInfo, gridBagConstraints);
- scrollIrodsInfo.setViewportView(pnlIrodsInfoInner);
+ pnlIrodsInfo.add(pnlIrodsInfoInner, java.awt.BorderLayout.CENTER);
pnlIrodsInfoInner.getAccessibleContext().setAccessibleName("info panel");
- pnlIrodsInfo.add(scrollIrodsInfo);
-
splitTargetCollections.setRightComponent(pnlIrodsInfo);
pnlIrodsArea.add(splitTargetCollections, java.awt.BorderLayout.CENTER);
@@ -1695,15 +1642,104 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
getContentPane().add(pnlIdropMain, java.awt.BorderLayout.CENTER);
- // pnlIdropBottom.setToolTipText("Display area for status and messages");
- // pnlIdropBottom.setLayout(new java.awt.BorderLayout());
- // pnlIdropBottom.add(lblIdropMessage, java.awt.BorderLayout.CENTER);
- try {
- CookSwing cookSwing = new CookSwing(this);
- pnlIdropBottom = (JPanel) cookSwing.render("org/irods/jargon/idrop/statusBarPanel.xml");
- } catch (Exception e) {
- e.printStackTrace();
- }
+ pnlIdropBottom.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.LOWERED));
+ pnlIdropBottom.setToolTipText("Display area for status and messages");
+ pnlIdropBottom.setLayout(new java.awt.GridBagLayout());
+
+ userNameLabel.setText("usernamelabel");
+ gridBagConstraints = new java.awt.GridBagConstraints();
+ gridBagConstraints.gridx = 0;
+ gridBagConstraints.gridy = 1;
+ gridBagConstraints.weightx = 0.0050;
+ pnlIdropBottom.add(userNameLabel, gridBagConstraints);
+
+ pnlTransferOverview.setLayout(new java.awt.BorderLayout());
+
+ lblTransferTypeLabel.setText("Transfer Type:");
+ pnlTransferType.add(lblTransferTypeLabel);
+
+ lblTransferType.setText(" ");
+ pnlTransferType.add(lblTransferType);
+
+ pnlTransferStatus.add(pnlTransferType);
+
+ lblTransferFilesCounts.setText("Files: xxxxx / xxxxxxx");
+ pnlTransferFileCounts.add(lblTransferFilesCounts);
+
+ pnlTransferStatus.add(pnlTransferFileCounts);
+
+ lblTransferByteCounts.setText("Bytes (total): xxxxxx / xxxxxx");
+ pnlTransferByteCounts.add(lblTransferByteCounts);
+
+ pnlTransferStatus.add(pnlTransferByteCounts);
+
+ pnlTransferOverview.add(pnlTransferStatus, java.awt.BorderLayout.NORTH);
+
+ pnlTransferFileInfo.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.LEFT));
+
+ lblCurrentFileLabel.setText("Current File:");
+ pnlTransferFileInfo.add(lblCurrentFileLabel);
+ pnlTransferFileInfo.add(lblCurrentFile);
+
+ pnlTransferOverview.add(pnlTransferFileInfo, java.awt.BorderLayout.PAGE_END);
+
+ gridBagConstraints = new java.awt.GridBagConstraints();
+ gridBagConstraints.gridx = 0;
+ gridBagConstraints.gridy = 0;
+ gridBagConstraints.gridwidth = 35;
+ gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
+ gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
+ pnlIdropBottom.add(pnlTransferOverview, gridBagConstraints);
+
+ transferStatusProgressBar.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.LOWERED));
+ transferStatusProgressBar.setStringPainted(true);
+ gridBagConstraints = new java.awt.GridBagConstraints();
+ gridBagConstraints.gridx = 1;
+ gridBagConstraints.gridy = 1;
+ gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
+ gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
+ gridBagConstraints.weightx = 8.0;
+ pnlIdropBottom.add(transferStatusProgressBar, gridBagConstraints);
+
+ transferQueueToolbarPanel.setBorder(javax.swing.BorderFactory.createEtchedBorder());
+
+ idropProgressPanelToolbar.setRollover(true);
+
+ btnShowTransferManager.setText("Manage");
+ btnShowTransferManager.setToolTipText("Show a panel to manage transfers");
+ btnShowTransferManager.setFocusable(false);
+ btnShowTransferManager.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
+ btnShowTransferManager.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
+ btnShowTransferManager.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ btnShowTransferManagerActionPerformed(evt);
+ }
+ });
+ idropProgressPanelToolbar.add(btnShowTransferManager);
+
+ togglePauseTransfer.setText("Pause");
+ togglePauseTransfer.setToolTipText("Pause the current transfer");
+ togglePauseTransfer.setFocusable(false);
+ togglePauseTransfer.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
+ togglePauseTransfer.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
+ togglePauseTransfer.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ togglePauseTransferActionPerformed(evt);
+ }
+ });
+ idropProgressPanelToolbar.add(togglePauseTransfer);
+
+ transferQueueToolbarPanel.add(idropProgressPanelToolbar);
+
+ pnlIdropProgressIcon.add(progressIconImageLabel);
+
+ transferQueueToolbarPanel.add(pnlIdropProgressIcon);
+
+ gridBagConstraints = new java.awt.GridBagConstraints();
+ gridBagConstraints.gridx = 34;
+ gridBagConstraints.gridy = 1;
+ pnlIdropBottom.add(transferQueueToolbarPanel, gridBagConstraints);
+
getContentPane().add(pnlIdropBottom, java.awt.BorderLayout.SOUTH);
jMenuFile.setMnemonic('f');
@@ -1728,8 +1764,7 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
jMenuView.setMnemonic('V');
jMenuView.setText("View");
- jCheckBoxMenuItemShowSourceTree.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_L,
- java.awt.event.InputEvent.SHIFT_MASK));
+ jCheckBoxMenuItemShowSourceTree.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_L, java.awt.event.InputEvent.SHIFT_MASK));
jCheckBoxMenuItemShowSourceTree.setMnemonic('L');
jCheckBoxMenuItemShowSourceTree.setText("Show Local");
jCheckBoxMenuItemShowSourceTree.addActionListener(new java.awt.event.ActionListener() {
@@ -1739,8 +1774,7 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
});
jMenuView.add(jCheckBoxMenuItemShowSourceTree);
- jCheckBoxMenuItemShowIrodsInfo.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_L,
- java.awt.event.InputEvent.SHIFT_MASK));
+ jCheckBoxMenuItemShowIrodsInfo.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_L, java.awt.event.InputEvent.SHIFT_MASK));
jCheckBoxMenuItemShowIrodsInfo.setMnemonic('I');
jCheckBoxMenuItemShowIrodsInfo.setText("Show iRODS Info");
jCheckBoxMenuItemShowIrodsInfo.addActionListener(new java.awt.event.ActionListener() {
@@ -1750,12 +1784,6 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
});
jMenuView.add(jCheckBoxMenuItemShowIrodsInfo);
- jMenuItemPreferences.setMnemonic('p');
- jMenuItemPreferences.setText("Preferences");
- jMenuItemPreferences.setToolTipText("Show the preferences panel");
- jMenuItemPreferences.addActionListener(showPreferencesDialogActionListener);
- jMenuView.add(jMenuItemPreferences);
-
jMenuBar1.add(jMenuView);
setJMenuBar(jMenuBar1);
@@ -1763,6 +1791,29 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
pack();
}// </editor-fold>//GEN-END:initComponents
+ private void btnShowTransferManagerActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnShowTransferManagerActionPerformed
+
+ showQueueManagerDialog();
+ }//GEN-LAST:event_btnShowTransferManagerActionPerformed
+
+ /**
+ * Click of 'pause' toggle in iDrop client view
+ * @param evt
+ */
+ private void togglePauseTransferActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_togglePauseTransferActionPerformed
+
+ try {
+ if (togglePauseTransfer.isSelected()) {
+ log.info("pausing....");
+ iDropCore.getTransferManager().pause();
+ } else {
+ log.info("resuming queue");
+ iDropCore.getTransferManager().resume();
+ }
+ } catch (Exception ex) {
+ Logger.getLogger(iDrop.class.getName()).log(Level.SEVERE, null, ex);
+ }
+ }//GEN-LAST:event_togglePauseTransferActionPerformed
public ActionListener showPreferencesDialogActionListener = new ActionListener() {
private static final long serialVersionUID = 1L;
@@ -1770,9 +1821,7 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
public void actionPerformed(ActionEvent e) {
newPreferencesDialog.setVisible(true);
}
-
};
-
public ActionListener okButtonPreferencesDialogActionListener = new ActionListener() {
private static final long serialVersionUID = 1L;
@@ -1781,7 +1830,6 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
getiDropCore().getPreferences().putBoolean("showGUI", showGUICheckBox.isSelected() ? true : false);
newPreferencesDialog.setVisible(false);
}
-
};
private void formWindowClosed(java.awt.event.WindowEvent evt) {// GEN-FIRST:event_formWindowClosed
@@ -1789,6 +1837,10 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
this.formShown = false;
}// GEN-LAST:event_formWindowClosed
+ /**
+ * refresh the iRODS file system tree view
+ * @param evt
+ */
private void btnRefreshTargetTreeActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_btnRefreshTargetTreeActionPerformed
buildTargetTree();
}// GEN-LAST:event_btnRefreshTargetTreeActionPerformed
@@ -1899,7 +1951,7 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
*/
public void signalChangeInAccountSoCachedDataCanBeCleared() {
log.info("clearing any cached data associated with the account");
- userTagCloudView = null;
+
irodsTree = null;
lastCachedInfoItem = null;
}
@@ -1914,41 +1966,8 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
}// GEN-LAST:event_pnlTagViewMasterComponentShown
private void tabIrodsViewsStateChanged(javax.swing.event.ChangeEvent evt) {// GEN-FIRST:event_tabIrodsViewsStateChanged
-
- if (tabIrodsViews.isShowing()) {
- if (userTagCloudView == null) {
- refreshTagCloud(txtTagNameSearch.getText());
- }
- }
-
}// GEN-LAST:event_tabIrodsViewsStateChanged
- /**
- * rebuild the tag cloud list
- */
- private void refreshTagCloud(final String tagSearchText) {
- log.info("lazily loading user tag cloud for:{}", getIrodsAccount());
- try {
- // FIXME: depict data objects/collections? munge together? wha...
- UserTagCloudService userTagCloudService = UserTagCloudServiceImpl.instance(
- irodsFileSystem.getIRODSAccessObjectFactory(), getIrodsAccount());
- userTagCloudView = userTagCloudService
- .searchForTagsForDataObjectsAndCollectionsUsingSearchTermForTheLoggedInUser(tagSearchText);
- } catch (JargonException ex) {
- Logger.getLogger(iDrop.class.getName()).log(Level.SEVERE, null, ex);
- } finally {
- irodsFileSystem.closeAndEatExceptions(getIrodsAccount());
-
- }
- try {
- TagCloudListModel tagCloudListModel = new TagCloudListModel(userTagCloudView);
- listTagCloudList.setModel(tagCloudListModel);
- } catch (IdropException ex) {
- Logger.getLogger(iDrop.class.getName()).log(Level.SEVERE, null, ex);
- throw new IdropRuntimeException(ex);
- }
- }
-
private void txtMainSearchKeyPressed(java.awt.event.KeyEvent evt) {// GEN-FIRST:event_txtMainSearchKeyPressed
// enter key triggers search
@@ -1973,38 +1992,6 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
}
}
- /**
- * Process a selection in the tag cloud list
- *
- * @param evt
- */
- private void listTagCloudListValueChanged(javax.swing.event.ListSelectionEvent evt) {// GEN-FIRST:event_listTagCloudListValueChanged
- // value changed on list selection indicates that a tag search should be done
- if (evt.getValueIsAdjusting()) {
- return;
- }
-
- Object selectedModelAsObject = listTagCloudList.getSelectedValue();
-
- if (selectedModelAsObject == null) {
- return;
- }
-
- TagCloudListModel tagCloudListModel = (TagCloudListModel) listTagCloudList.getModel();
-
- TagCloudEntry entry = tagCloudListModel.getTagCloudEntry(listTagCloudList.getMinSelectionIndex());
-
- log.info("search for tag cloud entry based on list selection:{}", entry);
-
- searchTagsAndBuildResultEntries(entry.getIrodsTagValue().getTagData());
-
- }// GEN-LAST:event_listTagCloudListValueChanged
-
- private void btnRefreshTagCloudActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_btnRefreshTagCloudActionPerformed
- log.info("refreshing the tag cloud on user action using search text of:{}", txtTagNameSearch.getText());
- refreshTagCloud(txtTagNameSearch.getText());
- }// GEN-LAST:event_btnRefreshTagCloudActionPerformed
-
private void txtTagsKeyPressed(java.awt.event.KeyEvent evt) {// GEN-FIRST:event_txtTagsKeyPressed
// FIXME: cull this
@@ -2040,8 +2027,7 @@ 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));
+ replicationDialog.setLocation((int) (this.getLocation().getX() + replicationDialog.getWidth() / 2), (int) (this.getLocation().getY() + replicationDialog.getHeight() / 2));
replicationDialog.setVisible(true);
}// GEN-LAST:event_btnReplicationActionPerformed
@@ -2091,24 +2077,23 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
@Override
public void run() {
+ idropGui.setBusyCursor();
FreeTaggingService freeTaggingService;
try {
- freeTaggingService = FreeTaggingServiceImpl.instance(irodsFileSystem.getIRODSAccessObjectFactory(),
+ freeTaggingService = FreeTaggingServiceImpl.instance(getiDropCore().getIrodsFileSystem().getIRODSAccessObjectFactory(),
getIrodsAccount());
if (lastCachedInfoItem instanceof Collection) {
log.info("processing tags for collection");
Collection collection = (Collection) lastCachedItemToProcessTagsFor;
- IRODSTagGrouping irodsTagGrouping = new IRODSTagGrouping(MetadataDomain.COLLECTION, collection
- .getCollectionName(), txtTags.getText(), getIrodsAccount().getUserName());
+ IRODSTagGrouping irodsTagGrouping = new IRODSTagGrouping(MetadataDomain.COLLECTION, collection.getCollectionName(), txtTags.getText(), getIrodsAccount().getUserName());
log.debug("new tag set is:{}", txtTags.getText());
freeTaggingService.updateTags(irodsTagGrouping);
} else if (lastCachedInfoItem instanceof DataObject) {
log.info("processing tags for data object");
DataObject dataObject = (DataObject) lastCachedItemToProcessTagsFor;
- IRODSTagGrouping irodsTagGrouping = new IRODSTagGrouping(MetadataDomain.DATA, dataObject
- .getCollectionName() + "/" + dataObject.getDataName(), txtTags.getText(),
+ IRODSTagGrouping irodsTagGrouping = new IRODSTagGrouping(MetadataDomain.DATA, dataObject.getCollectionName() + "/" + dataObject.getDataName(), txtTags.getText(),
getIrodsAccount().getUserName());
log.debug("new tag set is:{}", txtTags.getText());
freeTaggingService.updateTags(irodsTagGrouping);
@@ -2120,15 +2105,17 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
idropGui.showMessageFromOperation("update of info successful");
} catch (JargonException ex) {
+ idropGui.showIdropException(ex);
Logger.getLogger(iDrop.class.getName()).log(Level.SEVERE, null, ex);
throw new IdropRuntimeException(ex);
} finally {
try {
- irodsFileSystem.close(getIrodsAccount());
+ getiDropCore().getIrodsFileSystem().close(getIrodsAccount());
} catch (JargonException ex) {
Logger.getLogger(iDrop.class.getName()).log(Level.SEVERE, null, ex);
// logged and ignored
}
+ idropGui.setNormalCursor();
}
}
});
@@ -2166,286 +2153,113 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
return;
}
+ //FIXME: reimplement
// select the path in the tree and show the hierarchy tab
- TreeUtils.expandAll(irodsTree, selPath, true);
- irodsTree.scrollPathToVisible(selPath);
+ // TreeUtils.expandAll(irodsTree, selPath, true);
+ // irodsTree.scrollPathToVisible(selPath);
tabIrodsViews.setSelectedComponent(pnlTabHierarchicalView);
}// GEN-LAST:event_menuItemShowInHierarchyActionPerformed
-
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton btnMoveToTrash;
-
private javax.swing.JButton btnRefreshLocalDrives;
-
- private javax.swing.JButton btnRefreshTagCloud;
-
private javax.swing.JButton btnRefreshTargetTree;
-
private javax.swing.JButton btnReplication;
-
+ private javax.swing.JButton btnShowTransferManager;
private javax.swing.JButton btnUpdateInfo;
-
private javax.swing.JButton btnViewMetadata;
-
private javax.swing.JButton btnearch;
-
private javax.swing.JComboBox comboSearchType;
-
private javax.swing.JPanel iDropToolbar;
-
+ private javax.swing.JToolBar idropProgressPanelToolbar;
private javax.swing.JCheckBoxMenuItem jCheckBoxMenuItemShowIrodsInfo;
-
private javax.swing.JCheckBoxMenuItem jCheckBoxMenuItemShowSourceTree;
-
private javax.swing.JMenuBar jMenuBar1;
-
private javax.swing.JMenu jMenuEdit;
-
private javax.swing.JMenu jMenuFile;
-
private javax.swing.JMenuItem jMenuItemExit;
-
- private javax.swing.JMenuItem jMenuItemPreferences;
-
private javax.swing.JMenu jMenuView;
-
private javax.swing.JSplitPane jSplitPanelLocalRemote;
-
private javax.swing.JLabel lblComment;
-
+ private javax.swing.JLabel lblCurrentFile;
+ private javax.swing.JLabel lblCurrentFileLabel;
private javax.swing.JLabel lblFileOrCollectionName;
-
private javax.swing.JLabel lblFileParent;
-
- private javax.swing.JLabel lblIdropMessage;
-
private javax.swing.JLabel lblInfoCreatedAt;
-
private javax.swing.JLabel lblInfoCreatedAtValue;
-
private javax.swing.JLabel lblInfoLength;
-
private javax.swing.JLabel lblInfoLengthValue;
-
private javax.swing.JLabel lblInfoUpdatedAt;
-
private javax.swing.JLabel lblInfoUpdatedAtValue;
-
private javax.swing.JLabel lblMainSearch;
-
- private javax.swing.JLabel lblSearchTags;
-
private javax.swing.JLabel lblTags;
-
+ private javax.swing.JLabel lblTransferByteCounts;
+ private javax.swing.JLabel lblTransferFilesCounts;
+ private javax.swing.JLabel lblTransferType;
+ private javax.swing.JLabel lblTransferTypeLabel;
private javax.swing.JList listLocalDrives;
-
- private javax.swing.JList listTagCloudList;
-
private javax.swing.JMenuItem menuItemShowInHierarchy;
-
private javax.swing.JPanel pnlDrivesFiller;
-
private javax.swing.JPanel pnlFileIconSizer;
-
private javax.swing.JPanel pnlFileNameAndIcon;
-
private javax.swing.JPanel pnlIdropBottom;
-
private javax.swing.JPanel pnlIdropMain;
-
+ private javax.swing.JPanel pnlIdropProgressIcon;
private javax.swing.JPanel pnlInfoButton;
-
- private javax.swing.JPanel pnlInfoButtonSizer;
-
private javax.swing.JPanel pnlInfoCollectionParent;
-
private javax.swing.JPanel pnlInfoComment;
-
- private javax.swing.JPanel pnlInfoCommentScrollSizer;
-
private javax.swing.JPanel pnlInfoDetails;
-
private javax.swing.JPanel pnlInfoIcon;
-
private javax.swing.JPanel pnlInfoTags;
-
- private javax.swing.JPanel pnlInfoTagsSizer;
-
private javax.swing.JPanel pnlIrodsArea;
-
private javax.swing.JPanel pnlIrodsDetailsToggleSizer;
-
private javax.swing.JPanel pnlIrodsInfo;
-
private javax.swing.JPanel pnlIrodsInfoInner;
-
private javax.swing.JPanel pnlIrodsTreeMaster;
-
private javax.swing.JPanel pnlIrodsTreeToolbar;
-
private javax.swing.JPanel pnlLocalRoots;
-
private javax.swing.JPanel pnlLocalToggleSizer;
-
private javax.swing.JPanel pnlLocalTreeArea;
-
private javax.swing.JPanel pnlRefreshButton;
-
- private javax.swing.JPanel pnlScrollParentPathSizer;
-
private javax.swing.JPanel pnlSearchSizer;
-
private javax.swing.JPanel pnlTabHierarchicalView;
-
private javax.swing.JPanel pnlTabSearch;
-
private javax.swing.JPanel pnlTabSearchResults;
-
private javax.swing.JPanel pnlTabSearchTop;
-
- private javax.swing.JPanel pnlTabTagView;
-
- private javax.swing.JPanel pnlTagListing;
-
- private javax.swing.JPanel pnlTagResultsInner;
-
- private javax.swing.JPanel pnlTagSearch;
-
- private javax.swing.JPanel pnlTagSearchSearchBox;
-
- private javax.swing.JPanel pnlTagViewMaster;
-
- private javax.swing.JPanel pnlTargetTree;
-
private javax.swing.JPanel pnlToolbarInfo;
-
private javax.swing.JPanel pnlToolbarSizer;
-
private javax.swing.JPanel pnlTopToolbarSearchArea;
-
+ private javax.swing.JPanel pnlTransferByteCounts;
+ private javax.swing.JPanel pnlTransferFileCounts;
+ private javax.swing.JPanel pnlTransferFileInfo;
+ private javax.swing.JPanel pnlTransferOverview;
+ private javax.swing.JPanel pnlTransferStatus;
+ private javax.swing.JPanel pnlTransferType;
+ private javax.swing.JLabel progressIconImageLabel;
private javax.swing.JScrollPane scrollComment;
-
- private javax.swing.JScrollPane scrollIrodsInfo;
-
private javax.swing.JScrollPane scrollIrodsTree;
-
private javax.swing.JScrollPane scrollLocalDrives;
-
private javax.swing.JScrollPane scrollLocalFileTree;
-
private javax.swing.JScrollPane scrollPaneSearchResults;
-
- private javax.swing.JScrollPane scrollPaneTagCloudList;
-
private javax.swing.JScrollPane scrollParentPath;
-
- private javax.swing.JScrollPane scrollTagResults;
-
protected javax.swing.JPopupMenu searchTablePopupMenu;
-
private javax.swing.JToolBar.Separator separator1;
-
private javax.swing.JToolBar.Separator separator2;
-
- private javax.swing.JSplitPane splitTagsAndTagResults;
-
private javax.swing.JSplitPane splitTargetCollections;
-
private javax.swing.JTabbedPane tabIrodsViews;
-
private javax.swing.JTable tableSearchResults;
-
private javax.swing.JToggleButton toggleIrodsDetails;
-
private javax.swing.JToggleButton toggleLocalFiles;
-
+ private javax.swing.JToggleButton togglePauseTransfer;
private javax.swing.JToolBar toolBarInfo;
-
+ private javax.swing.JPanel transferQueueToolbarPanel;
+ private javax.swing.JProgressBar transferStatusProgressBar;
private javax.swing.JTextArea txtComment;
-
private javax.swing.JTextField txtMainSearch;
-
private javax.swing.JTextArea txtParentPath;
-
- private javax.swing.JTextField txtTagNameSearch;
-
private javax.swing.JTextField txtTags;
-
+ private javax.swing.JLabel userNameLabel;
// End of variables declaration//GEN-END:variables
- /**
- * Process a tag search and build the tag result panels based on the given search text
- *
- * @param searchText
- */
- private void searchTagsAndBuildResultEntries(final String searchText) {
- if (searchText.isEmpty()) {
- this.showMessageFromOperation("please enter a tag to search on");
- return;
- }
-
- final String searchTerms = searchText.trim();
- final iDrop idropGui = this;
-
- java.awt.EventQueue.invokeLater(new Runnable() {
-
- @Override
- public void run() {
-
- try {
- idropGui.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
- FreeTaggingService freeTaggingService = FreeTaggingServiceImpl.instance(
- irodsFileSystem.getIRODSAccessObjectFactory(), getIrodsAccount());
- TagQuerySearchResult result = freeTaggingService.searchUsingFreeTagString(searchTerms);
- pnlTagResultsInner.removeAll();
- pnlTagResultsInner.validate();
- scrollTagResults.validate();
-
- ColorHelper colorHelper = new ColorHelper();
-
- log.info("doing tag query on {}, build panels based on result");
- // FIXME: this is a bit of a shim for duplicates, i need to look at findWhere() in jargon core to
- // determine whether a distinct option is needed, for now, filter
-
- String lastEntry = "";
- String thisEntry = "";
-
- for (CollectionAndDataObjectListingEntry collectionAndDataObjectListingEntry : result
- .getQueryResultEntries()) {
- if (collectionAndDataObjectListingEntry.getObjectType() == CollectionAndDataObjectListingEntry.ObjectType.COLLECTION) {
- thisEntry = collectionAndDataObjectListingEntry.getPathOrName();
- } else {
- thisEntry = collectionAndDataObjectListingEntry.getParentPath() + "/"
- + collectionAndDataObjectListingEntry.getPathOrName();
- }
-
- if (thisEntry.equals(lastEntry)) {
- continue;
- } else {
- lastEntry = thisEntry;
- }
-
- DefaultFileRepresentationPanel fileRepresentationPanel = new DefaultFileRepresentationPanel(
- collectionAndDataObjectListingEntry, idropGui, colorHelper.getNextColor());
-
- pnlTagResultsInner.add(fileRepresentationPanel);
- }
-
- pnlTagResultsInner.validate();
- scrollTagResults.validate();
- pnlTagResultsInner.repaint();
-
- } catch (Exception e) {
- idropGui.showIdropException(e);
- return;
- } finally {
- irodsFileSystem.closeAndEatExceptions(getIrodsAccount());
- idropGui.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
- }
- }
- });
- }
-
public Object getLastCachedInfoItem() {
return lastCachedInfoItem;
}
@@ -2466,19 +2280,17 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
try {
idropGui.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
- CollectionAndDataObjectListAndSearchAO collectionAndDataObjectListAndSearchAO = irodsFileSystem
- .getIRODSAccessObjectFactory().getCollectionAndDataObjectListAndSearchAO(
- iDropCore.getIrodsAccount());
+ CollectionAndDataObjectListAndSearchAO collectionAndDataObjectListAndSearchAO = iDropCore.getIRODSAccessObjectFactory().getCollectionAndDataObjectListAndSearchAO(
+ iDropCore.getIrodsAccount());
IRODSSearchTableModel irodsSearchTableModel = new IRODSSearchTableModel(
- collectionAndDataObjectListAndSearchAO
- .searchCollectionsAndDataObjectsBasedOnName(searchTerms));
+ collectionAndDataObjectListAndSearchAO.searchCollectionsAndDataObjectsBasedOnName(searchTerms));
tableSearchResults.setModel(irodsSearchTableModel);
tabIrodsViews.setSelectedComponent(pnlTabSearch);
} catch (Exception e) {
idropGui.showIdropException(e);
return;
} finally {
- irodsFileSystem.closeAndEatExceptions(getIrodsAccount());
+ iDropCore.closeAllIRODSConnections();
idropGui.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
}
}
@@ -2502,17 +2314,16 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
try {
idropGui.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
FreeTaggingService freeTaggingService = FreeTaggingServiceImpl.instance(
- irodsFileSystem.getIRODSAccessObjectFactory(), getIrodsAccount());
+ iDropCore.getIRODSAccessObjectFactory(), getIrodsAccount());
TagQuerySearchResult result = freeTaggingService.searchUsingFreeTagString(searchTerms);
- IRODSSearchTableModel irodsSearchTableModel = new IRODSSearchTableModel(result
- .getQueryResultEntries());
+ IRODSSearchTableModel irodsSearchTableModel = new IRODSSearchTableModel(result.getQueryResultEntries());
tableSearchResults.setModel(irodsSearchTableModel);
tabIrodsViews.setSelectedComponent(pnlTabSearch);
} catch (Exception e) {
idropGui.showIdropException(e);
return;
} finally {
- irodsFileSystem.closeAndEatExceptions(getIrodsAccount());
+ iDropCore.closeIRODSConnectionForLoggedInAccount();
idropGui.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
}
}
@@ -2521,10 +2332,12 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
class PopupListener extends MouseAdapter {
+ @Override
public void mousePressed(MouseEvent e) {
showPopup(e);
}
+ @Override
public void mouseReleased(MouseEvent e) {
showPopup(e);
}
@@ -2546,4 +2359,19 @@ public class iDrop extends javax.swing.JFrame implements ActionListener, ItemLis
this.iDropCore = iDropCore;
}
+ public void setBusyCursor() {
+ this.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
+ }
+
+ public void setNormalCursor() {
+ this.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
+ }
+
+ public LocalFileTree getFileTree() {
+ return fileTree;
+ }
+
+ public void setFileTree(LocalFileTree fileTree) {
+ this.fileTree = fileTree;
+ }
}
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/services/IRODSClientDelegate.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/services/IRODSClientDelegate.java
deleted file mode 100644
index 2c7a8fe..0000000
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/services/IRODSClientDelegate.java
+++ /dev/null
@@ -1,85 +0,0 @@
-package org.irods.jargon.idrop.desktop.systraygui.services;
-
-import java.util.logging.Level;
-import java.util.logging.Logger;
-import org.irods.jargon.core.connection.IRODSAccount;
-import org.irods.jargon.core.exception.JargonException;
-import org.irods.jargon.core.pub.IRODSFileSystem;
-import org.irods.jargon.idrop.exceptions.IdropException;
-import org.slf4j.LoggerFactory;
-
-/**
- * Client delegate that talks to iRODS services
- * (This is a refactoring to optimize connection usage)
- * @author Mike Conway - DICE (www.irods.org)
- */
-public class IRODSClientDelegate {
-
- private IRODSFileSystem irodsFileSystem = null;
- private final IRODSAccount irodsAccount;
-
- public static org.slf4j.Logger log = LoggerFactory.getLogger(IRODSClientDelegate.class);
-
- /**
- * Create an instance of a client delegate. This delegate will maintain a connection so that
- * multiple services may be invoked. A disconnect() call will close any open connection.
- * @param irodsAccount <code>IRODSAccount</code>
- * @throws IdropException
- */
- public IRODSClientDelegate(final IRODSAccount irodsAccount) throws IdropException {
- if (irodsAccount == null) {
- throw new IdropException("irodsAccount is null");
- }
-
- this.irodsAccount = irodsAccount;
-
- }
-
- /**
- * Connect to iRODS to process a series of requests. The connection is retained until disconnect() is closed.
- * @throws IdropException
- */
- public void connect() throws IdropException {
-
- if (irodsFileSystem != null) {
- log.debug("already have an iRODS file system, proceed");
- return;
- }
-
- try {
- irodsFileSystem = IRODSFileSystem.instance();
- } catch (JargonException ex) {
- Logger.getLogger(IRODSClientDelegate.class.getName()).log(Level.SEVERE, null, ex);
- throw new IdropException("error connecting to iRODS");
- }
- }
-
- /**
- * Disconnect from iRODS. This method is called after the service is no longer needed.
- * @throws IdropException
- */
- public void disconnect() throws IdropException {
-
- log.info("disconnecting...");
-
- if (irodsFileSystem == null) {
- log.info("no irodsFileSystem, will just ignore");
- return;
- }
- try {
- irodsFileSystem.close(irodsAccount);
- irodsFileSystem = null;
- log.info("disconnected, irodsFileSystem is set to null");
- } catch (JargonException ex) {
- Logger.getLogger(IRODSClientDelegate.class.getName()).log(Level.SEVERE, null, ex);
- throw new IdropException("error disconnecting from iRODS", ex);
- }
-
-
-
- }
-
-
-
-
-}
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/services/IdropConfigurationService.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/services/IdropConfigurationService.java
new file mode 100644
index 0000000..2ad2f83
--- /dev/null
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/services/IdropConfigurationService.java
@@ -0,0 +1,25 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package org.irods.jargon.idrop.desktop.systraygui.services;
+
+import java.util.Properties;
+import org.irods.jargon.idrop.exceptions.IdropException;
+
+/**
+ *
+ * @author mikeconway
+ */
+public interface IdropConfigurationService {
+ String IDROP_PROPS_FILE_NAME = "idrop.properties";
+
+ Properties bootstrapConfiguration() throws IdropException;
+
+ /**
+ * Save the database configuration information to a properties file
+ * @throws IdropException
+ */
+ void saveConfigurationToPropertiesFile() throws IdropException;
+
+}
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/services/IdropConfigurationServiceImpl.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/services/IdropConfigurationServiceImpl.java
new file mode 100644
index 0000000..a08ebc7
--- /dev/null
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/services/IdropConfigurationServiceImpl.java
@@ -0,0 +1,150 @@
+package org.irods.jargon.idrop.desktop.systraygui.services;
+
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.sql.SQLException;
+import java.util.Properties;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import org.irods.jargon.idrop.desktop.systraygui.utils.IdropPropertiesHelper;
+import org.irods.jargon.idrop.exceptions.IdropAlreadyRunningException;
+import org.irods.jargon.idrop.exceptions.IdropException;
+import org.irods.jargon.transfer.TransferEngineException;
+import org.irods.jargon.transfer.TransferServiceFactoryImpl;
+import org.irods.jargon.transfer.engine.ConfigurationService;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Manage configuration information. This service will initialize and manage configuration information from iDrop
+ * @author Mike Conway - DICE (www.irods.org)
+ */
+public class IdropConfigurationServiceImpl implements IdropConfigurationService {
+
+ private final String idropConfigRootDirectoryAbsolutePath;
+ private final ConfigurationService configurationService;
+ private static final org.slf4j.Logger log = LoggerFactory.getLogger(IdropConfigurationServiceImpl.class);
+
+ public IdropConfigurationServiceImpl(final String idropConfigRootDirectoryAbsolutePath) throws IdropAlreadyRunningException, IdropException {
+
+ if (idropConfigRootDirectoryAbsolutePath == null) {
+ throw new IllegalArgumentException("idropConfigRootDirectoryAbsolutePath is null");
+ }
+
+ log.info("getting config service via factory");
+ try {
+ TransferServiceFactoryImpl transferServiceFactory = new TransferServiceFactoryImpl();
+ this.idropConfigRootDirectoryAbsolutePath = idropConfigRootDirectoryAbsolutePath;
+ this.configurationService = transferServiceFactory.instanceConfigurationService();
+
+ } catch (Exception ex) {
+ Logger.getLogger(IdropConfigurationServiceImpl.class.getName()).log(Level.SEVERE, null, ex);
+
+ if (ex.getMessage().indexOf("Failed to start database") != -1) {
+ throw new IdropAlreadyRunningException("iDrop is already running");
+ } else {
+ throw new IdropException(ex);
+ }
+ }
+ }
+
+ @Override
+ public Properties bootstrapConfiguration() throws IdropException {
+ log.info("bootstrapConfiguratiion()\nlooking for properties in database");
+ Properties databaseProperties;
+ try {
+ databaseProperties = configurationService.exportProperties();
+
+ } catch (Exception ex) {
+ Logger.getLogger(IdropConfigurationServiceImpl.class.getName()).log(Level.SEVERE, null, ex);
+ if (ex.getMessage().indexOf("Could not open Hibernate Session") != -1) {
+ throw new IdropAlreadyRunningException("iDrop is already running, or the iDrop database is in use");
+ } else {
+ throw new IdropException(ex);
+ }
+
+ }
+ log.debug("properties from database:{}", databaseProperties);
+
+ if (databaseProperties.isEmpty()) {
+ log.info("no properties found in database, attempt to import from idrop.properties in .idrop home dir");
+ databaseProperties = importPropertiesFromPropertiesFile();
+ }
+
+ if (databaseProperties.isEmpty()) {
+ log.info("no properties found in properties file in home directory, attempt to import default idrop.properties from classpath properties");
+ databaseProperties = importPropertiesFromDefaultFile();
+ }
+
+ log.info("now storing derived properties in idrop configuration");
+ saveConfigurationToPropertiesFile();
+ return databaseProperties;
+
+ }
+
+ /**
+ * Save the database configuration information to a properties file
+ * @throws IdropException
+ */
+ @Override
+ public void saveConfigurationToPropertiesFile() throws IdropException {
+ log.info("saveConfigurationToPropertiesFile()");
+ StringBuilder sb = new StringBuilder(idropConfigRootDirectoryAbsolutePath);
+ sb.append("/");
+ sb.append(IDROP_PROPS_FILE_NAME);
+
+ try {
+ Properties databaseProperties = configurationService.exportProperties();
+ databaseProperties.store(new FileOutputStream(sb.toString()), null);
+ } catch (TransferEngineException ex) {
+ Logger.getLogger(IdropConfigurationServiceImpl.class.getName()).log(Level.SEVERE, null, ex);
+ throw new IdropException("exception exporting final properties", ex);
+ } catch (IOException ioe) {
+ Logger.getLogger(IdropConfigurationServiceImpl.class.getName()).log(Level.SEVERE, null, ioe);
+ throw new IdropException("exception storing final properties in file", ioe);
+ }
+ }
+
+ /**
+ * In cases where there are no database properties, attempt to import them from a file in the .idrop directory
+ * @return
+ * @throws IdropException
+ */
+ private Properties importPropertiesFromPropertiesFile() throws IdropException {
+ log.info("importPropertiesFromPropertiesFile()");
+ StringBuilder sb = new StringBuilder(idropConfigRootDirectoryAbsolutePath);
+ sb.append("/");
+ sb.append(IDROP_PROPS_FILE_NAME);
+ Properties properties = new Properties();
+ try {
+ properties.load(new FileInputStream(sb.toString()));
+ importGivenPropertiesIntoDatabase(properties);
+ } catch (IOException ex) {
+ log.warn("idrop properties not found");
+ }
+
+ return properties;
+
+ }
+
+ private void importGivenPropertiesIntoDatabase(Properties properties) throws IdropException {
+ if (!properties.isEmpty()) {
+ log.info("some properties were located, importing into the database");
+ log.debug("props from file:{}", properties);
+ try {
+ configurationService.importProperties(properties);
+ } catch (TransferEngineException ex) {
+ Logger.getLogger(IdropConfigurationServiceImpl.class.getName()).log(Level.SEVERE, null, ex);
+ throw new IdropException("unable to import properties into database", ex);
+ }
+ }
+ }
+
+ private Properties importPropertiesFromDefaultFile() throws IdropException {
+ log.info("importPropertiesFromDefaultFile()");
+ IdropPropertiesHelper idropPropertiesHelper = new IdropPropertiesHelper();
+ Properties properties = idropPropertiesHelper.loadIdropProperties();
+ importGivenPropertiesIntoDatabase(properties);
+ return properties;
+ }
+}
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/services/RuleExecutionWorker.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/services/RuleExecutionWorker.java
index aa826b0..512964f 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
@@ -50,7 +50,7 @@ public final class RuleExecutionWorker extends SwingWorker {
@Override
protected Object doInBackground() throws Exception {
log.info("initiating rule execution");
- IRODSFileService irodsFileService = new IRODSFileService(irodsAccount, idropGui.getIrodsFileSystem());
+ IRODSFileService irodsFileService = new IRODSFileService(irodsAccount, idropGui.getiDropCore().getIrodsFileSystem());
execResult = irodsFileService.runIRODSRule(RuleLibrary.collectionRule(irodsTargetAbsolutePath));
return execResult;
}
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 986139b..bf113b7 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
@@ -1,10 +1,7 @@
package org.irods.jargon.idrop.desktop.systraygui.utils;
import java.awt.Image;
-import java.awt.image.BufferedImage;
-import java.io.File;
import java.net.URL;
-import javax.imageio.ImageIO;
import javax.swing.ImageIcon;
import javax.swing.JLabel;
import org.irods.jargon.idrop.desktop.systraygui.iDrop;
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/utils/IdropConfig.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/utils/IdropConfig.java
index b3c2e00..a5eb2c9 100644
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/utils/IdropConfig.java
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/utils/IdropConfig.java
@@ -5,7 +5,6 @@ import java.util.Properties;
import org.apache.log4j.Level;
import org.apache.log4j.PatternLayout;
import org.apache.log4j.RollingFileAppender;
-import org.irods.jargon.idrop.exceptions.IdropException;
/**
* Access data about the configuration of Idrop
@@ -20,9 +19,15 @@ public class IdropConfig {
return idropProperties;
}
- public IdropConfig() throws IdropException {
- IdropPropertiesHelper idropPropertiesHelper = new IdropPropertiesHelper();
- this.idropProperties = idropPropertiesHelper.loadIdropProperties();
+ /**
+ * Initialize this wrapper around properties with the <code>Properties</code> that represent the idrop configuration.
+ * @param properties
+ */
+ public IdropConfig(final Properties properties) {
+ if (properties == null) {
+ throw new IllegalArgumentException("null properties");
+ }
+ this.idropProperties = properties;
}
/**
@@ -101,6 +106,15 @@ public class IdropConfig {
return logSuccessful;
}
+
+ /**
+ * Get the configured synch device name. If not set, this will return a <code>null</code>
+ * @return
+ */
+ public String getSynchDeviceName() {
+ return idropProperties
+ .getProperty(IdropPropertiesHelper.SYNCH_DEVICE_NAME);
+ }
/**
* Should I have a rolling log in the user dir? Will return null of no logging desired, otherwise, will return a log
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/utils/IdropPropertiesHelper.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/utils/IdropPropertiesHelper.java
index a534ea1..e59e1e8 100644
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/utils/IdropPropertiesHelper.java
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/utils/IdropPropertiesHelper.java
@@ -4,7 +4,6 @@ import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;
import org.irods.jargon.idrop.exceptions.IdropException;
-import org.irods.jargon.testutils.TestingUtilsException;
/**
* Help accessing iDrop configuration properties
@@ -22,6 +21,7 @@ public class IdropPropertiesHelper {
public static final String ADVANCED_VIEW_PROPERTY = "advanced.view";
public static final String TRANSFER_DATABASE_NAME = "transfer.database";
public static final String ROLLING_LOG_LEVEL = "rolling.log.level";
+ public static final String SYNCH_DEVICE_NAME = "synch.device.name";
/**
* Load the default iDrop poperties file
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/utils/TreeUtils.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/utils/TreeUtils.java
index 7111899..37d0c76 100644
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/utils/TreeUtils.java
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/utils/TreeUtils.java
@@ -1,7 +1,9 @@
package org.irods.jargon.idrop.desktop.systraygui.utils;
import java.io.File;
+import java.util.ArrayList;
import java.util.Enumeration;
+import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JTree;
@@ -10,7 +12,11 @@ import javax.swing.tree.TreePath;
import org.irods.jargon.core.query.CollectionAndDataObjectListingEntry;
import org.irods.jargon.idrop.desktop.systraygui.viscomponents.IRODSFileSystemModel;
import org.irods.jargon.idrop.desktop.systraygui.viscomponents.IRODSNode;
+import org.irods.jargon.idrop.desktop.systraygui.viscomponents.IRODSOutlineModel;
+import org.irods.jargon.idrop.desktop.systraygui.viscomponents.LocalFileNode;
+import org.irods.jargon.idrop.desktop.systraygui.viscomponents.LocalFileSystemModel;
import org.irods.jargon.idrop.exceptions.IdropException;
+import org.netbeans.swing.outline.Outline;
import org.slf4j.LoggerFactory;
/**
@@ -64,6 +70,94 @@ public class TreeUtils {
return foundNode;
}
+ public static LocalFileNode findChild(LocalFileNode parent, String userObject) throws IdropException {
+ log.debug("finding child of parent:{}", parent);
+ log.debug("user object:{}", userObject);
+ String childString = "";
+
+ // FIXME: children of archive1 is null, child count is empty so it does not look for nodes
+
+ File parentEntry = (File) parent.getUserObject();
+ File childEntry = null;
+
+ LocalFileNode foundNode = null;
+
+ parent.lazyLoadOfChildrenOfThisNode();
+
+ for (int i = 0; i < parent.getChildCount(); i++) {
+ childEntry = (File) ((LocalFileNode) parent.getChildAt(i)).getUserObject();
+
+ if (childEntry.isDirectory()) {
+ log.debug("child entry is a collection");
+ if (userObject.equals(childEntry.getAbsolutePath())) {
+ foundNode = (LocalFileNode) parent.getChildAt(i);
+ break;
+ }
+ } else {
+ log.debug("child entry is a data object");
+
+ log.debug("looking for match when child entry is a file with abs path:{}", childEntry.getAbsolutePath());
+ if (userObject.equals(childEntry.getAbsolutePath())) {
+ foundNode = (LocalFileNode) parent.getChildAt(i);
+ break;
+ }
+ }
+ }
+ return foundNode;
+ }
+
+ public static TreePath buildTreePathForLocalAbsolutePath(final JTree tree, final String absolutePath) throws IdropException {
+ LocalFileSystemModel fileSystemModel = (LocalFileSystemModel) tree.getModel();
+ LocalFileNode localNode = (LocalFileNode) fileSystemModel.getRoot();
+ TreePath calculatedTreePath = new TreePath(localNode);
+ File rootEntry = (File) localNode.getUserObject();
+ String[] pathComponents = absolutePath.split("/");
+
+ StringBuilder searchRoot = new StringBuilder();
+ LocalFileNode currentNode = (LocalFileNode) fileSystemModel.getRoot();
+ File entry = (File) currentNode.getUserObject();
+ searchRoot.append(entry.getName());
+ if (searchRoot.length() == 0) {
+ searchRoot.append("/");
+ }
+
+ String nextPathComponent;
+
+
+ for (int i = 0; i < pathComponents.length; i++) {
+ // next element from userObjects is the child of the current node, note that for the first node (typically '/') a delimiting slash is not needed
+ if (searchRoot.length() > 1) {
+ searchRoot.append('/');
+ }
+
+ nextPathComponent = pathComponents[i];
+ searchRoot.append(nextPathComponent);
+ if (i > 0) {
+ currentNode =
+ findChild(currentNode, searchRoot.toString());
+ }
+
+ if (currentNode == null) {
+ log.warn("cannot find node for path, will attempt to return parent {}:", searchRoot.toString());
+ break;
+ } else {
+ // root node is already part of the calculcated tree path
+ if (currentNode.getUserObject().toString().equals("/")) {
+ // ignore this node
+ } else {
+ calculatedTreePath = calculatedTreePath.pathByAddingChild(currentNode);
+ }
+ }
+ }
+ if (calculatedTreePath == null) {
+ throw new IdropException("cannot find path to node:" + absolutePath);
+ }
+ return calculatedTreePath;
+
+ }
+
+
+
/**
* Given an absolute path to a file from the iRODS view, build the corresponding <code>TreePath</code> that points to the position
* in the tree model.
@@ -105,7 +199,6 @@ public class TreeUtils {
int relativePathStartsAfter = irodsRootNodePathComponents.length - 1;
String nextPathComponent;
-
for (int i = (relativePathStartsAfter + 1); i < irodsPathComponents.length; i++) {
// next element from userObjects is the child of the current node, note that for the first node (typically '/') a delimiting slash is not needed
if (searchRoot.length() > 1) {
@@ -120,7 +213,8 @@ public class TreeUtils {
}
if (currentNode == null) {
- throw new IdropException("cannot find node for path:" + searchRoot.toString());
+ log.warn("cannot find node for path, will attempt to return parent {}:", searchRoot.toString());
+ break;
} else {
// root node is already part of the calculcated tree path
if (currentNode.getUserObject().toString().equals("/")) {
@@ -130,7 +224,73 @@ public class TreeUtils {
}
}
}
+ if (calculatedTreePath == null) {
+ throw new IdropException("cannot find path to node:" + irodsAbsolutePath);
+ }
+ return calculatedTreePath;
+ }
+
+ public static TreePath buildTreePathForIrodsAbsolutePath(final Outline tree, final String irodsAbsolutePath) throws IdropException {
+
+ IRODSOutlineModel irodsFileSystemModel = (IRODSOutlineModel) tree.getModel();
+ // the root of the model, which may not be a path underneath the root of the irods resource
+ IRODSNode rootNode = (IRODSNode) irodsFileSystemModel.getRoot();
+ TreePath calculatedTreePath = new TreePath(rootNode);
+ CollectionAndDataObjectListingEntry rootEntry = (CollectionAndDataObjectListingEntry) rootNode.getUserObject();
+ String[] irodsPathComponents = irodsAbsolutePath.split("/");
+
+ /* get an array that has the path components that descend from the root of the iRODS file system to
+ * the subdirectory which the tree model considers the root of the tree
+ */
+ String[] irodsRootNodePathComponents = rootEntry.getPathOrName().split("/");
+
+ /* determine the relative calculatedTreePath of the given iRODS file underneath the root. There are cases where
+ * the root is not '/'.
+ */
+
+ StringBuilder searchRoot = new StringBuilder();
+ IRODSNode currentNode = (IRODSNode) irodsFileSystemModel.getRoot();
+ CollectionAndDataObjectListingEntry entry = (CollectionAndDataObjectListingEntry) currentNode.getUserObject();
+ searchRoot.append(entry.getPathOrName());
+
+ /* calculatedTreePath now holds the path from the root of iRODS to the root of the tree, now accumulate any
+ * TreePath entries that represent the path below the root of the tree contained in the
+ * absolute path. The relative path starts at the path component in the position after
+ * the length of the root path.
+ */
+
+ int relativePathStartsAfter = irodsRootNodePathComponents.length - 1;
+ String nextPathComponent;
+
+ for (int i = (relativePathStartsAfter + 1); i < irodsPathComponents.length; i++) {
+ // next element from userObjects is the child of the current node, note that for the first node (typically '/') a delimiting slash is not needed
+ if (searchRoot.length() > 1) {
+ searchRoot.append('/');
+ }
+
+ nextPathComponent = irodsPathComponents[i];
+ searchRoot.append(nextPathComponent);
+ if (i > 0) {
+ currentNode =
+ findChild(currentNode, searchRoot.toString());
+ }
+
+ if (currentNode == null) {
+ log.warn("cannot find node for path, will attempt to return parent {}:", searchRoot.toString());
+ break;
+ } else {
+ // root node is already part of the calculcated tree path
+ if (currentNode.getUserObject().toString().equals("/")) {
+ // ignore this node
+ } else {
+ calculatedTreePath = calculatedTreePath.pathByAddingChild(currentNode);
+ }
+ }
+ }
+ if (calculatedTreePath == null) {
+ throw new IdropException("cannot find path to node:" + irodsAbsolutePath);
+ }
return calculatedTreePath;
}
@@ -152,4 +312,76 @@ public class TreeUtils {
tree.collapsePath(parent);
}
}
+
+ /**
+ * Given a tree node, get the nodes that are in the given expansion state as a list of TreePath
+ * @param tree <code>JTree</code> that will be inspected
+ * @param expanded <code>boolean</code> that indicates the desired state that will be preserved in the tree paths
+ * @return <code>TreePath[]</code> with the list of paths in the given state
+ */
+ public static TreePath[] getPaths(JTree tree, boolean expanded) {
+ TreeNode root = (TreeNode) tree.getModel().getRoot();
+
+ // Create array to hold the treepaths
+ List list = new ArrayList();
+
+ // Traverse tree from root adding treepaths for all nodes to list
+ getPaths(tree, new TreePath(root), expanded, list);
+
+ // Convert list to array
+ return (TreePath[]) list.toArray(new TreePath[list.size()]);
+ }
+
+ public static TreePath[] getPaths(Outline tree, boolean expanded) {
+ TreeNode root = (TreeNode) tree.getOutlineModel().getRoot();
+
+ // Create array to hold the treepaths
+ List list = new ArrayList();
+
+ // Traverse tree from root adding treepaths for all nodes to list
+ getPaths(tree, new TreePath(root), expanded, list);
+
+ // Convert list to array
+ return (TreePath[]) list.toArray(new TreePath[list.size()]);
+ }
+
+ private static void getPaths(JTree tree, TreePath parent, boolean expanded, List list) {
+ // Return if node is not expanded
+ if (expanded && !tree.isVisible(parent)) {
+ return;
+ }
+
+ // Add node to list
+ list.add(parent);
+
+ // Create paths for all children
+ TreeNode node = (TreeNode) parent.getLastPathComponent();
+ if (node.getChildCount() >= 0) {
+ for (Enumeration e = node.children(); e.hasMoreElements();) {
+ TreeNode n = (TreeNode) e.nextElement();
+ TreePath path = parent.pathByAddingChild(n);
+ getPaths(tree, path, expanded, list);
+ }
+ }
+ }
+
+ private static void getPaths(Outline tree, TreePath parent, boolean expanded, List list) {
+ // Return if node is not expanded
+ if (expanded && !tree.isVisible(parent)) {
+ return;
+ }
+
+ // Add node to list
+ list.add(parent);
+
+ // Create paths for all children
+ TreeNode node = (TreeNode) parent.getLastPathComponent();
+ if (node.getChildCount() >= 0) {
+ for (Enumeration e = node.children(); e.hasMoreElements();) {
+ TreeNode n = (TreeNode) e.nextElement();
+ TreePath path = parent.pathByAddingChild(n);
+ getPaths(tree, path, expanded, list);
+ }
+ }
+ }
}
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
new file mode 100644
index 0000000..8cff4b5
--- /dev/null
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/utils/iDropUtils.java
@@ -0,0 +1,36 @@
+
+package org.irods.jargon.idrop.desktop.systraygui.utils;
+
+/**
+ * Misc iDrop utilities
+ * @author Mike Conway - DICE (www.irods.org)
+ */
+public class iDropUtils {
+
+
+ /**
+ * Given a file name, return the name up to 100 chars, otherwise, redact and abbreviate
+ * @param fileName
+ * @return
+ */
+ public static final String abbreviateFileName(final String fileName) {
+
+ if (fileName == null) {
+ throw new IllegalArgumentException("null fileName");
+ }
+
+ StringBuilder sb = new StringBuilder();
+ if(fileName.length() < 100) {
+ sb.append(fileName);
+ } else {
+ // gt 100 bytes, redact
+ sb.append(fileName.substring(0, 50));
+ sb.append(" ... ");
+ sb.append(fileName.substring(fileName.length() - 50));
+ }
+
+ return sb.toString();
+
+ }
+
+}
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/DefaultFileRepresentationPanel.form b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/DefaultFileRepresentationPanel.form
deleted file mode 100644
index d35702b..0000000
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/DefaultFileRepresentationPanel.form
+++ /dev/null
@@ -1,135 +0,0 @@
-<?xml version="1.1" encoding="UTF-8" ?>
-
-<Form version="1.3" maxVersion="1.7" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
- <Properties>
- <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
- <Color blue="ff" green="ff" red="ff" type="rgb"/>
- </Property>
- <Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
- <Border info="org.netbeans.modules.form.compat2.border.LineBorderInfo">
- <LineBorder/>
- </Border>
- </Property>
- <Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
- <Dimension value="[2147483647, 80]"/>
- </Property>
- <Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
- <Dimension value="[482, 80]"/>
- </Property>
- </Properties>
- <Events>
- <EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="formMouseClicked"/>
- </Events>
- <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"/>
- <AuxValue name="designerSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,1,44,0,0,1,-112"/>
- </AuxValues>
-
- <Layout class="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout"/>
- <SubComponents>
- <Container class="javax.swing.JPanel" name="pnlIcon">
- <Properties>
- <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
- <Color blue="ff" green="ff" red="ff" type="rgb"/>
- </Property>
- <Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
- <Dimension value="[32, 32]"/>
- </Property>
- </Properties>
- <Constraints>
- <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
- <BorderConstraints direction="West"/>
- </Constraint>
- </Constraints>
-
- <Layout class="org.netbeans.modules.form.compat2.layouts.DesignGridLayout">
- <Property name="columns" type="int" value="1"/>
- <Property name="rows" type="int" value="0"/>
- </Layout>
- </Container>
- <Container class="javax.swing.JPanel" name="pnlFileDetails">
- <Properties>
- <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
- <Color blue="ff" green="ff" red="ff" type="rgb"/>
- </Property>
- </Properties>
- <Constraints>
- <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
- <BorderConstraints direction="Center"/>
- </Constraint>
- </Constraints>
-
- <Layout class="org.netbeans.modules.form.compat2.layouts.DesignGridLayout">
- <Property name="columns" type="int" value="1"/>
- <Property name="rows" type="int" value="0"/>
- </Layout>
- <SubComponents>
- <Component class="javax.swing.JLabel" name="lblFileOrCollectionName">
- <Properties>
- <Property name="text" type="java.lang.String" value="file or collection name here"/>
- </Properties>
- </Component>
- </SubComponents>
- </Container>
- <Container class="javax.swing.JPanel" name="pnlShowInHierarchy">
- <Properties>
- <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
- <Color blue="ff" green="ff" red="ff" type="rgb"/>
- </Property>
- <Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
- <Dimension value="[30, 30]"/>
- </Property>
- </Properties>
- <Constraints>
- <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout" value="org.netbeans.modules.form.compat2.layouts.DesignBorderLayout$BorderConstraintsDescription">
- <BorderConstraints direction="East"/>
- </Constraint>
- </Constraints>
-
- <Layout>
- <DimensionLayout dim="0">
- <Group type="103" groupAlignment="0" attributes="0">
- <EmptySpace min="0" pref="30" max="32767" attributes="0"/>
- <Group type="103" rootIndex="1" groupAlignment="0" attributes="0">
- <Group type="102" attributes="0">
- <EmptySpace min="0" pref="0" max="32767" attributes="0"/>
- <Component id="btnShowInHierarchy" min="-2" max="-2" attributes="0"/>
- <EmptySpace min="0" pref="0" max="32767" attributes="0"/>
- </Group>
- </Group>
- </Group>
- </DimensionLayout>
- <DimensionLayout dim="1">
- <Group type="103" groupAlignment="0" attributes="0">
- <EmptySpace min="0" pref="298" max="32767" attributes="0"/>
- <Group type="103" rootIndex="1" groupAlignment="0" attributes="0">
- <Group type="102" attributes="0">
- <EmptySpace min="0" pref="135" max="32767" attributes="0"/>
- <Component id="btnShowInHierarchy" min="-2" max="-2" attributes="0"/>
- <EmptySpace min="0" pref="135" max="32767" attributes="0"/>
- </Group>
- </Group>
- </Group>
- </DimensionLayout>
- </Layout>
- <SubComponents>
- <Component class="javax.swing.JButton" name="btnShowInHierarchy">
- <Properties>
- <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
- <Image iconType="3" name="/org/irods/jargon/idrop/desktop/systraygui/images/show-in-hierarchy.png"/>
- </Property>
- <Property name="toolTipText" type="java.lang.String" value="Show this file or collection in the hierarchy view"/>
- </Properties>
- </Component>
- </SubComponents>
- </Container>
- </SubComponents>
-</Form>
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/DefaultFileRepresentationPanel.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/DefaultFileRepresentationPanel.java
deleted file mode 100644
index a8d8bfa..0000000
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/DefaultFileRepresentationPanel.java
+++ /dev/null
@@ -1,600 +0,0 @@
-
-/*
- * DefaultFileRepresentationPanel.java
- *
- * Created on Nov 12, 2010, 1:06:41 PM
- */
-package org.irods.jargon.idrop.desktop.systraygui.viscomponents;
-
-import java.awt.Color;
-import java.awt.datatransfer.DataFlavor;
-import java.awt.datatransfer.Transferable;
-import java.awt.datatransfer.UnsupportedFlavorException;
-import java.awt.dnd.DragSourceDragEvent;
-import java.awt.dnd.DragSourceMotionListener;
-import java.awt.event.MouseAdapter;
-import java.awt.event.MouseEvent;
-import java.awt.event.MouseListener;
-import java.io.File;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-import javax.swing.JComponent;
-import javax.swing.JOptionPane;
-import javax.swing.TransferHandler;
-import javax.swing.tree.TreePath;
-import javax.swing.tree.TreeSelectionModel;
-import org.irods.jargon.core.exception.JargonException;
-import org.irods.jargon.core.query.CollectionAndDataObjectListingEntry;
-import org.irods.jargon.idrop.desktop.systraygui.iDrop;
-import org.irods.jargon.idrop.desktop.systraygui.utils.IconHelper;
-import org.irods.jargon.idrop.exceptions.IdropException;
-import org.irods.jargon.idrop.exceptions.IdropRuntimeException;
-import org.slf4j.LoggerFactory;
-
-/**
- * Panel used in various displays for a file or collection, eventually this can shift to a JTable, as the gui design has changed
- * @author mikeconway
- */
-public class DefaultFileRepresentationPanel extends javax.swing.JPanel implements Transferable {
-
- private final CollectionAndDataObjectListingEntry collectionAndDataObjectListingEntry;
- private final iDrop idrop;
- private final Color backgroundColor;
- private DataFlavor dragAndDropPanelDataFlavor = null;
- public static org.slf4j.Logger log = LoggerFactory.getLogger(DefaultFileRepresentationPanel.class);
-
- /**
- * <p>Returns (creating, if necessary) the DataFlavor representing RandomDragAndDropPanel</p>
- * @return
- */
- public DataFlavor getDragAndDropPanelDataFlavor() throws Exception {
- // Lazy load/create the flavor
- if (dragAndDropPanelDataFlavor == null) {
- dragAndDropPanelDataFlavor = new DataFlavor(DataFlavor.javaJVMLocalObjectMimeType + ";class=org.irods.jargon.idrop.desktop.systraygui.viscomponents.DefaultFileRepresentationPanel");
- }
-
- return dragAndDropPanelDataFlavor;
- }
-
- /**
- * Create an instance of a data panel for display in iDroop
- * @param collectionAndDataObjectListingEntry <code>CollectionAndDataObjectListingEntry</code> with file/collection details
- * @param idrop <code>iDrop</code> gui reference.
- */
- public DefaultFileRepresentationPanel(final CollectionAndDataObjectListingEntry collectionAndDataObjectListingEntry, final iDrop idrop, final Color backgroundColor) {
- super();
- try {
- getDragAndDropPanelDataFlavor();
- } catch (Exception ex) {
- Logger.getLogger(DefaultFileRepresentationPanel.class.getName()).log(Level.SEVERE, null, ex);
- }
-
- initComponents();
-
- this.collectionAndDataObjectListingEntry = collectionAndDataObjectListingEntry;
- this.idrop = idrop;
- this.backgroundColor = backgroundColor;
-
-
- if (collectionAndDataObjectListingEntry.getObjectType() == CollectionAndDataObjectListingEntry.ObjectType.COLLECTION) {
- pnlIcon.add(IconHelper.getFolderIcon());
- try {
- lblFileOrCollectionName.setText(collectionAndDataObjectListingEntry.getLastPathComponentForCollectionName());
- } catch (JargonException ex) {
- Logger.getLogger(DefaultFileRepresentationPanel.class.getName()).log(Level.SEVERE, null, ex);
- throw new IdropRuntimeException(ex);
- }
- } else {
- pnlIcon.add(IconHelper.getFileIcon());
- lblFileOrCollectionName.setText(collectionAndDataObjectListingEntry.getPathOrName());
- }
-
- this.setToolTipText(collectionAndDataObjectListingEntry.getParentPath());
- pnlIcon.setBackground(backgroundColor);
- pnlFileDetails.setBackground(backgroundColor);
- pnlShowInHierarchy.setBackground(backgroundColor);
- lblFileOrCollectionName.setBackground(backgroundColor);
- DragAndDropTransferHandler th = new DragAndDropTransferHandler(idrop);
- setTransferHandler(th);
- addMouseListener(new DraggableMouseListener(idrop, collectionAndDataObjectListingEntry));
-
-
- //setUpDrag();
- }
-
- private void setUpDrag() {
- this.setTransferHandler(new TransferHandler("defaultFileRepresentationPanel"));
- MouseListener ml = new MouseAdapter() {
-
- public void mousePressed(MouseEvent e) {
- JComponent jc = (JComponent) e.getSource();
- TransferHandler th = jc.getTransferHandler();
- th.exportAsDrag(jc, e, TransferHandler.COPY);
- }
- };
- this.addMouseListener(ml);
- }
-
- /** 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() {
-
- pnlIcon = new javax.swing.JPanel();
- pnlFileDetails = new javax.swing.JPanel();
- lblFileOrCollectionName = new javax.swing.JLabel();
- pnlShowInHierarchy = new javax.swing.JPanel();
- btnShowInHierarchy = new javax.swing.JButton();
-
- setBackground(new java.awt.Color(255, 255, 255));
- setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
- setMaximumSize(new java.awt.Dimension(2147483647, 80));
- setPreferredSize(new java.awt.Dimension(482, 80));
- addMouseListener(new java.awt.event.MouseAdapter() {
- public void mouseClicked(java.awt.event.MouseEvent evt) {
- formMouseClicked(evt);
- }
- });
- setLayout(new java.awt.BorderLayout());
-
- pnlIcon.setBackground(new java.awt.Color(255, 255, 255));
- pnlIcon.setPreferredSize(new java.awt.Dimension(32, 32));
- pnlIcon.setLayout(new java.awt.GridLayout(0, 1));
- add(pnlIcon, java.awt.BorderLayout.WEST);
-
- pnlFileDetails.setBackground(new java.awt.Color(255, 255, 255));
- pnlFileDetails.setLayout(new java.awt.GridLayout(0, 1));
-
- lblFileOrCollectionName.setText("file or collection name here");
- pnlFileDetails.add(lblFileOrCollectionName);
-
- add(pnlFileDetails, java.awt.BorderLayout.CENTER);
-
- pnlShowInHierarchy.setBackground(new java.awt.Color(255, 255, 255));
- pnlShowInHierarchy.setPreferredSize(new java.awt.Dimension(30, 30));
-
- btnShowInHierarchy.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/irods/jargon/idrop/desktop/systraygui/images/show-in-hierarchy.png"))); // NOI18N
- btnShowInHierarchy.setToolTipText("Show this file or collection in the hierarchy view");
-
- org.jdesktop.layout.GroupLayout pnlShowInHierarchyLayout = new org.jdesktop.layout.GroupLayout(pnlShowInHierarchy);
- pnlShowInHierarchy.setLayout(pnlShowInHierarchyLayout);
- pnlShowInHierarchyLayout.setHorizontalGroup(
- pnlShowInHierarchyLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
- .add(0, 30, Short.MAX_VALUE)
- .add(pnlShowInHierarchyLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
- .add(pnlShowInHierarchyLayout.createSequentialGroup()
- .add(0, 0, Short.MAX_VALUE)
- .add(btnShowInHierarchy)
- .add(0, 0, Short.MAX_VALUE)))
- );
- pnlShowInHierarchyLayout.setVerticalGroup(
- pnlShowInHierarchyLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
- .add(0, 298, Short.MAX_VALUE)
- .add(pnlShowInHierarchyLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
- .add(pnlShowInHierarchyLayout.createSequentialGroup()
- .add(0, 135, Short.MAX_VALUE)
- .add(btnShowInHierarchy)
- .add(0, 135, Short.MAX_VALUE)))
- );
-
- add(pnlShowInHierarchy, java.awt.BorderLayout.EAST);
- }// </editor-fold>//GEN-END:initComponents
-
- /**
- * On a mouse click, set up the info panel
- * @param evt
- */
- private void formMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_formMouseClicked
-
- }//GEN-LAST:event_formMouseClicked
-
- /**
- * Get the file/collection data object that backs this panel
- * @return
- */
- public CollectionAndDataObjectListingEntry getCollectionAndDataObjectListingEntry() {
- return collectionAndDataObjectListingEntry;
- }
- // Variables declaration - do not modify//GEN-BEGIN:variables
- private javax.swing.JButton btnShowInHierarchy;
- private javax.swing.JLabel lblFileOrCollectionName;
- private javax.swing.JPanel pnlFileDetails;
- private javax.swing.JPanel pnlIcon;
- private javax.swing.JPanel pnlShowInHierarchy;
- // End of variables declaration//GEN-END:variables
-
- /**
- * <p>One of three methods defined by the Transferable interface.</p>
- * <p>If multiple DataFlavor's are supported, can choose what Object to return.</p>
- * <p>In this case, we only support one: the actual JPanel.</p>
- * <p>Note we could easily support more than one. For example, if supports text and drops to a JTextField, could return the label's text or any arbitrary text.</p>
- * @param flavor
- * @return
- */
- public Object getTransferData(DataFlavor flavor) {
-
- DataFlavor thisFlavor = null;
-
- try {
- thisFlavor = getDragAndDropPanelDataFlavor();
- } catch (Exception ex) {
- System.err.println("Problem lazy loading: " + ex.getMessage());
- ex.printStackTrace(System.err);
- return null;
- }
-
- // For now, assume wants this class... see loadDnD
- if (thisFlavor != null && flavor.equals(thisFlavor)) {
- return this;
- }
-
- return null;
- }
-
- /**
- * <p>One of three methods defined by the Transferable interface.</p>
- * <p>Returns supported DataFlavor. Again, we're only supporting this actual Object within the JVM.</p>
- * <p>For more information, see the JavaDoc for DataFlavor.</p>
- * @return
- */
- public DataFlavor[] getTransferDataFlavors() {
-
- DataFlavor[] flavors = {null};
-
- System.out.println("Step 4 of 7: Querying for acceptable DataFlavors to determine what is available. Our example only supports our custom RandomDragAndDropPanel DataFlavor.");
-
- try {
- flavors[0] = getDragAndDropPanelDataFlavor();
- } catch (Exception ex) {
- System.err.println("Problem lazy loading: " + ex.getMessage());
- ex.printStackTrace(System.err);
- return null;
- }
-
- return flavors;
- }
-
- /**
- * <p>One of three methods defined by the Transferable interface.</p>
- * <p>Determines whether this object supports the DataFlavor. In this case, only one is supported: for this object itself.</p>
- * @param flavor
- * @return True if DataFlavor is supported, otherwise false.
- */
- public boolean isDataFlavorSupported(DataFlavor flavor) {
-
- System.out.println("Step 6 of 7: Verifying that DataFlavor is supported. Our example only supports our custom RandomDragAndDropPanel DataFlavor.");
-
- DataFlavor[] flavors = {null};
- try {
- flavors[0] = getDragAndDropPanelDataFlavor();
- } catch (Exception ex) {
- System.err.println("Problem lazy loading: " + ex.getMessage());
- ex.printStackTrace(System.err);
- return false;
- }
-
- for (DataFlavor f : flavors) {
- if (f.equals(flavor)) {
- return true;
- }
- }
-
- return false;
- }
-}
-
-class DraggableMouseListener extends MouseAdapter {
-
- private final iDrop idrop;
- private final CollectionAndDataObjectListingEntry collectionAndDataObjectListingEntry;
-
- public DraggableMouseListener(final iDrop idrop, final CollectionAndDataObjectListingEntry collectionAndDataObjectListingEntry) {
- super();
- this.idrop = idrop;
- this.collectionAndDataObjectListingEntry = collectionAndDataObjectListingEntry;
- }
-
- @Override
- public void mouseClicked(MouseEvent me) {
-
- }
-
- @Override()
- public void mousePressed(MouseEvent e) {
- try {
- // TODO add your handling code here:
- idrop.initializeInfoPane(collectionAndDataObjectListingEntry);
- } catch (IdropException ex) {
- Logger.getLogger(DefaultFileRepresentationPanel.class.getName()).log(Level.SEVERE, null, ex);
- idrop.showIdropException(ex);
- throw new IdropRuntimeException(ex);
- }
-
- JComponent c = (JComponent) e.getSource();
- TransferHandler handler = c.getTransferHandler();
- handler.exportAsDrag(c, e, TransferHandler.COPY);
- }
-} // DraggableMouseListener
-
-class DragAndDropTransferHandler extends TransferHandler implements DragSourceMotionListener {
-
- public static org.slf4j.Logger log = LoggerFactory.getLogger(DragAndDropTransferHandler.class);
- public DataFlavor treeDataFlavor;
- private final iDrop idropGui;
-
- public DragAndDropTransferHandler(final iDrop idropGui) {
- super();
- this.idropGui = idropGui;
- try {
- treeDataFlavor = new DataFlavor(javax.swing.tree.TreeSelectionModel.class, "application/x-java-jvm-local-objectref; class=javax.swing.tree.TreeSelectionModel");
- } catch (Exception ex) {
- log.error("error building tree data flavor", ex);
- throw new IdropRuntimeException(ex);
- }
- }
-
- /**
- * <p>This creates the Transferable object. In our case, RandomDragAndDropPanel implements Transferable, so this requires only a type cast.</p>
- * @param c
- * @return
- */
- @Override()
- public Transferable createTransferable(JComponent c) {
-
- return (Transferable) c;
- }
-
- @Override
- public void dragMouseMoved(DragSourceDragEvent dsde) {
- }
-
- /**
- * <p>This is queried to see whether the component can be copied, moved, both or neither. We are only concerned with copying.</p>
- * @param c
- * @return
- */
- @Override()
- public int getSourceActions(JComponent c) {
- return TransferHandler.COPY;
- }
-
- @Override
- public boolean canImport(TransferHandler.TransferSupport info) {
-
- log.info("info for transfer:{}", info);
- log.info("tree data for comparison:{}", treeDataFlavor);
- log.debug("compared to file list flavor:{}", DataFlavor.javaFileListFlavor);
-
- DataFlavor[] dataFlavors = info.getDataFlavors();
- for (DataFlavor dataFlavor : dataFlavors) {
- log.info("data flavor:{}", dataFlavor);
- log.debug("rep class:{}", dataFlavor.getDefaultRepresentationClassAsString());
- log.debug("mime type:{}", dataFlavor.getMimeType());
- if (dataFlavor.getMimeType().equals("application/x-java-jvm-local-objectref; class=javax.swing.tree.TreeSelectionModel")) {
- log.info("can import as a tree selection model");
- return true;
- } else if (dataFlavor.equals(DataFlavor.javaFileListFlavor)) {
- log.info("can import as a list of files");
- return true;
- }
- }
-
- log.info("did not find data flavor, cannot import");
- return false;
- }
-
- @Override
- public boolean importData(TransferSupport support) {
-
- log.debug("importData()");
- Transferable transferable = support.getTransferable();
- log.debug("drop event on a file representation panel");
-
- DataFlavor[] dataFlavors = transferable.getTransferDataFlavors();
-
- for (DataFlavor dataFlavor : dataFlavors) {
-
- if (dataFlavor.getMimeType().equals("application/x-java-jvm-local-objectref; class=javax.swing.tree.TreeSelectionModel")) {
- log.info("processing from drop of java tree");
- try {
- processDropFromTree(transferable, dataFlavors, support);
- } catch (IdropException ex) {
- log.error("error processing DropFromTree", ex);
- throw new IdropRuntimeException(ex);
- }
- return true;
- } else {
- log.info("this transfer is for a file list from desktop");
- try {
- processDesktopDrop(transferable, dataFlavors, support);
- } catch (IdropException ex) {
- log.error("error processing DropFromTree", ex);
- throw new IdropRuntimeException(ex);
- }
-
- return true;
- }
- }
- return false;
-
- }
-
- /**
- * This transfer has been marked as able to import, and has been classified by data flavor as
- * coming from a JTree.
- * @param transferable
- * @param dataFlavors
- * @param support
- * @throws IdropRuntimeException
- */
- private void processDropFromTree(final Transferable transferable, final DataFlavor[] dataFlavors, final TransferSupport support) throws IdropException {
- log.debug("processDropFromTree()");
-
- TreeSelectionModel fileTree;
- try {
- fileTree = (TreeSelectionModel) transferable.getTransferData(dataFlavors[0]);
- } catch (UnsupportedFlavorException ex) {
- log.error("unsupported operation getting filetree", ex);
- throw new IdropRuntimeException("unsupported flavor in drop operation", ex);
- } catch (IOException ex) {
- log.error("IOException getting filetree", ex);
- throw new IdropRuntimeException("unsupported flavor in drop operation", ex);
- }
-
- List<String> sourcePaths = new ArrayList<String>();
- TreePath[] selectionPaths = fileTree.getSelectionPaths();
- Object[] path = null;
- StringBuilder pathBuilder = null;
- for (TreePath selectionPath : selectionPaths) {
- path = selectionPath.getPath();
- pathBuilder = new StringBuilder();
- int pathCtr = 0;
- for (Object pathElement : path) {
- pathBuilder.append(pathElement);
- if (pathCtr == 0) {
- // don't append the /
- } else if (pathCtr == path.length - 1) {
- // dont append a / to the end
- } else {
- pathBuilder.append('/');
- }
- pathCtr++;
- }
- String sourcePath = pathBuilder.toString();
- log.info("source path added: {}", sourcePath.toString());
- sourcePaths.add(sourcePath);
- }
-
- // make sure it's a drop onto the file panel and not some other unexpected drop target.
-
- Object dropComponent = support.getComponent();
-
- if (!(dropComponent instanceof DefaultFileRepresentationPanel)) {
- log.error("drop event is not on a DefaultFileRepresentationPanel");
- throw new IdropException("drop event is not on a DefaultFileRepresentationPanel");
- }
-
- DefaultFileRepresentationPanel targetPanel = (DefaultFileRepresentationPanel) dropComponent;
- CollectionAndDataObjectListingEntry targetCollectionAndDataObjectListingEntry = targetPanel.getCollectionAndDataObjectListingEntry();
- log.info("drop onto:{}", targetCollectionAndDataObjectListingEntry);
-
- // if dropping onto a data object, act as if the drop is on the parent collection
- String derivedTargetAbsolutePath;
- if (targetCollectionAndDataObjectListingEntry.getObjectType() == CollectionAndDataObjectListingEntry.ObjectType.DATA_OBJECT) {
- log.info("using parent collection, as target is a data object");
- derivedTargetAbsolutePath = targetCollectionAndDataObjectListingEntry.getParentPath();
- } else {
- log.info("drop onto collection, just using collection name");
- derivedTargetAbsolutePath = targetCollectionAndDataObjectListingEntry.getPathOrName();
- }
-
- int ret;
- if (sourcePaths.size() == 1) {
- ret = idropGui.showTransferConfirm(sourcePaths.get(0), derivedTargetAbsolutePath);
- } else {
- ret = idropGui.showTransferConfirm("multiple files", derivedTargetAbsolutePath);
- }
-
- if (ret == JOptionPane.NO_OPTION) {
- return;
- }
-
- // FIXME: put into swing worker
-
- for (String sourcePath : sourcePaths) {
- try {
- log.info("enqueue a put operation");
- idropGui.getTransferManager().enqueueAPut(sourcePath, derivedTargetAbsolutePath, idropGui.getIrodsAccount().getDefaultStorageResource(), idropGui.getIrodsAccount());
- } catch (JargonException ex) {
- log.error("error enqueueing a put operation", ex);
- throw new IdropException("error enqueing put operation", ex);
- }
-
- log.info("transfer enqueued");
- }
-
- }
-
- /**
- * Process a drop on the center panels coming from the desktop or OS explorer
- * @param support
- * @throws IdropRuntimeException
- */
- private void processDesktopDrop(final Transferable transferable, final DataFlavor[] dataFlavors, final TransferSupport support) throws IdropException {
-
- // make sure it's a drop onto the file panel and not some other unexpected drop target.
-
- Object dropComponent = support.getComponent();
-
- if (!(dropComponent instanceof DefaultFileRepresentationPanel)) {
- log.error("drop event is not on a DefaultFileRepresentationPanel");
- throw new IdropException("drop event is not on a DefaultFileRepresentationPanel");
- }
-
- DefaultFileRepresentationPanel targetPanel = (DefaultFileRepresentationPanel) dropComponent;
- CollectionAndDataObjectListingEntry targetCollectionAndDataObjectListingEntry = targetPanel.getCollectionAndDataObjectListingEntry();
- log.info("drop onto:{}", targetCollectionAndDataObjectListingEntry);
-
- List<File> list;
- try {
- list = (List<File>) transferable.getTransferData(
- DataFlavor.javaFileListFlavor);
- } catch (UnsupportedFlavorException ex) {
-
- log.error("UnsupportedFlavor error in processDesktopDrop", ex);
- throw new IdropException(ex);
- } catch (IOException ex) {
- log.error("IOException error in processDesktopDrop", ex);
- throw new IdropException(ex);
- }
-
- String derivedTargetAbsolutePath;
- if (targetCollectionAndDataObjectListingEntry.getObjectType() == CollectionAndDataObjectListingEntry.ObjectType.DATA_OBJECT) {
- log.info("using parent collection, as target is a data object");
- derivedTargetAbsolutePath = targetCollectionAndDataObjectListingEntry.getParentPath();
- } else {
- log.info("drop onto collection, just using collection name");
- derivedTargetAbsolutePath = targetCollectionAndDataObjectListingEntry.getPathOrName();
- }
-
-
- int ret;
- if (list.size() == 1) {
- ret = idropGui.showTransferConfirm(list.get(0).getAbsolutePath(), derivedTargetAbsolutePath);
- } else {
- ret = idropGui.showTransferConfirm("multiple files", derivedTargetAbsolutePath);
- }
-
- if (ret == JOptionPane.NO_OPTION) {
- return;
- }
-
- //FIXME: put into swing worker thread
-
- for (File transferFile : list) {
-
- log.info("processing transfer file:{}", transferFile.getAbsolutePath());
- // if dropping onto a data object, act as if the drop is on the parent collection
-
- try {
- log.info("enqueue a put operation");
- idropGui.getTransferManager().enqueueAPut(transferFile.getAbsolutePath(), derivedTargetAbsolutePath, idropGui.getIrodsAccount().getDefaultStorageResource(), idropGui.getIrodsAccount());
- } catch (JargonException ex) {
- log.error("error enqueueing a put operation", ex);
- throw new IdropException("error enqueing put operation", ex);
- }
-
- log.info("transfer enqueued");
- }
-
- log.info("drop from desktop processed");
-
- }
-}
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/FileDragGestureListener.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/FileDragGestureListener.java
deleted file mode 100644
index f19997d..0000000
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/FileDragGestureListener.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
-
-package org.irods.jargon.idrop.desktop.systraygui.viscomponents;
-
-import java.awt.dnd.DragSourceAdapter;
-import java.awt.dnd.DragSourceDragEvent;
-import java.awt.dnd.DragSourceDropEvent;
-import java.awt.dnd.DragSourceEvent;
-
-/**
- * @author Mike Conway - DICE (www.irods.org)
- */
-public class FileDragGestureListener extends DragSourceAdapter {
-
- @Override
- public void dragDropEnd(DragSourceDropEvent dsde) {
- super.dragDropEnd(dsde);
- }
-
- @Override
- public void dragEnter(DragSourceDragEvent dsde) {
- super.dragEnter(dsde);
- }
-
- @Override
- public void dragExit(DragSourceEvent dse) {
- super.dragExit(dse);
- }
-
-}
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/FileSystemModel.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/FileSystemModel.java
index 1e95f54..abf3193 100644
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/FileSystemModel.java
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/FileSystemModel.java
@@ -111,7 +111,8 @@ public class FileSystemModel implements TreeModel {
super(parent, child);
}
- public String toString() {
+ @Override
+ public String toString() {
return getName();
}
}
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/IRODSFileSystemModel.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/IRODSFileSystemModel.java
index 5c41fb3..d284930 100644
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/IRODSFileSystemModel.java
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/IRODSFileSystemModel.java
@@ -1,13 +1,19 @@
package org.irods.jargon.idrop.desktop.systraygui.viscomponents;
-import java.util.ArrayList;
-import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
+import javax.swing.event.TreeModelEvent;
import javax.swing.tree.DefaultTreeModel;
+import javax.swing.tree.MutableTreeNode;
+import javax.swing.tree.TreePath;
import org.irods.jargon.core.connection.IRODSAccount;
+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.utils.TreeUtils;
import org.irods.jargon.idrop.exceptions.IdropException;
import org.irods.jargon.idrop.exceptions.IdropRuntimeException;
+import org.slf4j.LoggerFactory;
/**
* Model of an underlying file system for browsing in a tree view
@@ -16,6 +22,35 @@ import org.irods.jargon.idrop.exceptions.IdropRuntimeException;
public class IRODSFileSystemModel extends DefaultTreeModel {
@Override
+ public void removeNodeFromParent(MutableTreeNode mtn) {
+ super.removeNodeFromParent(mtn);
+ }
+
+ public static org.slf4j.Logger log = LoggerFactory.getLogger(IRODSFileSystemModel.class);
+
+ private static class TreeModelListener implements javax.swing.event.TreeModelListener {
+
+ public TreeModelListener() {
+ }
+
+ @Override
+ public void treeNodesChanged(TreeModelEvent tme) {
+ }
+
+ @Override
+ public void treeNodesInserted(TreeModelEvent tme) {
+ }
+
+ @Override
+ public void treeNodesRemoved(TreeModelEvent tme) {
+ }
+
+ @Override
+ public void treeStructureChanged(TreeModelEvent tme) {
+ }
+ }
+
+ @Override
public Object getChild(Object parent, int index) {
triggerLazyLoading(parent);
return super.getChild(parent, index);
@@ -50,6 +85,24 @@ public class IRODSFileSystemModel extends DefaultTreeModel {
// pre-expand the child nodes of the root
rootNode.lazyLoadOfChildrenOfThisNode();
+ this.addTreeModelListener(new TreeModelListener() {
+ });
+
+ }
+
+ public IRODSFileSystemModel(final IRODSAccount irodsAccount) throws IdropException {
+ super(null);
+ if (irodsAccount == null) {
+ throw new IdropRuntimeException("null irodsAccount");
+ }
+ this.irodsAccount = irodsAccount;
+
+ this.addTreeModelListener(new TreeModelListener() {
+ });
}
+
+
+
+
}
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/IRODSNode.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/IRODSNode.java
index 52df7f6..ad7794c 100644
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/IRODSNode.java
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/IRODSNode.java
@@ -6,8 +6,6 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.tree.DefaultMutableTreeNode;
import org.irods.jargon.core.connection.IRODSAccount;
-import org.irods.jargon.core.exception.JargonException;
-import org.irods.jargon.core.pub.CollectionAO;
import org.irods.jargon.core.pub.CollectionAndDataObjectListAndSearchAO;
import org.irods.jargon.core.pub.IRODSFileSystem;
import org.irods.jargon.core.query.CollectionAndDataObjectListingEntry;
@@ -50,7 +48,12 @@ public class IRODSNode extends DefaultMutableTreeNode {
* @throws IdropException
*/
public void lazyLoadOfChildrenOfThisNode() throws IdropException {
- lazyLoadOfChildrenOfThisNode(!irodsTree.isRefreshingTree());
+ boolean refreshing = false;
+
+ if (irodsTree != null) {
+ refreshing = irodsTree.isRefreshingTree();
+ }
+ lazyLoadOfChildrenOfThisNode(!refreshing);
}
/**
@@ -85,7 +88,7 @@ public class IRODSNode extends DefaultMutableTreeNode {
cached = true;
- } catch (JargonException ex) {
+ } catch (Exception ex) {
Logger.getLogger(IRODSNode.class.getName()).log(Level.SEVERE, null, ex);
throw new IdropException("error occurred accessing collection data", ex);
} finally {
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
new file mode 100644
index 0000000..a5e0b05
--- /dev/null
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/IRODSOutlineModel.java
@@ -0,0 +1,206 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package org.irods.jargon.idrop.desktop.systraygui.viscomponents;
+
+import java.util.Date;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import javax.swing.table.TableModel;
+import javax.swing.tree.TreeModel;
+import javax.swing.tree.TreePath;
+import org.irods.jargon.core.exception.JargonException;
+import org.irods.jargon.core.pub.io.IRODSFile;
+import org.irods.jargon.core.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.utils.TreeUtils;
+import org.irods.jargon.idrop.exceptions.IdropException;
+import org.irods.jargon.idrop.exceptions.IdropRuntimeException;
+import org.netbeans.swing.outline.DefaultOutlineModel;
+import org.netbeans.swing.outline.RowModel;
+import org.slf4j.LoggerFactory;
+
+/**
+ * @author Mike Conway - DICE (www.irods.org)
+ */
+public class IRODSOutlineModel extends DefaultOutlineModel {
+
+ public static final org.slf4j.Logger log = LoggerFactory.getLogger(IRODSOutlineModel.class);
+ private iDrop idrop;
+
+ public IRODSOutlineModel(iDrop idrop, TreeModel tm, TableModel tm1, boolean bln, String string) {
+ super(tm, tm1, bln, string);
+ this.idrop = idrop;
+ }
+
+ public IRODSOutlineModel(iDrop idrop, TreeModel tm, RowModel rm, boolean bln, String string) {
+ super(tm, rm, bln, string);
+ this.idrop = idrop;
+ }
+
+ public void notifyFileShouldBeRemoved(final IRODSTree irodsTree, final String nodeAbsolutePath) throws IdropException {
+ }
+
+ public void notifyFileShouldBeRemoved(final IRODSNode deletedNode) throws IdropException {
+ log.info("deleting node from parent:{}", deletedNode);
+ final IRODSNode parent = (IRODSNode) deletedNode.getParent();
+
+
+
+ java.awt.EventQueue.invokeLater(new Runnable() {
+
+ @Override
+ public void run() {
+ parent.remove(deletedNode);
+ try {
+ IRODSTree stagingViewTree = idrop.getIrodsTree();
+ CollectionAndDataObjectListingEntry entry = (CollectionAndDataObjectListingEntry) ((IRODSNode) parent).getUserObject();
+ TreePath path = TreeUtils.buildTreePathForIrodsAbsolutePath(stagingViewTree, entry.getFormattedAbsolutePath());
+ stagingViewTree.collapsePath(path);
+ stagingViewTree.expandPath(path);
+ } catch (IdropException ex) {
+ Logger.getLogger(IRODSOutlineModel.class.getName()).log(Level.SEVERE, null, ex);
+ idrop.showIdropException(ex);
+ }
+ }
+ });
+ }
+
+ public void notifyCompletionOfOperation(final IRODSTree irodsTree, final TransferStatus transferStatus) throws IdropException {
+ log.info("tree model notified of status:{}", transferStatus);
+
+ if (transferStatus.getTransferState() != TransferState.OVERALL_COMPLETION) {
+ return;
+ }
+
+ // for put or copy operation, highlight the new node
+ if (transferStatus.getTransferType() == TransferStatus.TransferType.PUT
+ || transferStatus.getTransferType() == TransferStatus.TransferType.COPY) {
+ log.info("successful put transfer, find the parent tree node, and clear the children");
+ final IRODSOutlineModel thisOutlineModel = this;
+
+ java.awt.EventQueue.invokeLater(new Runnable() {
+
+ @Override
+ public void run() {
+ TreePath containingNodePath;
+ try {
+ containingNodePath = TreeUtils.buildTreePathForIrodsAbsolutePath(irodsTree, transferStatus.getTargetFileAbsolutePath());
+ } catch (IdropException ex) {
+ Logger.getLogger(IRODSOutlineModel.class.getName()).log(Level.SEVERE, null, ex);
+ throw new IdropRuntimeException("error building tree path", ex);
+ }
+ log.debug("tree path for put: {}", containingNodePath);
+ IRODSNode targetNode = (IRODSNode) containingNodePath.getLastPathComponent();
+ CollectionAndDataObjectListingEntry entry = (CollectionAndDataObjectListingEntry) targetNode.getUserObject();
+ if (entry.isDataObject()) {
+ log.info("substitute parent as target, as given node was a leaf");
+ targetNode = (IRODSNode) targetNode.getParent();
+ }
+
+ /* if the node was cached, children were loaded, so add a new one, otherwise,
+ the expand path in irodsTree.highlightPath() will cause the loading of the children */
+ if (targetNode.isCached()) {
+ try {
+ IRODSFile addedFile = idrop.getiDropCore().getIRODSFileFactoryForLoggedInAccount().instanceIRODSFile(transferStatus.getTargetFileAbsolutePath());
+ CollectionAndDataObjectListingEntry newEntry = new CollectionAndDataObjectListingEntry();
+ newEntry.setCreatedAt(new Date(addedFile.lastModified()));
+ newEntry.setDataSize(addedFile.length());
+ newEntry.setModifiedAt(new Date(addedFile.lastModified()));
+
+ if (addedFile.isDirectory()) {
+ newEntry.setObjectType(CollectionAndDataObjectListingEntry.ObjectType.COLLECTION);
+ newEntry.setParentPath(addedFile.getParent());
+ newEntry.setPathOrName(addedFile.getAbsolutePath());
+ } else {
+ newEntry.setObjectType(CollectionAndDataObjectListingEntry.ObjectType.DATA_OBJECT);
+ newEntry.setParentPath(addedFile.getParent());
+ newEntry.setPathOrName(addedFile.getName());
+ }
+
+ IRODSNode newNode = new IRODSNode(newEntry, idrop.getiDropCore().getIrodsAccount(), idrop.getiDropCore().getIrodsFileSystem(), irodsTree);
+ targetNode.add(newNode);
+
+ } catch (JargonException ex) {
+ Logger.getLogger(IRODSOutlineModel.class.getName()).log(Level.SEVERE, null, ex);
+ throw new IdropRuntimeException(ex);
+ }
+
+ }
+
+ if (entry.isDataObject()) {
+ try {
+ containingNodePath = TreeUtils.buildTreePathForIrodsAbsolutePath(irodsTree, entry.getParentPath());
+ } catch (IdropException ex) {
+ Logger.getLogger(IRODSOutlineModel.class.getName()).log(Level.SEVERE, null, ex);
+ throw new IdropRuntimeException("error building tree path", ex);
+
+ }
+ }
+
+ irodsTree.highlightPath(containingNodePath);
+ }
+ });
+
+ }
+ }
+
+ public void notifyFileShouldBeAdded(final IRODSTree irodsTree, final String irodsFileAbsolutePath) {
+ log.info("notifyFileShouldBeAdded() for node:{}", irodsFileAbsolutePath);
+
+ java.awt.EventQueue.invokeLater(new Runnable() {
+
+ @Override
+ public void run() {
+
+ IRODSFileFactory irodsFileFactory = idrop.getiDropCore().getIRODSFileFactoryForLoggedInAccount();
+ try {
+ 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: {}", irodsFileAbsolutePath);
+ return;
+ }
+ TreePath parentPath;
+ try {
+ parentPath = TreeUtils.buildTreePathForIrodsAbsolutePath(irodsTree, addedFile.getParent());
+ } catch (IdropException ex) {
+ Logger.getLogger(IRODSOutlineModel.class.getName()).log(Level.SEVERE, null, ex);
+ throw new IdropRuntimeException(ex);
+ }
+
+ if (parentPath == null) {
+ log.info("null path for lookup, just move on");
+ return;
+ }
+ log.info("building a new node");
+ CollectionAndDataObjectListingEntry newEntry = new CollectionAndDataObjectListingEntry();
+ newEntry.setCreatedAt(new Date(addedFile.lastModified()));
+ newEntry.setDataSize(addedFile.length());
+ newEntry.setModifiedAt(new Date(addedFile.lastModified()));
+
+ if (addedFile.isDirectory()) {
+ newEntry.setObjectType(CollectionAndDataObjectListingEntry.ObjectType.COLLECTION);
+ newEntry.setParentPath(addedFile.getParent());
+ newEntry.setPathOrName(addedFile.getAbsolutePath());
+ } else {
+ newEntry.setObjectType(CollectionAndDataObjectListingEntry.ObjectType.DATA_OBJECT);
+ newEntry.setParentPath(addedFile.getParent());
+ newEntry.setPathOrName(addedFile.getName());
+ }
+
+ IRODSNode newNode = new IRODSNode(newEntry, idrop.getiDropCore().getIrodsAccount(), idrop.getiDropCore().getIrodsFileSystem(), irodsTree);
+ ((IRODSNode) parentPath.getLastPathComponent()).add(newNode);
+ irodsTree.highlightPath(parentPath);
+ } catch (JargonException ex) {
+ Logger.getLogger(IRODSOutlineModel.class.getName()).log(Level.SEVERE, null, ex);
+ } finally {
+ idrop.getiDropCore().closeIRODSConnectionForLoggedInAccount();
+ }
+ }
+ });
+ }
+}
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/IRODSRowModel.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/IRODSRowModel.java
new file mode 100644
index 0000000..a610086
--- /dev/null
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/IRODSRowModel.java
@@ -0,0 +1,72 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package org.irods.jargon.idrop.desktop.systraygui.viscomponents;
+
+import java.util.Date;
+import org.irods.jargon.core.query.CollectionAndDataObjectListingEntry;
+import org.netbeans.swing.outline.RowModel;
+
+/**
+ * @author Mike Conway - DICE (www.irods.org)
+ */
+public class IRODSRowModel implements RowModel {
+
+ @Override
+ public int getColumnCount() {
+ return 2;
+ }
+
+ @Override
+ public Object getValueFor(Object node, int column) {
+ IRODSNode f = (IRODSNode) node;
+ CollectionAndDataObjectListingEntry entry = (CollectionAndDataObjectListingEntry) f.getUserObject();
+ switch (column) {
+
+ case 0:
+ return entry.getDataSize();
+ case 1:
+ return entry.getModifiedAt();
+ default:
+ assert false;
+ }
+ return null;
+ }
+
+ @Override
+ public Class getColumnClass(int i) {
+ switch (i) {
+
+ case 0:
+ return Long.class;
+ case 1:
+ return Date.class;
+ default:
+ assert false;
+ }
+ return null;
+ }
+
+ @Override
+ public boolean isCellEditable(Object o, int i) {
+ return false;
+ }
+
+ @Override
+ public void setValueFor(Object o, int i, Object o1) {
+ }
+
+ @Override
+ public String getColumnName(int i) {
+ switch (i) {
+ case 0:
+ return "size";
+ case 1:
+ return "last modified";
+ default:
+ assert false;
+ }
+ return null;
+ }
+}
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/IRODSSearchTableModel.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/IRODSSearchTableModel.java
index a586342..4af461b 100644
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/IRODSSearchTableModel.java
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/IRODSSearchTableModel.java
@@ -3,11 +3,9 @@ package org.irods.jargon.idrop.desktop.systraygui.viscomponents;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
-import java.util.Vector;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.table.AbstractTableModel;
-import javax.swing.table.DefaultTableModel;
import org.irods.jargon.core.exception.JargonException;
import org.irods.jargon.core.query.CollectionAndDataObjectListingEntry;
import org.irods.jargon.idrop.exceptions.IdropRuntimeException;
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 7c474e9..b06d2a5 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
@@ -2,23 +2,10 @@ package org.irods.jargon.idrop.desktop.systraygui.viscomponents;
import java.awt.Color;
import java.awt.Cursor;
-import java.awt.Graphics;
-import java.awt.Point;
import java.awt.Rectangle;
-import java.awt.datatransfer.DataFlavor;
-import java.awt.datatransfer.Transferable;
-import java.awt.datatransfer.UnsupportedFlavorException;
-import java.awt.dnd.DropTarget;
-import java.awt.dnd.DropTargetContext;
-import java.awt.dnd.DropTargetDragEvent;
-import java.awt.dnd.DropTargetDropEvent;
-import java.awt.dnd.DropTargetEvent;
-import java.awt.dnd.DropTargetListener;
import java.awt.event.ActionEvent;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
-import java.io.File;
-import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.logging.Level;
@@ -34,24 +21,24 @@ import javax.swing.event.TreeWillExpandListener;
import javax.swing.tree.ExpandVetoException;
import javax.swing.tree.TreeModel;
import javax.swing.tree.TreePath;
-import javax.swing.tree.TreeSelectionModel;
-import org.irods.jargon.core.exception.JargonException;
-import org.irods.jargon.core.pub.io.IRODSFile;
import org.irods.jargon.core.query.CollectionAndDataObjectListingEntry;
import org.irods.jargon.idrop.desktop.systraygui.DeleteIRODSDialog;
-import org.irods.jargon.idrop.desktop.systraygui.MoveIRODSFileToNewIRODSLocationDialog;
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.exceptions.IdropException;
import org.irods.jargon.idrop.exceptions.IdropRuntimeException;
+import org.netbeans.swing.outline.DefaultOutlineModel;
+import org.netbeans.swing.outline.Outline;
+import org.netbeans.swing.outline.OutlineModel;
+import org.netbeans.swing.outline.TreePathSupport;
import org.slf4j.LoggerFactory;
/**
* Swing JTree component for viewing iRODS server file system
* @author Mike Conway - DICE (www.irods.org)
*/
-public class IRODSTree extends JTree implements DropTargetListener, TreeWillExpandListener, TreeExpansionListener {
+public class IRODSTree extends Outline implements TreeWillExpandListener, TreeExpansionListener {
public static org.slf4j.Logger log = LoggerFactory.getLogger(IRODSTree.class);
protected iDrop idropParentGui = null;
@@ -59,10 +46,8 @@ public class IRODSTree extends JTree implements DropTargetListener, TreeWillExpa
protected Action m_action;
protected TreePath m_clickedPath;
protected IRODSTree thisTree;
- private int highlightedRow = -1;
- private Rectangle dirtyRegion = null;
- private Color highlightColor = new Color(Color.BLUE.getRed(), Color.BLUE.getGreen(), Color.BLUE.getBlue(), 100);
private boolean refreshingTree = false;
+ TreePathSupport tps;
public boolean isRefreshingTree() {
synchronized (this) {
@@ -77,11 +62,16 @@ public class IRODSTree extends JTree implements DropTargetListener, TreeWillExpa
}
public IRODSTree(TreeModel newModel, iDrop idropParentGui) {
- super(newModel);
+ super();
+
+ OutlineModel mdl = DefaultOutlineModel.createOutlineModel(
+ newModel, new IRODSRowModel(), true, "File System");
this.idropParentGui = idropParentGui;
- initializeMenusAndListeners();
+ tps = new TreePathSupport(mdl, this.getLayoutCache());
- //this.setEditable(true);
+ tps.addTreeExpansionListener(this);
+ tps.addTreeWillExpandListener(this);
+ initializeMenusAndListeners();
}
public IRODSTree() {
@@ -99,9 +89,15 @@ public class IRODSTree extends JTree implements DropTargetListener, TreeWillExpa
setDropMode(javax.swing.DropMode.ON);
setTransferHandler(new IRODSTreeTransferHandler(idropParentGui, "selectionModel"));
setUpTreeMenu();
- setUpDropListener();
- addTreeExpansionListener(this);
- addTreeWillExpandListener(this);
+ IrodsSelectionListenerForBuildingInfoPanel treeListener;
+ try {
+ treeListener = new IrodsSelectionListenerForBuildingInfoPanel(idropParentGui);
+ } catch (IdropException ex) {
+ Logger.getLogger(IRODSTree.class.getName()).log(Level.SEVERE, null, ex);
+ throw new IdropRuntimeException("error initializing selection listener", ex);
+ }
+ this.getSelectionModel().addListSelectionListener(treeListener);
+
}
/**
@@ -112,6 +108,7 @@ public class IRODSTree extends JTree implements DropTargetListener, TreeWillExpa
m_popup = new JPopupMenu();
m_action = new AbstractAction() {
+ @Override
public void actionPerformed(ActionEvent e) {
if (m_clickedPath == null) {
return;
@@ -129,12 +126,9 @@ public class IRODSTree extends JTree implements DropTargetListener, TreeWillExpa
Action newAction = new AbstractAction("New Folder") {
+ @Override
public void actionPerformed(ActionEvent e) {
-// java.awt.EventQueue.invokeLater(new Runnable() {
-//
-// public void run() {
-
log.info("adding new node");
IRODSNode parent = (IRODSNode) m_clickedPath.getLastPathComponent();
@@ -152,8 +146,6 @@ public class IRODSTree extends JTree implements DropTargetListener, TreeWillExpa
newDirectoryDialog.setLocation((int) (idropParentGui.getLocation().getX() + idropParentGui.getWidth() / 2), (int) (idropParentGui.getLocation().getY() + idropParentGui.getHeight() / 2));
newDirectoryDialog.setVisible(true);
}
- // });
- // thisTree.repaint();
};
m_popup.add(newAction);
@@ -164,19 +156,23 @@ public class IRODSTree extends JTree implements DropTargetListener, TreeWillExpa
@Override
public void actionPerformed(ActionEvent e) {
log.info("deleting a node");
+ int[] rows = thisTree.getSelectedRows();
+ log.debug("selected rows for delete:{}", rows);
- TreePath[] selects = thisTree.getSelectionPaths();
DeleteIRODSDialog deleteDialog;
- if (selects.length == 1) {
- IRODSNode toDelete = (IRODSNode) m_clickedPath.getLastPathComponent();
+ if (rows.length == 1) {
+
+ IRODSNode toDelete = (IRODSNode) thisTree.getValueAt(rows[0], 0);
log.info("deleting a single node: {}", toDelete);
deleteDialog = new DeleteIRODSDialog(idropParentGui, true, thisTree, toDelete);
} else {
List<IRODSNode> nodesToDelete = new ArrayList<IRODSNode>();
- for (TreePath treePath : selects) {
- nodesToDelete.add((IRODSNode) treePath.getLastPathComponent());
+ for (int row : rows) {
+ nodesToDelete.add((IRODSNode) thisTree.getValueAt(row, 0));
+
}
+
deleteDialog = new DeleteIRODSDialog(idropParentGui, true, thisTree, nodesToDelete);
}
@@ -188,6 +184,7 @@ public class IRODSTree extends JTree implements DropTargetListener, TreeWillExpa
m_popup.add(a1);
Action a2 = new AbstractAction("Rename") {
+ @Override
public void actionPerformed(ActionEvent e) {
log.info("renaming node");
@@ -218,328 +215,6 @@ public class IRODSTree extends JTree implements DropTargetListener, TreeWillExpa
}
@Override
- public void drop(DropTargetDropEvent dtde) {
-
- // drop from explorer - human presentable name = application/x-java-url; class=java.net.URL
- // process a drop onto this tree
- log.info("drop event:{}", dtde);
- Point pt = dtde.getLocation();
- DropTargetContext dtc = dtde.getDropTargetContext();
- JTree tree = (JTree) dtc.getComponent();
- TreePath targetPath = tree.getClosestPathForLocation(pt.x, pt.y);
- IRODSNode targetNode = (IRODSNode) targetPath.getLastPathComponent();
- log.info("drop node is: {}", targetNode);
- IRODSFileSystemModel irodsFileSystemModel = (IRODSFileSystemModel) this.getModel();
- // irods file system model beneath the tree may not have cached the children of this targetNode, trigger the cache operation
-
- /*
- if (irodsFileSystemModel.isLeaf(targetNode)) {
- log.debug("drop rejected");
- dtde.rejectDrop();
- return;
- }
-
- */
-
- Transferable transferable = dtde.getTransferable();
-
- DataFlavor[] transferrableFlavors = transferable.getTransferDataFlavors();
-
- // see if this is a phymove gesture
- if (transferable.isDataFlavorSupported(IRODSTreeTransferable.localPhymoveFlavor)) {
- log.info("drop accepted, process as a move");
- dtde.acceptDrop(dtde.getDropAction());
- processPhymoveGesture(transferable, targetNode);
- return;
- }
-
- // not a phymove
-
- boolean accepted = false;
-
- for (DataFlavor flavor : transferrableFlavors) {
- log.debug("flavor mime type:{}", flavor.getMimeType());
- log.debug("flavor human presentable name:{}", flavor.getHumanPresentableName());
- if (flavor.isFlavorJavaFileListType()) {
- log.info("drop accepted...process drop as file list from desktop");
- dtde.acceptDrop(dtde.getDropAction());
- processDropOfFileList(transferable, targetNode);
- accepted = true;
- break;
- } else if (flavor.getMimeType().equals("application/x-java-jvm-local-objectref; class=javax.swing.tree.TreeSelectionModel")) {
- log.info("drop accepted: process drop as serialized object");
- dtde.acceptDrop(dtde.getDropAction());
- processDropOfTreeSelectionModel(transferable, targetNode, flavor);
- accepted = true;
- break;
- } else {
- log.debug("flavor not processed: {}", flavor);
- }
- }
-
- if (!accepted) {
- log.info("drop rejected");
- dtde.rejectDrop();
- }
-
- }
-
- // handle a drop from the local file system
- private void processDropOfFileList(Transferable transferable, IRODSNode parent) throws IdropRuntimeException {
-
- log.info("process as drop of file list");
-
- final String sourceResource = idropParentGui.getIrodsAccount().getDefaultStorageResource();
- final iDrop idropGui = idropParentGui;
- final List<File> sourceFiles;
- CollectionAndDataObjectListingEntry putTarget = (CollectionAndDataObjectListingEntry) parent.getUserObject();
- final String targetIrodsFileAbsolutePath = putTarget.getPathOrName();
-
- try {
- // get the list of files
- sourceFiles = (List<File>) transferable.getTransferData(DataFlavor.javaFileListFlavor);
- } catch (UnsupportedFlavorException ex) {
- Logger.getLogger(IRODSTree.class.getName()).log(Level.SEVERE, null, ex);
- throw new IdropRuntimeException("unsupported flavor getting data from transfer");
- } catch (IOException ex) {
- Logger.getLogger(IRODSTree.class.getName()).log(Level.SEVERE, null, ex);
- throw new IdropRuntimeException("io exception getting data from transfer");
- }
-
- if (sourceFiles.isEmpty()) {
- log.error("no source files in transfer");
- throw new IdropRuntimeException("no source files in transfer");
- }
-
-
- StringBuilder sb = new StringBuilder();
-
- if (sourceFiles.size() > 1) {
- sb.append("Would you like to put multiple files");
- sb.append(" to iRODS at ");
- sb.append(putTarget.getPathOrName());
- } else {
- sb.append("Would you like to put the file ");
- sb.append(sourceFiles.get(0).getAbsolutePath());
- sb.append(" to iRODS at ");
- sb.append(putTarget.getPathOrName());
- }
-
- //default icon, custom title
- int n = JOptionPane.showConfirmDialog(
- this,
- sb.toString(),
- "Confirm a Put to iRODS ",
- JOptionPane.YES_NO_OPTION);
-
- if (n == JOptionPane.YES_OPTION) {
-
- // process the drop as a put
-
- java.awt.EventQueue.invokeLater(new Runnable() {
-
- @Override
- public void run() {
-
- for (File transferFile : sourceFiles) {
- log.info("initiating put transfer for source file:{}", transferFile.getAbsolutePath());
- try {
- idropGui.getTransferManager().enqueueAPut(transferFile.getAbsolutePath(), targetIrodsFileAbsolutePath, sourceResource, idropGui.getIrodsAccount());
- } catch (JargonException ex) {
- java.util.logging.Logger.getLogger(LocalFileTree.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
- idropGui.showIdropException(ex);
- }
- }
- }
- });
-
- }
-
- }
-
- @Override
- public void dragEnter(DropTargetDragEvent dtde) {
- //throw new UnsupportedOperationException("Not supported yet.");
- }
-
- @Override
- public void dragOver(DropTargetDragEvent dtde) {
-
- Point location = dtde.getLocation();
- int closestRow = this.getClosestRowForLocation((int) location.getX(), (int) location.getY());
- boolean highlighted = false;
-
- Graphics g = getGraphics();
-
- // row changed
-
- if (highlightedRow != closestRow) {
- if (null != dirtyRegion) {
- paintImmediately(dirtyRegion);
- }
-
- for (int j = 0; j < getRowCount(); j++) {
- if (closestRow == j) {
-
- Rectangle firstRowRect = getRowBounds(closestRow);
- this.dirtyRegion = firstRowRect;
- g.setColor(highlightColor);
-
- g.fillRect((int) dirtyRegion.getX(), (int) dirtyRegion.getY(), (int) dirtyRegion.getWidth(), (int) dirtyRegion.getHeight());
- highlightedRow = closestRow;
- }
- }
-
- }
-
- }
-
- @Override
- public void dropActionChanged(DropTargetDragEvent dtde) {
- }
-
- @Override
- public void dragExit(DropTargetEvent dte) {
- if (null != dirtyRegion) {
- paintImmediately(dirtyRegion);
- }
- }
- // processes drop from local file tree
-
- private void processDropOfTreeSelectionModel(final Transferable transferable, final IRODSNode parent, final DataFlavor dataFlavor) {
- final List<File> sourceFiles = new ArrayList<File>();
- CollectionAndDataObjectListingEntry putTarget = (CollectionAndDataObjectListingEntry) parent.getUserObject();
- final String targetIrodsFileAbsolutePath;
-
- if (putTarget.getObjectType() == CollectionAndDataObjectListingEntry.ObjectType.COLLECTION) {
- targetIrodsFileAbsolutePath = putTarget.getPathOrName();
- } else {
- targetIrodsFileAbsolutePath = putTarget.getParentPath();
- }
-
- final iDrop idropGui = idropParentGui;
-
- try {
- // get the list of files
- TreeSelectionModel transferableSelectionModel = (TreeSelectionModel) transferable.getTransferData(dataFlavor);
- TreePath[] treePaths = transferableSelectionModel.getSelectionPaths();
-
- for (TreePath treePath : treePaths) {
- LocalFileNode lastPathComponent = (LocalFileNode) treePath.getLastPathComponent();
- sourceFiles.add((File) lastPathComponent.getUserObject());
- }
-
- } catch (UnsupportedFlavorException ex) {
- Logger.getLogger(IRODSTree.class.getName()).log(Level.SEVERE, null, ex);
- throw new IdropRuntimeException("unsupported flavor getting data from transfer");
- } catch (IOException ex) {
- Logger.getLogger(IRODSTree.class.getName()).log(Level.SEVERE, null, ex);
- throw new IdropRuntimeException("io exception getting data from transfer");
- }
-
- if (sourceFiles.isEmpty()) {
- log.error("no source files in transfer");
- throw new IdropRuntimeException("no source files in transfer");
- }
-
- StringBuilder sb = new StringBuilder();
-
- if (sourceFiles.size() > 1) {
- sb.append("Would you like to put multiple files");
- sb.append(" to iRODS at ");
- sb.append(targetIrodsFileAbsolutePath);
- } else {
- sb.append("Would you like to put the file ");
- sb.append(sourceFiles.get(0).getAbsolutePath());
- sb.append(" to iRODS at ");
- sb.append(targetIrodsFileAbsolutePath);
- }
-
- //default icon, custom title
- int n = JOptionPane.showConfirmDialog(
- this,
- sb.toString(),
- "Confirm a Put to iRODS ",
- JOptionPane.YES_NO_OPTION);
-
- if (n == JOptionPane.YES_OPTION) {
-
- // process the drop as a put
-
- java.awt.EventQueue.invokeLater(new Runnable() {
-
- @Override
- public void run() {
-
- for (File transferFile : sourceFiles) {
- log.info("process a put from source: {}", transferFile.getAbsolutePath());
-
- String localSourceAbsolutePath = transferFile.getAbsolutePath();
- String sourceResource = idropParentGui.getIrodsAccount().getDefaultStorageResource();
- log.info("initiating put transfer");
- try {
- idropGui.getTransferManager().enqueueAPut(localSourceAbsolutePath, targetIrodsFileAbsolutePath, sourceResource, idropGui.getIrodsAccount());
- } catch (JargonException ex) {
- java.util.logging.Logger.getLogger(LocalFileTree.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
- idropGui.showIdropException(ex);
- }
- }
- }
- });
- }
-
- }
-
- private void setUpDropListener() throws IdropRuntimeException {
- try {
- DropTarget dt = new DropTarget(this, this);
- } catch (Exception ex) {
- Logger.getLogger(IRODSTree.class.getName()).log(Level.SEVERE, null, ex);
- throw new IdropRuntimeException("too many event listeners");
- }
- }
-
- private void processPhymoveGesture(Transferable transferable, IRODSNode targetNode) {
- log.info("process as drop of file list");
-
- List<IRODSFile> sourceFiles;
- CollectionAndDataObjectListingEntry targetEntry = (CollectionAndDataObjectListingEntry) targetNode.getUserObject();
- if (targetEntry.getObjectType() == CollectionAndDataObjectListingEntry.ObjectType.DATA_OBJECT) {
- log.warn("attempt to move a file to a data object, must be a collection");
- idropParentGui.showMessageFromOperation("unable to move file, the target of the move is not a collection");
- return;
- }
-
- try {
- // get the list of files
- sourceFiles = (List<IRODSFile>) transferable.getTransferData(IRODSTreeTransferable.localPhymoveFlavor);
- } catch (UnsupportedFlavorException ex) {
- Logger.getLogger(IRODSTree.class.getName()).log(Level.SEVERE, null, ex);
- throw new IdropRuntimeException("unsupported flavor getting data from transfer");
- } catch (IOException ex) {
- Logger.getLogger(IRODSTree.class.getName()).log(Level.SEVERE, null, ex);
- throw new IdropRuntimeException("io exception getting data from transfer");
- }
-
- if (sourceFiles.isEmpty()) {
- log.error("no source files in transfer");
- throw new IdropRuntimeException("no source files in transfer");
- }
-
- String targetFileAbsolutePath = targetEntry.getPathOrName();
- MoveIRODSFileToNewIRODSLocationDialog moveIRODSFileOrDirectoryDialog;
- if (sourceFiles.size() == 1) {
- moveIRODSFileOrDirectoryDialog = new MoveIRODSFileToNewIRODSLocationDialog(idropParentGui, true, targetNode, this, sourceFiles.get(0), targetFileAbsolutePath);
- } else {
- moveIRODSFileOrDirectoryDialog = new MoveIRODSFileToNewIRODSLocationDialog(idropParentGui, true, targetNode, this, sourceFiles, targetFileAbsolutePath);
- }
-
- moveIRODSFileOrDirectoryDialog.setLocation((int) (idropParentGui.getLocation().getX() + idropParentGui.getWidth() / 2), (int) (idropParentGui.getLocation().getY() + idropParentGui.getHeight() / 2));
- moveIRODSFileOrDirectoryDialog.setVisible(true);
-
- }
-
- @Override
public void treeExpanded(TreeExpansionEvent event) {
}
@@ -554,7 +229,8 @@ public class IRODSTree extends JTree implements DropTargetListener, TreeWillExpa
if (e.isPopupTrigger()) {
int x = e.getX();
int y = e.getY();
- TreePath path = thisTree.getPathForLocation(x, y);
+
+ TreePath path = thisTree.getClosestPathForLocation(x, y);
if (path != null) {
if (thisTree.isExpanded(path)) {
m_action.putValue(Action.NAME, "Collapse");
@@ -567,11 +243,12 @@ public class IRODSTree extends JTree implements DropTargetListener, TreeWillExpa
}
}
+ @Override
public void mousePressed(MouseEvent e) {
if (e.isPopupTrigger()) {
int x = e.getX();
int y = e.getY();
- TreePath path = thisTree.getPathForLocation(x, y);
+ TreePath path = thisTree.getClosestPathForLocation(x, y);
if (path != null) {
if (thisTree.isExpanded(path)) {
m_action.putValue(Action.NAME, "Collapse");
@@ -599,10 +276,24 @@ public class IRODSTree extends JTree implements DropTargetListener, TreeWillExpa
expandingNode.lazyLoadOfChildrenOfThisNode(!isRefreshingTree());
} catch (IdropException ex) {
Logger.getLogger(IRODSTree.class.getName()).log(Level.SEVERE, null, ex);
+ idropParentGui.showIdropException(ex);
throw new IdropRuntimeException("error expanding irodsNode");
} finally {
setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
-
}
}
+
+ public void highlightPath(final TreePath pathToHighlight) {
+ final IRODSTree highlightTree = this;
+ java.awt.EventQueue.invokeLater(new Runnable() {
+
+ @Override
+ public void run() {
+ highlightTree.collapsePath(pathToHighlight);
+ highlightTree.expandPath(pathToHighlight);
+ // highlightTree.sc
+ // highlightTree.scrollPathToVisible(pathToHighlight);
+ }
+ });
+ }
}
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 8ea5888..ccd80a4 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
@@ -1,16 +1,29 @@
package org.irods.jargon.idrop.desktop.systraygui.viscomponents;
+import java.awt.Graphics;
+import java.awt.Point;
+import java.awt.Rectangle;
+import java.awt.datatransfer.Clipboard;
import java.awt.datatransfer.DataFlavor;
import java.awt.datatransfer.Transferable;
+import java.awt.datatransfer.UnsupportedFlavorException;
+import java.awt.event.InputEvent;
import java.io.File;
+import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JComponent;
+import javax.swing.JOptionPane;
+import javax.swing.JTree;
import javax.swing.TransferHandler;
import javax.swing.tree.TreePath;
+import javax.swing.tree.TreeSelectionModel;
+import org.irods.jargon.core.exception.JargonException;
+import org.irods.jargon.core.pub.io.IRODSFile;
import org.irods.jargon.core.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.services.IRODSFileService;
import org.irods.jargon.idrop.exceptions.IdropException;
@@ -24,7 +37,18 @@ import org.slf4j.LoggerFactory;
*/
public class IRODSTreeTransferHandler extends TransferHandler {
- public static org.slf4j.Logger log = LoggerFactory.getLogger(IRODSTreeTransferHandler.class);
+ @Override
+ public void exportAsDrag(JComponent jc, InputEvent ie, int i) {
+ log.info("export as drag");
+ super.exportAsDrag(jc, ie, i);
+ }
+
+ @Override
+ public void exportToClipboard(JComponent jc, Clipboard clpbrd, int i) throws IllegalStateException {
+ super.exportToClipboard(jc, clpbrd, i);
+ }
+
+ public static org.slf4j.Logger log = LoggerFactory.getLogger(IRODSTreeTransferHandler.class);
public final iDrop idropGui;
public IRODSTreeTransferHandler(final iDrop idropGui, final String string) {
@@ -35,51 +59,139 @@ public class IRODSTreeTransferHandler extends TransferHandler {
this.idropGui = idropGui;
}
+
@Override
- public boolean canImport(TransferSupport support) {
- return super.canImport(support);
+ public boolean importData(TransferSupport ts) {
+
+ log.info("importData in irods:{}", ts);
+ // mac opt = 1 w/o = 2 (no plus icon for a 2 so it's a move) / for drag from local is 1 (copy)
+ Point pt = ts.getDropLocation().getDropPoint();
+ IRODSTree tree = (IRODSTree) ts.getComponent();
+ TreePath targetPath = tree.getClosestPathForLocation(pt.x, pt.y);
+ IRODSNode targetNode = (IRODSNode) targetPath.getLastPathComponent();
+ log.info("drop node is: {}", targetNode);
+
+ Transferable transferable = ts.getTransferable();
+
+ DataFlavor[] transferrableFlavors = transferable.getTransferDataFlavors();
+
+ // see if this is a phymove gesture or an iRODS copy
+ if (transferable.isDataFlavorSupported(IRODSTreeTransferable.irodsTreeDataFlavor)) {
+ log.info("drop accepted, process as a move or copy, based on the action");
+
+ if (ts.isDrop()) {
+ if (ts.getUserDropAction() == 1) {
+ // copy
+ processCopyGesture(transferable, targetNode);
+ return true;
+ } else {
+ processPhymoveGesture(transferable, targetNode);
+ return true;
+ }
+ }
+
+
+ }
+
+ // not a phymove
+
+ boolean accepted = false;
+
+ for (DataFlavor flavor : transferrableFlavors) {
+ log.debug("flavor mime type:{}", flavor.getMimeType());
+ log.debug("flavor human presentable name:{}", flavor.getHumanPresentableName());
+ if (flavor.isFlavorJavaFileListType()) {
+ log.info("drop accepted...process drop as file list from desktop");
+ //dtde.acceptDrop(dtde.getDropAction());
+ processDropOfFileList(transferable, targetNode);
+ accepted = true;
+ break;
+ } else if (flavor.getMimeType().equals("application/x-java-jvm-local-objectref; class=javax.swing.tree.TreeSelectionModel")) {
+ log.info("drop accepted: process drop as serialized object");
+ // dtde.acceptDrop(dtde.getDropAction());
+ processDropOfTreeSelectionModel(transferable, targetNode, flavor);
+ accepted = true;
+ break;
+ } else {
+ log.debug("flavor not processed: {}", flavor);
+ }
+ }
+
+ if (!accepted) {
+ log.info("drop rejected");
+ accepted=false;
+ }
+
+ return accepted;
+
+ // return super.importData(ts);
}
+
@Override
- public boolean canImport(JComponent comp, DataFlavor[] transferFlavors) {
- log.debug("canImport component:{}", comp);
- log.debug("transferFlavors:{}", transferFlavors);
- if (comp instanceof IRODSTree) {
- for (DataFlavor flavor : transferFlavors) {
+ public boolean canImport(TransferSupport support) {
+ Point location = support.getDropLocation().getDropPoint();
+ IRODSTree tree = (IRODSTree) support.getComponent();
+
+
+ log.warn("transferFlavors:{}", support.getDataFlavors());
+
+ // if (support.getComponent() instanceof IRODSTree) {
+ for (DataFlavor flavor : support.getDataFlavors()) {
if (flavor.equals(DataFlavor.javaFileListFlavor)) {
log.debug("found file list flavor, will import");
return true;
+ } else if (flavor.getMimeType().equals("application/x-java-jvm-local-objectref; class=javax.swing.tree.TreeSelectionModel")) {
+ log.debug("found file list flavor, will import");
+ return true;
}
}
- }
+ //}
log.debug("cannot import");
return false;
+
+ }
+
+ @Override
+ public void exportDone(JComponent comp, Transferable trans, int action) {
+ if (action != MOVE) {
+ return;
+ }
+ }
+ /**
+ * We support both copy and move actions.
+ */
+ @Override
+ public int getSourceActions(JComponent c) {
+ return TransferHandler.COPY_OR_MOVE;
}
@Override
protected Transferable createTransferable(JComponent c) {
log.debug("creating a transferrable from the irods tree view");
-
+
List<File> transferFiles = new ArrayList<File>();
IRODSTree stagingViewTree = (IRODSTree) c;
// get the selected node (one for now)
-
- TreePath[] selectionPaths = stagingViewTree.getSelectionModel().getSelectionPaths();
- log.info("transferrable path:{}", selectionPaths);
-
+ int[] rows = idropGui.getIrodsTree().getSelectedRows();
+ log.debug("selected rows for delete:{}", rows);
+
+ List<IRODSNode> nodesToTransfer = new ArrayList<IRODSNode>();
+ for (int row : rows) {
+ nodesToTransfer.add((IRODSNode) idropGui.getIrodsTree().getValueAt(row, 0));
+ }
+
IRODSFileService irodsFileService;
try {
- irodsFileService = new IRODSFileService(idropGui.getIrodsAccount(), idropGui.getIrodsFileSystem());
+ irodsFileService = new IRODSFileService(idropGui.getIrodsAccount(), idropGui.getiDropCore().getIrodsFileSystem());
} catch (IdropException ex) {
Logger.getLogger(IRODSTreeTransferHandler.class.getName()).log(Level.SEVERE, null, ex);
throw new IdropRuntimeException(ex);
}
- IRODSNode listingEntryNode;
String objectPath;
- for (TreePath selectionPath : selectionPaths) {
- listingEntryNode = (IRODSNode) selectionPath.getLastPathComponent();
- CollectionAndDataObjectListingEntry listingEntry = (CollectionAndDataObjectListingEntry) listingEntryNode.getUserObject();
+ for (IRODSNode nodeToTransfer : nodesToTransfer) {
+ CollectionAndDataObjectListingEntry listingEntry = (CollectionAndDataObjectListingEntry) nodeToTransfer.getUserObject();
if (listingEntry.getObjectType() == CollectionAndDataObjectListingEntry.ObjectType.COLLECTION) {
objectPath = listingEntry.getPathOrName();
} else {
@@ -95,5 +207,248 @@ public class IRODSTreeTransferHandler extends TransferHandler {
}
return new IRODSTreeTransferable(transferFiles, stagingViewTree);
+
+ }
+
+ private void processDropOfTreeSelectionModel(final Transferable transferable, final IRODSNode parent, final DataFlavor dataFlavor) {
+ final List<File> sourceFiles = new ArrayList<File>();
+ CollectionAndDataObjectListingEntry putTarget = (CollectionAndDataObjectListingEntry) parent.getUserObject();
+ final String targetIrodsFileAbsolutePath;
+
+ if (putTarget.getObjectType() == CollectionAndDataObjectListingEntry.ObjectType.COLLECTION) {
+ targetIrodsFileAbsolutePath = putTarget.getPathOrName();
+ } else {
+ targetIrodsFileAbsolutePath = putTarget.getParentPath();
+ }
+
+ try {
+ // get the list of files
+ TreeSelectionModel transferableSelectionModel = (TreeSelectionModel) transferable.getTransferData(dataFlavor);
+ TreePath[] treePaths = transferableSelectionModel.getSelectionPaths();
+
+ for (TreePath treePath : treePaths) {
+ LocalFileNode lastPathComponent = (LocalFileNode) treePath.getLastPathComponent();
+ sourceFiles.add((File) lastPathComponent.getUserObject());
+ }
+
+ } catch (UnsupportedFlavorException ex) {
+ Logger.getLogger(IRODSTree.class.getName()).log(Level.SEVERE, null, ex);
+ throw new IdropRuntimeException("unsupported flavor getting data from transfer");
+ } catch (IOException ex) {
+ Logger.getLogger(IRODSTree.class.getName()).log(Level.SEVERE, null, ex);
+ throw new IdropRuntimeException("io exception getting data from transfer");
+ }
+
+ if (sourceFiles.isEmpty()) {
+ log.error("no source files in transfer");
+ throw new IdropRuntimeException("no source files in transfer");
+ }
+
+ StringBuilder sb = new StringBuilder();
+
+ if (sourceFiles.size() > 1) {
+ sb.append("Would you like to put multiple files");
+ sb.append(" to iRODS at ");
+ sb.append(targetIrodsFileAbsolutePath);
+ } else {
+ sb.append("Would you like to put the file ");
+ sb.append(sourceFiles.get(0).getAbsolutePath());
+ sb.append(" to iRODS at ");
+ sb.append(targetIrodsFileAbsolutePath);
+ }
+
+ //default icon, custom title
+ int n = JOptionPane.showConfirmDialog(
+ idropGui,
+ sb.toString(),
+ "Confirm a Put to iRODS ",
+ JOptionPane.YES_NO_OPTION);
+
+ if (n == JOptionPane.YES_OPTION) {
+
+ // process the drop as a put
+
+ java.awt.EventQueue.invokeLater(new Runnable() {
+
+ @Override
+ public void run() {
+
+ for (File transferFile : sourceFiles) {
+ log.info("process a put from source: {}", transferFile.getAbsolutePath());
+
+ String localSourceAbsolutePath = transferFile.getAbsolutePath();
+ String sourceResource = idropGui.getIrodsAccount().getDefaultStorageResource();
+ log.info("initiating put transfer");
+ try {
+ idropGui.getiDropCore().getTransferManager().enqueueAPut(localSourceAbsolutePath, targetIrodsFileAbsolutePath, sourceResource, idropGui.getIrodsAccount());
+ } catch (JargonException ex) {
+ java.util.logging.Logger.getLogger(LocalFileTree.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
+ idropGui.showIdropException(ex);
+ }
+ }
+ }
+ });
+ }
+
+ }
+
+ private void processPhymoveGesture(Transferable transferable, IRODSNode targetNode) {
+ log.info("process as drop of file list");
+
+ List<IRODSFile> sourceFiles;
+ CollectionAndDataObjectListingEntry targetEntry = (CollectionAndDataObjectListingEntry) targetNode.getUserObject();
+ if (targetEntry.getObjectType() == CollectionAndDataObjectListingEntry.ObjectType.DATA_OBJECT) {
+ log.warn("attempt to move a file to a data object, must be a collection");
+ idropGui.showMessageFromOperation("unable to move file, the target of the move is not a collection");
+ return;
+ }
+
+ try {
+ // get the list of files
+ sourceFiles = (List<IRODSFile>) transferable.getTransferData(IRODSTreeTransferable.irodsTreeDataFlavor);
+ } catch (UnsupportedFlavorException ex) {
+ Logger.getLogger(IRODSTree.class.getName()).log(Level.SEVERE, null, ex);
+ throw new IdropRuntimeException("unsupported flavor getting data from transfer");
+ } catch (IOException ex) {
+ Logger.getLogger(IRODSTree.class.getName()).log(Level.SEVERE, null, ex);
+ throw new IdropRuntimeException("io exception getting data from transfer");
+ }
+
+ if (sourceFiles.isEmpty()) {
+ log.error("no source files in transfer");
+ throw new IdropRuntimeException("no source files in transfer");
+ }
+
+ String targetFileAbsolutePath = targetEntry.getPathOrName();
+ MoveOrCopyiRODSDialog moveIRODSFileOrDirectoryDialog;
+ if (sourceFiles.size() == 1) {
+ moveIRODSFileOrDirectoryDialog = new MoveOrCopyiRODSDialog(idropGui, true, targetNode, idropGui.getIrodsTree(), sourceFiles.get(0), targetFileAbsolutePath, false);
+ } else {
+ moveIRODSFileOrDirectoryDialog = new MoveOrCopyiRODSDialog(idropGui, true, targetNode, idropGui.getIrodsTree(), sourceFiles, targetFileAbsolutePath, false);
+ }
+
+ moveIRODSFileOrDirectoryDialog.setLocation((int) (idropGui.getLocation().getX() + idropGui.getWidth() / 2), (int) (idropGui.getLocation().getY() + idropGui.getHeight() / 2));
+ moveIRODSFileOrDirectoryDialog.setVisible(true);
+
+ }
+
+ // handle a drop from the local file system
+ private void processDropOfFileList(Transferable transferable, IRODSNode parent) throws IdropRuntimeException {
+
+ log.info("process as drop of file list");
+
+ final String sourceResource = idropGui.getIrodsAccount().getDefaultStorageResource();
+ final List<File> sourceFiles;
+ CollectionAndDataObjectListingEntry putTarget = (CollectionAndDataObjectListingEntry) parent.getUserObject();
+ final String targetIrodsFileAbsolutePath = putTarget.getPathOrName();
+
+ try {
+ // get the list of files
+ sourceFiles = (List<File>) transferable.getTransferData(DataFlavor.javaFileListFlavor);
+ } catch (UnsupportedFlavorException ex) {
+ Logger.getLogger(IRODSTree.class.getName()).log(Level.SEVERE, null, ex);
+ throw new IdropRuntimeException("unsupported flavor getting data from transfer");
+ } catch (IOException ex) {
+ Logger.getLogger(IRODSTree.class.getName()).log(Level.SEVERE, null, ex);
+ throw new IdropRuntimeException("io exception getting data from transfer");
+ }
+
+ if (sourceFiles.isEmpty()) {
+ log.error("no source files in transfer");
+ throw new IdropRuntimeException("no source files in transfer");
+ }
+
+ StringBuilder sb = new StringBuilder();
+
+ if (sourceFiles.size() > 1) {
+ sb.append("Would you like to put multiple files");
+ sb.append(" to iRODS at ");
+ sb.append(putTarget.getPathOrName());
+ } else {
+ sb.append("Would you like to put the file ");
+ sb.append(sourceFiles.get(0).getAbsolutePath());
+ sb.append(" to iRODS at ");
+ sb.append(putTarget.getPathOrName());
+ }
+
+ //default icon, custom title
+ int n = JOptionPane.showConfirmDialog(
+ idropGui,
+ sb.toString(),
+ "Confirm a Put to iRODS ",
+ JOptionPane.YES_NO_OPTION);
+
+ if (n == JOptionPane.YES_OPTION) {
+
+ // process the drop as a put
+
+ java.awt.EventQueue.invokeLater(new Runnable() {
+
+ @Override
+ public void run() {
+
+ for (File transferFile : sourceFiles) {
+ log.info("initiating put transfer for source file:{}", transferFile.getAbsolutePath());
+ try {
+ idropGui.getiDropCore().getTransferManager().enqueueAPut(transferFile.getAbsolutePath(), targetIrodsFileAbsolutePath, sourceResource, idropGui.getIrodsAccount());
+ } catch (JargonException ex) {
+ java.util.logging.Logger.getLogger(LocalFileTree.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
+ idropGui.showIdropException(ex);
+ }
+ }
+ }
+ });
+
+ }
+
+ }
+
+ private void processCopyGesture(Transferable transferable, IRODSNode targetNode) {
+ log.info("process as drop of file list");
+
+ List<IRODSFile> sourceFiles;
+ CollectionAndDataObjectListingEntry targetEntry = (CollectionAndDataObjectListingEntry) targetNode.getUserObject();
+ if (targetEntry.getObjectType() == CollectionAndDataObjectListingEntry.ObjectType.DATA_OBJECT) {
+ log.warn("attempt to copy a file to a data object, must be a collection");
+ idropGui.showMessageFromOperation("unable to copy file, the target of the copy is not a collection");
+ return;
+ }
+
+ try {
+ // get the list of files
+ sourceFiles = (List<IRODSFile>) transferable.getTransferData(IRODSTreeTransferable.irodsTreeDataFlavor);
+
+ /* for the source files, default to the resource that was specified at login,this might need to be reconsidered
+ * but can cause a -321000 no resc error if no default set in irods.
+ */
+
+ for (IRODSFile sourceFile : sourceFiles) {
+ sourceFile.setResource(idropGui.getiDropCore().getIrodsAccount().getDefaultStorageResource());
+ }
+
+ } catch (UnsupportedFlavorException ex) {
+ Logger.getLogger(IRODSTree.class.getName()).log(Level.SEVERE, null, ex);
+ throw new IdropRuntimeException("unsupported flavor getting data from transfer");
+ } catch (IOException ex) {
+ Logger.getLogger(IRODSTree.class.getName()).log(Level.SEVERE, null, ex);
+ throw new IdropRuntimeException("io exception getting data from transfer");
+ }
+
+ if (sourceFiles.isEmpty()) {
+ log.error("no source files in transfer");
+ throw new IdropRuntimeException("no source files in transfer");
+ }
+
+ String targetFileAbsolutePath = targetEntry.getPathOrName();
+ MoveOrCopyiRODSDialog moveIRODSFileOrDirectoryDialog;
+ if (sourceFiles.size() == 1) {
+ moveIRODSFileOrDirectoryDialog = new MoveOrCopyiRODSDialog(idropGui, true, targetNode, idropGui.getIrodsTree(), sourceFiles.get(0), targetFileAbsolutePath, true);
+ } else {
+ moveIRODSFileOrDirectoryDialog = new MoveOrCopyiRODSDialog(idropGui, true, targetNode, idropGui.getIrodsTree(), sourceFiles, targetFileAbsolutePath,true);
+ }
+
+ moveIRODSFileOrDirectoryDialog.setLocation((int) (idropGui.getLocation().getX() + idropGui.getWidth() / 2), (int) (idropGui.getLocation().getY() + idropGui.getHeight() / 2));
+ moveIRODSFileOrDirectoryDialog.setVisible(true);
}
+
}
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/IRODSTreeTransferable.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/IRODSTreeTransferable.java
index 775f4d6..964654b 100644
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/IRODSTreeTransferable.java
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/IRODSTreeTransferable.java
@@ -21,19 +21,20 @@ public class IRODSTreeTransferable implements Transferable {
private List<File> files;
private IRODSTree stagingViewTree;
public static org.slf4j.Logger log = LoggerFactory.getLogger(IRODSTreeTransferable.class);
- public static DataFlavor localPhymoveFlavor = null;
+ public static DataFlavor irodsTreeDataFlavor = null;
static {
try {
- localPhymoveFlavor = new DataFlavor(org.irods.jargon.idrop.desktop.systraygui.viscomponents.IRODSTreeTransferable.class,
+ irodsTreeDataFlavor = new DataFlavor(org.irods.jargon.idrop.desktop.systraygui.viscomponents.IRODSTreeTransferable.class,
"Local phymove");
} catch (Exception e) {
log.error("error creating transferrable", e);
}
}
- public String toString() {
+ @Override
+ public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("staging view tree transferrable:");
if (files == null) {
@@ -66,12 +67,12 @@ public class IRODSTreeTransferable implements Transferable {
@Override
public DataFlavor[] getTransferDataFlavors() {
log.debug("getting data flavors from idrop series (will be a list with one iros file for file or collection");
- return new DataFlavor[]{DataFlavor.javaFileListFlavor, localPhymoveFlavor};
+ return new DataFlavor[]{DataFlavor.javaFileListFlavor, irodsTreeDataFlavor};
}
@Override
public boolean isDataFlavorSupported(DataFlavor flavor) {
- return (flavor.equals(DataFlavor.javaFileListFlavor) || flavor.equals(localPhymoveFlavor));
+ return (flavor.equals(DataFlavor.javaFileListFlavor) || flavor.equals(irodsTreeDataFlavor));
}
@Override
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 0ac9810..ba6c047 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
@@ -15,10 +15,8 @@ import java.util.logging.Logger;
import javax.swing.JOptionPane;
import javax.swing.tree.TreePath;
import javax.swing.tree.TreeSelectionModel;
-import org.irods.jargon.core.pub.DataTransferOperations;
import org.irods.jargon.core.pub.domain.Collection;
import org.irods.jargon.core.pub.domain.DataObject;
-import org.irods.jargon.core.pub.io.IRODSFile;
import org.irods.jargon.idrop.desktop.systraygui.iDrop;
import org.irods.jargon.idrop.exceptions.IdropException;
import org.slf4j.LoggerFactory;
@@ -221,7 +219,7 @@ public class InfoPanelTransferHandler extends TransferHandler {
try {
log.info("enqueue a put operation");
- idropGui.getTransferManager().enqueueAPut(sourcePath, dataObject.getCollectionName(), idropGui.getIrodsAccount().getDefaultStorageResource(), idropGui.getIrodsAccount());
+ idropGui.getiDropCore().getTransferManager().enqueueAPut(sourcePath, dataObject.getCollectionName(), idropGui.getIrodsAccount().getDefaultStorageResource(), idropGui.getIrodsAccount());
} catch (JargonException ex) {
Logger.getLogger(InfoPanelTransferHandler.class.getName()).log(Level.SEVERE, null, ex);
throw new IdropException("error enqueing put operation", ex);
@@ -242,7 +240,7 @@ public class InfoPanelTransferHandler extends TransferHandler {
try {
log.info("enqueue a put operation");
- idropGui.getTransferManager().enqueueAPut(sourcePath, collection.getCollectionName(), idropGui.getIrodsAccount().getDefaultStorageResource(), idropGui.getIrodsAccount());
+ idropGui.getiDropCore().getTransferManager().enqueueAPut(sourcePath, collection.getCollectionName(), idropGui.getIrodsAccount().getDefaultStorageResource(), idropGui.getIrodsAccount());
} catch (JargonException ex) {
Logger.getLogger(InfoPanelTransferHandler.class.getName()).log(Level.SEVERE, null, ex);
throw new IdropException("error enqueing put operation", ex);
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
new file mode 100644
index 0000000..ddd0b32
--- /dev/null
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/IrodsSelectionListenerForBuildingInfoPanel.java
@@ -0,0 +1,161 @@
+/*
+ *A listener for iRODS tree selected
+ */
+package org.irods.jargon.idrop.desktop.systraygui.viscomponents;
+
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import javax.swing.event.ListSelectionEvent;
+import javax.swing.event.ListSelectionListener;
+import javax.swing.event.TreeExpansionEvent;
+import javax.swing.event.TreeExpansionListener;
+import javax.swing.event.TreeSelectionEvent;
+import javax.swing.event.TreeSelectionListener;
+import org.irods.jargon.core.pub.CollectionAO;
+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.exceptions.IdropException;
+import org.irods.jargon.idrop.exceptions.IdropRuntimeException;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Class to encapsulate handling of info panel. This object will listen to tree selection events in the iDROP
+ * iRODS tree, and initialize the info panel.
+ *
+ *
+ *
+ * @author Mike Conway - DICE (www.irods.org)
+ */
+public class IrodsSelectionListenerForBuildingInfoPanel implements ListSelectionListener {
+
+ public static org.slf4j.Logger log = LoggerFactory.getLogger(IrodsSelectionListenerForBuildingInfoPanel.class);
+ private final iDrop idrop;
+ private IRODSOutlineModel irodsFileSystemModel = null;
+
+ public IrodsSelectionListenerForBuildingInfoPanel(final iDrop idrop) throws IdropException {
+ if (idrop == null) {
+ throw new IdropException("null iDrop");
+ }
+
+ this.idrop = idrop;
+
+ }
+
+ public void valueChanged(TreeSelectionEvent e) {
+//FIXME: reimplement
+
+ /*
+ if (!(idrop.getIrodsTree().getLastSelectedPathComponent() instanceof IRODSNode)) {
+ log.info("last selected is not a Node");
+ return;
+ }
+
+
+ final IRODSNode node = (IRODSNode) idrop.getIrodsTree().getLastSelectedPathComponent();
+ try {
+ identifyNodeTypeAndInitializeInfoPanel(node);
+ } catch (IdropException ex) {
+ Logger.getLogger(IrodsTreeListenerForBuildingInfoPanel.class.getName()).log(Level.SEVERE, null, ex);
+ throw new IdropRuntimeException("exception processing valueChanged() event for IRODSNode selection");
+ }
+
+ * *
+ */
+ }
+
+ public void treeExpanded(TreeExpansionEvent event) {
+ /*TreePath expandedTreePath = event.getPath();
+ IRODSNode expandedNode = (IRODSNode) expandedTreePath.getLastPathComponent();
+ try {
+ identifyNodeTypeAndInitializeInfoPanel(expandedNode);
+ } catch (IdropException ex) {
+ Logger.getLogger(IrodsTreeListenerForBuildingInfoPanel.class.getName()).log(Level.SEVERE, null, ex);
+ throw new IdropRuntimeException("exception processing treeExpanded() event for IRODSNode selection");
+ }*/
+ }
+
+ public void treeCollapsed(TreeExpansionEvent event) {
+ // operation not needed, left for interface contract
+ }
+
+ /**
+ * Look at the kind of irods node and handle appropriately
+ * @param irodsNode
+ * @throws IdropException
+ */
+ public void identifyNodeTypeAndInitializeInfoPanel(final IRODSNode irodsNode) throws IdropException {
+
+ if (!idrop.getToggleIrodsDetails().isSelected()) {
+ return;
+ }
+
+ if (irodsNode.isLeaf()) {
+ log.info("selected node is a leaf, get a data object");
+ buildDataObjectFromSelectedIRODSNodeAndGiveToInfoPanel(irodsNode);
+ } else {
+ log.info("selected node is a collection, get a collection object");
+ buildCollectionFromSelectedIRODSNodeAndGiveToInfoPanel(irodsNode);
+ }
+ }
+
+ /**
+ * When a selected node in the iRODS tree is a data object, put the data object info in the info panel
+ * @param irodsNode
+ */
+ private void buildDataObjectFromSelectedIRODSNodeAndGiveToInfoPanel(final IRODSNode irodsNode) throws IdropException {
+ try {
+ CollectionAndDataObjectListingEntry collectionAndDataObjectListingEntry = (CollectionAndDataObjectListingEntry) irodsNode.getUserObject();
+ log.info("will be getting a data object based on entry in IRODSNode:{}", irodsNode);
+ DataObjectAO dataObjectAO = idrop.getiDropCore().getIRODSAccessObjectFactory().getDataObjectAO(idrop.getIrodsAccount());
+ DataObject dataObject = dataObjectAO.findByCollectionNameAndDataName(collectionAndDataObjectListingEntry.getParentPath(), collectionAndDataObjectListingEntry.getPathOrName());
+ idrop.initializeInfoPanel(dataObject);
+ } catch (Exception e) {
+ log.error("error building data object for: {}", irodsNode);
+ throw new IdropException(e);
+ }
+ }
+
+ /**
+ * When a selected node in the iRODS tree is a collection, put the collection info into the info panel
+ * @param irodsNode
+ */
+ private void buildCollectionFromSelectedIRODSNodeAndGiveToInfoPanel(final IRODSNode irodsNode) throws IdropException {
+ try {
+ CollectionAndDataObjectListingEntry collectionAndDataObjectListingEntry = (CollectionAndDataObjectListingEntry) irodsNode.getUserObject();
+ log.info("will be getting a collection based on entry in IRODSNode:{}", irodsNode);
+ CollectionAO collectionAO = idrop.getiDropCore().getIRODSAccessObjectFactory().getCollectionAO(idrop.getIrodsAccount());
+ Collection collection = collectionAO.findByAbsolutePath(collectionAndDataObjectListingEntry.getPathOrName());
+ idrop.initializeInfoPanel(collection);
+ } catch (Exception e) {
+ log.error("error building collection objectt for: {}", irodsNode);
+ throw new IdropException(e);
+
+ }
+ }
+
+ @Override
+ public void valueChanged(ListSelectionEvent lse) {
+ if (lse.getValueIsAdjusting()) {
+ return;
+ }
+ log.info("lse: {}", lse);
+
+ if (irodsFileSystemModel == null) {
+ irodsFileSystemModel = (IRODSOutlineModel) idrop.getIrodsTree().getModel();
+ }
+
+ // use first selection for info
+ int idx = lse.getLastIndex();
+ IRODSNode selectedNode = (IRODSNode) irodsFileSystemModel.getValueAt(idx, 0);
+ log.info("selected node to initialize info panel:{}", selectedNode);
+ try {
+ identifyNodeTypeAndInitializeInfoPanel(selectedNode);
+ } catch (IdropException ex) {
+ Logger.getLogger(IrodsSelectionListenerForBuildingInfoPanel.class.getName()).log(Level.SEVERE, null, ex);
+ throw new IdropRuntimeException("error initializing info panel for selected irods node");
+ }
+ }
+}
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 5463c67..cbfb67d 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
@@ -9,8 +9,6 @@ import javax.swing.event.TreeExpansionEvent;
import javax.swing.event.TreeExpansionListener;
import javax.swing.event.TreeSelectionEvent;
import javax.swing.event.TreeSelectionListener;
-import javax.swing.tree.TreePath;
-import org.irods.jargon.core.exception.JargonException;
import org.irods.jargon.core.pub.CollectionAO;
import org.irods.jargon.core.pub.DataObjectAO;
import org.irods.jargon.core.pub.domain.Collection;
@@ -45,12 +43,14 @@ public class IrodsTreeListenerForBuildingInfoPanel implements TreeSelectionListe
@Override
public void valueChanged(TreeSelectionEvent e) {
+//FIXME: reimplement
-
+ /*
if (!(idrop.getIrodsTree().getLastSelectedPathComponent() instanceof IRODSNode)) {
log.info("last selected is not a Node");
return;
}
+
final IRODSNode node = (IRODSNode) idrop.getIrodsTree().getLastSelectedPathComponent();
try {
@@ -60,6 +60,9 @@ public class IrodsTreeListenerForBuildingInfoPanel implements TreeSelectionListe
throw new IdropRuntimeException("exception processing valueChanged() event for IRODSNode selection");
}
+ * *
+ */
+
}
@Override
@@ -107,7 +110,7 @@ public class IrodsTreeListenerForBuildingInfoPanel implements TreeSelectionListe
try {
CollectionAndDataObjectListingEntry collectionAndDataObjectListingEntry = (CollectionAndDataObjectListingEntry) irodsNode.getUserObject();
log.info("will be getting a data object based on entry in IRODSNode:{}", irodsNode);
- DataObjectAO dataObjectAO = idrop.getIrodsFileSystem().getIRODSAccessObjectFactory().getDataObjectAO(idrop.getIrodsAccount());
+ DataObjectAO dataObjectAO = idrop.getiDropCore().getIRODSAccessObjectFactory().getDataObjectAO(idrop.getIrodsAccount());
DataObject dataObject = dataObjectAO.findByCollectionNameAndDataName(collectionAndDataObjectListingEntry.getParentPath(), collectionAndDataObjectListingEntry.getPathOrName());
idrop.initializeInfoPanel(dataObject);
} catch (Exception e) {
@@ -124,7 +127,7 @@ public class IrodsTreeListenerForBuildingInfoPanel implements TreeSelectionListe
try {
CollectionAndDataObjectListingEntry collectionAndDataObjectListingEntry = (CollectionAndDataObjectListingEntry) irodsNode.getUserObject();
log.info("will be getting a collection based on entry in IRODSNode:{}", irodsNode);
- CollectionAO collectionAO = idrop.getIrodsFileSystem().getIRODSAccessObjectFactory().getCollectionAO(idrop.getIrodsAccount());
+ CollectionAO collectionAO = idrop.getiDropCore().getIRODSAccessObjectFactory().getCollectionAO(idrop.getIrodsAccount());
Collection collection = collectionAO.findByAbsolutePath(collectionAndDataObjectListingEntry.getPathOrName());
idrop.initializeInfoPanel(collection);
} catch (Exception e) {
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/LocalFileNode.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/LocalFileNode.java
index d0a496b..9aaf39b 100644
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/LocalFileNode.java
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/LocalFileNode.java
@@ -18,6 +18,10 @@ public class LocalFileNode extends DefaultMutableTreeNode {
private boolean cached = false;
+ public boolean isCached() {
+ return cached;
+ }
+
public static org.slf4j.Logger log = LoggerFactory.getLogger(LocalFileNode.class);
public LocalFileNode(final File file) {
@@ -54,19 +58,8 @@ public class LocalFileNode extends DefaultMutableTreeNode {
@Override
public void insert(MutableTreeNode arg0, int arg1) {
super.insert(arg0, arg1);
- Collections.sort(this.children, nodeComparator);
}
-
- protected static Comparator nodeComparator = new Comparator() {
- public int compare(Object o1, Object o2) {
- return o1.toString().compareToIgnoreCase(o2.toString());
- }
-
- public boolean equals(Object obj) {
- return false;
- }
- };
-
+
public void forceReloadOfChildrenOfThisNode() {
cached = false;
this.removeAllChildren();
@@ -82,6 +75,7 @@ public class LocalFileNode extends DefaultMutableTreeNode {
} else {
returnedString = localFile.getName();
}
+ // log.debug("name for node is: {}", returnedString);
return returnedString;
}
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/LocalFileSystemModel.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/LocalFileSystemModel.java
index ad33e0d..015effe 100644
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/LocalFileSystemModel.java
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/LocalFileSystemModel.java
@@ -1,8 +1,16 @@
package org.irods.jargon.idrop.desktop.systraygui.viscomponents;
+import java.io.File;
import javax.swing.tree.DefaultMutableTreeNode;
import javax.swing.tree.DefaultTreeModel;
+import javax.swing.tree.TreePath;
+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.utils.TreeUtils;
+import org.irods.jargon.idrop.exceptions.IdropException;
+import org.slf4j.LoggerFactory;
/**
* (NEW) Implementation of the DefaultTreeModel for the local file system.
@@ -10,6 +18,8 @@ import javax.swing.tree.DefaultTreeModel;
*/
public class LocalFileSystemModel extends DefaultTreeModel {
+ public static org.slf4j.Logger log = LoggerFactory.getLogger(LocalFileSystemModel.class);
+
public LocalFileSystemModel(DefaultMutableTreeNode node) {
super(node);
// pre-expand the child nodes of the root
@@ -17,5 +27,38 @@ public class LocalFileSystemModel extends DefaultTreeModel {
localFileNode.lazyLoadOfChildrenOfThisNode();
}
+ public void notifyCompletionOfOperation(final LocalFileTree fileTree, final TransferStatus transferStatus) throws IdropException {
+ log.info("tree model notified of status:{}", transferStatus);
+
+ if (transferStatus.getTransferState() != TransferState.OVERALL_COMPLETION) {
+ return;
+ }
+
+ // for put or copy operation, highlight the new node
+ if (transferStatus.getTransferType() == TransferStatus.TransferType.GET) {
+ log.info("successful get transfer, find the parent tree node, and clear the children");
+
+ TreePath parentNodePath = TreeUtils.buildTreePathForLocalAbsolutePath(fileTree, transferStatus.getTargetFileAbsolutePath());
+ log.debug("tree path for put: {}", parentNodePath);
+ LocalFileNode targetNode = (LocalFileNode) parentNodePath.getLastPathComponent();
+ File entry = (File) targetNode.getUserObject();
+ if (entry.isFile()) {
+ log.info("substitute parent as target, as given node was a leaf");
+ targetNode = (LocalFileNode) targetNode.getParent();
+ }
+ targetNode.forceReloadOfChildrenOfThisNode();
+ targetNode.lazyLoadOfChildrenOfThisNode();
+ this.reload(targetNode);
+ if (entry.isFile()) {
+ parentNodePath = TreeUtils.buildTreePathForLocalAbsolutePath(fileTree, entry.getParent());
+ fileTree.highlightPath(parentNodePath);
+ } else {
+ fileTree.highlightPath(parentNodePath);
+
+ }
+
+ }
+ }
+
}
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 17c511b..4eea604 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
@@ -5,30 +5,14 @@
package org.irods.jargon.idrop.desktop.systraygui.viscomponents;
import java.awt.Color;
-import java.awt.Graphics;
-import java.awt.Point;
import java.awt.Rectangle;
-import java.awt.datatransfer.DataFlavor;
-import java.awt.datatransfer.Transferable;
-import java.awt.datatransfer.UnsupportedFlavorException;
-import java.awt.dnd.DropTarget;
-import java.awt.dnd.DropTargetContext;
-import java.awt.dnd.DropTargetDragEvent;
-import java.awt.dnd.DropTargetDropEvent;
-import java.awt.dnd.DropTargetEvent;
-import java.awt.dnd.DropTargetListener;
import java.awt.event.ActionEvent;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.io.File;
-import java.io.IOException;
import java.util.Enumeration;
-import java.util.List;
-import java.util.logging.Level;
-import java.util.logging.Logger;
import javax.swing.AbstractAction;
import javax.swing.Action;
-import javax.swing.JOptionPane;
import javax.swing.JPopupMenu;
import javax.swing.JTree;
import javax.swing.event.TreeExpansionEvent;
@@ -37,13 +21,9 @@ import javax.swing.tree.DefaultTreeCellRenderer;
import javax.swing.tree.ExpandVetoException;
import javax.swing.tree.TreeModel;
import javax.swing.tree.TreePath;
-import org.irods.jargon.core.exception.JargonException;
-import org.irods.jargon.core.pub.io.IRODSFile;
-import org.irods.jargon.core.query.CollectionAndDataObjectListingEntry;
import org.irods.jargon.idrop.desktop.systraygui.DeleteLocalFileDialog;
import org.irods.jargon.idrop.desktop.systraygui.NewLocalDirectoryDialog;
import org.irods.jargon.idrop.desktop.systraygui.RenameLocalDirectoryDialog;
-import org.irods.jargon.idrop.exceptions.IdropRuntimeException;
import org.slf4j.LoggerFactory;
import org.irods.jargon.idrop.desktop.systraygui.iDrop;
import org.irods.jargon.idrop.exceptions.IdropException;
@@ -52,7 +32,7 @@ import org.irods.jargon.idrop.exceptions.IdropException;
* JTree for viewing local file system, includes DnD support from StagingViewTree.
* @author Mike Conway - DICE (www.irods.org)
*/
-public class LocalFileTree extends JTree implements DropTargetListener, TreeWillExpandListener {
+public class LocalFileTree extends JTree implements TreeWillExpandListener {
public static org.slf4j.Logger log = LoggerFactory.getLogger(LocalFileTree.class);
private iDrop idropParentGui = null;
@@ -61,195 +41,43 @@ public class LocalFileTree extends JTree implements DropTargetListener, TreeWill
protected TreePath m_clickedPath;
protected LocalFileTree thisTree;
private int highlightedRow = -1;
- private Rectangle dirtyRegion = null;
+ private Rectangle dirtyRegion = null;
private Color highlightColor = new Color(Color.BLUE.getRed(), Color.BLUE.getGreen(), Color.BLUE.getBlue(), 100);
- public LocalFileTree(TreeModel newModel, iDrop idropParentGui) {
- super(newModel);
- this.setCellRenderer(new DefaultTreeCellRenderer());
- setUpDropListener();
- this.idropParentGui = idropParentGui;
- setUpTreeMenu();
-
+ public Rectangle getDirtyRegion() {
+ return dirtyRegion;
}
- public LocalFileTree() {
- super();
- setUpDropListener();
- this.thisTree = this;
- setUpTreeMenu();
+ public void setDirtyRegion(Rectangle dirtyRegion) {
+ this.dirtyRegion = dirtyRegion;
}
- @Override
- public void drop(DropTargetDropEvent dtde) {
-
- // process a drop onto this tree
- log.info("drop event:{}", dtde);
- Point pt = dtde.getLocation();
- DropTargetContext dtc = dtde.getDropTargetContext();
- JTree tree = (JTree) dtc.getComponent();
- TreePath parentpath = tree.getClosestPathForLocation(pt.x, pt.y);
- LocalFileNode nodeThatWasDropTarget = (LocalFileNode) parentpath.getLastPathComponent();
- final File nodeThatWasDropTargetAsFile = (File) nodeThatWasDropTarget.getUserObject();
- log.info("drop node is: {}", nodeThatWasDropTargetAsFile);
- LocalFileSystemModel fileSystemModel = (LocalFileSystemModel) this.getModel();
-
- Transferable transferable = dtde.getTransferable();
-
- DataFlavor[] transferrableFlavors = transferable.getTransferDataFlavors();
-
- for (DataFlavor flavor : transferrableFlavors) {
- log.debug("flavor mime type:{}", flavor.getMimeType());
- if (flavor.isFlavorJavaFileListType()) {
- log.info("process drop as file list");
- dtde.acceptDrop(dtde.getDropAction());
- processDropAfterAcceptingDataFlavor(transferable, nodeThatWasDropTargetAsFile);
- break;
- } else if (flavor.getMimeType().equals("application/x-java-jvm-local-objectref; class=javax.swing.tree.TreeSelectionModel")) {
- log.info("process drop as serialized object");
- dtde.acceptDrop(dtde.getDropAction());
- processDropFromSerializedObjectType(transferable, nodeThatWasDropTargetAsFile);
- break;
- } else if (flavor.getMimeType().equals("application/x-java-jvm-local-objectref; class=org.irods.jargon.idrop.desktop.systraygui.viscomponents.DefaultFileRepresentationPanel")) {
- dtde.acceptDrop(dtde.getDropAction());
- try {
- processDropFromFileRepresentationPanel(transferable, nodeThatWasDropTargetAsFile, flavor);
- } catch (IdropException ex) {
- Logger.getLogger(LocalFileTree.class.getName()).log(Level.SEVERE, null, ex);
- throw new IdropRuntimeException(ex);
- }
- } else {
- log.debug("flavor not processed: {}", flavor);
- }
- }
+ public Color getHighlightColor() {
+ return highlightColor;
}
- private void processDropAfterAcceptingDataFlavor(Transferable transferable, File nodeThatWasDropTargetAsFile) throws IdropRuntimeException {
-
- final iDrop idropGui = idropParentGui;
- final List<File> sourceFiles;
-
- try {
- // get the list of files
- sourceFiles = (List<File>) transferable.getTransferData(DataFlavor.javaFileListFlavor);
- } catch (UnsupportedFlavorException ex) {
- throw new IdropRuntimeException("unsupported flavor getting data from transfer");
- } catch (IOException ex) {
- throw new IdropRuntimeException("io exception getting data from transfer");
- }
-
- if (sourceFiles.isEmpty()) {
- log.error("no source files in transfer");
- throw new IdropRuntimeException("no source files in transfer");
- }
-
- final String tempTargetLocalFileAbsolutePath;
-
- if (nodeThatWasDropTargetAsFile.isDirectory()) {
- tempTargetLocalFileAbsolutePath = nodeThatWasDropTargetAsFile.getAbsolutePath();
- } else {
- log.info("drop target was a file, use the parent collection name for the transfer");
- tempTargetLocalFileAbsolutePath = nodeThatWasDropTargetAsFile.getParent();
- }
-
- StringBuilder sb = new StringBuilder();
-
- if (sourceFiles.size() == 1) {
- sb.append("Would you like to copy the remote file ");
- sb.append(sourceFiles.get(0).getAbsolutePath());
- sb.append(" to ");
- sb.append(tempTargetLocalFileAbsolutePath);
- } else {
- sb.append("Would you like to copy multiple files to ");
- sb.append(tempTargetLocalFileAbsolutePath);
-
- }
-
- //default icon, custom title
- int n = JOptionPane.showConfirmDialog(
- this,
- sb.toString(),
- "Confirm a Get ",
- JOptionPane.YES_NO_OPTION);
-
- if (n == JOptionPane.YES_OPTION) {
-
- // process the drop as a get
-
- java.awt.EventQueue.invokeLater(new Runnable() {
-
- @Override
- public void run() {
- try {
- for (File transferFile : sourceFiles) {
-
- if (transferFile instanceof IRODSFile) {
- log.info("initiating a transfer of iRODS file:{}", transferFile.getAbsolutePath());
- log.info("transfer to local file:{}", tempTargetLocalFileAbsolutePath);
- idropGui.getTransferManager().enqueueAGet(transferFile.getAbsolutePath(), tempTargetLocalFileAbsolutePath, "", idropGui.getIrodsAccount());
- } else {
- log.info("process a local to local move with source...not yet implemented : {}", transferFile.getAbsolutePath());
- }
- }
- } catch (JargonException ex) {
- java.util.logging.Logger.getLogger(LocalFileTree.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
- idropGui.showIdropException(ex);
- throw new IdropRuntimeException(ex);
- }
- }
- });
-
- }
+ public void setHighlightColor(Color highlightColor) {
+ this.highlightColor = highlightColor;
}
- @Override
- public void dragEnter(DropTargetDragEvent dtde) {
- //throw new UnsupportedOperationException("Not supported yet.");
+ public int getHighlightedRow() {
+ return highlightedRow;
}
- @Override
- public void dragOver(DropTargetDragEvent dtde) {
-
- Point location = dtde.getLocation();
- int closestRow = this.getClosestRowForLocation((int) location.getX(), (int) location.getY());
- boolean highlighted = false;
-
- Graphics g = getGraphics();
-
- // row changed
-
- if (highlightedRow != closestRow) {
- if (null != dirtyRegion) {
- paintImmediately(dirtyRegion);
- }
-
- for (int j = 0; j < getRowCount(); j++) {
- if (closestRow == j) {
-
- Rectangle firstRowRect = getRowBounds(closestRow);
- this.dirtyRegion = firstRowRect;
- g.setColor(highlightColor);
-
- g.fillRect((int) dirtyRegion.getX(), (int) dirtyRegion.getY(), (int) dirtyRegion.getWidth(), (int) dirtyRegion.getHeight());
- highlightedRow = closestRow;
- }
- }
-
- }
-
- //throw new UnsupportedOperationException("Not supported yet.");
+ public void setHighlightedRow(int highlightedRow) {
+ this.highlightedRow = highlightedRow;
}
+
- @Override
- public void dropActionChanged(DropTargetDragEvent dtde) {
- //throw new UnsupportedOperationException("Not supported yet.");
- }
+ public LocalFileTree(TreeModel newModel, iDrop idropParentGui) {
+ super(newModel);
+ this.idropParentGui = idropParentGui;
+ setDragEnabled(true);
+ this.setTransferHandler(new LocalTreeTransferHandler(idropParentGui));
+ this.setCellRenderer(new DefaultTreeCellRenderer());
+ setUpTreeMenu();
+ setDropMode(javax.swing.DropMode.ON);
- @Override
- public void dragExit(DropTargetEvent dte) {
- if (null != dirtyRegion) {
- paintImmediately(dirtyRegion);
- }
}
/**
@@ -321,6 +149,18 @@ public class LocalFileTree extends JTree implements DropTargetListener, TreeWill
return currentTreeNode;
}
+
+ public void highlightPath(final TreePath pathToHighlight) {
+ final LocalFileTree highlightTree = this;
+ java.awt.EventQueue.invokeLater(new Runnable() {
+
+ @Override
+ public void run() {
+ highlightTree.expandPath(pathToHighlight);
+ highlightTree.scrollPathToVisible(pathToHighlight);
+ }
+ });
+ }
/**
* Given a nodeThatWasDropTargetAsFile node in the tree, search the children for the given path
@@ -359,24 +199,13 @@ public class LocalFileTree extends JTree implements DropTargetListener, TreeWill
}
- private void processDropFromSerializedObjectType(Transferable transferable, File parent) {
- log.debug("processing as a drop of a serialized object");
- }
-
- private void setUpDropListener() throws IdropRuntimeException {
- try {
- DropTarget dt = new DropTarget(this, this);
- } catch (Exception ex) {
- throw new IdropRuntimeException("exception setting up drop listener", ex);
- }
- }
-
private void setUpTreeMenu() {
this.thisTree = this;
m_popup = new JPopupMenu();
m_action = new AbstractAction() {
- public void actionPerformed(ActionEvent e) {
+ @Override
+ public void actionPerformed(ActionEvent e) {
if (m_clickedPath == null) {
return;
}
@@ -401,7 +230,7 @@ public class LocalFileTree extends JTree implements DropTargetListener, TreeWill
@Override
public void run() {
- log.info("adding new node");
+ log.info("adding new node");
LocalFileNode parentNode = (LocalFileNode) m_clickedPath.getLastPathComponent();
File parentFile = (File) parentNode.getUserObject();
@@ -474,88 +303,6 @@ public class LocalFileTree extends JTree implements DropTargetListener, TreeWill
public void treeWillCollapse(TreeExpansionEvent event) throws ExpandVetoException {
}
- private void processDropFromFileRepresentationPanel(Transferable transferable, File nodeThatWasDropTargetAsFile, DataFlavor dataFlavor) throws IdropException {
-
- DefaultFileRepresentationPanel fileRepresentationPanel;
- try {
- Object transferObject = transferable.getTransferData(dataFlavor);
- if (!(transferObject instanceof DefaultFileRepresentationPanel)) {
- log.error("unable to cast transferable as a DefaultFileRepresentationPanel");
- throw new IdropRuntimeException("unable to cast transferable as a DefaultFileRepresentationPanel");
- }
-
- fileRepresentationPanel = (DefaultFileRepresentationPanel) transferObject;
-
- } catch (UnsupportedFlavorException ex) {
- Logger.getLogger(LocalFileTree.class.getName()).log(Level.SEVERE, null, ex);
- throw new IdropException(ex);
- } catch (IOException ex) {
- Logger.getLogger(LocalFileTree.class.getName()).log(Level.SEVERE, null, ex);
- throw new IdropException(ex);
-
- }
-
- CollectionAndDataObjectListingEntry collectionAndDataObjectListingEntry = fileRepresentationPanel.getCollectionAndDataObjectListingEntry();
- log.info("drag of filePanel for:{}", collectionAndDataObjectListingEntry);
-
-
- final String sourceAbsolutePath;
- if (collectionAndDataObjectListingEntry.getObjectType() == CollectionAndDataObjectListingEntry.ObjectType.COLLECTION) {
- log.info("get of collection");
- sourceAbsolutePath = collectionAndDataObjectListingEntry.getPathOrName();
- } else {
- log.info("get of data object");
- sourceAbsolutePath = collectionAndDataObjectListingEntry.getParentPath() + "/" + collectionAndDataObjectListingEntry.getPathOrName();
- }
-
- String tempTargetLocalFileAbsolutePath;
-
- if (nodeThatWasDropTargetAsFile.isDirectory()) {
- tempTargetLocalFileAbsolutePath = nodeThatWasDropTargetAsFile.getAbsolutePath();
- } else {
- log.info("drop target was a file, use the parent collection name for the transfer");
- tempTargetLocalFileAbsolutePath = nodeThatWasDropTargetAsFile.getParent();
- }
-
- final String targetLocalFileAbsolutePath = tempTargetLocalFileAbsolutePath;
-
- StringBuilder sb = new StringBuilder();
- sb.append("Would you like to copy the remote file ");
- sb.append(sourceAbsolutePath);
- sb.append(" to ");
- sb.append(targetLocalFileAbsolutePath);
- final iDrop idropGui = idropParentGui;
-
- //default icon, custom title
- int n = JOptionPane.showConfirmDialog(
- this,
- sb.toString(),
- "Confirm a Get ",
- JOptionPane.YES_NO_OPTION);
-
- if (n == JOptionPane.YES_OPTION) {
-
- // process the drop as a get
-
- java.awt.EventQueue.invokeLater(new Runnable() {
-
- @Override
- public void run() {
-
- log.info("initiating get transfer");
- try {
- idropGui.getTransferManager().enqueueAGet(sourceAbsolutePath, targetLocalFileAbsolutePath, "", idropGui.getIrodsAccount());
- } catch (JargonException ex) {
- java.util.logging.Logger.getLogger(LocalFileTree.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
- idropGui.showIdropException(ex);
- }
- }
- });
-
- }
-
- }
-
class PopupTrigger extends MouseAdapter {
@Override
@@ -576,6 +323,7 @@ public class LocalFileTree extends JTree implements DropTargetListener, TreeWill
}
}
+ @Override
public void mousePressed(MouseEvent e) {
if (e.isPopupTrigger()) {
int x = e.getX();
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
new file mode 100644
index 0000000..7efd2ab
--- /dev/null
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/LocalTreeTransferHandler.java
@@ -0,0 +1,233 @@
+package org.irods.jargon.idrop.desktop.systraygui.viscomponents;
+
+import java.awt.Graphics;
+import java.awt.Point;
+import java.awt.Rectangle;
+import java.awt.datatransfer.Clipboard;
+import java.awt.datatransfer.DataFlavor;
+import java.awt.datatransfer.Transferable;
+import java.awt.datatransfer.UnsupportedFlavorException;
+import java.awt.event.InputEvent;
+import java.io.File;
+import java.io.IOException;
+import java.util.List;
+import javax.swing.JComponent;
+import javax.swing.JOptionPane;
+import javax.swing.JTree;
+import javax.swing.TransferHandler;
+import javax.swing.tree.TreePath;
+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.exceptions.IdropRuntimeException;
+import org.slf4j.LoggerFactory;
+
+/**
+ * A transfer handler for the local file tree
+ * @author Mike Conway - DICE (www.irods.org)
+ */
+public class LocalTreeTransferHandler extends TransferHandler {
+
+ public static org.slf4j.Logger log = LoggerFactory.getLogger(LocalTreeTransferHandler.class);
+ public final iDrop idropGui;
+
+ @Override
+ public boolean canImport(TransferSupport support) {
+ Point location = support.getDropLocation().getDropPoint();
+ LocalFileTree tree = (LocalFileTree) support.getComponent();
+
+ int closestRow = idropGui.getFileTree().getClosestRowForLocation((int) location.getX(), (int) location.getY());
+ boolean highlighted = false;
+
+ Graphics g = tree.getGraphics();
+
+ // row changed
+
+ if (tree.getHighlightedRow() != closestRow) {
+ if (null != tree.getDirtyRegion()) {
+ tree.paintImmediately(tree.getDirtyRegion());
+ }
+
+ for (int j = 0; j < tree.getRowCount(); j++) {
+ if (closestRow == j) {
+
+ Rectangle firstRowRect = tree.getRowBounds(closestRow);
+ 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());
+ tree.setHighlightedRow(closestRow);
+ }
+ }
+
+ }
+
+ log.warn("transferFlavors:{}", support.getDataFlavors());
+
+ for (DataFlavor flavor : support.getDataFlavors()) {
+ if (flavor.equals(DataFlavor.javaFileListFlavor)) {
+ log.debug("found file list flavor, will import");
+ return true;
+ } else if (flavor.getMimeType().equals("application/x-java-jvm-local-objectref; class=javax.swing.tree.TreeSelectionModel")) {
+ log.debug("found file list flavor, will import");
+ return true;
+ }
+ }
+
+ log.debug("cannot import");
+ return false;
+ }
+
+ @Override
+ public void exportAsDrag(JComponent jc, InputEvent ie, int i) {
+ super.exportAsDrag(jc, ie, i);
+ }
+
+ @Override
+ public void exportToClipboard(JComponent jc, Clipboard clpbrd, int i) throws IllegalStateException {
+ super.exportToClipboard(jc, clpbrd, i);
+ }
+
+ @Override
+ public boolean importData(TransferSupport ts) {
+ log.info("importData event:{}", ts);
+ Point pt = ts.getDropLocation().getDropPoint();
+ JTree tree = (JTree) ts.getComponent();
+ TreePath parentpath = tree.getClosestPathForLocation(pt.x, pt.y);
+ LocalFileNode nodeThatWasDropTarget = (LocalFileNode) parentpath.getLastPathComponent();
+ final File nodeThatWasDropTargetAsFile = (File) nodeThatWasDropTarget.getUserObject();
+ log.info("local file node is: {}", nodeThatWasDropTargetAsFile);
+ LocalFileSystemModel fileSystemModel = (LocalFileSystemModel) tree.getModel();
+
+ Transferable transferable = ts.getTransferable();
+
+ DataFlavor[] transferrableFlavors = transferable.getTransferDataFlavors();
+
+ boolean imported = false;
+
+ for (DataFlavor flavor : transferrableFlavors) {
+ log.debug("flavor mime type:{}", flavor.getMimeType());
+ if (flavor.isFlavorJavaFileListType()) {
+ log.info("process drop as file list");
+
+ processDropAfterAcceptingDataFlavor(transferable, nodeThatWasDropTargetAsFile);
+ imported = true;
+ break;
+ } 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);
+ imported = true;
+ break;
+ } else {
+ log.debug("flavor not processed: {}", flavor);
+ }
+ }
+ return imported;
+ }
+
+ private void processDropAfterAcceptingDataFlavor(Transferable transferable, File nodeThatWasDropTargetAsFile) throws IdropRuntimeException {
+
+ final List<File> sourceFiles;
+
+ try {
+ // get the list of files
+ sourceFiles = (List<File>) transferable.getTransferData(DataFlavor.javaFileListFlavor);
+ } catch (UnsupportedFlavorException ex) {
+ throw new IdropRuntimeException("unsupported flavor getting data from transfer");
+ } catch (IOException ex) {
+ throw new IdropRuntimeException("io exception getting data from transfer");
+ }
+
+ if (sourceFiles.isEmpty()) {
+ log.error("no source files in transfer");
+ throw new IdropRuntimeException("no source files in transfer");
+ }
+
+ final String tempTargetLocalFileAbsolutePath;
+
+ if (nodeThatWasDropTargetAsFile.isDirectory()) {
+ tempTargetLocalFileAbsolutePath = nodeThatWasDropTargetAsFile.getAbsolutePath();
+ } else {
+ log.info("drop target was a file, use the parent collection name for the transfer");
+ tempTargetLocalFileAbsolutePath = nodeThatWasDropTargetAsFile.getParent();
+ }
+
+ StringBuilder sb = new StringBuilder();
+
+ if (sourceFiles.size() == 1) {
+ sb.append("Would you like to copy the remote file ");
+ sb.append(sourceFiles.get(0).getAbsolutePath());
+ sb.append(" to ");
+ sb.append(tempTargetLocalFileAbsolutePath);
+ } else {
+ sb.append("Would you like to copy multiple files to ");
+ sb.append(tempTargetLocalFileAbsolutePath);
+
+ }
+
+ //default icon, custom title
+ int n = JOptionPane.showConfirmDialog(
+ idropGui,
+ sb.toString(),
+ "Confirm a Get ",
+ JOptionPane.YES_NO_OPTION);
+
+ if (n == JOptionPane.YES_OPTION) {
+
+ // process the drop as a get
+
+ java.awt.EventQueue.invokeLater(new Runnable() {
+
+ @Override
+ public void run() {
+ try {
+ for (File transferFile : sourceFiles) {
+
+ 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());
+ } else {
+ log.info("process a local to local move with source...not yet implemented : {}", transferFile.getAbsolutePath());
+ }
+ }
+ } catch (JargonException ex) {
+ java.util.logging.Logger.getLogger(LocalFileTree.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
+ idropGui.showIdropException(ex);
+ throw new IdropRuntimeException(ex);
+ }
+ }
+ });
+
+ }
+ }
+
+ private void processDropFromSerializedObjectType(Transferable transferable, File parent) {
+ log.debug("processing as a drop of a serialized object");
+ }
+
+ public LocalTreeTransferHandler(final iDrop idropGui) {
+ super("selectionModel");
+ if (idropGui == null) {
+ throw new IllegalArgumentException("null idropGui");
+ }
+ this.idropGui = idropGui;
+ }
+
+ /**
+ * We support both copy and move actions.
+ */
+ @Override
+ public int getSourceActions(JComponent c) {
+ return TransferHandler.COPY_OR_MOVE;
+ }
+
+ @Override
+ protected void exportDone(JComponent jc, Transferable t, int i) {
+ super.exportDone(jc, t, i);
+ }
+
+
+
+
+}
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/RoundedBorder.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/RoundedBorder.java
deleted file mode 100644
index d691945..0000000
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/RoundedBorder.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
-package org.irods.jargon.idrop.desktop.systraygui.viscomponents;
-
-import java.awt.Component;
-import java.awt.Graphics;
-import java.awt.Insets;
-import javax.swing.border.AbstractBorder;
-
-/**
- *
- * @author mikeconway
- */
-public class RoundedBorder extends AbstractBorder {
-
- private final static int MARGIN = 10;
-
- public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) {
- g.drawRoundRect(x, y, width - 1, height - 1, MARGIN, MARGIN);
- }
-
- public Insets getBorderInsets(Component c) {
- return new Insets(MARGIN, MARGIN, MARGIN, MARGIN);
- }
-
- public Insets getBorderInsets(Component c, Insets insets) {
- insets.left = insets.top = insets.right = insets.bottom = MARGIN;
- return insets;
-
- }
-}
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/TagCloudListModel.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/TagCloudListModel.java
deleted file mode 100644
index 6bbf127..0000000
--- a/idrop-swing/src/main/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/TagCloudListModel.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
-package org.irods.jargon.idrop.desktop.systraygui.viscomponents;
-
-import javax.swing.DefaultListModel;
-import org.irods.jargon.idrop.exceptions.IdropException;
-import org.irods.jargon.usertagging.domain.TagCloudEntry;
-import org.irods.jargon.usertagging.domain.UserTagCloudView;
-
-/**
- * List model for tag cloud view list panel
- * @author Mike Conway - DICE (www.irods.org)
- */
-public class TagCloudListModel extends DefaultListModel {
-
- private final UserTagCloudView userTagCloudView;
- private final Object[] entryKeys;
-
- @Override
- public Object getElementAt(int index) {
-
- StringBuilder sb = new StringBuilder();
- TagCloudEntry entry = userTagCloudView.getTagCloudEntries().get(entryKeys[index]);
- sb.append(entry.getIrodsTagValue().getTagData());
- sb.append(" (f=");
- sb.append(entry.getCountOfFiles());
- sb.append(" c=");
- sb.append(entry.getCountOfCollections());
- sb.append(")");
- return sb.toString();
- }
-
- @Override
- public int getSize() {
- return userTagCloudView.getTagCloudEntries().size();
- }
-
- /**
- * Constructor for list model used in user tag view.
- * @param userTagCloudView <code>UserTagCloudView</code> with a summary of user tags.
- * @throws IdropException
- */
- public TagCloudListModel(final UserTagCloudView userTagCloudView) throws IdropException {
- if (userTagCloudView == null) {
- throw new IdropException("null userTagCloudView");
- }
-
- this.userTagCloudView = userTagCloudView;
- entryKeys = userTagCloudView.getTagCloudEntries().keySet().toArray();
-
- }
-
- /**
- * Method to return the actual tag cloud object.
- * @param index <code>int</code> with the position of the desired entry
- * @return <code>TagCloudEntry</code> with the value at the given index, or null if no value is found
- */
- public TagCloudEntry getTagCloudEntry(final int index) {
- return userTagCloudView.getTagCloudEntries().get(entryKeys[index]);
- }
-}
diff --git a/idrop-swing/src/main/java/org/irods/jargon/idrop/exceptions/IdropAlreadyRunningException.java b/idrop-swing/src/main/java/org/irods/jargon/idrop/exceptions/IdropAlreadyRunningException.java
new file mode 100644
index 0000000..975644f
--- /dev/null
+++ b/idrop-swing/src/main/java/org/irods/jargon/idrop/exceptions/IdropAlreadyRunningException.java
@@ -0,0 +1,24 @@
+package org.irods.jargon.idrop.exceptions;
+
+/**
+ * Exception caused by iDrop already running.
+ * @author Mike Conway - DICE (www.irods.org)
+ */
+public class IdropAlreadyRunningException extends IdropException {
+
+ public IdropAlreadyRunningException() {
+ }
+
+ public IdropAlreadyRunningException(String message) {
+ super(message);
+ }
+
+ public IdropAlreadyRunningException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+ public IdropAlreadyRunningException(Throwable cause) {
+ super(cause);
+ }
+
+}
diff --git a/idrop-swing/src/main/resources/idrop.properties b/idrop-swing/src/main/resources/idrop.properties
index 23be921..5ec85f5 100644
--- a/idrop-swing/src/main/resources/idrop.properties
+++ b/idrop-swing/src/main/resources/idrop.properties
@@ -7,7 +7,7 @@ login.preset.zone=lifelibZone
login.preset.resource=lifelibResc1
login.preset.port=2247
-transferengine.record.successful.files=false
+transferengine.record.successful.files=true
#login.preset.host=localhost
#login.preset.zone=test1
diff --git a/idrop-swing/src/main/resources/log4j.properties b/idrop-swing/src/main/resources/log4j.properties
index b6ebd32..fdf513f 100644
--- a/idrop-swing/src/main/resources/log4j.properties
+++ b/idrop-swing/src/main/resources/log4j.properties
@@ -1,10 +1,11 @@
# Set root logger level to DEBUG and its only appender to A1.
#log4j.rootCategory=WARN, A1
log4j.category.org.irods.jargon.idrop=DEBUG, A1
-log4j.category.org.irods.jargon.core=DEBUG, A1
-log4j.categor.org.irods.jargon.part=INFO,A1
+log4j.category.org.irods.jargon.core=INFO, A1
log4j.categor.org.irods.jargon.usertagging=INFO,A1
-log4j.category.org.irods.jargon.transferengine=INFO, A1
+log4j.category.org.irods.jargon.transfer=INFO, A1
+log4j.category.org.irods.jargon.datautils=DEBUG, A1
+
log4j.category.org.hibernate=ERROR, A1
diff --git a/idrop-swing/src/main/resources/org/irods/jargon/idrop/statusBarPanel.xml b/idrop-swing/src/main/resources/org/irods/jargon/idrop/statusBarPanel.xml
deleted file mode 100644
index 73a9e03..0000000
--- a/idrop-swing/src/main/resources/org/irods/jargon/idrop/statusBarPanel.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-
-<panel var="pnlIdropBottom">
- <bevelborder type="LOWERED" />
- <gridbaglayout>
- <gridbagconstraints id="gbc" gridx="0" gridy="0" weightx="0.1" fill="BOTH">
- <panel>
- <gridbaglayout>
- <gridbagconstraints id="gbc1" gridx="0" gridy="0" weightx="0.005" fill="BOTH">
- <label var="currentUserNameLabel">
- <bevelborder type="LOWERED" />
- </label>
- </gridbagconstraints>
- <idref ctor="gbc1" gridx="1" weightx="0.01">
- <label var="queuedTransfersLabel" text="Queued Transfers: 0/0">
- <bevelborder type="LOWERED" />
- </label>
- </idref>
- <idref ctor="gbc1" gridx="5" weightx="0.08">
- <progressbar var="queuedTransfersProgressBar" minimum="0" stringpainted="true">
- <bevelborder type="LOWERED" />
- </progressbar>
- </idref>
- <idref ctor="gbc1" gridx="6" weightx="0.005">
- <label var="currentDateLabel">
- <bevelborder type="LOWERED" />
- </label>
- </idref>
- </gridbaglayout>
- </panel>
- </gridbagconstraints>
- </gridbaglayout>
-</panel>
diff --git a/idrop-swing/src/test/java/org/irods/jargon/idrop/desktop/systraygui/services/IRODSFileServiceTest.java b/idrop-swing/src/test/java/org/irods/jargon/idrop/desktop/systraygui/services/IRODSFileServiceTest.java
deleted file mode 100644
index f916b88..0000000
--- a/idrop-swing/src/test/java/org/irods/jargon/idrop/desktop/systraygui/services/IRODSFileServiceTest.java
+++ /dev/null
@@ -1,272 +0,0 @@
-/*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
-package org.irods.jargon.idrop.desktop.systraygui.services;
-
-import org.junit.Ignore;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Properties;
-import junit.framework.TestCase;
-import org.irods.jargon.core.connection.IRODSAccount;
-import org.irods.jargon.core.pub.CollectionAO;
-import org.irods.jargon.core.pub.IRODSFileSystem;
-import org.irods.jargon.core.pub.domain.AvuData;
-import org.irods.jargon.core.pub.io.IRODSFile;
-import org.irods.jargon.core.query.AVUQueryElement;
-import org.irods.jargon.core.query.AVUQueryOperatorEnum;
-import org.irods.jargon.core.query.MetaDataAndDomainData;
-import org.irods.jargon.core.query.RodsGenQueryEnum;
-import org.irods.jargon.core.rule.IRODSRuleExecResult;
-import org.irods.jargon.idrop.desktop.systraygui.iDrop;
-import org.irods.jargon.testutils.AssertionHelper;
-import org.irods.jargon.testutils.IRODSTestSetupUtilities;
-import org.irods.jargon.testutils.TestingPropertiesHelper;
-import org.irods.jargon.testutils.filemanip.ScratchFileUtils;
-import org.junit.BeforeClass;
-import org.junit.Test;
-import org.mockito.Mockito;
-import static org.junit.Assert.*;
-
-/**
- *
- * @author mikeconway
- */
-public class IRODSFileServiceTest {
-
- private static Properties testingProperties = new Properties();
- private static TestingPropertiesHelper testingPropertiesHelper = new TestingPropertiesHelper();
- private static ScratchFileUtils scratchFileUtils = null;
- public static final String IRODS_TEST_SUBDIR_PATH = "IRODSFileServiceTest";
- private static IRODSTestSetupUtilities irodsTestSetupUtilities = null;
- private static AssertionHelper assertionHelper = null;
-
- @BeforeClass
- public static void setUpBeforeClass() throws Exception {
- TestingPropertiesHelper testingPropertiesLoader = new TestingPropertiesHelper();
- testingProperties = testingPropertiesLoader.getTestProperties();
- scratchFileUtils = new ScratchFileUtils(testingProperties);
- irodsTestSetupUtilities = new IRODSTestSetupUtilities();
- irodsTestSetupUtilities.initializeIrodsScratchDirectory();
- irodsTestSetupUtilities.initializeDirectoryForTest(IRODS_TEST_SUBDIR_PATH);
- assertionHelper = new AssertionHelper();
- }
-
- /**
- * Test of getCollectionsUnderParentCollection method, of class IRODSFileService.
- */
- @Ignore
- public void testGetCollectionsUnderParentCollection() throws Exception {
- System.out.println("getCollectionsUnderParentCollection");
- String parentCollectionAbsolutePath = "";
- IRODSFileService instance = null;
- List expResult = null;
- List result = instance.getCollectionsUnderParentCollection(parentCollectionAbsolutePath);
- assertEquals(expResult, result);
- // TODO review the generated test code and remove the default call to fail.
- fail("The test case is a prototype.");
- }
-
- /**
- * Test of getStringFromSourcePaths method, of class IRODSFileService.
- */
- @Ignore
- public void testGetStringFromSourcePaths() throws Exception {
- System.out.println("getStringFromSourcePaths");
- List<String> sourcePaths = null;
- IRODSFileService instance = null;
- String expResult = "";
- String result = instance.getStringFromSourcePaths(sourcePaths);
- assertEquals(expResult, result);
- // TODO review the generated test code and remove the default call to fail.
- fail("The test case is a prototype.");
- }
-
- /**
- * Test of runIRODSRule method, of class IRODSFileService.
- */
- @Ignore
- public void testRunIRODSRule() throws Exception {
- System.out.println("runIRODSRule");
- String irodsRule = "";
- IRODSFileService instance = null;
- IRODSRuleExecResult expResult = null;
- IRODSRuleExecResult result = instance.runIRODSRule(irodsRule);
- assertEquals(expResult, result);
- // TODO review the generated test code and remove the default call to fail.
- fail("The test case is a prototype.");
- }
-
- /**
- * Test of getResources method, of class IRODSFileService.
- */
- @Ignore
- public void testGetResources() throws Exception {
- System.out.println("getResources");
- IRODSFileService instance = null;
- List expResult = null;
- List result = instance.getResources();
- assertEquals(expResult, result);
- // TODO review the generated test code and remove the default call to fail.
- fail("The test case is a prototype.");
- }
-
- /**
- * Test of getVirusStatusForParentCollection method, of class IRODSFileService.
- */
- @Test
- public void testGetVirusStatusForParentCollection() throws Exception {
- System.out.println("getVirusStatusForParentCollection");
- String virusAvuAttrib = "PolicyDrivenService:PolicyProcessingResultAttribute:VirusScan";
-
- String subdirPrefix = "testGetVirusStatusForParentCollection";
- int count = 2;
-
- IRODSFileSystem irodsFileSystem = IRODSFileSystem.instance();
- IRODSAccount irodsAccount = testingPropertiesHelper.buildIRODSAccountFromTestProperties(testingProperties);
-
- String targetIrodsCollection = testingPropertiesHelper.buildIRODSCollectionAbsolutePathFromTestProperties(
- testingProperties, IRODS_TEST_SUBDIR_PATH + "/"
- + subdirPrefix);
- IRODSFile irodsFile = irodsFileSystem.getIRODSFileFactory(irodsAccount).instanceIRODSFile(targetIrodsCollection);
- irodsFile.mkdirs();
- irodsFile.close();
-
- CollectionAO collectionAO = irodsFileSystem.getIRODSAccessObjectFactory().getCollectionAO(irodsAccount);
- AvuData virusScanError = AvuData.instance(virusAvuAttrib, "fail", "");
-
- String myTarget = "";
-
- for (int i = 0; i < count; i++) {
- myTarget = targetIrodsCollection + "/c" + (10000 + i)
- + subdirPrefix;
- irodsFile = irodsFileSystem.getIRODSFileFactory(irodsAccount).instanceIRODSFile(myTarget);
- irodsFile.mkdirs();
- collectionAO.addAVUMetadata(irodsFile.getAbsolutePath(), virusScanError);
- irodsFile.close();
- }
-
- List<AVUQueryElement> queryElements = new ArrayList<AVUQueryElement>();
-
- queryElements.add(AVUQueryElement.instanceForValueQuery(
- AVUQueryElement.AVUQueryPart.ATTRIBUTE,
- AVUQueryOperatorEnum.EQUAL, virusAvuAttrib));
-
- StringBuilder sb = new StringBuilder();
- sb.append(RodsGenQueryEnum.COL_COLL_NAME.getName());
- sb.append(" LIKE ");
- sb.append("'");
- sb.append(targetIrodsCollection);
- sb.append("%");
- sb.append("'");
-
- List<MetaDataAndDomainData> metadata = collectionAO.findMetadataValuesByMetadataQueryWithAdditionalWhere(queryElements, sb.toString());
- irodsFileSystem.close();
-
- TestCase.assertEquals("wrong number of entries returned", 2, metadata.size());
-
-
- }
-
- /**
- * Test of getVirusStatusForParentCollection method, of class IRODSFileService.
- */
- @Test
- public void testGetFixityForParentCollection() throws Exception {
- System.out.println("testGetFixityForParentCollection");
- String fixityAvuAttrib = "PolicyDrivenService:PolicyProcessingResultAttribute:FixityCheck";
-
- String subdirPrefix = "testGetFixityForParentCollection";
- int count = 2;
-
- IRODSFileSystem irodsFileSystem = IRODSFileSystem.instance();
- IRODSAccount irodsAccount = testingPropertiesHelper.buildIRODSAccountFromTestProperties(testingProperties);
-
- String targetIrodsCollection = testingPropertiesHelper.buildIRODSCollectionAbsolutePathFromTestProperties(
- testingProperties, IRODS_TEST_SUBDIR_PATH + "/"
- + subdirPrefix);
- IRODSFile irodsFile = irodsFileSystem.getIRODSFileFactory(irodsAccount).instanceIRODSFile(targetIrodsCollection);
- irodsFile.mkdirs();
- irodsFile.close();
-
- CollectionAO collectionAO = irodsFileSystem.getIRODSAccessObjectFactory().getCollectionAO(irodsAccount);
- AvuData virusScanError = AvuData.instance(fixityAvuAttrib, "fail", "");
-
- String myTarget = "";
-
- for (int i = 0; i < count; i++) {
- myTarget = targetIrodsCollection + "/c" + (10000 + i)
- + subdirPrefix;
- irodsFile = irodsFileSystem.getIRODSFileFactory(irodsAccount).instanceIRODSFile(myTarget);
- irodsFile.mkdirs();
- collectionAO.addAVUMetadata(irodsFile.getAbsolutePath(), virusScanError);
- irodsFile.close();
- }
-
- List<AVUQueryElement> queryElements = new ArrayList<AVUQueryElement>();
-
- queryElements.add(AVUQueryElement.instanceForValueQuery(
- AVUQueryElement.AVUQueryPart.ATTRIBUTE,
- AVUQueryOperatorEnum.EQUAL, fixityAvuAttrib));
-
- StringBuilder sb = new StringBuilder();
- sb.append(RodsGenQueryEnum.COL_COLL_NAME.getName());
- sb.append(" LIKE ");
- sb.append("'");
- sb.append(targetIrodsCollection);
- sb.append("%");
- sb.append("'");
-
- List<MetaDataAndDomainData> metadata = collectionAO.findMetadataValuesByMetadataQueryWithAdditionalWhere(queryElements, sb.toString());
- irodsFileSystem.close();
-
- TestCase.assertEquals("wrong number of entries returned", 2, metadata.size());
-
-
- }
-
- @Test
- public void testGetMetadataForCollection() throws Exception {
- System.out.println("testGetMetadataForCollection");
- String virusAvuAttrib = "PolicyDrivenService:PolicyProcessingResultAttribute:VirusScan";
-
- String subdirPrefix = "testGetVirusStatusForParentCollection";
- int count = 2;
-
- IRODSFileSystem irodsFileSystem = IRODSFileSystem.instance();
- IRODSAccount irodsAccount = testingPropertiesHelper.buildIRODSAccountFromTestProperties(testingProperties);
-
- String targetIrodsCollection = testingPropertiesHelper.buildIRODSCollectionAbsolutePathFromTestProperties(
- testingProperties, IRODS_TEST_SUBDIR_PATH + "/"
- + subdirPrefix);
- IRODSFile irodsFile = irodsFileSystem.getIRODSFileFactory(irodsAccount).instanceIRODSFile(targetIrodsCollection);
- irodsFile.mkdirs();
- irodsFile.close();
-
- CollectionAO collectionAO = irodsFileSystem.getIRODSAccessObjectFactory().getCollectionAO(irodsAccount);
- AvuData virusScanError = AvuData.instance(virusAvuAttrib, "fail", "");
-
- String myTarget = "";
-
- for (int i = 0; i < count; i++) {
- myTarget = targetIrodsCollection + "/c" + (10000 + i)
- + subdirPrefix;
- irodsFile = irodsFileSystem.getIRODSFileFactory(irodsAccount).instanceIRODSFile(myTarget);
- irodsFile.mkdirs();
- collectionAO.addAVUMetadata(irodsFile.getAbsolutePath(), virusScanError);
- irodsFile.close();
- }
-
- irodsFileSystem.close();
-
- iDrop idrop = Mockito.mock(iDrop.class);
-
- IRODSFileService irodsFileService = new IRODSFileService(irodsAccount, irodsFileSystem);
- List<MetaDataAndDomainData> metadataAndDomainData = irodsFileService.getMetadataForCollection(irodsFile.getAbsolutePath());
-
- TestCase.assertEquals("wrong number of entries returned", 1, metadataAndDomainData.size());
-
-
- }
-}
diff --git a/idrop-swing/src/test/java/org/irods/jargon/idrop/desktop/systraygui/services/IdropConfigurationServiceImplTest.java b/idrop-swing/src/test/java/org/irods/jargon/idrop/desktop/systraygui/services/IdropConfigurationServiceImplTest.java
new file mode 100644
index 0000000..2ae6ab9
--- /dev/null
+++ b/idrop-swing/src/test/java/org/irods/jargon/idrop/desktop/systraygui/services/IdropConfigurationServiceImplTest.java
@@ -0,0 +1,86 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package org.irods.jargon.idrop.desktop.systraygui.services;
+
+import java.util.Properties;
+
+import junit.framework.Assert;
+import junit.framework.TestCase;
+import org.irods.jargon.testutils.TestingPropertiesHelper;
+import org.irods.jargon.testutils.filemanip.ScratchFileUtils;
+import org.irods.jargon.transfer.TransferServiceFactoryImpl;
+import org.irods.jargon.transfer.engine.ConfigurationService;
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ *
+ * @author mikeconway
+ */
+public class IdropConfigurationServiceImplTest {
+
+ private static IdropConfigurationService idropConfigurationService;
+ private static ConfigurationService configurationService;
+ private static Properties testingProperties = new Properties();
+ private static TestingPropertiesHelper testingPropertiesHelper = new TestingPropertiesHelper();
+ private static ScratchFileUtils scratchFileUtils = null;
+ private static final String TESTING_SUBDIR = "IdropConfigurationServiceImplTest";
+
+ public IdropConfigurationServiceImplTest() {
+ }
+
+ @BeforeClass
+ public static void setUpClass() throws Exception {
+ TestingPropertiesHelper testingPropertiesLoader = new TestingPropertiesHelper();
+ testingProperties = testingPropertiesLoader.getTestProperties();
+ scratchFileUtils = new ScratchFileUtils(testingProperties);
+ scratchFileUtils.clearAndReinitializeScratchDirectory(TESTING_SUBDIR);
+ idropConfigurationService = new IdropConfigurationServiceImpl(scratchFileUtils.createAndReturnAbsoluteScratchPath(TESTING_SUBDIR));
+ TransferServiceFactoryImpl transferServiceFactory = new TransferServiceFactoryImpl();
+ configurationService = transferServiceFactory.instanceConfigurationService();
+ }
+
+ @AfterClass
+ public static void tearDownClass() throws Exception {
+ }
+
+ @Before
+ public void setUp() throws Exception {
+ scratchFileUtils.clearAndReinitializeScratchDirectory(TESTING_SUBDIR);
+ configurationService.importProperties(new Properties());
+ }
+
+ @After
+ public void tearDown() {
+ }
+
+
+ @Test
+ public void testBootstrapConfigurationWhenPropsInDb() throws Exception {
+ String testPropKey = "testBootstrapConfigurationWhenPropsInDb";
+ String testPropVal = "thevalue";
+ Properties testProps = new Properties();
+ testProps.put(testPropKey, testPropVal);
+ configurationService.importProperties(testProps);
+ Properties myProps = idropConfigurationService.bootstrapConfiguration();
+ Assert.assertNotNull("null props returned", myProps);
+ Assert.assertEquals(1, myProps.size());
+ Assert.assertEquals(testPropVal, myProps.get(testPropKey));
+ }
+
+ @Test
+ public void testBootstrapConfigurationWhenPropsInClasspath() throws Exception {
+ Properties testProps = new Properties();
+ configurationService.importProperties(testProps);
+ Properties myProps = idropConfigurationService.bootstrapConfiguration();
+ Assert.assertNotNull("null props returned", myProps);
+ Assert.assertFalse("props shold not be empty will be loaded from classpath", myProps.isEmpty());
+ Assert.assertNotNull("should have loaded props from classpath", myProps.get("login.preset"));
+ }
+
+}
diff --git a/idrop-swing/src/test/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/IRODSSearchTableModelTest.java b/idrop-swing/src/test/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/IRODSSearchTableModelTest.java
index 8f9adcc..3b375e0 100644
--- a/idrop-swing/src/test/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/IRODSSearchTableModelTest.java
+++ b/idrop-swing/src/test/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/IRODSSearchTableModelTest.java
@@ -7,6 +7,8 @@ package org.irods.jargon.idrop.desktop.systraygui.viscomponents;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
+
+import junit.framework.Assert;
import junit.framework.TestCase;
import org.irods.jargon.core.query.CollectionAndDataObjectListingEntry;
import org.junit.After;
@@ -49,7 +51,7 @@ public class IRODSSearchTableModelTest {
List<CollectionAndDataObjectListingEntry> entries = new ArrayList<CollectionAndDataObjectListingEntry>();
IRODSSearchTableModel model = new IRODSSearchTableModel(entries);
int actual = model.getColumnCount();
- TestCase.assertEquals(5, actual);
+ Assert.assertEquals(5, actual);
}
/**
@@ -64,11 +66,11 @@ public class IRODSSearchTableModelTest {
List<CollectionAndDataObjectListingEntry> entries = new ArrayList<CollectionAndDataObjectListingEntry>();
IRODSSearchTableModel model = new IRODSSearchTableModel(entries);
- TestCase.assertEquals(CollectionAndDataObjectListingEntry.ObjectType.class, model.getColumnClass(0));
- TestCase.assertEquals(String.class, model.getColumnClass(1));
- TestCase.assertEquals(String.class, model.getColumnClass(2));
- TestCase.assertEquals(Date.class, model.getColumnClass(3));
- TestCase.assertEquals(Date.class, model.getColumnClass(4));
+ Assert.assertEquals(CollectionAndDataObjectListingEntry.ObjectType.class, model.getColumnClass(0));
+ Assert.assertEquals(String.class, model.getColumnClass(1));
+ Assert.assertEquals(String.class, model.getColumnClass(2));
+ Assert.assertEquals(Date.class, model.getColumnClass(3));
+ Assert.assertEquals(Date.class, model.getColumnClass(4));
}
/**
@@ -79,7 +81,7 @@ public class IRODSSearchTableModelTest {
List<CollectionAndDataObjectListingEntry> entries = new ArrayList<CollectionAndDataObjectListingEntry>();
entries.add(Mockito.mock(CollectionAndDataObjectListingEntry.class));
IRODSSearchTableModel model = new IRODSSearchTableModel(entries);
- TestCase.assertEquals(1, model.getRowCount());
+ Assert.assertEquals(1, model.getRowCount());
}
/**
@@ -96,6 +98,6 @@ public class IRODSSearchTableModelTest {
entry.setPathOrName("/a/path/child");
entries.add(entry);
IRODSSearchTableModel model = new IRODSSearchTableModel(entries);
- TestCase.assertEquals(CollectionAndDataObjectListingEntry.ObjectType.COLLECTION, model.getValueAt(0, 0));
+ Assert.assertEquals(CollectionAndDataObjectListingEntry.ObjectType.COLLECTION, model.getValueAt(0, 0));
}
}
diff --git a/idrop-swing/src/test/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/LocalFileSystemModelTest.java b/idrop-swing/src/test/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/LocalFileSystemModelTest.java
index 8e69c66..7efeb96 100644
--- a/idrop-swing/src/test/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/LocalFileSystemModelTest.java
+++ b/idrop-swing/src/test/java/org/irods/jargon/idrop/desktop/systraygui/viscomponents/LocalFileSystemModelTest.java
@@ -6,6 +6,8 @@ package org.irods.jargon.idrop.desktop.systraygui.viscomponents;
import java.io.File;
import java.util.Properties;
+
+import junit.framework.Assert;
import junit.framework.TestCase;
import org.irods.jargon.testutils.IRODSTestSetupUtilities;
import org.irods.jargon.testutils.TestingPropertiesHelper;
@@ -61,6 +63,6 @@ public class LocalFileSystemModelTest {
File testFile = new File(testFileName);
LocalFileNode localFileNode = new LocalFileNode(testFile);
LocalFileSystemModel localFileSystemModel = new LocalFileSystemModel(localFileNode);
- TestCase.assertNotNull("null local file system model, could not create", localFileSystemModel);
+ Assert.assertNotNull("null local file system model, could not create", localFileSystemModel);
}
}
diff --git a/idrop-swing/src/test/java/org/irods/jargon/idrop/desktop/unittest/AllTests.java b/idrop-swing/src/test/java/org/irods/jargon/idrop/desktop/unittest/AllTests.java
new file mode 100644
index 0000000..66dd3cb
--- /dev/null
+++ b/idrop-swing/src/test/java/org/irods/jargon/idrop/desktop/unittest/AllTests.java
@@ -0,0 +1,27 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package org.irods.jargon.idrop.desktop.unittest;
+
+import org.irods.jargon.idrop.desktop.systraygui.services.IdropConfigurationServiceImplTest;
+import org.irods.jargon.idrop.desktop.systraygui.utils.IdropPropertiesHelperTest;
+import org.irods.jargon.idrop.desktop.systraygui.utils.LocalFileUtilsTest;
+import org.irods.jargon.idrop.desktop.systraygui.viscomponents.FileSystemModelTest;
+import org.irods.jargon.idrop.desktop.systraygui.viscomponents.IRODSSearchTableModelTest;
+import org.irods.jargon.idrop.desktop.systraygui.viscomponents.LocalFileSystemModelTest;
+import org.irods.jargon.idrop.desktop.systraygui.viscomponents.MetadataTableModelTest;
+import org.irods.jargon.idrop.desktop.systraygui.viscomponents.QueueManagerDetailTableModelTest;
+import org.irods.jargon.idrop.desktop.systraygui.viscomponents.QueueManagerMasterTableModelTest;
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+
+@RunWith(Suite.class)
+@Suite.SuiteClasses({ IdropPropertiesHelperTest.class, LocalFileUtilsTest.class,
+ FileSystemModelTest.class, IRODSSearchTableModelTest.class,
+ LocalFileSystemModelTest.class, MetadataTableModelTest.class,
+ QueueManagerDetailTableModelTest.class, QueueManagerMasterTableModelTest.class, IdropConfigurationServiceImplTest.class
+ })
+public class AllTests {
+
+}
diff --git a/idrop-swing/src/test/resources/testing.properties b/idrop-swing/src/test/resources/testing.properties
index e89c277..8c79b7a 100644
--- a/idrop-swing/src/test/resources/testing.properties
+++ b/idrop-swing/src/test/resources/testing.properties
@@ -23,7 +23,7 @@ test.confirm=true
# test.data.directory=/temp/irodsscratch/ - unix example
# test.data.directory=C:/projects/eclipse_workspace/jargon-svn/target/scratch/ - windows example
-test.data.directory=/Users/mikeconway/NetBeansProjects/iDropDesktop/target/scratch/
+test.data.directory=/Users/mikeconway/temp/irodsscratch/
#test.data.directory=/tmp
# properties that point to a local IRODS that can be badly mangled by various tests
test.irods.admin=rods
@@ -42,7 +42,7 @@ test.irods.port=1247
test.irods.zone=test1
# IRODS directory under zone/home/user, under which scratch IRODS files will be placed
-test.irods.scratch.subdir=test-scratch
+test.irods.scratch.subdir=jargon-scratch
# for MAC Users (this is a temp fix) put the system path to your irods icommands
-test.mac.icommand.path=/opt/iRODS/iRODS2.2/clients/icommands/bin/ \ No newline at end of file
+test.mac.icommand.path=/opt/iRODS/iRODS2.5/iRODS/clients/icommands/bin/
diff --git a/idrop-swing/todo.txt b/idrop-swing/todo.txt
index 3c64100..a7ab1e3 100644
--- a/idrop-swing/todo.txt
+++ b/idrop-swing/todo.txt
@@ -1,62 +1,24 @@
-TODO
-
-X*refresh tags button
-X*sorted tag list
-X*collections and data objects in list?
-x*search 1 term -> result panels
-x*result panels -> info panel
-x*click tag -> result panels
-X*sort and organize tag cloud
-X*refactor info panel
-X*search multiple terms
-X*drag to result panel
-X*drag from result panel to local
-??*add well-known comment tag
-??*search auto-complete???
-
-2010-12-01 08:56:17,559 197609 [AWT-EventQueue-0] INFO org.irods.jargon.core.pub.io.IRODSFileImpl - setting file name, given path = /renci/home/rods/Proposal.pdf
-2010-12-01 08:56:17,559 197609 [AWT-EventQueue-0] INFO org.irods.jargon.core.pub.io.IRODSFileImpl - detected local separator = /
-2010-12-01 08:56:17,559 197609 [AWT-EventQueue-0] INFO org.irods.jargon.core.pub.io.IRODSFileImpl - file name was set as: Proposal.pdf
-2010-12-01 08:56:17,559 197609 [AWT-EventQueue-0] INFO org.irods.jargon.core.connection.IRODSCommands - closing connection
-2010-12-01 08:56:17,559 197609 [AWT-EventQueue-0] INFO org.irods.jargon.core.connection.IRODSCommands - sending disconnect message
-2010-12-01 08:56:17,559 197609 [AWT-EventQueue-0] INFO org.irods.jargon.core.connection.IRODSConnection - shutting down connection: true
-2010-12-01 08:56:17,559 197609 [AWT-EventQueue-0] DEBUG org.irods.jargon.idrop.desktop.systraygui.viscomponents.IRODSTreeTransferable - getting data flavors from idrop series (will be a list with one iros file for file or collection
-2010-12-01 08:56:17,562 197612 [AWT-EventQueue-0] INFO org.irods.jargon.idrop.desktop.systraygui.viscomponents.IRODSTreeTransferable - getting files from transfser data:[irods://rods@iren.renci.org:1247/renci/home/rods/Proposal.pdf]
-2010-12-01 08:56:37,596 217646 [AWT-EventQueue-0] DEBUG org.irods.jargon.idrop.desktop.systraygui.viscomponents.IRODSTreeTransferHandler - creating a transferrable from the irods tree view
-2010-12-01 08:56:37,614 217664 [AWT-EventQueue-0] INFO org.irods.jargon.idrop.desktop.systraygui.viscomponents.IRODSTreeTransferHandler - transferrable path:[/, renci, home, rods, Proposal.pdf]
-2010-12-01 08:56:37,614 217664 [AWT-EventQueue-0] INFO org.irods.jargon.core.connection.IRODSConnection - opening irods socket
-2010-12-01 08:56:37,614 217664 [AWT-EventQueue-0] INFO org.irods.jargon.core.connection.IRODSConnection - connecting socket...
-2010-12-01 08:56:37,960 218010 [AWT-EventQueue-0] INFO org.irods.jargon.core.connection.IRODSConnection - socket opened successfully
-2010-12-01 08:56:37,961 218011 [AWT-EventQueue-0] INFO org.irods.jargon.core.connection.IRODSConnection - connection identified as:irodsSimpleConnection/AWT-EventQueue-0/1291211797961
-2010-12-01 08:56:37,961 218011 [AWT-EventQueue-0] INFO org.irods.jargon.core.connection.IRODSCommands - reading message from irods
-2010-12-01 08:56:39,715 219765 [AWT-EventQueue-0] INFO org.irods.jargon.core.connection.IRODSCommands - sending standard irods password
-2010-12-01 08:56:39,715 219765 [AWT-EventQueue-0] INFO org.irods.jargon.core.connection.IRODSCommands - reading message from irods
-2010-12-01 08:56:40,399 220449 [AWT-EventQueue-0] INFO org.irods.jargon.core.connection.IRODSCommands - calling irods function with streams
-2010-12-01 08:56:40,399 220449 [AWT-EventQueue-0] INFO org.irods.jargon.core.connection.IRODSCommands - reading message from irods
-2010-12-01 08:56:40,798 220848 [AWT-EventQueue-0] INFO org.irods.jargon.core.connection.EnvironmentalInfoAccessor - getting irods server properties
-2010-12-01 08:56:40,798 220848 [AWT-EventQueue-0] INFO org.irods.jargon.core.connection.IRODSCommands - calling irods function with streams
-2010-12-01 08:56:40,798 220848 [AWT-EventQueue-0] WARN org.irods.jargon.core.connection.IRODSConnection - nothing to send, ignoring...
-2010-12-01 08:56:40,798 220848 [AWT-EventQ