Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGianMaria Romanato2017-01-01 13:14:37 -0500
committerGianMaria Romanato2017-01-01 13:14:37 -0500
commitc55e93ce6c1c4b6013ab18360b5fbb3d69683b40 (patch)
treed7dc90e0b721d05f5ba6f1ab51debc226882c3e7
parentf3d5845ac00b1d556988ea2c7207327480665132 (diff)
downloadorg.eclipse.virgo.ide-c55e93ce6c1c4b6013ab18360b5fbb3d69683b40.tar.gz
org.eclipse.virgo.ide-c55e93ce6c1c4b6013ab18360b5fbb3d69683b40.tar.xz
org.eclipse.virgo.ide-c55e93ce6c1c4b6013ab18360b5fbb3d69683b40.zip
509803: Runtime wizard should use relative paths when updatingfeature/509803
repository properties file Originally the Virgo tools where adding new folders to the repository properties file as absolute path. Now the tools use paths relative to the Virgo home when possible.
-rw-r--r--org.eclipse.virgo.ide.runtime.ui/src/org/eclipse/virgo/ide/runtime/internal/ui/PDEHelper.java8
-rw-r--r--org.eclipse.virgo.ide.runtime.ui/src/org/eclipse/virgo/ide/runtime/internal/ui/PDETargetPlatformWizardFragment.java4
2 files changed, 10 insertions, 2 deletions
diff --git a/org.eclipse.virgo.ide.runtime.ui/src/org/eclipse/virgo/ide/runtime/internal/ui/PDEHelper.java b/org.eclipse.virgo.ide.runtime.ui/src/org/eclipse/virgo/ide/runtime/internal/ui/PDEHelper.java
index 19555f5..9b559b6 100644
--- a/org.eclipse.virgo.ide.runtime.ui/src/org/eclipse/virgo/ide/runtime/internal/ui/PDEHelper.java
+++ b/org.eclipse.virgo.ide.runtime.ui/src/org/eclipse/virgo/ide/runtime/internal/ui/PDEHelper.java
@@ -310,9 +310,15 @@ public final class PDEHelper {
Properties added = new Properties();
int count = 0;
+ IPath virgoHome = runtime.getLocation();
+
for (File file : newFoldersSet) {
+ IPath path = new Path(file.getCanonicalPath());
+ if (virgoHome.isPrefixOf(path)) {
+ path = path.removeFirstSegments(virgoHome.segmentCount());
+ }
added.put(ADDED_BY_VIRGO_TOOLS + count + REPO_TYPE, TYPE_WATCHED);
- added.put(ADDED_BY_VIRGO_TOOLS + count + WATCH_DIRECTORY, file.getCanonicalPath());
+ added.put(ADDED_BY_VIRGO_TOOLS + count + WATCH_DIRECTORY, path.toString());
count++;
}
diff --git a/org.eclipse.virgo.ide.runtime.ui/src/org/eclipse/virgo/ide/runtime/internal/ui/PDETargetPlatformWizardFragment.java b/org.eclipse.virgo.ide.runtime.ui/src/org/eclipse/virgo/ide/runtime/internal/ui/PDETargetPlatformWizardFragment.java
index 550eced..f190c05 100644
--- a/org.eclipse.virgo.ide.runtime.ui/src/org/eclipse/virgo/ide/runtime/internal/ui/PDETargetPlatformWizardFragment.java
+++ b/org.eclipse.virgo.ide.runtime.ui/src/org/eclipse/virgo/ide/runtime/internal/ui/PDETargetPlatformWizardFragment.java
@@ -77,6 +77,8 @@ public class PDETargetPlatformWizardFragment extends WizardFragment {
*/
@Override
public void performFinish(IProgressMonitor monitor) throws CoreException {
- targetPlatformComposite.performFinish(monitor);
+ if (targetPlatformComposite != null) {
+ targetPlatformComposite.performFinish(monitor);
+ }
}
}

Back to the top