Author: rob.stryker(a)jboss.com
Date: 2007-11-16 14:35:27 -0500 (Fri, 16 Nov 2007)
New Revision: 4958
Modified:
trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/wizards/pages/FilesetInfoWizardPage.java
Log:
JBIDE-1325 Much simpler solution ;)
A for loop is still needed to make sure the project name label is correct.
Modified:
trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/wizards/pages/FilesetInfoWizardPage.java
===================================================================
---
trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/wizards/pages/FilesetInfoWizardPage.java 2007-11-16
19:07:30 UTC (rev 4957)
+++
trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/wizards/pages/FilesetInfoWizardPage.java 2007-11-16
19:35:27 UTC (rev 4958)
@@ -2,7 +2,6 @@
import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
@@ -28,6 +27,7 @@
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.dialogs.ContainerSelectionDialog;
import org.eclipse.ui.ide.IDE;
+import org.jboss.ide.eclipse.archives.core.ArchivesCore;
import org.jboss.ide.eclipse.archives.core.model.ArchivesModelCore;
import org.jboss.ide.eclipse.archives.core.model.IArchiveFileSet;
import org.jboss.ide.eclipse.archives.core.model.IArchiveNode;
@@ -291,19 +291,21 @@
if (fileset.getGlobalSourcePath() != null) {
rootDir = fileset.getGlobalSourcePath();
+ rootDirIsWorkspaceRelative = fileset.isInWorkspace();
rootDirText.setText(rootDir.toString());
- rootDirIsWorkspaceRelative = fileset.isInWorkspace();
}
} else {
- rootProjectLabel.setText(parentNode.getProjectPath().lastSegment());
+ IProject[] project = ResourcesPlugin.getWorkspace().getRoot().getProjects();
+ for( int i = 0; i < project.length; i++ )
+ if( project[i].getLocation().equals(parentNode.getProjectPath()))
+ rootProjectLabel.setText(project[i].getName());
rootDirIsWorkspaceRelative = true;
rootDir = parentNode.getProjectPath();
- rootDirText.setText(rootDir.toString());
}
}
private void changePreview() {
- IPath root = rootDir; //isRootDirWorkspaceRelative() ?
ResourcesPlugin.getWorkspace().getRoot().getLocation().append(rootDir) : rootDir;
+ IPath root = rootDir;
IPath paths[] = ArchivesModelCore.findMatchingPaths(root, includesText.getText(),
excludesText.getText());
previewComposite.setInput(paths);
}
@@ -324,8 +326,7 @@
if (project != null) {
IPath relativePath = path.removeFirstSegments(1);
rootProjectLabel.setText(project.getName());
-
- rootDir = ResourcesPlugin.getWorkspace().getRoot().getLocation().append(path);
+ rootDir = ArchivesCore.getInstance().getVariables().getProjectPath(projectName);
if (!relativePath.isEmpty()) {
rootDirText.setText(relativePath.toString());
} else {
Show replies by date