Author: snjeza
Date: 2009-01-23 20:30:48 -0500 (Fri, 23 Jan 2009)
New Revision: 13262
Modified:
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/wizards/AbstractArchiveWizard.java
Log:
JBIDE-3627 Exception while creating second war archive for Seam war project
Modified:
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/wizards/AbstractArchiveWizard.java
===================================================================
---
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/wizards/AbstractArchiveWizard.java 2009-01-23
22:55:56 UTC (rev 13261)
+++
trunk/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/wizards/AbstractArchiveWizard.java 2009-01-24
01:30:48 UTC (rev 13262)
@@ -20,6 +20,7 @@
import org.eclipse.core.runtime.Status;
import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.wizard.IWizardPage;
import org.eclipse.jface.wizard.WizardPage;
@@ -126,7 +127,27 @@
}
public void init(IWorkbench workbench, IStructuredSelection selection) {
- if (selection == null) return;
+ if (selection == null) {
+ ISelection sel =
ProjectArchivesCommonView.getInstance().getCommonViewer().getSelection();
+ if ( !(sel instanceof IStructuredSelection)) {
+ return;
+ }
+ selection = (IStructuredSelection) sel;
+ }
+ init(selection);
+
+ if (initialDestinationPath == null) {
+ ISelection sel =
ProjectArchivesCommonView.getInstance().getCommonViewer().getSelection();
+ if ( !(sel instanceof IStructuredSelection)) {
+ return;
+ }
+ selection = (IStructuredSelection) sel;
+ init(selection);
+ }
+ setNeedsProgressMonitor(true);
+ }
+
+ private void init(IStructuredSelection selection) {
project = null;
Object selected = (selection.isEmpty() ? project : selection.getFirstElement());
@@ -152,8 +173,6 @@
isPathWorkspaceRelative = true;
}
}
-
- setNeedsProgressMonitor(true);
}
public IArchiveNode getInitialNode() {