Author: rob.stryker(a)jboss.com
Date: 2008-07-16 17:30:02 -0400 (Wed, 16 Jul 2008)
New Revision: 9157
Modified:
trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/wizards/AbstractArchiveWizard.java
trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/wizards/pages/ArchiveInfoWizardPage.java
Log:
JBIDE-2385 - error message was previously just for aarchives in teh same project. Now its
for all.
Modified:
trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/wizards/AbstractArchiveWizard.java
===================================================================
---
trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/wizards/AbstractArchiveWizard.java 2008-07-16
18:21:29 UTC (rev 9156)
+++
trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/wizards/AbstractArchiveWizard.java 2008-07-16
21:30:02 UTC (rev 9157)
@@ -34,6 +34,10 @@
public AbstractArchiveWizard () {
this.project = ProjectArchivesView.getInstance().getCurrentProject();
+ IStructuredSelection selection = ProjectArchivesView.getInstance().getSelection();
+ Object s = selection.getFirstElement();
+ if( s instanceof IArchiveNode )
+ initialDestinationNode = (IArchiveNode)s;
}
public AbstractArchiveWizard (IArchive existingPackage) {
Modified:
trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/wizards/pages/ArchiveInfoWizardPage.java
===================================================================
---
trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/wizards/pages/ArchiveInfoWizardPage.java 2008-07-16
18:21:29 UTC (rev 9156)
+++
trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/wizards/pages/ArchiveInfoWizardPage.java 2008-07-16
21:30:02 UTC (rev 9157)
@@ -1,5 +1,10 @@
package org.jboss.ide.eclipse.archives.ui.wizards.pages;
+import java.util.ArrayList;
+import java.util.Arrays;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
import org.eclipse.swt.SWT;
@@ -145,6 +150,11 @@
} else {
destinationComposite.init(archive.getDestinationPath().toString(),
archive.isDestinationInWorkspace());
}
+ } else {
+ if(wizard.getInitialNode() != null )
+ destinationComposite.init(wizard.getInitialNode());
+ else
+ destinationComposite.init(wizard.getInitialPath(),
wizard.isInitialPathWorkspaceRelative());
}
}
@@ -177,7 +187,12 @@
destinationLocation = new Path(destinationComposite.getPath());
}
- IArchive[] packages =
ModelUtil.getProjectArchives(wizard.getProject().getLocation());
+ ArrayList<IArchive> allArchives = new ArrayList<IArchive>();
+ IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects();
+ for( int i = 0; i < projects.length; i++ )
+ allArchives.addAll(Arrays.asList(ModelUtil.getProjectArchives(projects[i].getLocation())));
+
+ IArchive[] packages = (IArchive[]) allArchives.toArray(new
IArchive[allArchives.size()]);
if (packages != null) {
for( int i = 0; i < packages.length; i++ ) {
IArchive pkg = (IArchive) packages[i];
Show replies by date