Author: rob.stryker(a)jboss.com
Date: 2007-11-19 14:31:32 -0500 (Mon, 19 Nov 2007)
New Revision: 4978
Modified:
trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/wizards/FilesetWizard.java
trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/wizards/pages/FilesetInfoWizardPage.java
Log:
JBIDE-1325 -hopefully fixed. I swear.
Modified:
trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/wizards/FilesetWizard.java
===================================================================
---
trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/wizards/FilesetWizard.java 2007-11-19
19:19:20 UTC (rev 4977)
+++
trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/wizards/FilesetWizard.java 2007-11-19
19:31:32 UTC (rev 4978)
@@ -58,11 +58,10 @@
fileset.setExcludesPattern(page1.getExcludes());
fileset.setIncludesPattern(page1.getIncludes());
if( page1.isRootDirWorkspaceRelative()) {
- int workspaceLength =
ResourcesPlugin.getWorkspace().getRoot().getLocation().toOSString().length();
- fileset.setSourcePath(new Path(page1.getRootDir().substring(workspaceLength)));
+ fileset.setSourcePath(new Path(page1.getWorkspaceRelativeRootDir()));
fileset.setInWorkspace(true);
} else {
- fileset.setSourcePath(new Path(page1.getRootDir()));
+ fileset.setSourcePath(new Path(page1.getAbsoluteRootDir()));
fileset.setInWorkspace(false);
}
}
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-19
19:19:20 UTC (rev 4977)
+++
trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/wizards/pages/FilesetInfoWizardPage.java 2007-11-19
19:31:32 UTC (rev 4978)
@@ -44,7 +44,7 @@
private Text excludesText;
private ArchiveNodeDestinationComposite destinationComposite;
- private String includes, excludes;
+ private String includes, excludes, workspaceRelativeRootDir;
/**
* This variable must at all times be global. ALWAYS
@@ -204,11 +204,6 @@
excludesKey.setLayoutData(createFormData(includesText,5,null,0,null,5,0,max));
excludesText.setLayoutData(createFormData(includesText,5,null,0,excludesKey,10,100,-5));
-
-
-
-
-
// customize widgets
destinationKey.setText(ArchivesUIMessages.FilesetInfoWizardPage_destination_label);
rootProjectKey.setText(ArchivesUIMessages.FilesetInfoWizardPage_rootProject_label);
@@ -270,9 +265,13 @@
return excludes;
}
- public String getRootDir () {
+ public String getAbsoluteRootDir () {
return rootDir.toOSString();
}
+
+ public String getWorkspaceRelativeRootDir() {
+ return workspaceRelativeRootDir;
+ }
public boolean isRootDirWorkspaceRelative () {
return rootDirIsWorkspaceRelative;
@@ -291,6 +290,7 @@
if (fileset.getGlobalSourcePath() != null) {
rootDir = fileset.getGlobalSourcePath();
+ workspaceRelativeRootDir = fileset.getSourcePath().toString();
rootDirIsWorkspaceRelative = fileset.isInWorkspace();
rootDirText.setText(rootDir.toString());
}
@@ -301,6 +301,7 @@
rootProjectLabel.setText(project[i].getName());
rootDirIsWorkspaceRelative = true;
rootDir = parentNode.getProjectPath();
+ workspaceRelativeRootDir = "";
}
}
@@ -324,11 +325,12 @@
IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
if (project != null) {
- IPath relativePath = path.removeFirstSegments(1);
+ IPath projectRelativePath = path.removeFirstSegments(1);
rootProjectLabel.setText(project.getName());
- rootDir = ArchivesCore.getInstance().getVariables().getProjectPath(projectName);
- if (!relativePath.isEmpty()) {
- rootDirText.setText(relativePath.toString());
+ rootDir =
ArchivesCore.getInstance().getVariables().getProjectPath(projectName).append(projectRelativePath);
+ workspaceRelativeRootDir = path.toString();
+ if (!projectRelativePath.isEmpty()) {
+ rootDirText.setText(projectRelativePath.toString());
} else {
rootDirText.setText("");
}
@@ -349,6 +351,7 @@
if (path != null && path.length() > 0) {
rootDirText.setText(path);
rootDir = new Path(path);
+ workspaceRelativeRootDir = null;
rootDirIsWorkspaceRelative = false;
rootProjectLabel.setText(ArchivesUIMessages.FilesetInfoWizardPage_noProjectMessage);
changePreview();
Show replies by date