509803: Runtime wizard should use relative paths when updating
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.
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 @@
             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 @@
      */
     @Override
     public void performFinish(IProgressMonitor monitor) throws CoreException {
-        targetPlatformComposite.performFinish(monitor);
+        if (targetPlatformComposite != null) {
+            targetPlatformComposite.performFinish(monitor);
+        }
     }
 }