Author: rob.stryker(a)jboss.com
Date: 2007-09-07 18:36:30 -0400 (Fri, 07 Sep 2007)
New Revision: 3499
Modified:
trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/views/ArchivesMenuHandler.java
Log:
added ability to add folders as one path
(add folder: abc\def\ghi)
Modified:
trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/views/ArchivesMenuHandler.java
===================================================================
---
trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/views/ArchivesMenuHandler.java 2007-09-07
21:35:09 UTC (rev 3498)
+++
trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/views/ArchivesMenuHandler.java 2007-09-07
22:36:30 UTC (rev 3499)
@@ -289,12 +289,23 @@
int response = dialog.open();
if (response == Dialog.OK) {
- String folderName = dialog.getValue();
+ String[] folderPaths = dialog.getValue().split("[\\\\/]");
IArchiveNode selected = getSelectedNode();
+ IArchiveFolder current = null;
+ IArchiveFolder temp = null;
+
+ for(int i = folderPaths.length-1; i >= 0 ; i-- ) {
+ temp = ArchiveNodeFactory.createFolder();
+ temp.setName(folderPaths[i]);
+ if( current == null )
+ current = temp;
+ else {
+ temp.addChild(current);
+ current = temp;
+ }
+ }
- IArchiveFolder folder = ArchiveNodeFactory.createFolder();
- folder.setName(folderName);
- ArchivesModel.instance().attach(selected, folder, new NullProgressMonitor());
+ ArchivesModel.instance().attach(selected, current, new NullProgressMonitor());
}
}
Show replies by date