[Esbox-commits] r841 - in branches/sdkPlugins/maemosdk: org.maemo.esbox.maemosdk.analysis/src/org/maemo/esbox/internal/maemosdk/analysis org.maemo.esbox.maemosdk.core org.maemo.esbox.maemosdk.core/META-INF org.maemo.esbox.maemosdk.core/conf org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/adapters org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/sbrsh org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/sdk org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/execEnv org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/scratchbox org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/sdk org.maemo.esbox.maemosdk.sdk1/conf org.maemo.esbox.maemosdk.sdk1/src/org/maemo/esbox/maemosdk/sdk1 org.maemo.esbox.maemosdk.sdk1/src/org/maemo/esbox/maemosdk/sdk1/command org.maemo.esbox.maemosdk.sdk1/src/org/maemo/esbox/maemosdk/sdk1/core org.maemo.esbox.maemosdk.sdk1/src/org/maemo/esbox/maemosdk/sdk1/launcher org.maemo.esbox.maemosdk.sdk1/src/org/maemo/esbox/maemosdk/sdk1/ui org.maemo.esbox.maemosdk.sdk1/src/org/maemo/esbox/maemosdk/sdk1/ui/adapters org.maemo.esbox.maemosdk.sdk1/src/org/maemo/esbox/maemosdk/sdk1/ui/preferences org.maemo.esbox.maemosdk.sdk1/src/org/maemo/esbox/maemosdk/sdk1/ui/wizard org.maemo.esbox.maemosdk.sdk2 org.maemo.esbox.maemosdk.sdk2/META-INF org.maemo.esbox.maemosdk.sdk2/conf org.maemo.esbox.maemosdk.sdk2/src/org/maemo/esbox/maemosdk/sdk2 org.maemo.esbox.maemosdk.sdk2/src/org/maemo/esbox/maemosdk/sdk2/command org.maemo.esbox.maemosdk.sdk2/src/org/maemo/esbox/maemosdk/sdk2/core org.maemo.esbox.maemosdk.sdk2/src/org/maemo/esbox/maemosdk/sdk2/launcher org.maemo.esbox.maemosdk.sdk2/src/org/maemo/esbox/maemosdk/sdk2/ui org.maemo.esbox.maemosdk.sdk2/src/org/maemo/esbox/maemosdk/sdk2/ui/adapters org.maemo.esbox.maemosdk.sdk2/src/org/maemo/esbox/maemosdk/sdk2/ui/preferences org.maemo.esbox.maemosdk.sdk2/src/org/maemo/esbox/maemosdk/sdk2/ui/wizard org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/commands org.maemo.esbox.maemosdk.ui org.maemo.esbox.maemosdk.ui/META-INF org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/adapters org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/maemosdk/ui org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/maemosdk/ui/actions org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/maemosdk/ui/preferences org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/maemosdk/ui/targets/wizards

baranov at garage.maemo.org baranov at garage.maemo.org
Wed Oct 8 16:17:49 EEST 2008


Author: baranov
Date: 2008-10-08 16:17:48 +0300 (Wed, 08 Oct 2008)
New Revision: 841

Added:
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/MaemoEnvironmentUtils.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/adapters/MaemoTargetEnvironmentModifierAdapter.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/adapters/MaemoTargetEnvironmentModifierAdapterFactory.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/AbstractGetGdbQemuCommandPatternCommand.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/sdk/AbstractScratchboxSDK.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/sdk/AbstractScratchboxSDKTarget.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk1/src/org/maemo/esbox/maemosdk/sdk1/command/
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk1/src/org/maemo/esbox/maemosdk/sdk1/command/GetGdbQemuCommandPatternCommand.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk1/src/org/maemo/esbox/maemosdk/sdk1/command/ListSessionsCommand.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk1/src/org/maemo/esbox/maemosdk/sdk1/core/Scratchbox1FileSystemMapping.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk1/src/org/maemo/esbox/maemosdk/sdk1/launcher/
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk1/src/org/maemo/esbox/maemosdk/sdk1/launcher/Scratchbox1EnvironmentProvider.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk1/src/org/maemo/esbox/maemosdk/sdk1/launcher/Scratchbox1ProcessLauncher.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk1/src/org/maemo/esbox/maemosdk/sdk1/launcher/Scratchbox1ProcessLauncherFactory.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk1/src/org/maemo/esbox/maemosdk/sdk1/launcher/ScratchboxTargetSwitcher.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk1/src/org/maemo/esbox/maemosdk/sdk1/ui/
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk1/src/org/maemo/esbox/maemosdk/sdk1/ui/adapters/
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk1/src/org/maemo/esbox/maemosdk/sdk1/ui/adapters/MaemoSDKInstallTargetAdapterFactory.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk1/src/org/maemo/esbox/maemosdk/sdk1/ui/adapters/MaemoScratchbox1SDKManageTargetAdapter.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk1/src/org/maemo/esbox/maemosdk/sdk1/ui/preferences/
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk1/src/org/maemo/esbox/maemosdk/sdk1/ui/preferences/Scratchbox1PreferencesPage.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk1/src/org/maemo/esbox/maemosdk/sdk1/ui/wizard/
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk1/src/org/maemo/esbox/maemosdk/sdk1/ui/wizard/NewScratchbox1TargetWizard.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk1/src/org/maemo/esbox/maemosdk/sdk1/ui/wizard/TargetWizardDevkitsPage.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk2/conf/
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk2/conf/sb2_prefs.xml
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk2/src/org/maemo/esbox/maemosdk/sdk2/command/GetGdbQemuCommandPatternCommand.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk2/src/org/maemo/esbox/maemosdk/sdk2/command/RemoveTargetSb2Command.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk2/src/org/maemo/esbox/maemosdk/sdk2/launcher/
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk2/src/org/maemo/esbox/maemosdk/sdk2/launcher/Scratchbox2EnvironmentProvider.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk2/src/org/maemo/esbox/maemosdk/sdk2/launcher/Scratchbox2ProcessLauncher.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk2/src/org/maemo/esbox/maemosdk/sdk2/launcher/Scratchbox2ProcessLauncherFactory.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk2/src/org/maemo/esbox/maemosdk/sdk2/ui/
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk2/src/org/maemo/esbox/maemosdk/sdk2/ui/adapters/
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk2/src/org/maemo/esbox/maemosdk/sdk2/ui/adapters/ESboxTargetRemover.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk2/src/org/maemo/esbox/maemosdk/sdk2/ui/adapters/MaemoSDKInstallTargetAdapterFactory.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk2/src/org/maemo/esbox/maemosdk/sdk2/ui/adapters/MaemoScratchbox2SDKManageTargetAdapter.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk2/src/org/maemo/esbox/maemosdk/sdk2/ui/preferences/
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk2/src/org/maemo/esbox/maemosdk/sdk2/ui/preferences/Scratchbox2PreferencesPage.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk2/src/org/maemo/esbox/maemosdk/sdk2/ui/wizard/
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk2/src/org/maemo/esbox/maemosdk/sdk2/ui/wizard/MaemoRootstrapContentLabelProvider.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk2/src/org/maemo/esbox/maemosdk/sdk2/ui/wizard/NewScratchbox2TargetWizard.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk2/src/org/maemo/esbox/maemosdk/sdk2/ui/wizard/TargetWizardRootstrapSb2Page.java
Removed:
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/MaemoPreferenceInitializer.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/SB1PreferenceInitializer.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/SB2PreferenceInitializer.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/GetGdbQemuCommandPatternCommand.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/GetMaemoRootstrapLocationCommand.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/RemoveTargetSb2Command.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/sdk/Scratchbox1FileSystemMapping.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/sdk/Scratchbox1ProcessLauncher.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/sdk/Scratchbox1ProcessLauncherFactory.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/sdk/Scratchbox1SDK.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/sdk/Scratchbox1SDKTarget.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/sdk/Scratchbox2FileSystemMapping.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/sdk/Scratchbox2ProcessLauncher.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/sdk/Scratchbox2ProcessLauncherFactory.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/sdk/Scratchbox2SDK.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/sdk/Scratchbox2SDKTarget.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/sdk/providers/
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/scratchbox/ScratchboxFacade.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/scratchbox/ScratchboxTargetSwitcher.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/sdk/IScratchbox1SDK.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/sdk/IScratchbox1SDKTarget.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/sdk/IScratchbox2SDK.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/sdk/IScratchbox2SDKTarget.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/adapters/ESboxTargetRemover.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/adapters/MaemoSDKInstallTargetAdapterFactory.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/adapters/MaemoScratchbox1SDKManageTargetAdapter.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/adapters/MaemoScratchbox2SDKManageTargetAdapter.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/maemosdk/ui/MaemoRootstrapContentLabelProvider.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/maemosdk/ui/preferences/Scratchbox1PreferencesPage.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/maemosdk/ui/targets/wizards/NewScratchbox1TargetWizard.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/maemosdk/ui/targets/wizards/NewScratchbox2TargetWizard.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/maemosdk/ui/targets/wizards/TargetWizardDevkitsPage.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/maemosdk/ui/targets/wizards/TargetWizardRootstrapSb2Page.java
Modified:
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.analysis/src/org/maemo/esbox/internal/maemosdk/analysis/Activator.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/META-INF/MANIFEST.MF
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/conf/maemo_prefs.xml
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/conf/run.sh
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/conf/sb1_prefs.xml
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/plugin.xml
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/Activator.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/adapters/MaemoGdbServerSupportAdapter.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/adapters/MaemoGdbServerSupportAdapterFactory.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/CreateMaemoRootstrapSb2Command.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/CreateTargetCommand.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/CreateTargetSb2Command.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/GetCurrentTargetCommand.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/GetCurrentTargetSb2Command.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/GetVersionScratchboxCommand.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/KillallCommand.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/ListAvailableMaemoRootstrapsSb2Command.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/ListCompilersCommand.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/ListCompilersSb2Command.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/ListCputranspCommand.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/ListCputranspSb2Command.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/ListDevkitsCommand.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/ListInstalledMaemoRootstrapsSb2Command.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/ListSessionsCommand.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/ListTargetsCommand.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/MaemoCommand.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/MaemoRootstrapSb2Command.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/RemoveMaemoRootstrapSb2Command.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/RemoveTargetCommand.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/ResetTargetCommand.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/RootstrapCommand.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/ScratchboxCommand.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/SelectTargetCommand.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/ShowPathMappingSb2Command.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/ShowTargetCommand.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/SimpleCommand.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/sbrsh/AddSbrshCommand.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/sbrsh/ConfigureSbrshCommand.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/sbrsh/MountTargetSbrshCommand.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/sbrsh/UnmountTargetSbrshCommand.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/sdk/BaseScratchboxSDKTarget.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/sdk/IScratchboxSDKPlatformArchitectureProvider.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/sdk/ScratchboxSDK.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/MaemoPreferenceConstants.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/MaemoPreferenceMigrator.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/OldStyleProjectProperties.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/OldStyleWorkspaceProjectPropertiesProvider.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/ScratchboxPackageManagerProvider.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/ScratchboxPropertyTester.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/execEnv/MaemoExecutionEnvironment.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/execEnv/X11ExecutionEnvironment.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/scratchbox/ESboxScriptLauncher.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/scratchbox/MaemoLauncher.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/scratchbox/PersistentCache.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/scratchbox/XLauncher.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/sdk/IScratchboxSDK.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/sdk/IScratchboxSDKTarget.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/sdk/ScratchboxSDKFacade.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk1/conf/sb1_prefs.xml
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk1/src/org/maemo/esbox/maemosdk/sdk1/core/IScratchboxSDK1.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk1/src/org/maemo/esbox/maemosdk/sdk1/core/ScratchboxSDK1.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk1/src/org/maemo/esbox/maemosdk/sdk1/core/ScratchboxSDK1Target.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk2/META-INF/MANIFEST.MF
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk2/plugin.xml
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk2/src/org/maemo/esbox/maemosdk/sdk2/Activator.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk2/src/org/maemo/esbox/maemosdk/sdk2/command/GetMaemoRootstrapLocationCommand.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk2/src/org/maemo/esbox/maemosdk/sdk2/command/MaemoRootstrapSb2Command.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk2/src/org/maemo/esbox/maemosdk/sdk2/core/IScratchboxSDK2.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk2/src/org/maemo/esbox/maemosdk/sdk2/core/ScratchboxSDK2.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk2/src/org/maemo/esbox/maemosdk/sdk2/core/ScratchboxSDK2Target.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/AllTests.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/TestOProfileValgrindSupport.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/TestProcessLauncher.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/TestRunStandalone.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/TestSB1ProcessLauncher.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/TestSB2SDKProvider.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/commands/BaseTest.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/commands/MockCommandAbstractor.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/commands/MockProcessLauncher.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/commands/MockProcessLauncherFactory.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/commands/TestCreateTargetCommand.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/commands/TestCreateTargetSb2Command.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/commands/TestGetCurrentTargetCommand.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/commands/TestListCommands.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/commands/TestListSb2Commands.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/commands/TestRemoveCommand.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/commands/TestRemoveSb2Command.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/commands/TestScratchboxCommand.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/commands/TestSelectTargetCommand.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/commands/TestShowPathMappingSb2Command.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/commands/TestShowTargetCommand.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.ui/META-INF/MANIFEST.MF
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.ui/plugin.xml
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/UIActivator.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/adapters/MaemoScratchboxSDKManageTargetAdapterBase.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/maemosdk/ui/actions/MaemoDropdownMenuAction.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/maemosdk/ui/actions/ValidateVirtualMachineCommand.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/maemosdk/ui/actions/XDropdownMenuAction.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/maemosdk/ui/preferences/ESboxXServerPreferencePage.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/maemosdk/ui/targets/wizards/TargetWizardNamePage.java
   branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/maemosdk/ui/targets/wizards/TargetWizardPageFactory.java
Log:
ScratchboxSDK1 and ScratchboxSDK2 moved from maemosdk.core.
TBD:
- Commands should be split on core, sdk1, sdk2
- plugins runtime to be limited.
- testing, although currenly passes same number of test as trunk version.
- ScratchboxSDKFacade to be studied.



Modified: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.analysis/src/org/maemo/esbox/internal/maemosdk/analysis/Activator.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.analysis/src/org/maemo/esbox/internal/maemosdk/analysis/Activator.java	2008-10-07 23:27:03 UTC (rev 840)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.analysis/src/org/maemo/esbox/internal/maemosdk/analysis/Activator.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -11,13 +11,19 @@
 
 package org.maemo.esbox.internal.maemosdk.analysis;
 
-import org.eclipse.core.runtime.*;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+
+import org.eclipse.core.runtime.FileLocator;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Plugin;
+import org.eclipse.core.runtime.Status;
 import org.eclipse.ui.plugin.AbstractUIPlugin;
 import org.maemo.esbox.core.ErrorLogger;
 import org.osgi.framework.BundleContext;
 
-import java.io.*;
-
 /**
  * @author eswartz
  *

Modified: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/META-INF/MANIFEST.MF
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/META-INF/MANIFEST.MF	2008-10-07 23:27:03 UTC (rev 840)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/META-INF/MANIFEST.MF	2008-10-08 13:17:48 UTC (rev 841)
@@ -15,13 +15,12 @@
 Bundle-RequiredExecutionEnvironment: J2SE-1.5
 Bundle-ActivationPolicy: lazy
 Export-Package: org.maemo.esbox.internal.maemosdk.core,
+ org.maemo.esbox.internal.maemosdk.core.adapters,
  org.maemo.esbox.internal.maemosdk.core.command,
  org.maemo.esbox.internal.maemosdk.core.command.scratchbox;x-friends:="org.maemo.esbox.maemosdk.tests",
  org.maemo.esbox.internal.maemosdk.core.command.scratchbox.sbrsh;x-friends:="org.maemo.esbox.maemosdk.tests",
  org.maemo.esbox.internal.maemosdk.core.sdk;x-friends:="org.maemo.esbox.maemosdk.tests",
- org.maemo.esbox.internal.maemosdk.core.sdk.providers;x-friends:="org.maemo.esbox.maemosdk.tests",
  org.maemo.esbox.maemosdk.core,
- org.maemo.esbox.maemosdk.core.command,
  org.maemo.esbox.maemosdk.core.execEnv,
  org.maemo.esbox.maemosdk.core.platform,
  org.maemo.esbox.maemosdk.core.scratchbox,

Modified: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/conf/maemo_prefs.xml
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/conf/maemo_prefs.xml	2008-10-07 23:27:03 UTC (rev 840)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/conf/maemo_prefs.xml	2008-10-08 13:17:48 UTC (rev 841)
@@ -9,6 +9,13 @@
 	<entry key="DISPLAY_X_COMMAND_UNIX">Xephyr ${DISPLAY} -host-cursor -screen 800x480x16 -dpi 96 -ac -extension Composite</entry>
 	<entry key="DISPLAY_X_COMMAND_WIN32">c:/cygwin/usr/X11R6/bin/Xwin ${DISPLAY} -lesspointer -swcursor -screen 0 800x480x16 -dpi 96 -ac -extension Composite</entry>
 	<!-- this is initialized dynamically <entry key="DISPLAY_X_COMMAND"></entry> -->
+	
+	<!-- others commands -->	
+	<entry key="X_DISPLAY">:2</entry>
+	<entry key="X_PATH_WIN32">c:/cygwin/bin</entry>
+	<entry key="X_PATH_UNIX"></entry>
+	<!-- this is initialized dynamically <entry key="X_PATH"></entry> -->
+	
 	<entry key="MAEMO_COMMAND">af-sb-init.sh ${ACTIONS}</entry>
 	<entry key="MAEMO_START_ACTION">start</entry>
 	<entry key="MAEMO_RESTART_ACTION">restart</entry>

Modified: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/conf/run.sh
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/conf/run.sh	2008-10-07 23:27:03 UTC (rev 840)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/conf/run.sh	2008-10-08 13:17:48 UTC (rev 841)
@@ -9,7 +9,7 @@
 # *
 # * Contributors:
 # *    Raul Herbster (raul at embedded.ufcg.edu.br) (UFCG) - initial API and implementation
-# *    Ed Swartz (Nokia)
+# *    Ed Swartz (Nokia) - additions and changes
 # *******************************************************************************/
 
 __version=0.5
@@ -27,13 +27,17 @@
 
 cd $__location
 
-# gather exports
-IFS=,; for __export in $__export_list; do
-	export $__export
-done
-IFS=" "
+# apply exports and unsets
+if [ "$__export_list" != "-" ] ; then
+	IFS=,; for __export in $__export_list; do
+		case $__export in 
+			-* ) 	unset `echo $__export | sed s/-//` ;;
+			* ) 	export $__export ;;
+		esac
+	done
+	IFS=" "
+fi
 
-
 # Run command
 $__command
 

Modified: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/conf/sb1_prefs.xml
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/conf/sb1_prefs.xml	2008-10-07 23:27:03 UTC (rev 840)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/conf/sb1_prefs.xml	2008-10-08 13:17:48 UTC (rev 841)
@@ -10,7 +10,7 @@
 		WHEN ANYTHING ELSE CHANGED which can be merged into existing prefs, 
 		adjust ESboxPreferenceInitializer#RPEFS_VERSION_MINOR -->
 		
-	<entry key="SB1_LOGIN_COMMAND">/scratchbox/login -d ${RUN_SCRIPT_DIRECTORY} "./run.sh ${{DIRECTORY}} \\\"${{{EXPORTS}}}\\\" \\\"${{{COMMAND}}} ${{{ARGS}}}\\\""</entry>
+	<entry key="SB1_LOGIN_COMMAND">/scratchbox/login -d ${RUN_SCRIPT_DIRECTORY} "./${RUN_SCRIPT} ${{DIRECTORY}} \\\"${{{EXPORTS}}}\\\" \\\"${{{COMMAND}}} ${{{ARGS}}}\\\""</entry>
 	<entry key="SB1_SBOX_COMMAND">sb-conf ${ACTIONS} ${OPTIONS}</entry>	
 
 	<entry key="RUN_SCRIPT_LOC">/scratchbox/users/${USER}/home/${USER}/.esbox/</entry>

Modified: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/plugin.xml
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/plugin.xml	2008-10-07 23:27:03 UTC (rev 840)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/plugin.xml	2008-10-08 13:17:48 UTC (rev 841)
@@ -337,6 +337,13 @@
                type="org.maemo.esbox.core.adapters.IDefaultExecutionEnvironmentAdapter">
          </adapter>
       </factory>
+       <factory
+            adaptableType="org.maemo.esbox.core.sdk.ISDKTarget"
+            class="org.maemo.esbox.internal.maemosdk.core.adapters.MaemoTargetEnvironmentModifierAdapterFactory">
+         <adapter
+               type="org.maemo.esbox.launch.adapters.ITargetEnvironmentModifierAdapter">
+         </adapter>
+      </factory>
    </extension>
  
   <extension

Modified: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/Activator.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/Activator.java	2008-10-07 23:27:03 UTC (rev 840)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/Activator.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -1,14 +1,20 @@
 package org.maemo.esbox.internal.maemosdk.core;
 
-import org.eclipse.core.runtime.*;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+
+import org.eclipse.core.runtime.FileLocator;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Plugin;
+import org.eclipse.core.runtime.Status;
 import org.eclipse.core.runtime.preferences.InstanceScope;
 import org.eclipse.jface.preference.IPreferenceStore;
 import org.eclipse.ui.preferences.ScopedPreferenceStore;
 import org.maemo.esbox.core.ErrorLogger;
 import org.osgi.framework.BundleContext;
 
-import java.io.*;
-
 /**
  * The activator class controls the plug-in life cycle
  */

Added: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/MaemoEnvironmentUtils.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/MaemoEnvironmentUtils.java	                        (rev 0)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/MaemoEnvironmentUtils.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -0,0 +1,47 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Nokia Corporation
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    Ed Swartz (Nokia) - initial API and implementation
+ *******************************************************************************/
+
+package org.maemo.esbox.internal.maemosdk.core;
+
+import org.maemo.esbox.core.CorePreferenceManager;
+import org.maemo.esbox.core.env.IEnvironmentModifierBlock;
+import org.maemo.esbox.core.machine.IMachine;
+import org.maemo.esbox.core.machine.IVirtualMachine;
+import org.maemo.esbox.maemosdk.core.MaemoPreferenceConstants;
+
+/**
+ * @author eswartz
+ *
+ */
+public class MaemoEnvironmentUtils {
+	/**
+	 * Define DISPLAY for launches under the emulator that need a connection to the X server.
+	 * <p>
+	 * This uses the setting from the X Server preferences.
+	 * @param serverMachine the machine that hosts X
+	 * @param envBlock
+	 */
+	public static void defineEmulatorXDisplayVariable(IMachine serverMachine, IEnvironmentModifierBlock envBlock) {
+		// local launches need DISPLAY that points back to the host machine
+		String display = CorePreferenceManager.getInstance().getRegisteredKeyValue(
+				MaemoPreferenceConstants.X_DISPLAY);
+		if (display != null && display.length() > 0) {
+			String host = "";
+			
+			// XXX: provide an accessor from IMachine
+			if (serverMachine instanceof IVirtualMachine) {
+				host = "10.0.2.2";
+			}
+			
+			envBlock.define("DISPLAY", host + display);
+		}
+	}
+}

Deleted: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/MaemoPreferenceInitializer.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/MaemoPreferenceInitializer.java	2008-10-07 23:27:03 UTC (rev 840)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/MaemoPreferenceInitializer.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007-2008 INdT, (c) 2008 Nokia Corporation
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *    Raul Herbster (UFCG) - initial API and implementation
- *    Ed Swartz (Nokia)
- *******************************************************************************/
-package org.maemo.esbox.internal.maemosdk.core;
-
-import org.eclipse.core.runtime.FileLocator;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
-import org.maemo.esbox.core.*;
-import org.maemo.esbox.maemosdk.core.MaemoPreferenceConstants;
-import org.maemo.esbox.maemosdk.core.MaemoPreferenceMigrator;
-
-/**
- * Initialize maemo preferences.
- */
-public class MaemoPreferenceInitializer extends AbstractPreferenceInitializer {
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer#initializeDefaultPreferences()
-	 */
-	public void initializeDefaultPreferences() {
-		CorePreferenceManager.getInstance().registerAndUpdatePreferences(
-				MaemoPreferenceConstants.class,
-				MaemoPreferenceConstants.getPreferenceStore(),
-				FileLocator.find(Activator.getDefault().getBundle(), 
-						new Path("conf/maemo_prefs.xml"),
-						null),
-				MaemoPreferenceConstants.VERSION_MAJOR,
-				MaemoPreferenceConstants.VERSION_MINOR,
-				new MaemoPreferenceMigrator());
-	}
-}

Deleted: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/SB1PreferenceInitializer.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/SB1PreferenceInitializer.java	2008-10-07 23:27:03 UTC (rev 840)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/SB1PreferenceInitializer.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007-2008 INdT, (c) 2008 Nokia Corporation
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *    Raul Herbster (UFCG) - initial API and implementation
- *    Ed Swartz (Nokia)
- *******************************************************************************/
-package org.maemo.esbox.internal.maemosdk.core;
-
-import org.eclipse.core.runtime.FileLocator;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
-import org.maemo.esbox.core.*;
-import org.maemo.esbox.internal.api.core.OldESboxPreferenceMigrator;
-import org.maemo.esbox.maemosdk.core.SB1PreferenceConstants;
-
-/**
- * Initialize SB1 preferences.
- */
-public class SB1PreferenceInitializer extends AbstractPreferenceInitializer {
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer#initializeDefaultPreferences()
-	 */
-	public void initializeDefaultPreferences() {
-		CorePreferenceManager.getInstance().registerAndUpdatePreferences(
-				SB1PreferenceConstants.class,
-				SB1PreferenceConstants.getPreferenceStore(),
-				FileLocator.find(Activator.getDefault().getBundle(), 
-						new Path("conf/sb1_prefs.xml"),
-						null),
-				SB1PreferenceConstants.VERSION_MAJOR,
-				SB1PreferenceConstants.VERSION_MINOR,
-				new OldESboxPreferenceMigrator());
-	}
-}

Deleted: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/SB2PreferenceInitializer.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/SB2PreferenceInitializer.java	2008-10-07 23:27:03 UTC (rev 840)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/SB2PreferenceInitializer.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007-2008 INdT, (c) 2008 Nokia Corporation
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *    Raul Herbster (UFCG) - initial API and implementation
- *    Ed Swartz (Nokia)
- *******************************************************************************/
-package org.maemo.esbox.internal.maemosdk.core;
-
-import org.eclipse.core.runtime.FileLocator;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
-import org.maemo.esbox.core.*;
-import org.maemo.esbox.internal.api.core.OldESboxPreferenceMigrator;
-import org.maemo.esbox.maemosdk.core.SB2PreferenceConstants;
-
-/**
- * Initialize SB1 preferences.
- */
-public class SB2PreferenceInitializer extends AbstractPreferenceInitializer {
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer#initializeDefaultPreferences()
-	 */
-	public void initializeDefaultPreferences() {
-		CorePreferenceManager.getInstance().registerAndUpdatePreferences(
-				SB2PreferenceConstants.class,
-				SB2PreferenceConstants.getPreferenceStore(),
-				FileLocator.find(Activator.getDefault().getBundle(), 
-						new Path("conf/sb2_prefs.xml"),
-						null),
-				SB2PreferenceConstants.VERSION_MAJOR,
-				SB2PreferenceConstants.VERSION_MINOR,
-				new OldESboxPreferenceMigrator());
-	}
-}

Modified: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/adapters/MaemoGdbServerSupportAdapter.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/adapters/MaemoGdbServerSupportAdapter.java	2008-10-07 23:27:03 UTC (rev 840)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/adapters/MaemoGdbServerSupportAdapter.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -11,16 +11,15 @@
 
 package org.maemo.esbox.internal.maemosdk.core.adapters;
 
+import java.text.MessageFormat;
+
 import org.maemo.esbox.core.ESboxException;
 import org.maemo.esbox.core.sdk.ISDKTarget;
 import org.maemo.esbox.internal.maemosdk.core.Activator;
 import org.maemo.esbox.launch.adapters.IGdbServerSupportAdapter;
 import org.maemo.esbox.maemosdk.core.MaemoPreferenceConstants;
-import org.maemo.esbox.maemosdk.core.scratchbox.ScratchboxFacade;
 import org.maemo.esbox.maemosdk.core.sdk.IScratchboxSDKTarget;
 
-import java.text.MessageFormat;
-
 /**
  * Maemo implementation, which takes care of sb1 vs. sb2 differences
  * @author eswartz
@@ -28,9 +27,9 @@
  */
 public class MaemoGdbServerSupportAdapter implements IGdbServerSupportAdapter {
 
-	private final ISDKTarget sdkTarget;
-	
-	public MaemoGdbServerSupportAdapter(ISDKTarget sdkTarget) {
+	private final IScratchboxSDKTarget sdkTarget;
+
+	public MaemoGdbServerSupportAdapter(IScratchboxSDKTarget sdkTarget) {
 		this.sdkTarget = sdkTarget;
 	}
 
@@ -51,7 +50,7 @@
 			architecture = IScratchboxSDKTarget.ARCHITECTURE_X86;
 		}
 		try {
-			String commandPattern = ScratchboxFacade.getInstance().getGdbQemuCommandPattern(sdkTarget, architecture);
+			String commandPattern = sdkTarget.getGdbQemuCommandPattern( architecture);
 			return commandPattern;
 		} catch (ESboxException e) {
 			String msg = MessageFormat.format(

Modified: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/adapters/MaemoGdbServerSupportAdapterFactory.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/adapters/MaemoGdbServerSupportAdapterFactory.java	2008-10-07 23:27:03 UTC (rev 840)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/adapters/MaemoGdbServerSupportAdapterFactory.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -14,6 +14,7 @@
 import org.eclipse.core.runtime.IAdapterFactory;
 import org.maemo.esbox.core.sdk.ISDKTarget;
 import org.maemo.esbox.launch.adapters.IGdbServerSupportAdapter;
+import org.maemo.esbox.maemosdk.core.sdk.IScratchboxSDKTarget;
 
 /**
  * @author eswartz
@@ -25,9 +26,9 @@
 	 * @see org.eclipse.core.runtime.IAdapterFactory#getAdapter(java.lang.Object, java.lang.Class)
 	 */
 	public Object getAdapter(Object adaptableObject, Class adapterType) {
-		if (adaptableObject instanceof ISDKTarget) {
+		if (adaptableObject instanceof IScratchboxSDKTarget) {
 			if (adapterType.equals(IGdbServerSupportAdapter.class)) {
-				return new MaemoGdbServerSupportAdapter((ISDKTarget) adaptableObject);
+				return new MaemoGdbServerSupportAdapter((IScratchboxSDKTarget) adaptableObject);
 			}
 		}
 		return null;

Added: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/adapters/MaemoTargetEnvironmentModifierAdapter.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/adapters/MaemoTargetEnvironmentModifierAdapter.java	                        (rev 0)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/adapters/MaemoTargetEnvironmentModifierAdapter.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -0,0 +1,60 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Nokia Corporation
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    Ed Swartz (Nokia) - initial API and implementation
+ *******************************************************************************/
+
+package org.maemo.esbox.internal.maemosdk.core.adapters;
+
+import org.maemo.esbox.core.env.EnvironmentManager;
+import org.maemo.esbox.core.env.IEnvironmentModifierBlock;
+import org.maemo.esbox.core.sdk.ISDKTarget;
+import org.maemo.esbox.internal.maemosdk.core.MaemoEnvironmentUtils;
+import org.maemo.esbox.launch.adapters.ITargetEnvironmentModifierAdapter;
+import org.maemo.esbox.launch.core.AbstractLocalLaunchProxy;
+import org.maemo.esbox.launch.core.ILaunchProxy;
+
+/**
+ * Provide the necessary variables for maemo launches.
+ * @author eswartz
+ *
+ */
+public class MaemoTargetEnvironmentModifierAdapter implements ITargetEnvironmentModifierAdapter {
+
+	private final ISDKTarget sdkTarget;
+
+	/**
+	 * @param sdkTarget
+	 */
+	public MaemoTargetEnvironmentModifierAdapter(ISDKTarget sdkTarget) {
+		this.sdkTarget = sdkTarget;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.maemo.esbox.launch.adapters.ITargetEnvironmentModifierAdapter#getTargetEnvironmentModifierBlock(org.maemo.esbox.launch.core.ILaunchProxy)
+	 */
+	public IEnvironmentModifierBlock getTargetEnvironmentModifierBlock(ILaunchProxy launchProxy) {
+		IEnvironmentModifierBlock envBlock = EnvironmentManager.getInstance().createEnvironmentModifierBlock();
+		
+		// first, all launches need proper DBUS access
+		envBlock.define("DBUS_SESSION_BUS_ADDRESS", "unix:path=/tmp/session_bus_socket");
+		
+		if (launchProxy instanceof AbstractLocalLaunchProxy) {
+			MaemoEnvironmentUtils.defineEmulatorXDisplayVariable(sdkTarget.getSDK().getMachine(), envBlock);
+			
+		} else {
+			// remote launches need DISPLAY for its own machine
+			
+			envBlock.define("DISPLAY", ":0");
+			
+		}
+		
+		return envBlock;
+	}
+
+}

Added: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/adapters/MaemoTargetEnvironmentModifierAdapterFactory.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/adapters/MaemoTargetEnvironmentModifierAdapterFactory.java	                        (rev 0)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/adapters/MaemoTargetEnvironmentModifierAdapterFactory.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -0,0 +1,46 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Nokia Corporation
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    Ed Swartz (Nokia) - initial API and implementation
+ *******************************************************************************/
+
+package org.maemo.esbox.internal.maemosdk.core.adapters;
+
+import org.eclipse.core.runtime.IAdapterFactory;
+import org.maemo.esbox.core.sdk.ISDKTarget;
+import org.maemo.esbox.launch.adapters.ITargetEnvironmentModifierAdapter;
+
+/**
+ * 
+ * @author eswartz
+ *
+ */
+public class MaemoTargetEnvironmentModifierAdapterFactory implements IAdapterFactory {
+
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.core.runtime.IAdapterFactory#getAdapter(java.lang.Object, java.lang.Class)
+	 */
+	public Object getAdapter(Object adaptableObject, Class adapterType) {
+		if (adapterType.equals(ITargetEnvironmentModifierAdapter.class)) {
+			if (adaptableObject instanceof ISDKTarget) {
+				ISDKTarget sdkTarget = (ISDKTarget) adaptableObject;
+				return new MaemoTargetEnvironmentModifierAdapter(sdkTarget);
+			}
+		}
+		return null;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.core.runtime.IAdapterFactory#getAdapterList()
+	 */
+	public Class[] getAdapterList() {
+		return new Class[] { ITargetEnvironmentModifierAdapter.class };
+	}
+
+}

Added: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/AbstractGetGdbQemuCommandPatternCommand.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/AbstractGetGdbQemuCommandPatternCommand.java	                        (rev 0)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/AbstractGetGdbQemuCommandPatternCommand.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -0,0 +1,137 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Nokia Corporation
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    Ed Swartz (Nokia) - initial API and implementation
+ *******************************************************************************/
+package org.maemo.esbox.internal.maemosdk.core.command.scratchbox;
+
+import org.eclipse.core.runtime.IStatus;
+import org.maemo.esbox.core.*;
+import org.maemo.esbox.core.sdk.ISDKTarget;
+import org.maemo.esbox.internal.maemosdk.core.Activator;
+import org.maemo.esbox.internal.maemosdk.core.command.ICommandAbstractor;
+import org.maemo.esbox.maemosdk.core.*;
+import org.maemo.esbox.maemosdk.core.scratchbox.ScratchboxException;
+import org.maemo.esbox.maemosdk.core.sdk.*;
+import org.osgi.framework.Version;
+
+import java.util.List;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+/**
+ * Get the command pattern for launching qemu with the debugger  
+ * @author eswartz
+ * 
+ */
+public abstract class AbstractGetGdbQemuCommandPatternCommand <ScboxSDKTarget extends IScratchboxSDKTarget>  extends ScratchboxCommand {
+
+	protected ScboxSDKTarget sdkTarget;
+
+	public AbstractGetGdbQemuCommandPatternCommand(ScboxSDKTarget sdkTarget, ICommandAbstractor commandAbstractor, int sboxVersion) {
+		super(commandAbstractor, sboxVersion);
+		this.sdkTarget = sdkTarget;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see embedded.core.scratchbox.command.IScratchboxCommand#performCommand(java.lang.Object)
+	 */	
+	public abstract String performCommand(List<String> param)throws ScratchboxException, ESboxException;
+//	{
+//		if (!this.checkParameters(param))
+//			throw new ScratchboxInvalidParameterException(
+//					"Invalid number of parameters");
+//
+//		String commandPattern = null;
+//
+//		String architecture = param.get(0);
+//		
+//		if (architecture.equals(IScratchboxSDKTarget.ARCHITECTURE_ARMEL))
+//		{
+//			if (sdkTarget instanceof IScratchbox1SDKTarget) {
+//				// scratchbox often misconfigures the softlinks, so explicitly launch the qemu configured for the target
+//				String qemu = getConfiguredQemu();
+//				if (qemu == null) {
+//					// fallback
+//					Activator.getErrorLogger().log(IStatus.WARNING, 
+//							"Target " + sdkTarget + " does not seem to use qemu, so assuming qemu-arm for debugging", null);
+//					qemu = "qemu-arm";
+//				}
+//
+//				// get the version
+//				Version version = null;
+//				Pattern versionPattern = Pattern.compile("qemu-.*((\\d+)\\.(\\d+)\\.(\\d+))-.*");
+//				Matcher matcher = versionPattern.matcher(qemu);
+//				if (matcher.matches()) {
+//					version = new Version(matcher.group(1));
+//				}
+//				
+//				// For ARM emulator debug, use "qemu-arm" command.
+//				commandPattern = sdkTarget.getPreferenceValue(SB1PreferenceConstants.SB1_GDB_REMOTE_QEMU);
+//				
+//				if (version != null && version.compareTo(new Version(0, 8, 0)) < 0) {
+//					// hide ${PORT}, which doesn't exist in 0.7.x
+//					commandPattern = commandPattern.replace("${PORT}", "");
+//					//Activator.getErrorLogger().log(IStatus.WARNING, 
+//					//		"The version of qemu-arm in use (" + version + ") is too old -- debugging may not work.  Check your softlinks in /scratchbox/devkits/cputransp/bin/.", null);
+//				}
+//				
+//				commandPattern = commandPattern.replace("${QEMU}", qemu);
+//				
+//			} else if (sdkTarget instanceof IScratchbox2SDKTarget) {
+//				// we think this always uses a new enough version, so keep ${PORT}
+//				commandPattern = sdkTarget.getPreferenceValue(SB2PreferenceConstants.SB2_GDB_REMOTE_QEMU);
+//			} else {
+//				throw new ScratchboxException("unknown scratchbox version");
+//			}
+//		}
+//		else {
+//			// The others, just standard "gdbserver" command.
+//			commandPattern = sdkTarget.getPreferenceValue(MaemoPreferenceConstants.SBOX_GDB_REMOTE);
+//		}
+//		
+//		return commandPattern;
+//	}
+
+	/**
+	 * Find what qemu is configured for this target.
+	 * @return qemu name, or <code>null</code> if not using qemu
+	 */
+	protected String getConfiguredQemu() throws ESboxException {
+		
+		// we use sb-select show <target> to find out if qemu is even used for this target.
+		String showAction = commandAbstractor.getPreferenceValue(
+				SB1PreferenceConstants.SB1_SHOW_ACT);
+		String showInfoCommandString = this
+		.replaceScratchboxConfigCommand(showAction,
+				new String[] { sdkTarget.getName() });
+		
+		Process process = createProcess(showInfoCommandString, null);
+		
+		List<String> lines = getLineInputFromProcessAndWait(process, true, 0);
+		
+		// see if this is the line describing CPU transparency
+		Pattern namePattern = Pattern.compile(".*/(qemu-\\S+).*");
+		for (String line : lines) {
+			Matcher matcher = namePattern.matcher(line);
+			if (matcher.matches()) {
+				return matcher.group(1);
+			}
+		}
+		
+		return null;
+	}
+
+	@Override
+	public int getParametersSize() {
+		return 1;
+	}
+
+}

Modified: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/CreateMaemoRootstrapSb2Command.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/CreateMaemoRootstrapSb2Command.java	2008-10-07 23:27:03 UTC (rev 840)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/CreateMaemoRootstrapSb2Command.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -13,11 +13,11 @@
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.maemo.esbox.core.*;
 
+import org.maemo.esbox.core.env.IEnvironmentModifierBlock;
 import org.maemo.esbox.core.process.ProcessLauncherUtils;
 import org.maemo.esbox.core.sdk.ISDK;
+import org.maemo.esbox.internal.maemosdk.core.command.ICommandAbstractor;
 import org.maemo.esbox.maemosdk.core.SB2PreferenceConstants;
-import org.maemo.esbox.maemosdk.core.ScratchboxInvalidParameterException;
-import org.maemo.esbox.maemosdk.core.command.ICommandAbstractor;
 import org.maemo.esbox.maemosdk.core.scratchbox.ScratchboxException;
 
 import java.util.*;
@@ -72,13 +72,13 @@
 				SB2PreferenceConstants.SB2_MAEMO_ROOTSTRAP_INSTALL_ACT));
 		params.add(targetName);
 		
-		Properties env = commandAbstractor.getProcessLauncherFactory().getStandardEnvironment();
-		env = ProcessLauncherUtils.defineProxyVariables(env);
+		IEnvironmentModifierBlock envBlock = commandAbstractor.getProcessLauncherFactory().defaultEnvironmentModifierBlock();
+		ProcessLauncherUtils.defineProxyVariables(envBlock);
 		
 		setMonitorAndConsole(
 				monitor,
 				CorePlugin.getDefault().getConsole(true, null, "Installing rootstrap " + targetName));
-		doPerformCommand(params, env, 0);
+		doPerformCommand(params, envBlock, 0);
 		
 		sdk.refresh();
 		

Modified: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/CreateTargetCommand.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/CreateTargetCommand.java	2008-10-07 23:27:03 UTC (rev 840)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/CreateTargetCommand.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -13,10 +13,8 @@
 
 import org.maemo.esbox.core.ESboxException;
 import org.maemo.esbox.core.sdk.ISDK;
+import org.maemo.esbox.internal.maemosdk.core.command.ICommandAbstractor;
 import org.maemo.esbox.maemosdk.core.SB1PreferenceConstants;
-import org.maemo.esbox.maemosdk.core.ScratchboxInvalidParameterException;
-import org.maemo.esbox.maemosdk.core.command.ICommandAbstractor;
-import org.maemo.esbox.maemosdk.core.command.ScratchboxCommand;
 
 import java.util.List;
 

Modified: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/CreateTargetSb2Command.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/CreateTargetSb2Command.java	2008-10-07 23:27:03 UTC (rev 840)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/CreateTargetSb2Command.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -14,10 +14,8 @@
 import org.maemo.esbox.core.process.*;
 import org.maemo.esbox.core.sdk.ISDK;
 import org.maemo.esbox.internal.maemosdk.core.Activator;
+import org.maemo.esbox.internal.maemosdk.core.command.ICommandAbstractor;
 import org.maemo.esbox.maemosdk.core.SB2PreferenceConstants;
-import org.maemo.esbox.maemosdk.core.ScratchboxInvalidParameterException;
-import org.maemo.esbox.maemosdk.core.command.ICommandAbstractor;
-import org.maemo.esbox.maemosdk.core.command.ScratchboxCommand;
 
 import java.util.List;
 

Modified: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/GetCurrentTargetCommand.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/GetCurrentTargetCommand.java	2008-10-07 23:27:03 UTC (rev 840)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/GetCurrentTargetCommand.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -12,10 +12,8 @@
 package org.maemo.esbox.internal.maemosdk.core.command.scratchbox;
 
 import org.maemo.esbox.core.ESboxException;
+import org.maemo.esbox.internal.maemosdk.core.command.ICommandAbstractor;
 import org.maemo.esbox.maemosdk.core.SB1PreferenceConstants;
-import org.maemo.esbox.maemosdk.core.ScratchboxInvalidParameterException;
-import org.maemo.esbox.maemosdk.core.command.ICommandAbstractor;
-import org.maemo.esbox.maemosdk.core.command.ScratchboxCommand;
 import org.maemo.esbox.maemosdk.core.scratchbox.ScratchboxException;
 import org.maemo.esbox.maemosdk.core.sdk.IScratchboxSDK;
 

Modified: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/GetCurrentTargetSb2Command.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/GetCurrentTargetSb2Command.java	2008-10-07 23:27:03 UTC (rev 840)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/GetCurrentTargetSb2Command.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -16,9 +16,7 @@
 import org.eclipse.core.runtime.CoreException;
 import org.eclipse.core.runtime.Path;
 import org.maemo.esbox.core.*;
-import org.maemo.esbox.maemosdk.core.ScratchboxInvalidParameterException;
-import org.maemo.esbox.maemosdk.core.command.ICommandAbstractor;
-import org.maemo.esbox.maemosdk.core.command.ScratchboxCommand;
+import org.maemo.esbox.internal.maemosdk.core.command.ICommandAbstractor;
 import org.maemo.esbox.maemosdk.core.scratchbox.ScratchboxException;
 
 import java.io.*;

Deleted: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/GetGdbQemuCommandPatternCommand.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/GetGdbQemuCommandPatternCommand.java	2008-10-07 23:27:03 UTC (rev 840)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/GetGdbQemuCommandPatternCommand.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -1,138 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Nokia Corporation
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *    Ed Swartz (Nokia) - initial API and implementation
- *******************************************************************************/
-package org.maemo.esbox.internal.maemosdk.core.command.scratchbox;
-
-import org.eclipse.core.runtime.IStatus;
-import org.maemo.esbox.core.*;
-import org.maemo.esbox.core.sdk.ISDKTarget;
-import org.maemo.esbox.internal.maemosdk.core.Activator;
-import org.maemo.esbox.maemosdk.core.*;
-import org.maemo.esbox.maemosdk.core.command.ICommandAbstractor;
-import org.maemo.esbox.maemosdk.core.command.ScratchboxCommand;
-import org.maemo.esbox.maemosdk.core.scratchbox.ScratchboxException;
-import org.maemo.esbox.maemosdk.core.sdk.*;
-import org.osgi.framework.Version;
-
-import java.util.List;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-/**
- * Get the command pattern for launching qemu with the debugger  
- * @author eswartz
- * 
- */
-public class GetGdbQemuCommandPatternCommand extends ScratchboxCommand {
-
-	private ISDKTarget sdkTarget;
-
-	public GetGdbQemuCommandPatternCommand(ISDKTarget sdkTarget, ICommandAbstractor commandAbstractor, int sboxVersion) {
-		super(commandAbstractor, sboxVersion);
-		this.sdkTarget = sdkTarget;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see embedded.core.scratchbox.command.IScratchboxCommand#performCommand(java.lang.Object)
-	 */	
-	public String performCommand(List<String> param)
-			throws ScratchboxException, ESboxException {
-		if (!this.checkParameters(param))
-			throw new ScratchboxInvalidParameterException(
-					"Invalid number of parameters");
-
-		String commandPattern = null;
-
-		String architecture = param.get(0);
-		
-		if (architecture.equals(IScratchboxSDKTarget.ARCHITECTURE_ARMEL))
-		{
-			if (sdkTarget instanceof IScratchbox1SDKTarget) {
-				// scratchbox often misconfigures the softlinks, so explicitly launch the qemu configured for the target
-				String qemu = getConfiguredQemu();
-				if (qemu == null) {
-					// fallback
-					Activator.getErrorLogger().log(IStatus.WARNING, 
-							"Target " + sdkTarget + " does not seem to use qemu, so assuming qemu-arm for debugging", null);
-					qemu = "qemu-arm";
-				}
-
-				// get the version
-				Version version = null;
-				Pattern versionPattern = Pattern.compile("qemu-.*((\\d+)\\.(\\d+)\\.(\\d+))-.*");
-				Matcher matcher = versionPattern.matcher(qemu);
-				if (matcher.matches()) {
-					version = new Version(matcher.group(1));
-				}
-				
-				// For ARM emulator debug, use "qemu-arm" command.
-				commandPattern = sdkTarget.getPreferenceValue(SB1PreferenceConstants.SB1_GDB_REMOTE_QEMU);
-				
-				if (version != null && version.compareTo(new Version(0, 8, 0)) < 0) {
-					// hide ${PORT}, which doesn't exist in 0.7.x
-					commandPattern = commandPattern.replace("${PORT}", "");
-					//Activator.getErrorLogger().log(IStatus.WARNING, 
-					//		"The version of qemu-arm in use (" + version + ") is too old -- debugging may not work.  Check your softlinks in /scratchbox/devkits/cputransp/bin/.", null);
-				}
-				
-				commandPattern = commandPattern.replace("${QEMU}", qemu);
-				
-			} else if (sdkTarget instanceof IScratchbox2SDKTarget) {
-				// we think this always uses a new enough version, so keep ${PORT}
-				commandPattern = sdkTarget.getPreferenceValue(SB2PreferenceConstants.SB2_GDB_REMOTE_QEMU);
-			} else {
-				throw new ScratchboxException("unknown scratchbox version");
-			}
-		}
-		else {
-			// The others, just standard "gdbserver" command.
-			commandPattern = sdkTarget.getPreferenceValue(MaemoPreferenceConstants.SBOX_GDB_REMOTE);
-		}
-		
-		return commandPattern;
-	}
-
-	/**
-	 * Find what qemu is configured for this target.
-	 * @return qemu name, or <code>null</code> if not using qemu
-	 */
-	private String getConfiguredQemu() throws ESboxException {
-		
-		// we use sb-select show <target> to find out if qemu is even used for this target.
-		String showAction = commandAbstractor.getPreferenceValue(
-				SB1PreferenceConstants.SB1_SHOW_ACT);
-		String showInfoCommandString = this
-		.replaceScratchboxConfigCommand(showAction,
-				new String[] { sdkTarget.getName() });
-		
-		Process process = createProcess(showInfoCommandString, null);
-		
-		List<String> lines = getLineInputFromProcessAndWait(process, true, 0);
-		
-		// see if this is the line describing CPU transparency
-		Pattern namePattern = Pattern.compile(".*/(qemu-\\S+).*");
-		for (String line : lines) {
-			Matcher matcher = namePattern.matcher(line);
-			if (matcher.matches()) {
-				return matcher.group(1);
-			}
-		}
-		
-		return null;
-	}
-
-	@Override
-	public int getParametersSize() {
-		return 1;
-	}
-
-}

Deleted: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/GetMaemoRootstrapLocationCommand.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/GetMaemoRootstrapLocationCommand.java	2008-10-07 23:27:03 UTC (rev 840)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/GetMaemoRootstrapLocationCommand.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -1,82 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Nokia Corporation.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *    Ed Swartz (Nokia) - initial API and implementation
- *******************************************************************************/
-
-package org.maemo.esbox.internal.maemosdk.core.command.scratchbox;
-
-import org.eclipse.core.filesystem.IFileStore;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.maemo.esbox.core.ESboxException;
-import org.maemo.esbox.maemosdk.core.SB2PreferenceConstants;
-import org.maemo.esbox.maemosdk.core.ScratchboxInvalidParameterException;
-import org.maemo.esbox.maemosdk.core.command.ICommandAbstractor;
-import org.maemo.esbox.maemosdk.core.scratchbox.ScratchboxException;
-import org.maemo.esbox.maemosdk.core.sdk.IScratchbox2SDKTarget;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * @author eswartz
- *
- */
-public class GetMaemoRootstrapLocationCommand extends MaemoRootstrapSb2Command {
-
-	private IScratchbox2SDKTarget sdkTarget;
-
-	public GetMaemoRootstrapLocationCommand(
-			ICommandAbstractor commandAbstractor, IScratchbox2SDKTarget sdkTarget) {
-		super(commandAbstractor);
-		this.sdkTarget = sdkTarget;
-	}
-
-	@Override
-	public int getParametersSize() {
-		return 0;
-	}
-	
-	@Override
-	protected boolean checkParameters(List<String> param) {
-		return param.size() == 0;
-	}
-	
-	/* (non-Javadoc)
-	 * @see org.maemo.esbox.internal.core.command.ICommand#performCommand(java.util.List)
-	 */
-	public Object performCommand(List<String> params)
-			throws ScratchboxException, ESboxException {
-		if (!this.checkParameters(params))
-			throw new ScratchboxInvalidParameterException(
-					"Invalid number of parameters");
-		
-		List<String> rsCommands = new ArrayList<String>(2);
-		
-		String pathAction = commandAbstractor.getPreferenceValue(
-				SB2PreferenceConstants.SB2_MAEMO_ROOTSTRAP_PATH_ACT);
-
-		rsCommands.add(pathAction);
-		rsCommands.add(sdkTarget.getName());
-		
-		List<String> results = doPerformCommand(rsCommands, null, 0);
-		if (results.size() == 0)
-			throw new ScratchboxException("Could not detect rootstrap location for " + sdkTarget + "\ngot:\n" 
-					+ catenateLines(results));
-		
-		// ignore bogus report of deleted rootstrap
-		IPath root = new Path(results.get(0).trim());
-		IFileStore store = sdkTarget.getMachineFileSystemAccess().getFileStore(root);
-		if (store.fetchInfo().exists())
-			return root;
-		else
-			throw new ScratchboxException("Rootstrap location for " + sdkTarget + " does not exist: " + store);
-	}
-
-}

Modified: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/GetVersionScratchboxCommand.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/GetVersionScratchboxCommand.java	2008-10-07 23:27:03 UTC (rev 840)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/GetVersionScratchboxCommand.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -12,11 +12,9 @@
 package org.maemo.esbox.internal.maemosdk.core.command.scratchbox;
 
 import org.maemo.esbox.core.*;
+import org.maemo.esbox.internal.maemosdk.core.command.ICommandAbstractor;
 import org.maemo.esbox.maemosdk.core.SB1PreferenceConstants;
 import org.maemo.esbox.maemosdk.core.SB2PreferenceConstants;
-import org.maemo.esbox.maemosdk.core.ScratchboxInvalidParameterException;
-import org.maemo.esbox.maemosdk.core.command.ICommandAbstractor;
-import org.maemo.esbox.maemosdk.core.command.ScratchboxCommand;
 import org.maemo.esbox.maemosdk.core.scratchbox.ScratchboxException;
 
 import java.util.List;

Modified: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/KillallCommand.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/KillallCommand.java	2008-10-07 23:27:03 UTC (rev 840)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/KillallCommand.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -12,10 +12,8 @@
 package org.maemo.esbox.internal.maemosdk.core.command.scratchbox;
 
 import org.maemo.esbox.core.ESboxException;
+import org.maemo.esbox.internal.maemosdk.core.command.ICommandAbstractor;
 import org.maemo.esbox.maemosdk.core.SB1PreferenceConstants;
-import org.maemo.esbox.maemosdk.core.ScratchboxInvalidParameterException;
-import org.maemo.esbox.maemosdk.core.command.ICommandAbstractor;
-import org.maemo.esbox.maemosdk.core.command.ScratchboxCommand;
 import org.maemo.esbox.maemosdk.core.scratchbox.ScratchboxException;
 
 import java.util.List;

Modified: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/ListAvailableMaemoRootstrapsSb2Command.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/ListAvailableMaemoRootstrapsSb2Command.java	2008-10-07 23:27:03 UTC (rev 840)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/ListAvailableMaemoRootstrapsSb2Command.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -11,10 +11,10 @@
 package org.maemo.esbox.internal.maemosdk.core.command.scratchbox;
 
 import org.maemo.esbox.core.*;
+import org.maemo.esbox.core.env.IEnvironmentModifierBlock;
 import org.maemo.esbox.core.process.ProcessLauncherUtils;
+import org.maemo.esbox.internal.maemosdk.core.command.ICommandAbstractor;
 import org.maemo.esbox.maemosdk.core.SB2PreferenceConstants;
-import org.maemo.esbox.maemosdk.core.ScratchboxInvalidParameterException;
-import org.maemo.esbox.maemosdk.core.command.ICommandAbstractor;
 import org.maemo.esbox.maemosdk.core.scratchbox.MaemoRootstrap;
 import org.maemo.esbox.maemosdk.core.scratchbox.ScratchboxException;
 
@@ -51,11 +51,11 @@
 				SB2PreferenceConstants.SB2_MAEMO_ROOTSTRAP_AVAILABLE_ACT);
 		
 		// ensure the proxy is established
-		Properties proxyEnv = commandAbstractor.getProcessLauncherFactory().getStandardEnvironment();
-		proxyEnv = ProcessLauncherUtils.defineProxyVariables(proxyEnv);
+		IEnvironmentModifierBlock proxyEnvBlock = commandAbstractor.getProcessLauncherFactory().defaultEnvironmentModifierBlock();
+		ProcessLauncherUtils.defineProxyVariables(proxyEnvBlock);
 		
 		List<String> available = doPerformCommand(
-				Collections.singletonList(availableAction), proxyEnv, LIST_TIMEOUT);
+				Collections.singletonList(availableAction), proxyEnvBlock, LIST_TIMEOUT);
 
 		// this output has a few header lines
 		List<MaemoRootstrap> targetsAvailable = new ArrayList<MaemoRootstrap>();

Modified: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/ListCompilersCommand.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/ListCompilersCommand.java	2008-10-07 23:27:03 UTC (rev 840)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/ListCompilersCommand.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -12,10 +12,8 @@
 package org.maemo.esbox.internal.maemosdk.core.command.scratchbox;
 
 import org.maemo.esbox.core.ESboxException;
+import org.maemo.esbox.internal.maemosdk.core.command.ICommandAbstractor;
 import org.maemo.esbox.maemosdk.core.SB1PreferenceConstants;
-import org.maemo.esbox.maemosdk.core.ScratchboxInvalidParameterException;
-import org.maemo.esbox.maemosdk.core.command.ICommandAbstractor;
-import org.maemo.esbox.maemosdk.core.command.ScratchboxCommand;
 import org.maemo.esbox.maemosdk.core.scratchbox.ScratchboxException;
 
 import java.util.List;

Modified: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/ListCompilersSb2Command.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/ListCompilersSb2Command.java	2008-10-07 23:27:03 UTC (rev 840)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/ListCompilersSb2Command.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -16,9 +16,7 @@
 import org.eclipse.core.runtime.Path;
 import org.maemo.esbox.core.ESboxException;
 import org.maemo.esbox.internal.maemosdk.core.Activator;
-import org.maemo.esbox.maemosdk.core.ScratchboxInvalidParameterException;
-import org.maemo.esbox.maemosdk.core.command.ICommandAbstractor;
-import org.maemo.esbox.maemosdk.core.command.ScratchboxCommand;
+import org.maemo.esbox.internal.maemosdk.core.command.ICommandAbstractor;
 import org.maemo.esbox.maemosdk.core.scratchbox.ScratchboxException;
 
 import java.util.ArrayList;

Modified: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/ListCputranspCommand.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/ListCputranspCommand.java	2008-10-07 23:27:03 UTC (rev 840)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/ListCputranspCommand.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -12,10 +12,8 @@
 package org.maemo.esbox.internal.maemosdk.core.command.scratchbox;
 
 import org.maemo.esbox.core.ESboxException;
+import org.maemo.esbox.internal.maemosdk.core.command.ICommandAbstractor;
 import org.maemo.esbox.maemosdk.core.SB1PreferenceConstants;
-import org.maemo.esbox.maemosdk.core.ScratchboxInvalidParameterException;
-import org.maemo.esbox.maemosdk.core.command.ICommandAbstractor;
-import org.maemo.esbox.maemosdk.core.command.ScratchboxCommand;
 import org.maemo.esbox.maemosdk.core.scratchbox.ScratchboxException;
 
 import java.util.List;

Modified: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/ListCputranspSb2Command.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/ListCputranspSb2Command.java	2008-10-07 23:27:03 UTC (rev 840)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/ListCputranspSb2Command.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -13,9 +13,8 @@
 import org.eclipse.core.filesystem.IFileStore;
 import org.eclipse.core.runtime.Path;
 import org.maemo.esbox.core.ESboxException;
-import org.maemo.esbox.maemosdk.core.ScratchboxInvalidParameterException;
-import org.maemo.esbox.maemosdk.core.command.ICommandAbstractor;
-import org.maemo.esbox.maemosdk.core.command.ScratchboxCommand;
+import org.maemo.esbox.core.process.ProcessLauncherUtils;
+import org.maemo.esbox.internal.maemosdk.core.command.ICommandAbstractor;
 import org.maemo.esbox.maemosdk.core.scratchbox.ScratchboxException;
 
 import java.util.*;
@@ -48,8 +47,8 @@
 		expected.add("sb2-qemu-arm");
 		expected.add("sbrsh");
 		
-		Properties properties = commandAbstractor.getProcessLauncherFactory().getStandardEnvironment();
-		String pathenv = (String) properties.get("PATH");
+		Properties env = ProcessLauncherUtils.getSynthesizedEnvironment(commandAbstractor.getProcessLauncherFactory());
+		String pathenv = env.getProperty("PATH");
 		if (pathenv == null) {
 			pathenv = "/usr/bin:/bin";	// XXX
 		}

Modified: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/ListDevkitsCommand.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/ListDevkitsCommand.java	2008-10-07 23:27:03 UTC (rev 840)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/ListDevkitsCommand.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -12,10 +12,8 @@
 package org.maemo.esbox.internal.maemosdk.core.command.scratchbox;
 
 import org.maemo.esbox.core.ESboxException;
+import org.maemo.esbox.internal.maemosdk.core.command.ICommandAbstractor;
 import org.maemo.esbox.maemosdk.core.SB1PreferenceConstants;
-import org.maemo.esbox.maemosdk.core.ScratchboxInvalidParameterException;
-import org.maemo.esbox.maemosdk.core.command.ICommandAbstractor;
-import org.maemo.esbox.maemosdk.core.command.ScratchboxCommand;
 import org.maemo.esbox.maemosdk.core.scratchbox.ScratchboxException;
 
 import java.util.List;

Modified: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/ListInstalledMaemoRootstrapsSb2Command.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/ListInstalledMaemoRootstrapsSb2Command.java	2008-10-07 23:27:03 UTC (rev 840)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/ListInstalledMaemoRootstrapsSb2Command.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -11,9 +11,8 @@
 package org.maemo.esbox.internal.maemosdk.core.command.scratchbox;
 
 import org.maemo.esbox.core.ESboxException;
+import org.maemo.esbox.internal.maemosdk.core.command.ICommandAbstractor;
 import org.maemo.esbox.maemosdk.core.SB2PreferenceConstants;
-import org.maemo.esbox.maemosdk.core.ScratchboxInvalidParameterException;
-import org.maemo.esbox.maemosdk.core.command.ICommandAbstractor;
 import org.maemo.esbox.maemosdk.core.scratchbox.ScratchboxException;
 
 import java.util.Collections;

Modified: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/ListSessionsCommand.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/ListSessionsCommand.java	2008-10-07 23:27:03 UTC (rev 840)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/ListSessionsCommand.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -12,9 +12,8 @@
 package org.maemo.esbox.internal.maemosdk.core.command.scratchbox;
 
 import org.maemo.esbox.core.ESboxException;
+import org.maemo.esbox.internal.maemosdk.core.command.ICommandAbstractor;
 import org.maemo.esbox.maemosdk.core.SB1PreferenceConstants;
-import org.maemo.esbox.maemosdk.core.command.ICommandAbstractor;
-import org.maemo.esbox.maemosdk.core.command.ScratchboxCommand;
 import org.maemo.esbox.maemosdk.core.scratchbox.ScratchboxException;
 
 import java.util.ArrayList;

Modified: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/ListTargetsCommand.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/ListTargetsCommand.java	2008-10-07 23:27:03 UTC (rev 840)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/ListTargetsCommand.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -12,10 +12,9 @@
 package org.maemo.esbox.internal.maemosdk.core.command.scratchbox;
 
 import org.maemo.esbox.core.*;
+import org.maemo.esbox.internal.maemosdk.core.command.ICommandAbstractor;
 import org.maemo.esbox.maemosdk.core.SB1PreferenceConstants;
 import org.maemo.esbox.maemosdk.core.SB2PreferenceConstants;
-import org.maemo.esbox.maemosdk.core.command.ICommandAbstractor;
-import org.maemo.esbox.maemosdk.core.command.ScratchboxCommand;
 import org.maemo.esbox.maemosdk.core.scratchbox.ScratchboxException;
 
 import java.util.List;

Modified: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/MaemoCommand.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/MaemoCommand.java	2008-10-07 23:27:03 UTC (rev 840)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/MaemoCommand.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -14,13 +14,13 @@
 import org.eclipse.ui.console.MessageConsole;
 import org.maemo.esbox.core.*;
 
+import org.maemo.esbox.core.env.IEnvironmentModifierBlock;
 import org.maemo.esbox.core.process.*;
 import org.maemo.esbox.core.sdk.ISDKTarget;
 import org.maemo.esbox.internal.maemosdk.core.Activator;
+import org.maemo.esbox.internal.maemosdk.core.MaemoEnvironmentUtils;
+import org.maemo.esbox.internal.maemosdk.core.command.ICommandAbstractor;
 import org.maemo.esbox.maemosdk.core.MaemoPreferenceConstants;
-import org.maemo.esbox.maemosdk.core.ScratchboxInvalidParameterException;
-import org.maemo.esbox.maemosdk.core.command.ICommandAbstractor;
-import org.maemo.esbox.maemosdk.core.command.ScratchboxCommand;
 import org.maemo.esbox.maemosdk.core.scratchbox.ScratchboxException;
 
 import java.io.*;
@@ -79,8 +79,12 @@
 		maemoCommand = this.replaceActions(maemoCommand,params.get(0));
 		
 		IProcessLauncherFactory processLauncherFactory = commandAbstractor.getProcessLauncherFactory();
+		
+		IEnvironmentModifierBlock envBlock = processLauncherFactory.defaultEnvironmentModifierBlock();
+		MaemoEnvironmentUtils.defineEmulatorXDisplayVariable(sdkTarget.getSDK().getMachine(), envBlock);
+		
 		IProcessLauncher processLauncher = ProcessLauncherCreator.createProcessLauncher(processLauncherFactory, null,
-				Collections.singletonList(maemoCommand), null);
+				Collections.singletonList(maemoCommand), envBlock);
 		
 		Process process = processLauncher.createProcess();
 		

Modified: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/MaemoRootstrapSb2Command.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/MaemoRootstrapSb2Command.java	2008-10-07 23:27:03 UTC (rev 840)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/MaemoRootstrapSb2Command.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -11,11 +11,11 @@
 package org.maemo.esbox.internal.maemosdk.core.command.scratchbox;
 
 import org.maemo.esbox.core.*;
+import org.maemo.esbox.core.env.IEnvironmentModifierBlock;
 import org.maemo.esbox.core.process.CommandLineArguments;
 import org.maemo.esbox.core.process.ShellTemplateSubstitutor;
+import org.maemo.esbox.internal.maemosdk.core.command.ICommandAbstractor;
 import org.maemo.esbox.maemosdk.core.SB2PreferenceConstants;
-import org.maemo.esbox.maemosdk.core.command.ICommandAbstractor;
-import org.maemo.esbox.maemosdk.core.command.ScratchboxCommand;
 import org.maemo.esbox.maemosdk.core.scratchbox.ScratchboxException;
 
 import java.util.*;
@@ -47,13 +47,13 @@
 	 * Perform the command with the given params as command line arguments,
 	 * with an optional timeout (triggering ScratchboxException if reached)
 	 * @param params command line parameters to maemo-rootstrap
-	 * @param env any environment needed or <code>null</code>
+	 * @param envBlock any environment needed or <code>null</code>
 	 * @param timeout if not 0, timeout in milliseconds
 	 * @return lines from stdout
 	 * @throws ScratchboxException if command execution fails or if timeout reached
 	 */
 	@SuppressWarnings("unchecked")
-	protected List<String> doPerformCommand(List<String> params, Properties env, long timeout)
+	protected List<String> doPerformCommand(List<String> params, IEnvironmentModifierBlock envBlock, long timeout)
 			throws ESboxException {
 		String rootstrapCommand = commandAbstractor.getPreferenceValue(
 					SB2PreferenceConstants.SB2_MAEMO_ROOTSTRAP_COMMAND);
@@ -66,11 +66,11 @@
 		rootstrapCommand = substitutor.substitute(rootstrapCommand);
 		
 		if (console == null) {
-			Process process = createProcess(rootstrapCommand, env);
+			Process process = createProcess(rootstrapCommand, envBlock);
 			List<String> results = getLineInputFromProcessAndWait(process, allowErrors(), timeout);
 			return results;
 		} else {
-			runAndWaitForProcess("Running " + rootstrapCommand, rootstrapCommand, env, timeout);
+			runAndWaitForProcess("Running " + rootstrapCommand, rootstrapCommand, envBlock, timeout);
 			return Collections.EMPTY_LIST;
 		}
 	}

Modified: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/RemoveMaemoRootstrapSb2Command.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/RemoveMaemoRootstrapSb2Command.java	2008-10-07 23:27:03 UTC (rev 840)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/RemoveMaemoRootstrapSb2Command.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -13,10 +13,10 @@
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.maemo.esbox.core.*;
 
+import org.maemo.esbox.core.env.IEnvironmentModifierBlock;
 import org.maemo.esbox.core.process.ProcessLauncherUtils;
+import org.maemo.esbox.internal.maemosdk.core.command.ICommandAbstractor;
 import org.maemo.esbox.maemosdk.core.SB2PreferenceConstants;
-import org.maemo.esbox.maemosdk.core.ScratchboxInvalidParameterException;
-import org.maemo.esbox.maemosdk.core.command.ICommandAbstractor;
 import org.maemo.esbox.maemosdk.core.scratchbox.ScratchboxException;
 
 import java.util.*;
@@ -65,14 +65,14 @@
 		commands.add(action);
 		commands.add(targetName);
 		
-		Properties env = commandAbstractor.getProcessLauncherFactory().getStandardEnvironment();
-		env = ProcessLauncherUtils.defineProxyVariables(env);
+		IEnvironmentModifierBlock envBlock = commandAbstractor.getProcessLauncherFactory().defaultEnvironmentModifierBlock();
+		ProcessLauncherUtils.defineProxyVariables(envBlock);
 		
 		setMonitorAndConsole(
 				monitor,
 				CorePlugin.getDefault().getConsole(true, null, "Removing rootstrap " + targetName));
 
-		doPerformCommand(commands, env, 0);
+		doPerformCommand(commands, envBlock, 0);
 		
 		return Boolean.TRUE;
 	}

Modified: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/RemoveTargetCommand.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/RemoveTargetCommand.java	2008-10-07 23:27:03 UTC (rev 840)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/RemoveTargetCommand.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -13,11 +13,8 @@
 
 import org.maemo.esbox.core.ESboxException;
 import org.maemo.esbox.core.sdk.ISDK;
+import org.maemo.esbox.internal.maemosdk.core.command.ICommandAbstractor;
 import org.maemo.esbox.maemosdk.core.SB1PreferenceConstants;
-import org.maemo.esbox.maemosdk.core.ScratchboxInvalidParameterException;
-import org.maemo.esbox.maemosdk.core.command.ICommandAbstractor;
-import org.maemo.esbox.maemosdk.core.command.ListTargetsCommand;
-import org.maemo.esbox.maemosdk.core.command.ScratchboxCommand;
 import org.maemo.esbox.maemosdk.core.scratchbox.ScratchboxException;
 
 import java.util.ArrayList;

Deleted: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/RemoveTargetSb2Command.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/RemoveTargetSb2Command.java	2008-10-07 23:27:03 UTC (rev 840)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/RemoveTargetSb2Command.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -1,96 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Nokia Corporation
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *    Ed Swartz (Nokia) - initial API and implementation
- *******************************************************************************/
-package org.maemo.esbox.internal.maemosdk.core.command.scratchbox;
-
-import org.eclipse.core.filesystem.EFS;
-import org.eclipse.core.filesystem.IFileStore;
-import org.eclipse.core.runtime.CoreException;
-import org.maemo.esbox.core.ESboxException;
-import org.maemo.esbox.core.sdk.ISDK;
-import org.maemo.esbox.maemosdk.core.command.ICommandAbstractor;
-import org.maemo.esbox.maemosdk.core.command.ScratchboxCommand;
-import org.maemo.esbox.maemosdk.core.scratchbox.ScratchboxException;
-import org.maemo.esbox.maemosdk.core.sdk.IScratchbox2SDK;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * Remove a Scratchbox 2 target.
- * There's no known command for this, but we can manually fix up the system.
- * 
- */
-public class RemoveTargetSb2Command extends ScratchboxCommand {
-
-	private IScratchbox2SDK sdk;
-
-	public RemoveTargetSb2Command(ISDK sdk, ICommandAbstractor commandAbstractor) {
-		super(commandAbstractor, 2);
-		this.sdk = (IScratchbox2SDK) sdk;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see embedded.core.scratchbox.command.IScratchboxCommand#performCommand(java.lang.Object)
-	 */	
-	public Object performCommand(List<String> param) throws ScratchboxException, ESboxException {
-		if (!this.checkParameters(param))
-			throw new ScratchboxInvalidParameterException(
-					"Invalid number of parameters");
-
-		String targetToRemove = param.get(0);
-		if (!targetExist(targetToRemove))
-			throw new ScratchboxInvalidParameterException("Target "
-					+ targetToRemove + " does not exist.");
-
-		IFileStore sb2Dir = commandAbstractor.getFileSystemAccess().getFileStore(
-				sdk.getScratchbox2ConfigDirectory());
-		IFileStore targetDir = sb2Dir.getChild(targetToRemove);
-		
-		if (!targetDir.fetchInfo().exists()) {
-			throw new ScratchboxInvalidParameterException("Target "
-					+ targetToRemove + " does not exist at the expected location: " + targetDir);
-		}
-		
-		try {
-			targetDir.delete(EFS.NONE, null);
-		} catch (CoreException e) {
-			throw new ScratchboxException("Failed to delete rootstrap", e);
-		} finally {
-			sdk.refresh();
-		}
-		
-		return true;
-	}
-
-	/**
-	 * Verify if a target exists.
-	 * @param targetToRemove
-	 *            the target to verify.
-	 * 
-	 * @return true, if the target exists in Scratchbox; false, otherwise.
-	 * @throws ScratchboxException
-	 *             if some problem occurrs while requesting Scratchbox services.
-	 */
-	private boolean targetExist(String targetToRemove)
-			throws ESboxException {
-		List<String> targetsAvailable = new ListTargetsCommand(commandAbstractor, sboxVersion)
-				.performCommand(new ArrayList<String>());
-		return targetsAvailable.contains(targetToRemove);
-	}
-
-	@Override
-	public int getParametersSize() {
-		return 1;
-	}
-
-}

Modified: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/ResetTargetCommand.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/ResetTargetCommand.java	2008-10-07 23:27:03 UTC (rev 840)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/ResetTargetCommand.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -12,10 +12,8 @@
 package org.maemo.esbox.internal.maemosdk.core.command.scratchbox;
 
 import org.maemo.esbox.core.ESboxException;
+import org.maemo.esbox.internal.maemosdk.core.command.ICommandAbstractor;
 import org.maemo.esbox.maemosdk.core.SB1PreferenceConstants;
-import org.maemo.esbox.maemosdk.core.ScratchboxInvalidParameterException;
-import org.maemo.esbox.maemosdk.core.command.ICommandAbstractor;
-import org.maemo.esbox.maemosdk.core.command.ScratchboxCommand;
 import org.maemo.esbox.maemosdk.core.scratchbox.ScratchboxException;
 
 import java.util.List;

Modified: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/RootstrapCommand.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/RootstrapCommand.java	2008-10-07 23:27:03 UTC (rev 840)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/RootstrapCommand.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -12,10 +12,8 @@
 package org.maemo.esbox.internal.maemosdk.core.command.scratchbox;
 
 import org.maemo.esbox.core.ESboxException;
+import org.maemo.esbox.internal.maemosdk.core.command.ICommandAbstractor;
 import org.maemo.esbox.maemosdk.core.SB1PreferenceConstants;
-import org.maemo.esbox.maemosdk.core.ScratchboxInvalidParameterException;
-import org.maemo.esbox.maemosdk.core.command.ICommandAbstractor;
-import org.maemo.esbox.maemosdk.core.command.ScratchboxCommand;
 import org.maemo.esbox.maemosdk.core.scratchbox.ScratchboxException;
 
 import java.util.List;

Modified: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/ScratchboxCommand.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/ScratchboxCommand.java	2008-10-07 23:27:03 UTC (rev 840)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/ScratchboxCommand.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -15,6 +15,7 @@
 import org.eclipse.core.runtime.jobs.Job;
 import org.eclipse.ui.console.MessageConsole;
 import org.maemo.esbox.core.*;
+import org.maemo.esbox.core.env.IEnvironmentModifierBlock;
 import org.maemo.esbox.core.process.*;
 import org.maemo.esbox.internal.maemosdk.core.Activator;
 import org.maemo.esbox.internal.maemosdk.core.command.ICommand;
@@ -226,16 +227,16 @@
 	 * Create a process from the given process launch handler factory and 
 	 * the given command line.
 	 * @param commandLine the command line string
-	 * @param env prperties
+	 * @param envBlock prperties
 	 * @throws ScratchboxException failure to launch process
 	 */
-	public Process createProcess(String commandline, Properties env) throws ESboxException {
+	public Process createProcess(String commandline, IEnvironmentModifierBlock envBlock) throws ESboxException {
 		List<String> cmdLine = CommandLineArguments.createFromCommandLine(commandline);
 		IProcessLauncher processLauncher = ProcessLauncherCreator.createProcessLauncher(
 				commandAbstractor.getProcessLauncherFactory(), 
 				null,
 				cmdLine,
-				env);
+				envBlock);
 		Process process = processLauncher.createProcess();
 		if (console != null) {
 			new PrintStream(console.newMessageStream()).println(commandline);
@@ -259,12 +260,12 @@
 	}
 
 	protected IStatus runAndWaitForProcess(String jobName, final String commandline,
-			Properties env, long timeout) throws ESboxException {
+			IEnvironmentModifierBlock envBlock, long timeout) throws ESboxException {
 		final IProcessLauncher processLauncher = ProcessLauncherCreator.createProcessLauncher(
 				commandAbstractor.getProcessLauncherFactory(), 
 				null,
 				CommandLineArguments.createFromCommandLine(commandline),
-				env);
+				envBlock);
 		processLauncher.usePTY(true);
 		
 		final Process process = processLauncher.createProcess();

Modified: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/SelectTargetCommand.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/SelectTargetCommand.java	2008-10-07 23:27:03 UTC (rev 840)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/SelectTargetCommand.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -12,10 +12,8 @@
 package org.maemo.esbox.internal.maemosdk.core.command.scratchbox;
 
 import org.maemo.esbox.core.ESboxException;
+import org.maemo.esbox.internal.maemosdk.core.command.ICommandAbstractor;
 import org.maemo.esbox.maemosdk.core.SB1PreferenceConstants;
-import org.maemo.esbox.maemosdk.core.ScratchboxInvalidParameterException;
-import org.maemo.esbox.maemosdk.core.command.ICommandAbstractor;
-import org.maemo.esbox.maemosdk.core.command.ScratchboxCommand;
 import org.maemo.esbox.maemosdk.core.scratchbox.ScratchboxException;
 import org.maemo.esbox.maemosdk.core.sdk.IScratchboxSDK;
 

Modified: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/ShowPathMappingSb2Command.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/ShowPathMappingSb2Command.java	2008-10-07 23:27:03 UTC (rev 840)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/ShowPathMappingSb2Command.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -15,9 +15,8 @@
 import org.eclipse.core.runtime.Path;
 import org.maemo.esbox.core.*;
 import org.maemo.esbox.core.process.*;
+import org.maemo.esbox.internal.maemosdk.core.command.ICommandAbstractor;
 import org.maemo.esbox.maemosdk.core.SB2PreferenceConstants;
-import org.maemo.esbox.maemosdk.core.command.ICommandAbstractor;
-import org.maemo.esbox.maemosdk.core.command.ScratchboxCommand;
 import org.maemo.esbox.maemosdk.core.scratchbox.ScratchboxException;
 
 import java.io.ByteArrayOutputStream;

Modified: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/ShowTargetCommand.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/ShowTargetCommand.java	2008-10-07 23:27:03 UTC (rev 840)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/ShowTargetCommand.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -12,10 +12,8 @@
 package org.maemo.esbox.internal.maemosdk.core.command.scratchbox;
 
 import org.maemo.esbox.core.ESboxException;
+import org.maemo.esbox.internal.maemosdk.core.command.ICommandAbstractor;
 import org.maemo.esbox.maemosdk.core.SB1PreferenceConstants;
-import org.maemo.esbox.maemosdk.core.ScratchboxInvalidParameterException;
-import org.maemo.esbox.maemosdk.core.command.ICommandAbstractor;
-import org.maemo.esbox.maemosdk.core.command.ScratchboxCommand;
 import org.maemo.esbox.maemosdk.core.scratchbox.ScratchboxException;
 import org.maemo.esbox.maemosdk.core.scratchbox.ScratchboxTarget;
 

Modified: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/SimpleCommand.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/SimpleCommand.java	2008-10-07 23:27:03 UTC (rev 840)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/SimpleCommand.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -14,9 +14,7 @@
 import org.maemo.esbox.core.*;
 import org.maemo.esbox.core.process.IProcessLauncher;
 import org.maemo.esbox.core.process.ProcessLauncherCreator;
-import org.maemo.esbox.maemosdk.core.ScratchboxInvalidParameterException;
-import org.maemo.esbox.maemosdk.core.command.ICommandAbstractor;
-import org.maemo.esbox.maemosdk.core.command.ScratchboxCommand;
+import org.maemo.esbox.internal.maemosdk.core.command.ICommandAbstractor;
 import org.maemo.esbox.maemosdk.core.scratchbox.ScratchboxException;
 
 import java.util.List;

Modified: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/sbrsh/AddSbrshCommand.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/sbrsh/AddSbrshCommand.java	2008-10-07 23:27:03 UTC (rev 840)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/sbrsh/AddSbrshCommand.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -12,10 +12,10 @@
 package org.maemo.esbox.internal.maemosdk.core.command.scratchbox.sbrsh;
 
 import org.maemo.esbox.core.ESboxException;
+import org.maemo.esbox.internal.maemosdk.core.command.ICommandAbstractor;
+import org.maemo.esbox.internal.maemosdk.core.command.scratchbox.ScratchboxCommand;
+import org.maemo.esbox.internal.maemosdk.core.command.scratchbox.ScratchboxInvalidParameterException;
 import org.maemo.esbox.maemosdk.core.MaemoPreferenceConstants;
-import org.maemo.esbox.maemosdk.core.ScratchboxInvalidParameterException;
-import org.maemo.esbox.maemosdk.core.command.ICommandAbstractor;
-import org.maemo.esbox.maemosdk.core.command.ScratchboxCommand;
 import org.maemo.esbox.maemosdk.core.scratchbox.ScratchboxException;
 
 import java.util.List;

Modified: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/sbrsh/ConfigureSbrshCommand.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/sbrsh/ConfigureSbrshCommand.java	2008-10-07 23:27:03 UTC (rev 840)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/sbrsh/ConfigureSbrshCommand.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -12,10 +12,10 @@
 package org.maemo.esbox.internal.maemosdk.core.command.scratchbox.sbrsh;
 
 import org.maemo.esbox.core.ESboxException;
+import org.maemo.esbox.internal.maemosdk.core.command.ICommandAbstractor;
+import org.maemo.esbox.internal.maemosdk.core.command.scratchbox.ScratchboxCommand;
+import org.maemo.esbox.internal.maemosdk.core.command.scratchbox.ScratchboxInvalidParameterException;
 import org.maemo.esbox.maemosdk.core.MaemoPreferenceConstants;
-import org.maemo.esbox.maemosdk.core.ScratchboxInvalidParameterException;
-import org.maemo.esbox.maemosdk.core.command.ICommandAbstractor;
-import org.maemo.esbox.maemosdk.core.command.ScratchboxCommand;
 import org.maemo.esbox.maemosdk.core.scratchbox.ScratchboxException;
 
 import java.util.List;

Modified: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/sbrsh/MountTargetSbrshCommand.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/sbrsh/MountTargetSbrshCommand.java	2008-10-07 23:27:03 UTC (rev 840)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/sbrsh/MountTargetSbrshCommand.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -12,10 +12,10 @@
 package org.maemo.esbox.internal.maemosdk.core.command.scratchbox.sbrsh;
 
 import org.maemo.esbox.core.ESboxException;
+import org.maemo.esbox.internal.maemosdk.core.command.ICommandAbstractor;
+import org.maemo.esbox.internal.maemosdk.core.command.scratchbox.ScratchboxCommand;
+import org.maemo.esbox.internal.maemosdk.core.command.scratchbox.ScratchboxInvalidParameterException;
 import org.maemo.esbox.maemosdk.core.MaemoPreferenceConstants;
-import org.maemo.esbox.maemosdk.core.ScratchboxInvalidParameterException;
-import org.maemo.esbox.maemosdk.core.command.ICommandAbstractor;
-import org.maemo.esbox.maemosdk.core.command.ScratchboxCommand;
 import org.maemo.esbox.maemosdk.core.scratchbox.ScratchboxException;
 
 import java.util.List;

Modified: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/sbrsh/UnmountTargetSbrshCommand.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/sbrsh/UnmountTargetSbrshCommand.java	2008-10-07 23:27:03 UTC (rev 840)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/sbrsh/UnmountTargetSbrshCommand.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -12,10 +12,10 @@
 package org.maemo.esbox.internal.maemosdk.core.command.scratchbox.sbrsh;
 
 import org.maemo.esbox.core.ESboxException;
+import org.maemo.esbox.internal.maemosdk.core.command.ICommandAbstractor;
+import org.maemo.esbox.internal.maemosdk.core.command.scratchbox.ScratchboxCommand;
+import org.maemo.esbox.internal.maemosdk.core.command.scratchbox.ScratchboxInvalidParameterException;
 import org.maemo.esbox.maemosdk.core.MaemoPreferenceConstants;
-import org.maemo.esbox.maemosdk.core.ScratchboxInvalidParameterException;
-import org.maemo.esbox.maemosdk.core.command.ICommandAbstractor;
-import org.maemo.esbox.maemosdk.core.command.ScratchboxCommand;
 import org.maemo.esbox.maemosdk.core.scratchbox.ScratchboxException;
 
 import java.util.List;

Modified: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/sdk/BaseScratchboxSDKTarget.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/sdk/BaseScratchboxSDKTarget.java	2008-10-07 23:27:03 UTC (rev 840)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/sdk/BaseScratchboxSDKTarget.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -12,7 +12,9 @@
 package org.maemo.esbox.internal.maemosdk.core.sdk;
 
 import org.eclipse.core.runtime.Platform;
-import org.maemo.esbox.core.sdk.*;
+import org.maemo.esbox.core.sdk.ISDK;
+import org.maemo.esbox.core.sdk.ISDKPlatform;
+import org.maemo.esbox.core.sdk.ISDKTarget;
 import org.maemo.esbox.internal.api.core.sdk.BaseSDKTarget;
 import org.maemo.esbox.internal.maemosdk.core.adapters.MaemoRunStandaloneSupportAdapterFactory;
 import org.maemo.esbox.maemosdk.core.sdk.IScratchboxSDKTarget;

Modified: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/sdk/IScratchboxSDKPlatformArchitectureProvider.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/sdk/IScratchboxSDKPlatformArchitectureProvider.java	2008-10-07 23:27:03 UTC (rev 840)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/sdk/IScratchboxSDKPlatformArchitectureProvider.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -10,9 +10,7 @@
  *******************************************************************************/
 package org.maemo.esbox.internal.maemosdk.core.sdk;
 
-import org.eclipse.core.runtime.IPath;
 import org.maemo.esbox.core.sdk.ISDKPlatform;
-import org.maemo.esbox.maemosdk.core.sdk.IScratchboxSDK;
 
 /**
  * Helper interface to identify the platform and architecture

Deleted: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/sdk/Scratchbox1FileSystemMapping.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/sdk/Scratchbox1FileSystemMapping.java	2008-10-07 23:27:03 UTC (rev 840)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/sdk/Scratchbox1FileSystemMapping.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -1,66 +0,0 @@
-/**
- * (c) 2008 Nokia
- */
-package org.maemo.esbox.internal.maemosdk.core.sdk;
-
-import com.nokia.cpp.internal.api.utils.core.Pair;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.maemo.esbox.internal.api.core.machine.FileSystemMapping;
-
-import java.util.List;
-
-/**
- * Represent the mappings from the machine to a Scratchbox 1 target running on the machine.
- * This represents the direct mappings with all softlinks resolved (so, not "/scratchbox/users/user/usr"
- * but "/scratchbox/users/user/targets/CHINOOK_ARMEL/usr") 
- * @author eswartz
- *
- */
-public class Scratchbox1FileSystemMapping extends FileSystemMapping {
-
-	/**
-	 * Construct with default Linux path canonicalizers and add mappings for paths
-	 * known to be mapped.
-	 * @param targetRoot 
-	 * @param target
-	 */
-	public Scratchbox1FileSystemMapping(IPath scratchboxBase, String target, String user) {
-		
-		super(FileSystemMapping.getMachineCanonicalizer(true), FileSystemMapping.getMachineCanonicalizer(true));
-		
-		List<Pair<IPath, IPath>> mappings = getHostToTargetRootMappings();
-		mappings.clear();
-		
-		// directories that are the same for all targets
-		String[] topLevelDirs = {	
-				"dev", "home", "host_usr", "proc", "scratchbox", "sys", "targets"
-		};
-		
-		IPath sharedBase = scratchboxBase;
-		map(mappings, sharedBase, new Path("/"));
-		for (String topLevelDir : topLevelDirs) {
-			map(mappings, sharedBase.append(topLevelDir), new Path(topLevelDir).makeAbsolute());
-		}
-		
-		// directories that depend on the current target
-		String[] topLevelLinks = { 
-				"bin", "boot", "cdrom", "etc", "floppy", "initrd",
-				"lib", "media", "mnt", "opt", "root", "sbin", "srv", "usr", "var"
-		};
-		
-		IPath perTargetBase = scratchboxBase.append("targets").append(target);
-		for (String topLevelDir : topLevelLinks) {
-			map(mappings, perTargetBase.append(topLevelDir), new Path(topLevelDir).makeAbsolute());
-		}
-
-		setHostToTargetRootMappings(mappings);
-	}
-
-	private void map(List<Pair<IPath, IPath>> mappings, IPath from, IPath to) {
-		mappings.add(new Pair<IPath, IPath>(from, to));
-	}
-
-	
-}

Deleted: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/sdk/Scratchbox1ProcessLauncher.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/sdk/Scratchbox1ProcessLauncher.java	2008-10-07 23:27:03 UTC (rev 840)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/sdk/Scratchbox1ProcessLauncher.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -1,185 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Nokia Corporation.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *    Ed Swartz (Nokia) - initial API and implementation
- *******************************************************************************/
-package org.maemo.esbox.internal.maemosdk.core.sdk;
-
-import org.eclipse.core.filesystem.EFS;
-import org.eclipse.core.filesystem.IFileStore;
-import org.eclipse.core.filesystem.provider.FileInfo;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.maemo.esbox.core.*;
-import org.maemo.esbox.core.process.*;
-import org.maemo.esbox.core.sdk.ISDKTarget;
-import org.maemo.esbox.internal.maemosdk.core.Activator;
-import org.maemo.esbox.maemosdk.core.SB1PreferenceConstants;
-import org.maemo.esbox.maemosdk.core.scratchbox.ScratchboxException;
-import org.maemo.esbox.maemosdk.core.scratchbox.ScratchboxTargetSwitcher;
-
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.util.*;
-
-/**
- * For SB 1, we need to use a "run.sh" wrapper script.  The
- * login program does not conserve variables set outside
- * unless "-k" is passed, but we don't want to use that anyway,
- * in order to have a clean SB environment.
- * @author eswartz
- *
- */
-public class Scratchbox1ProcessLauncher extends BaseProcessLauncher implements
-		IProcessLauncher {
-
-	private ISDKTarget sdkTarget;
-	private List<String> originalArguments;
-
-	public Scratchbox1ProcessLauncher(
-			ISDKTarget sdkTarget, 
-			IPath workingDirectory,
-			List<String> cmdLine, Properties environment) {
-		// in SB 1, the working directory, executable, args, and environment
-		// are encoded in a single command to a wrapper script
-		super(encodeArgumentArray(sdkTarget, workingDirectory, 
-						cmdLine,
-						environment), 
-				null,
-				null,
-				sdkTarget);
-		if (sdkTarget == null)
-			throw new IllegalArgumentException();
-		this.sdkTarget = sdkTarget;
-		this.originalArguments = cmdLine;
-	}
-	
-	/* (non-Javadoc)
-	 * @see org.maemo.esbox.internal.core.BaseProcessLauncher#getLaunchInfoPrefix()
-	 */
-	@Override
-	protected String getLaunchInfoPrefix() {
-		return sdkTarget + " ";
-	}
-	
-	/* (non-Javadoc)
-	 * @see org.maemo.esbox.internal.core.BaseProcessLauncher#getLaunchInfoStandardEnvironment()
-	 */
-	@Override
-	protected Map<String, String> getLaunchInfoStandardEnvironment() {
-		return sdkTarget.getSDK().getMachine().getStandardEnvironment();
-	}
-	
-	@Override
-	public String getCommandLineString() {
-		return CommandLineArguments.toCommandLine(originalArguments);
-	}
-	
-	private static List<String> encodeArgumentArray(ISDKTarget sdkTarget, 
-			IPath workingDirectory,  
-			List<String> cmdLine,
-			Properties environment) {
-				
-		// get the location where the launcher script will be copied on the target
-		String runScriptLocation = sdkTarget.getPreferenceValue(SB1PreferenceConstants.RUN_SCRIPT_LOC);
-	
-		// encode working directory inside scratchbox
-		if (workingDirectory == null) {
-			workingDirectory = new Path("/");
-		}
-		
-		// get complete environment to play with
-		Properties fullEnv = new Properties();
-		if (environment != null) {
-			fullEnv.putAll(environment);
-		}
-		
-		// sort environment variables, since no longer done in run.sh
-		List<String> envArgs = EnvironmentProperties.createEnvpList(fullEnv, true);
-		
-		// ensure SOMETHING is exported, or else run.sh fails
-		if (envArgs.isEmpty()) {
-			envArgs.add("_DUMMY="); //$NON-NLS-1$
-		}
-		
-		// Encode the launch command by replacing the arguments
-		// representing template arguments with the actual values.
-		//
-		ShellTemplateSubstitutor substitutor = new ShellTemplateSubstitutor();
-		
-		substitutor.define("RUN_SCRIPT_DIRECTORY", runScriptLocation);
-		substitutor.define("DIRECTORY", workingDirectory.toPortableString());
-		
-		String exportsString = CommandLineArguments.toString(envArgs, ",", false); //$NON-NLS-1$
-
-		substitutor.define("EXPORTS", exportsString); 
-		substitutor.define("COMMAND", cmdLine.get(0));
-		substitutor.define("ARGS", CommandLineArguments.toCommandLine(cmdLine.subList(1, cmdLine.size())));
-
-		// get the Scratchbox invocation pattern
-		String commandPattern = sdkTarget.getPreferenceValue(SB1PreferenceConstants.SB1_LOGIN_COMMAND);
-
-		// replace variables
-		commandPattern = substitutor.substitute(commandPattern);
-		
-		List<String> commandArgs = CommandLineArguments.createFromCommandLine(commandPattern);
-		return commandArgs;
-	}
-
-
-	@Override
-	protected void setupForLaunch() throws ESboxException {
-		// first, be sure we're running under the current target
-		ScratchboxTargetSwitcher.ensureCurrentTarget(sdkTarget);
-
-		IFileStore runScriptLocation = sdkTarget.getMachineFileSystemAccess().getFileStore(new Path(
-				sdkTarget.getPreferenceValue(SB1PreferenceConstants.RUN_SCRIPT_LOC)));
-		IFileStore runScript = runScriptLocation.getChild("run.sh");
-		
-		if (!runScript.fetchInfo().exists()) {
-			try {
-				runScriptLocation.mkdir(EFS.NONE, null);
-				
-				OutputStream os = null;
-				InputStream is = null;
-				try {
-					os = runScript.openOutputStream(EFS.OVERWRITE, null);
-					is = Activator.getPluginRelativeInputStream("./conf/run.sh");
-					byte[] content = new byte[8192];
-					int len;
-					while ((len = is.read(content)) > 0) {
-						os.write(content, 0, len);
-					}
-				} finally {
-					Policy.close(os);
-					Policy.close(is);
-				}
-				
-				FileInfo info = new FileInfo();
-				info.setAttribute(EFS.ATTRIBUTE_EXECUTABLE, true);
-				runScript.putInfo(info, EFS.NONE, null);
-				
-			} catch (Exception e) {
-				throw (ScratchboxException) new ScratchboxException("Cannot copy run script to " + runScript).initCause(e);
-			}
-		}
-	}
-	
-
-	/* (non-Javadoc)
-	 * @see org.maemo.esbox.internal.core.BaseProcessLauncher#doCreateProcess()
-	 */
-	@Override
-	protected Process doCreateProcess() throws Exception {
-		return sdkTarget.getSDK().getMachine().createProcess(
-				getLaunchCurrentWorkingDirectory(), getLaunchCommandArguments(), 
-				getLaunchEnvironment(), isUsePTY());
-	}
-	
-
-}

Deleted: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/sdk/Scratchbox1ProcessLauncherFactory.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/sdk/Scratchbox1ProcessLauncherFactory.java	2008-10-07 23:27:03 UTC (rev 840)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/sdk/Scratchbox1ProcessLauncherFactory.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -1,75 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Nokia Corporation.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *    Ed Swartz (Nokia) - initial API and implementation
- *******************************************************************************/
-package org.maemo.esbox.internal.maemosdk.core.sdk;
-
-import org.eclipse.core.runtime.IPath;
-import org.maemo.esbox.core.process.IProcessLauncher;
-import org.maemo.esbox.core.sdk.ISDKTarget;
-import org.maemo.esbox.internal.api.core.BaseProcessLauncherFactory;
-
-import java.util.*;
-
-/**
- * @author eswartz
- *
- */
-public class Scratchbox1ProcessLauncherFactory extends
-		BaseProcessLauncherFactory {
-
-	protected ISDKTarget sdkTarget;
-	private Properties standardEnv;
-	private final boolean runAsRoot;
-
-	public Scratchbox1ProcessLauncherFactory(ISDKTarget sdkTarget, boolean runAsRoot) {
-		super(false);
-		this.sdkTarget = sdkTarget;
-		this.runAsRoot = runAsRoot;
-	}
-
-	/**
-	 * The standard environment *should* include the host environment if the Esbox
-	 * environment setting is 'Append', but we don't want to pass these to sb1,
-	 * ever.
-	 */
-	protected Properties readStandardEnvironment() {
-		if (standardEnv == null) {
-			standardEnv = new Properties();
-
-			// ensure that DBUS is visible, if available
-			// XXX: do this more cleanly
-			String value = System.getenv("DBUS_SESSION_BUS_ADDRESS");
-			if (value != null) {
-				standardEnv.put("DBUS_SESSION_BUS_ADDRESS", value);
-			}
-			// don't use system environment; sb1 wants its own isolated context
-			mergeOrSetUserVariables(sdkTarget.getSDK().getMachine().getEnvironmentVariablePrefix(),  
-					standardEnv, null);
-		}
-		return standardEnv;
-	}
-	
-	/* (non-Javadoc)
-	 * @see org.maemo.esbox.core.IProcessLauncherFactory#createProcessLaunchHandler(org.eclipse.core.runtime.IPath, org.eclipse.core.runtime.IPath, org.maemo.esbox.core.List<String>, java.util.Properties)
-	 */
-	protected IProcessLauncher doCreateProcessLaunchHandler(
-			IPath workingDirectory, List<String> cmdLine,
-			Properties environment) {
-
-		if (runAsRoot) {
-			cmdLine = new ArrayList<String>(cmdLine);
-			cmdLine.add(0, "fakeroot");
-		}
-		return new Scratchbox1ProcessLauncher(
-				sdkTarget,
-				workingDirectory, cmdLine,
-				environment != null ? environment : readStandardEnvironment()); 
-	}
-}

Deleted: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/sdk/Scratchbox1SDK.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/sdk/Scratchbox1SDK.java	2008-10-07 23:27:03 UTC (rev 840)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/sdk/Scratchbox1SDK.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -1,107 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Nokia Corporation.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *    Ed Swartz (Nokia) - initial API and implementation
- *******************************************************************************/
-package org.maemo.esbox.internal.maemosdk.core.sdk;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.maemo.esbox.core.*;
-import org.maemo.esbox.core.machine.IMachine;
-import org.maemo.esbox.core.sdk.IPreferenceProvider;
-import org.maemo.esbox.core.sdk.ISDKTarget;
-import org.maemo.esbox.internal.maemosdk.core.Activator;
-import org.maemo.esbox.maemosdk.core.SB1PreferenceConstants;
-import org.maemo.esbox.maemosdk.core.scratchbox.ScratchboxFacade;
-import org.maemo.esbox.maemosdk.core.sdk.IScratchbox1SDK;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * SDK for a Scratchbox 1.x environment
- * @author eswartz
- *
- */
-public class Scratchbox1SDK extends ScratchboxSDK implements IScratchbox1SDK {
-
-	private IPath sdkRoot;
-//	private IPreferenceProvider prefProvider;
-	private final IScratchboxSDKPlatformArchitectureProvider platformArchitectureProvider;
-	
-	/**
-	 * @param version
-	 * @param name
-	 */
-	public Scratchbox1SDK(
-			IMachine machine,
-			IScratchboxSDKPlatformArchitectureProvider platformArchitectureProvider,
-			String version, 
-			IPreferenceProvider prefProvider) {
-		super(machine, version, NAME);
-		this.sdkRoot = null;
-		this.platformArchitectureProvider = platformArchitectureProvider;
-		this.prefProvider = prefProvider;
-	}
-
-	public void refresh() {
-		// populate targets
-		super.refresh();
-		try {
-			List<String> targetNames = getPrivateTargets();
-			List<ISDKTarget> newTargets = new ArrayList<ISDKTarget>();
-			for (String target : targetNames) {
-				IPath sb1TargetRoot = getSDKRoot().append("targets").append(target); //$NON-NLS-1$
-				ISDKTarget sdkTarget = new Scratchbox1SDKTarget(
-						this, 
-						platformArchitectureProvider.getPlatform(target),
-						platformArchitectureProvider.getArchitecture(target),
-						target,
-						sb1TargetRoot);
-				newTargets.add(sdkTarget);
-			}
-			this.targets = newTargets;
-		} catch (ESboxException e) {
-			Activator.getErrorLogger().logError("Could not refresh targets", e);
-		}
-	}
-	
-	public synchronized IPath getSDKRoot() {
-		if (sdkRoot == null) {
-			String userPath = prefProvider.getPreferenceValue(SB1PreferenceConstants.SB1_SBOX_SANDBOX);
-			sdkRoot = new Path(userPath);
-
-			/*
-			// ensure this is canonical
-			try {
-				sdkRoot = new Path(sdkRoot.toFile().getCanonicalPath());
-			} catch (IOException e) {
-				Activator.getErrorLogger().logError("Cannot canonicalize scratchbox installation path", e);
-			}
-			*/
-		}
-		return sdkRoot;
-	}
-	
-	
-	
-
-	/**
-	 * Return the list of available targets in Scratchbox.
-	 * 
-	 * @return a list with the available targets in Scratchbox.
-	 * @throws ESboxException
-	 *             if some problem related to Scratchbox communication occurs.
-	 */
-	private List<String> getPrivateTargets() throws ESboxException {
-		return ScratchboxFacade.getInstance().getTargets(this); 
-	}
-	
-	
-}

Deleted: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/sdk/Scratchbox1SDKTarget.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/sdk/Scratchbox1SDKTarget.java	2008-10-07 23:27:03 UTC (rev 840)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/sdk/Scratchbox1SDKTarget.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -1,71 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Nokia Corporation.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *    Ed Swartz (Nokia) - initial API and implementation
- *******************************************************************************/
-package org.maemo.esbox.internal.maemosdk.core.sdk;
-
-import org.eclipse.core.runtime.IPath;
-import org.maemo.esbox.core.CorePreferenceConstants;
-import org.maemo.esbox.core.process.IProcessLauncherFactory;
-import org.maemo.esbox.core.sdk.ISDKPlatform;
-import org.maemo.esbox.maemosdk.core.sdk.IScratchbox1SDKTarget;
-
-/**
- * SDK target for a Scratchbox 1.x environment
- * 
- * @author eswartz
- * 
- */
-public class Scratchbox1SDKTarget extends BaseScratchboxSDKTarget implements IScratchbox1SDKTarget {
-
-	private IPath targetRoot;
-
-	/**
-	 * @param version
-	 * @param name
-	 */
-	public Scratchbox1SDKTarget(Scratchbox1SDK sdk,
-			ISDKPlatform platform,
-			String architecture, String target,
-			IPath targetRoot) {
-		super(sdk, platform, architecture, target);
-		this.targetRoot = targetRoot;
-		init(new Scratchbox1FileSystemMapping(sdk.getSDKRoot(), target,
-						sdk.getPreferenceValue(CorePreferenceConstants.USER))
-		//,new AptPackageManager(this)
-		);
-	}
-
-	public IPath getSDKTargetRoot() {
-		return targetRoot;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.maemo.esbox.core.ISDKTarget#createProcessLauncher()
-	 */
-	public IProcessLauncherFactory getProcessLauncherFactory() {
-		return new Scratchbox1ProcessLauncherFactory(this, false); 
-	}
-
-	/* (non-Javadoc)
-	 * @see org.maemo.esbox.core.scratchbox.sdk.IScratchboxSDKTarget#getProcessLauncherFactoryForInstall()
-	 */
-	public IProcessLauncherFactory getProcessLauncherFactoryForInstall() {
-		return new Scratchbox1ProcessLauncherFactory(this, true); 
-	}
-	
-
-	public IPath getRootstrapPath() {
-		// Rootstrap path is just the TargetRoot like this:
-		//     /scratchbox/users/maemo/targets/CHINOOK_ARMEL
-		return  getSDKTargetRoot();
-	}
-}

Deleted: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/sdk/Scratchbox2FileSystemMapping.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/sdk/Scratchbox2FileSystemMapping.java	2008-10-07 23:27:03 UTC (rev 840)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/sdk/Scratchbox2FileSystemMapping.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -1,77 +0,0 @@
-/**
- * (c) 2008 Nokia
- */
-package org.maemo.esbox.internal.maemosdk.core.sdk;
-
-import com.nokia.cpp.internal.api.utils.core.Pair;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.maemo.esbox.core.ESboxException;
-import org.maemo.esbox.internal.api.core.machine.FileSystemMapping;
-import org.maemo.esbox.internal.api.core.machine.IFileSystemMappingImpl;
-import org.maemo.esbox.internal.maemosdk.core.Activator;
-import org.maemo.esbox.maemosdk.core.scratchbox.ScratchboxFacade;
-import org.maemo.esbox.maemosdk.core.sdk.IScratchbox2SDKTarget;
-
-import java.util.*;
-
-/**
- * Represent the mappings from the machine to a Scratchbox 2 target running on the machine.
- * This represents the direct mappings with all softlinks resolved.
- * @author eswartz
- *
- */
-public class Scratchbox2FileSystemMapping extends FileSystemMapping implements
-		IFileSystemMappingImpl {
-	/**
-	 * Construct with default path canonicalizers and add mappings for paths
-	 * known to be mapped.
-	 * @param targetRoot 
-	 * @param target
-	 */
-	public Scratchbox2FileSystemMapping(IScratchbox2SDKTarget sdkTarget, IPath scratchboxBase, String target, String user) {
-		
-		super(FileSystemMapping.getMachineCanonicalizer(true), FileSystemMapping.getMachineCanonicalizer(true));
-		
-		List<Pair<IPath, IPath>> mappings = getHostToTargetRootMappings();
-		mappings.clear();
-		
-		// directories we're interested in
-		String[] topLevelDirs = {	
-				"/dev", "/home", "/proc",  "/sys", "/targets",
-				"/bin", "/boot", "/cdrom", "/etc", "/floppy", "/initrd",
-				"/lib", "/media", "/mnt", "/opt", "/root", "/sbin", "/srv", "/usr", "/var",
-				
-				// things get messier, so be more specific
-				"/var/cache/apt", "/usr/include", "/usr/lib", "/usr/local/include", "/usr/local/lib",
-				"/usr/X11R6", "/usr/local", "/home/user",
-		};
-		
-		List<IPath> topLevelPaths = new ArrayList<IPath>();
-		topLevelPaths.add(new Path("/"));
-		for (String topLevelDir : topLevelDirs) {
-			topLevelPaths.add(new Path(topLevelDir));
-		}
-		
-		Map<IPath, IPath> pathMapping = null;
-		try {
-			pathMapping = ScratchboxFacade.getInstance().getSb2PathMapping(
-					sdkTarget, topLevelPaths);
-		} catch (ESboxException e) {
-			Activator.getErrorLogger().logError("Unable to map Scratchbox 2 paths", e);
-			return;
-		}
-		
-		for (Map.Entry<IPath, IPath> entry : pathMapping.entrySet()) {
-			map(mappings, entry.getValue(), entry.getKey());
-		}
-		
-		setHostToTargetRootMappings(mappings);
-	}
-
-	private void map(List<Pair<IPath, IPath>> mappings, IPath from, IPath to) {
-		mappings.add(new Pair<IPath, IPath>(from, to));
-	}
-
-}

Deleted: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/sdk/Scratchbox2ProcessLauncher.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/sdk/Scratchbox2ProcessLauncher.java	2008-10-07 23:27:03 UTC (rev 840)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/sdk/Scratchbox2ProcessLauncher.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -1,112 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Nokia Corporation.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *    Ed Swartz (Nokia) - initial API and implementation
- *******************************************************************************/
-package org.maemo.esbox.internal.maemosdk.core.sdk;
-
-import org.eclipse.core.runtime.IPath;
-import org.maemo.esbox.core.process.*;
-import org.maemo.esbox.core.sdk.ISDKTarget;
-import org.maemo.esbox.maemosdk.core.SB2PreferenceConstants;
-import org.maemo.esbox.maemosdk.core.scratchbox.ScratchboxException;
-
-import java.util.*;
-
-/**
- * For SB 2, launching is easy and follows the same pattern as a normal
- * program invocation.  
- * @author eswartz
- *
- */
-public class Scratchbox2ProcessLauncher extends BaseProcessLauncher implements
-		IProcessLauncher {
-
-	private ISDKTarget sdkTarget;
-
-	public Scratchbox2ProcessLauncher(
-			ISDKTarget sdkTarget, 
-			IPath workingDirectory,
-			List<String> cmdLine, 
-			Properties environment,
-			String modeKey, boolean runAsRoot) {
-		super(encodeArgumentArray(sdkTarget, cmdLine, modeKey), environment, workingDirectory,
-				sdkTarget);
-		if (runAsRoot) {
-			getLaunchCommandArguments().add(0, "sudo");
-		}
-		if (sdkTarget == null)
-			throw new IllegalArgumentException();
-		this.sdkTarget = sdkTarget;
-	}
-	
-	/* (non-Javadoc)
-	 * @see org.maemo.esbox.internal.core.BaseProcessLauncher#getLaunchInfoPrefix()
-	 */
-	@Override
-	protected String getLaunchInfoPrefix() {
-		return sdkTarget + " ";
-	}
-	
-	/* (non-Javadoc)
-	 * @see org.maemo.esbox.internal.core.BaseProcessLauncher#getLaunchInfoStandardEnvironment()
-	 */
-	@Override
-	protected Map<String, String> getLaunchInfoStandardEnvironment() {
-		return sdkTarget.getSDK().getMachine().getStandardEnvironment();
-	}
-	
-	private static List<String> encodeArgumentArray(
-			ISDKTarget sdkTarget,
-			List<String> cmdLine,
-			String modeKey) {
-				
-		// Encode the launch command by replacing the arguments
-		// representing template arguments with the actual values.
-		//
-		ShellTemplateSubstitutor substitutor = new ShellTemplateSubstitutor();
-		
-		substitutor.define("TARGET", sdkTarget.getName());
-		substitutor.define("COMMAND", cmdLine.get(0));
-		substitutor.define("ARGS", CommandLineArguments.toCommandLine(cmdLine.subList(1, cmdLine.size())));
-
-		String level = sdkTarget.getPreferenceValue(SB2PreferenceConstants.SB2_LOG_LEVEL);
-		if (level.length() > 0) {
-			substitutor.define("LOG_OPTION", "-L " + level);
-		} else {
-			substitutor.define("LOG_OPTION", "");
-		}
-
-		String mapMode = sdkTarget.getPreferenceValue(modeKey);
-		substitutor.define("MAPPING_MODE", mapMode);
-
-		// get the Scratchbox invocation pattern
-		String commandPattern = sdkTarget.getPreferenceValue(SB2PreferenceConstants.SB2_EXEC_COMMAND);
-
-		// replace variables
-		commandPattern = substitutor.substitute(commandPattern);
-		
-		List<String> commandArgs = CommandLineArguments.createFromCommandLine(commandPattern);
-		return commandArgs;
-	}
-
-	@Override
-	protected void setupForLaunch() throws ScratchboxException {
-		// nothing
-	}
-
-	/* (non-Javadoc)
-	 * @see org.maemo.esbox.internal.core.BaseProcessLauncher#doCreateProcess()
-	 */
-	@Override
-	protected Process doCreateProcess() throws Exception {
-		return sdkTarget.getSDK().getMachine().createProcess(
-				getLaunchCurrentWorkingDirectory(), getLaunchCommandArguments(),
-				getLaunchEnvironment(), isUsePTY());
-	}
-}

Deleted: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/sdk/Scratchbox2ProcessLauncherFactory.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/sdk/Scratchbox2ProcessLauncherFactory.java	2008-10-07 23:27:03 UTC (rev 840)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/sdk/Scratchbox2ProcessLauncherFactory.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -1,105 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Nokia Corporation.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *    Ed Swartz (Nokia) - initial API and implementation
- *******************************************************************************/
-package org.maemo.esbox.internal.maemosdk.core.sdk;
-
-import org.eclipse.core.runtime.IPath;
-import org.maemo.esbox.core.*;
-import org.maemo.esbox.core.process.EnvironmentProperties;
-import org.maemo.esbox.core.process.IProcessLauncher;
-import org.maemo.esbox.core.sdk.ISDKTarget;
-import org.maemo.esbox.internal.api.core.BaseProcessLauncherFactory;
-
-import java.util.*;
-
-/**
- * @author eswartz
- *
- */
-public class Scratchbox2ProcessLauncherFactory extends
-		BaseProcessLauncherFactory {
-
-	protected ISDKTarget sdkTarget;
-	private Properties standardEnv;
-	private String mappingModeKey;
-	private final boolean runAsRoot;
-	
-	/**
-	 * Create a factory and specify whether it is creating commands in build
-	 * mode (sb2 -m maemo) or installation mode (sb2 -e)
-	 * @param sdkTarget
-	 * @param isBuildMode true: build mode, false: installation mode
-	 */
-	public Scratchbox2ProcessLauncherFactory(ISDKTarget sdkTarget, String mappingModeKey, boolean runAsRoot) {
-		super(false);
-		if (sdkTarget == null)
-			throw new IllegalArgumentException();
-		this.sdkTarget = sdkTarget;
-		this.mappingModeKey = mappingModeKey; 
-		this.runAsRoot = runAsRoot;
-	}
-
-	protected Properties readStandardEnvironment() {
-		if (standardEnv == null) {
-			standardEnv = new Properties();
-			
-			Map<String, String> env = sdkTarget.getSDK().getMachine().getStandardEnvironment();
-			mergeOrSetUserVariables(sdkTarget.getSDK().getMachine().getEnvironmentVariablePrefix(), 
-					standardEnv, env);
-		}
-		return standardEnv;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.maemo.esbox.core.IProcessLauncherFactory#createProcessLaunchHandler(org.eclipse.core.runtime.IPath, org.eclipse.core.runtime.IPath, org.maemo.esbox.core.List<String>, java.util.Properties)
-	 */
-	protected IProcessLauncher doCreateProcessLaunchHandler(
-			IPath workingDirectory, List<String> cmdLine,
-			Properties environment) {
-
-		return new Scratchbox2ProcessLauncher(
-				sdkTarget,
-				workingDirectory, cmdLine,
-				augmentEnvironment(environment),
-				mappingModeKey,
-				runAsRoot); 
-	}
-
-	/**
-	 * sbox2 depends on some variables always existing, so avoid attempts
-	 * to run without them.
-	 * @param environment
-	 * @return possibly modified environment
-	 */
-	private Properties augmentEnvironment(Properties environment) {
-		// if no env, then default is used anyway
-		if (environment == null)
-			return null; //readStandardEnvironment();
-		
-		if (environment.containsKey("HOME") && environment.containsKey("SBOX_DIR"))
-			return environment;
-		
-		Properties augmented = EnvironmentProperties.copyProperties(environment);
-		
-		// avoid spurious nil dereferences
-		Object homeDir = getStandardEnvironment().get("HOME");
-		if (homeDir != null)
-			augmented.put("HOME", homeDir);
-		else
-			augmented.put("HOME", "/home/" + sdkTarget.getPreferenceValue(CorePreferenceConstants.USER));
-		Object sboxDir = getStandardEnvironment().get("SBOX_DIR");
-		if (sboxDir != null)
-			augmented.put("SBOX_DIR", sboxDir.toString());
-		else
-			augmented.put("SBOX_DIR", "");
-
-		return augmented;
-	}
-}

Deleted: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/sdk/Scratchbox2SDK.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/sdk/Scratchbox2SDK.java	2008-10-07 23:27:03 UTC (rev 840)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/sdk/Scratchbox2SDK.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -1,109 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Nokia Corporation.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *    Ed Swartz (Nokia) - initial API and implementation
- *******************************************************************************/
-package org.maemo.esbox.internal.maemosdk.core.sdk;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.maemo.esbox.core.*;
-import org.maemo.esbox.core.machine.IMachine;
-import org.maemo.esbox.core.sdk.IPreferenceProvider;
-import org.maemo.esbox.core.sdk.ISDKTarget;
-import org.maemo.esbox.internal.maemosdk.core.Activator;
-import org.maemo.esbox.maemosdk.core.scratchbox.ScratchboxException;
-import org.maemo.esbox.maemosdk.core.scratchbox.ScratchboxFacade;
-import org.maemo.esbox.maemosdk.core.sdk.IScratchbox2SDK;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * SDK target for a Scratchbox 2 environment
- * @author eswartz
- *
- */
-public class Scratchbox2SDK extends ScratchboxSDK implements IScratchbox2SDK {
-
-	private static final IPath ROOT_PATH = new Path("/");
-	private final IScratchboxSDKPlatformArchitectureProvider platformArchitectureProvider;
-	
-	/**
-	 * @param version
-	 * @param name
-	 */
-	public Scratchbox2SDK(
-			IMachine machine,
-			IScratchboxSDKPlatformArchitectureProvider platformArchitectureProvider,
-			String version, IPreferenceProvider prefProvider) {
-		super(machine, version, NAME);
-		this.platformArchitectureProvider = platformArchitectureProvider;
-		this.prefProvider = prefProvider;
-	}
-
-	public void refresh() {
-		// populate targets
-		super.refresh();
-		
-		List<String> targetNames;
-		try {
-			targetNames = getTargets();
-		} catch (ESboxException e) {
-			Activator.getErrorLogger().logError("Could not refresh targets", e);
-			return;
-		}
-		List<ISDKTarget> newTargets = new ArrayList<ISDKTarget>();
-		for (String target : targetNames) {
-			// ignore this one, left behind by errant rootstrap installations
-			if (target.equals("libtool_build"))
-				continue;
-			IPath config = getScratchbox2ConfigDirectory();
-			IPath sb2BasePath = config.append(target);
-			Scratchbox2SDKTarget sdkTarget = new Scratchbox2SDKTarget(this,
-					platformArchitectureProvider.getPlatform(target),
-					platformArchitectureProvider.getArchitecture(target),
-					target,
-					sb2BasePath);
-			newTargets.add(sdkTarget);
-			
-			try {
-				IPath sb2RootstrapPath = ScratchboxFacade.getInstance().getMaemoRootstrapPath(sdkTarget);
-				sdkTarget.setRootstrapPath(sb2RootstrapPath);
-			} catch (ESboxException e) {
-				Activator.getErrorLogger().logError(null, e);
-			}
-
-		}
-		this.targets = newTargets;
-	}
-	
-	public IPath getSDKRoot() {
-		return ROOT_PATH;
-	}
-	
-
-	/**
-	 * Return the list of available targets in Scratchbox.
-	 * 
-	 * @return a list with the available targets in Scratchbox.
-	 * @throws ScratchboxException
-	 *             if some problem related to Scratchbox communication occurs.
-	 */
-	private List<String> getPrivateTargets() throws ESboxException {
-		return ScratchboxFacade.getInstance().getTargets(this); 
-	}
-	
-	public IPath getScratchbox2ConfigDirectory() {
-		String userName = prefProvider.getPreferenceValue(CorePreferenceConstants.USER);
-		if (userName.length() == 0) 
-			userName = "ubuntu";
-		return new Path("home").append(userName).append(".scratchbox2").makeAbsolute();
-	}
-	
-}

Deleted: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/sdk/Scratchbox2SDKTarget.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/sdk/Scratchbox2SDKTarget.java	2008-10-07 23:27:03 UTC (rev 840)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/sdk/Scratchbox2SDKTarget.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -1,78 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Nokia Corporation.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *    Ed Swartz (Nokia) - initial API and implementation
- *******************************************************************************/
-package org.maemo.esbox.internal.maemosdk.core.sdk;
-
-import org.eclipse.core.runtime.IPath;
-import org.maemo.esbox.core.*;
-import org.maemo.esbox.core.process.IProcessLauncherFactory;
-import org.maemo.esbox.core.sdk.ISDKPlatform;
-import org.maemo.esbox.maemosdk.core.SB2PreferenceConstants;
-import org.maemo.esbox.maemosdk.core.sdk.IScratchbox2SDKTarget;
-
-/**
- * SDK target for a Scratchbox 2 environment
- * 
- * @author eswartz
- * 
- */
-public class Scratchbox2SDKTarget extends BaseScratchboxSDKTarget implements IScratchbox2SDKTarget {
-	private IPath targetRoot;
-	private IPath rootstrapRoot;
-
-	/**
-	 * @param version
-	 * @param name
-	 */
-	public Scratchbox2SDKTarget(Scratchbox2SDK scratchbox2SDK,
-			ISDKPlatform platform,
-			String architecture, String target,
-			IPath targetRoot) {
-		super(scratchbox2SDK, platform, architecture, target);
-		if (targetRoot == null)
-			throw new IllegalArgumentException();
-		this.targetRoot = targetRoot;
-		init(new Scratchbox2FileSystemMapping(this, targetRoot, target,
-						scratchbox2SDK.getPreferenceValue(CorePreferenceConstants.USER))
-		//,new AptPackageManager(this)
-		);
-	}
-
-	/* (non-Javadoc)
-	 * @see org.maemo.esbox.core.sdk.ISDKTarget#getSDKTargetRoot()
-	 */
-	public IPath getSDKTargetRoot() {
-		return targetRoot;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.maemo.esbox.core.ISDKTarget#createProcessLauncher()
-	 */
-	public IProcessLauncherFactory getProcessLauncherFactory() {
-		// default is build mode
-		return new Scratchbox2ProcessLauncherFactory(this, SB2PreferenceConstants.SB2_MAPPING_MODE, false); 
-	}
-
-	public IProcessLauncherFactory getProcessLauncherFactoryForInstall() {
-		// install mode needs to be a different mapping and also run as root
-		return new Scratchbox2ProcessLauncherFactory(this, SB2PreferenceConstants.SB2_INSTALL_MAPPING_MODE, true); 
-	}
-
-	public IPath getRootstrapPath() {
-		return rootstrapRoot;
-	}
-
-	/** Not API!  The targets should be refreshed from ISDK#refresh() */
-	void setRootstrapPath(IPath rootstrapPath) {
-		this.rootstrapRoot = rootstrapPath;
-	}
-}	

Modified: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/sdk/ScratchboxSDK.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/sdk/ScratchboxSDK.java	2008-10-07 23:27:03 UTC (rev 840)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/sdk/ScratchboxSDK.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -12,14 +12,13 @@
 
 import java.util.List;
 
-import org.eclipse.core.runtime.Assert;
 import org.eclipse.core.runtime.IPath;
 import org.maemo.esbox.core.ESboxException;
 import org.maemo.esbox.core.machine.ILocalMachine;
 import org.maemo.esbox.core.machine.IMachine;
 import org.maemo.esbox.core.sdk.IPreferenceProvider;
 import org.maemo.esbox.internal.api.core.sdk.BaseSDK;
-import org.maemo.esbox.maemosdk.core.command.ICommandAbstractor;
+import org.maemo.esbox.internal.maemosdk.core.command.ICommandAbstractor;
 import org.maemo.esbox.maemosdk.core.sdk.IScratchboxSDK;
 import org.maemo.esbox.maemosdk.core.sdk.IScratchboxSDKTarget;
 

Modified: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/MaemoPreferenceConstants.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/MaemoPreferenceConstants.java	2008-10-07 23:27:03 UTC (rev 840)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/MaemoPreferenceConstants.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -48,9 +48,13 @@
 	public static final String START_GDB_SERVER = "START_GDB_SERVER";
 	public static final String USE_X_HOST = "USE_X_HOST";
 	public static final String X_HOST_CMD = "X_HOST_CMD";
+	public static final String X_DISPLAY = "X_DISPLAY";
+	public static final String X_PATH = "X_PATH";
 
 	/* OS-specific defaults */
 	static final String DISPLAY_X_COMMAND_WIN32 = "DISPLAY_X_COMMAND_WIN32";
 	static final String DISPLAY_X_COMMAND_UNIX = "DISPLAY_X_COMMAND_UNIX";
+	static final String X_PATH_WIN32 = "X_PATH_WIN32";
+	static final String X_PATH_UNIX = "X_PATH_UNIX";
 
 }

Modified: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/MaemoPreferenceMigrator.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/MaemoPreferenceMigrator.java	2008-10-07 23:27:03 UTC (rev 840)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/MaemoPreferenceMigrator.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -40,7 +40,14 @@
 			hostEnvKey = MaemoPreferenceConstants.DISPLAY_X_COMMAND_UNIX;
 		newPropertyDefaults.put(MaemoPreferenceConstants.DISPLAY_X_COMMAND, 
 				newPropertyDefaults.getProperty(hostEnvKey));
-		newPropertyDefaults.remove(hostEnvKey);
+		
+		if (HostUtils.isWindows())
+			hostEnvKey = MaemoPreferenceConstants.X_PATH_WIN32;
+		else
+			hostEnvKey = MaemoPreferenceConstants.X_PATH_UNIX;
+		newPropertyDefaults.put(MaemoPreferenceConstants.X_PATH, 
+				newPropertyDefaults.getProperty(hostEnvKey));
+		
 	}
 	
 }

Modified: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/OldStyleProjectProperties.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/OldStyleProjectProperties.java	2008-10-07 23:27:03 UTC (rev 840)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/OldStyleProjectProperties.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -12,7 +12,6 @@
 package org.maemo.esbox.maemosdk.core;
 
 import java.text.MessageFormat;
-import java.util.Collection;
 import java.util.List;
 
 import org.eclipse.core.resources.IProject;
@@ -25,8 +24,6 @@
 import org.maemo.esbox.core.sdk.ISDK;
 import org.maemo.esbox.core.sdk.ISDKTarget;
 import org.maemo.esbox.internal.maemosdk.core.Activator;
-import org.maemo.esbox.maemosdk.core.sdk.IScratchbox1SDK;
-import org.maemo.esbox.maemosdk.core.sdk.IScratchbox2SDK;
 import org.maemo.esbox.maemosdk.core.sdk.IScratchboxSDK;
 import org.maemo.esbox.maemosdk.core.sdk.ScratchboxSDKFacade;
 import org.maemo.esbox.project.core.IProjectProperties;
@@ -139,7 +136,7 @@
 		
 		List<IScratchboxSDK> sboxSDKs = ScratchboxSDKFacade.getInstance().getAllScratchboxSDKs();
 		for(IScratchboxSDK sboxSDK : sboxSDKs){
-			if(version.equals(sboxSDK.getMainVersion())){
+			if(version.equals(Integer.toString(sboxSDK.getSboxVersion()))){
 				sdk=sboxSDK;
 				break;
 			}

Modified: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/OldStyleWorkspaceProjectPropertiesProvider.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/OldStyleWorkspaceProjectPropertiesProvider.java	2008-10-07 23:27:03 UTC (rev 840)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/OldStyleWorkspaceProjectPropertiesProvider.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -15,7 +15,8 @@
 import org.eclipse.core.resources.IProjectNature;
 import org.eclipse.core.runtime.CoreException;
 import org.maemo.esbox.internal.maemosdk.core.Activator;
-import org.maemo.esbox.project.core.*;
+import org.maemo.esbox.project.core.IOldStyleProjectPropertiesProvider;
+import org.maemo.esbox.project.core.IProjectProperties;
 
 /**
  * Implementation of oldStyleProjectPropertiesProvider to allow converting

Modified: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/ScratchboxPackageManagerProvider.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/ScratchboxPackageManagerProvider.java	2008-10-07 23:27:03 UTC (rev 840)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/ScratchboxPackageManagerProvider.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -13,7 +13,8 @@
 
 import org.maemo.esbox.core.process.IProcessLauncherFactory;
 import org.maemo.esbox.core.sdk.ISDKTarget;
-import org.maemo.esbox.linux.packages.core.*;
+import org.maemo.esbox.linux.packages.core.IPackageManager;
+import org.maemo.esbox.linux.packages.core.IPackageManagerProvider;
 import org.maemo.esbox.linux.packages.core.aptpkgconfig.AptPackageManager;
 import org.maemo.esbox.maemosdk.core.sdk.IScratchboxSDKTarget;
 

Modified: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/ScratchboxPropertyTester.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/ScratchboxPropertyTester.java	2008-10-07 23:27:03 UTC (rev 840)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/ScratchboxPropertyTester.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -5,9 +5,8 @@
 import org.eclipse.core.resources.IProject;
 import org.eclipse.core.resources.IResource;
 import org.eclipse.core.runtime.IAdaptable;
-import org.maemo.esbox.core.*;
+import org.maemo.esbox.core.ESboxException;
 import org.maemo.esbox.core.sdk.ISDKTarget;
-import org.maemo.esbox.maemosdk.core.sdk.IScratchbox2SDKTarget;
 import org.maemo.esbox.maemosdk.core.sdk.IScratchboxSDKTarget;
 import org.maemo.esbox.project.core.ProjectManager;
 
@@ -61,13 +60,13 @@
 			//
 			ISDKTarget sdkTarget = getSDKTarget(project);
 			if (sdkTarget != null) {
-				boolean isSbox2 = sdkTarget instanceof IScratchbox2SDKTarget;
+//				boolean isSbox2 = sdkTarget instanceof IScratchbox2SDKTarget;
 				boolean isX86 = sdkTarget.getArchitecture().equals(IScratchboxSDKTarget.ARCHITECTURE_X86);
 				boolean isARM = sdkTarget.getArchitecture().equals(IScratchboxSDKTarget.ARCHITECTURE_ARMEL);
 				
 				if (property.equals("isEmulatorTarget")) {
 					// sb2 doesn't YET ship an x86 emulator
-					return !isSbox2 || isARM;
+					return /*!isSbox2 ||*/ isARM;
 				}
 				
 				if (property.equals("isRemoteTarget")) {

Modified: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/execEnv/MaemoExecutionEnvironment.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/execEnv/MaemoExecutionEnvironment.java	2008-10-07 23:27:03 UTC (rev 840)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/execEnv/MaemoExecutionEnvironment.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -15,7 +15,7 @@
 import org.eclipse.core.runtime.CoreException;
 import org.eclipse.jface.dialogs.MessageDialog;
 import org.eclipse.swt.widgets.Shell;
-import org.maemo.esbox.core.*;
+import org.maemo.esbox.core.ESboxException;
 import org.maemo.esbox.core.sdk.ISDKTarget;
 import org.maemo.esbox.internal.maemosdk.core.Activator;
 import org.maemo.esbox.maemosdk.core.scratchbox.ESboxScriptLauncher;

Modified: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/execEnv/X11ExecutionEnvironment.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/execEnv/X11ExecutionEnvironment.java	2008-10-07 23:27:03 UTC (rev 840)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/execEnv/X11ExecutionEnvironment.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -15,7 +15,7 @@
 import org.eclipse.core.runtime.CoreException;
 import org.eclipse.jface.dialogs.MessageDialog;
 import org.eclipse.swt.widgets.Shell;
-import org.maemo.esbox.core.*;
+import org.maemo.esbox.core.ESboxException;
 import org.maemo.esbox.core.sdk.ISDKTarget;
 import org.maemo.esbox.internal.maemosdk.core.Activator;
 import org.maemo.esbox.maemosdk.core.scratchbox.ESboxScriptLauncher;

Modified: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/scratchbox/ESboxScriptLauncher.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/scratchbox/ESboxScriptLauncher.java	2008-10-07 23:27:03 UTC (rev 840)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/scratchbox/ESboxScriptLauncher.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -12,20 +12,44 @@
 
 package org.maemo.esbox.maemosdk.core.scratchbox;
 
-import org.eclipse.core.resources.*;
-import org.eclipse.core.runtime.*;
+import java.io.File;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.util.List;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IWorkspaceRunnable;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.resources.WorkspaceJob;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.OperationCanceledException;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.SubProgressMonitor;
 import org.eclipse.ui.console.MessageConsole;
-import org.maemo.esbox.core.*;
-import org.maemo.esbox.core.machine.*;
-
-import org.maemo.esbox.core.process.*;
-import org.maemo.esbox.core.sdk.*;
+import org.maemo.esbox.core.CorePlugin;
+import org.maemo.esbox.core.CorePreferenceManager;
+import org.maemo.esbox.core.ESboxException;
+import org.maemo.esbox.core.Policy;
+import org.maemo.esbox.core.machine.IMachine;
+import org.maemo.esbox.core.machine.IProcess;
+import org.maemo.esbox.core.machine.MachineManager;
+import org.maemo.esbox.core.machine.ProcessFilterCmdLineRegexp;
+import org.maemo.esbox.core.process.CommandLineArguments;
+import org.maemo.esbox.core.process.IProcessLauncher;
+import org.maemo.esbox.core.process.IProcessLauncherFactory;
+import org.maemo.esbox.core.process.ProcessLauncherCreator;
+import org.maemo.esbox.core.sdk.IPreferenceProvider;
+import org.maemo.esbox.core.sdk.ISDK;
+import org.maemo.esbox.core.sdk.ISDKTarget;
 import org.maemo.esbox.internal.maemosdk.core.Activator;
 import org.maemo.esbox.project.core.ProjectManager;
 
-import java.io.*;
-import java.util.List;
-
 /**
  * Class handle all methods that needs some graphical environment.
  * It invokes graphical thing that are ordered in window - preferences -

Modified: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/scratchbox/MaemoLauncher.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/scratchbox/MaemoLauncher.java	2008-10-07 23:27:03 UTC (rev 840)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/scratchbox/MaemoLauncher.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -12,13 +12,16 @@
 
 package org.maemo.esbox.maemosdk.core.scratchbox;
 
+import java.io.IOException;
+import java.util.List;
+
 import org.maemo.esbox.core.ESboxException;
-import org.maemo.esbox.core.machine.*;
+import org.maemo.esbox.core.machine.IMachine;
+import org.maemo.esbox.core.machine.IProcess;
+import org.maemo.esbox.core.machine.ProcessFilterCmdLineRegexp;
 import org.maemo.esbox.core.sdk.ISDKTarget;
+import org.maemo.esbox.maemosdk.core.sdk.AbstractScratchboxSDK;
 
-import java.io.IOException;
-import java.util.List;
-
 /**
  * This class maintains knowledge about whether maemo is running in
  * a target and controls access to starting, stopping, and querying status.
@@ -74,9 +77,11 @@
 		if (isMaemoRunning(sdkTarget))
 			throw new ScratchboxException("Maemo is already running");
 
-		ScratchboxFacade.getInstance().startMaemoCommand(sdkTarget);
+		AbstractScratchboxSDK.startMaemoCommand(sdkTarget);
 	}
 
+	
+	
 	/**
 	 * Stop maemo if it's running
 	 * @param sdkTarget
@@ -87,7 +92,7 @@
 		//if (!isMaemoRunning(sdkTarget))
 		//	throw new ScratchboxException("Maemo is not running, or failed to launch.");
 
-		ScratchboxFacade.getInstance().stopMaemoCommand(sdkTarget);
+		AbstractScratchboxSDK.stopMaemoCommand(sdkTarget);
 	}
 	
 	/**
@@ -96,7 +101,7 @@
 	 * @throws ESboxException if cannot be restarted
 	 */
 	public void restartMaemo(ISDKTarget sdkTarget) throws ESboxException {
-		ScratchboxFacade.getInstance().restartMaemoCommand(sdkTarget);
+		AbstractScratchboxSDK.restartMaemoCommand(sdkTarget);
 	}
 
 	/**

Modified: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/scratchbox/PersistentCache.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/scratchbox/PersistentCache.java	2008-10-07 23:27:03 UTC (rev 840)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/scratchbox/PersistentCache.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -11,14 +11,19 @@
 
 package org.maemo.esbox.maemosdk.core.scratchbox;
 
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.util.HashMap;
+import java.util.Map;
+
 import org.eclipse.core.runtime.IPath;
 import org.maemo.esbox.core.Policy;
 import org.maemo.esbox.internal.maemosdk.core.Activator;
 
-import java.io.*;
-import java.util.HashMap;
-import java.util.Map;
-
 /**
  * This object stores (key, value) pairs for cached data which is expensive to compute.
  * The keys are unique strings.  Values are serializable objects. 

Deleted: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/scratchbox/ScratchboxFacade.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/scratchbox/ScratchboxFacade.java	2008-10-07 23:27:03 UTC (rev 840)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/scratchbox/ScratchboxFacade.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -1,1035 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007-2008 INdT, (c) 2008 Nokia Corporation
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *    Raul Herbster (UFCG) - initial API and implementation
- *    Ed Swartz (Nokia)
- *******************************************************************************/
-package org.maemo.esbox.maemosdk.core.scratchbox;
-
-import org.eclipse.core.runtime.*;
-import org.maemo.esbox.core.*;
-import org.maemo.esbox.core.machine.*;
-import org.maemo.esbox.core.process.IProcessLauncher;
-import org.maemo.esbox.core.process.IProcessLauncherFactory;
-import org.maemo.esbox.core.sdk.*;
-import org.maemo.esbox.internal.api.core.sdk.UserAwarePreferenceProviderWrapper;
-import org.maemo.esbox.internal.maemosdk.core.Activator;
-import org.maemo.esbox.internal.maemosdk.core.command.ICommand;
-import org.maemo.esbox.internal.maemosdk.core.command.scratchbox.*;
-import org.maemo.esbox.internal.maemosdk.core.command.scratchbox.sbrsh.*;
-import org.maemo.esbox.maemosdk.core.command.ICommandAbstractor;
-import org.maemo.esbox.maemosdk.core.command.ListTargetsCommand;
-import org.maemo.esbox.maemosdk.core.sdk.*;
-import org.maemo.esbox.maemosdk.sdk1.command.ListSessionsCommand;
-
-import java.util.*;
-
-/**
- * This class implements some services frequently called by clients which need
- * to know Scratchbox configuration values. 
- * <p>
- * All the methods are synchronized because executing a scratchbox 1 command (at least) may require
- * a target switch, and we don't want these to compete.
- * <p>
- * These methods may return cached results, but this may be switched
- * using #setUseCachedData(boolean) or #clearCachedData().
- * <p>
- * The build machine hosting the SDK need not be alive for any items that
- * return cached data, but the machine will be acquired if the cache 
- * cannot satisfy the request.
- */
-public class ScratchboxFacade1 {
-
-	private static ScratchboxFacade singleton = null;
-
-	private final List<String> emptyArguments = new ArrayList<String>();
-
-	private boolean useCaching;
-
-	private PersistentCache cache;
-	
-	/** String for URI of machine where we detected scratchbox 1 */
-	private static final String SB1_MACHINE = "sb1_machine";
-	/** String for scratchbox 1 version or <code>null</code> */
-	private static final String SB1_VERSION = "sb1_version";
-	/** String for URI of machine where we detected scratchbox 2 */
-	private static final String SB2_MACHINE = "sb2_machine";
-	/** String for scratchbox 2 version or <code>null</code> */
-	private static final String SB2_VERSION = "sb2_version";
-	/** String[] scratchbox 1 target name array */
-	private static final String SB1_TARGETS = "sb1_targets";
-	/** String[] scratchbox 2 target name array */
-	private static final String SB2_TARGETS = "sb2_targets";
-	/** Map<String,Map<String, String>> of sb2 target names to a map of the target directory to host directory path mappings */
-	private static final String SB2_TARGET_TO_PATH_MAPPINGS_MAP = "sb2_target_to_path_mappings_map";
-	/** Map<String,String> of sb2 target names to rootstrap paths */
-	private static final String SB2_TARGET_TO_ROOTSTRAP_MAP = "sb2_target_to_rootstrap_map";
-	
-	/**
-	 * Constructor.
-	 * 
-	 * Construct and Scratchbox abstraction to call services of Scratchbox
-	 * environment.
-	 */
-	private ScratchboxFacade() {
-		useCaching = true; //!GeneralUtils.isJUnitRunning();
-		cache = new PersistentCache();
-		cache.load();
-	}
-
-	/**
-	 * Return an instance of Scratchbox.
-	 * 
-	 * @return an instance of Scratchbox.
-	 */
-	public static synchronized ScratchboxFacade getInstance() {
-		if (singleton == null)
-			singleton = new ScratchboxFacade();
-		return singleton;
-	}
-
-	public synchronized boolean isUsingCachedData() {
-		return useCaching;
-	}
-	
-	public synchronized void useCachedData(boolean use) {
-		this.useCaching = use;
-	}
-	
-	public synchronized void clearCachedData() {
-		if (useCaching) {
-			cache.clear();
-		}
-	}
-	
-	public synchronized void saveCachedData() {
-		if (useCaching) {
-			cache.save();
-		}
-	}
-	
-	/** Get the cached value for a key (KEY_...),
-	 * or <code>null</code> if not registered
-	 * @param key the KEY... key name
-	 * @return the cached value or <code>null</code> if not registered or caching is not used   
-	 */ 
-	private Object getCachedValue(String key) {
-		if (useCaching)
-			return cache.get(key);
-		else
-			return null;
-	}
-	
-	/** Store the cached value for a key.
-	 * @param key
-	 * @param value or <code>null</code> (does not delete a value)
-	 */
-	private void setCachedValue(String key, Object value) {
-		if (useCaching)
-			cache.set(key, value);
-	}
-	
-	private void throwBadESboxException(IScratchboxSDK sdk) throws ESboxException {
-		throw new ESboxException("Unrecognized or unexpected scratchbox version: " + sdk);
-	}
-
-	/**
-	 * Be sure the machine hosting the SDK or target is alive before running commands on it. 
-	 * @param machine
-	 * @param monitor 
-	 */
-	private void acquireMachine(final IMachine machine) throws ESboxException {
-		if (!machine.isAlive()) {
-			IStatus status = MachineManager.getInstance().acquireMachine(machine, null);
-			if (!status.isOK()) {
-				ESboxException e = new ESboxException(status.getMessage(), status.getException());
-				Activator.getErrorLogger().logError("Failed to launch machine for scratchbox command",
-						e);
-				throw e;
-			}
-		}
-	}
-
-	/** SB1 is usually installed to contain softlinks into /usr/bin, but the .tar.gz
-	 * installation method doesn't do this.  So be sure to handle sb1 commands which might not be on /usr/bin. */
-	private ICommandAbstractor getSb1WrappedCommandAbstractor(final ICommandAbstractor commandAbstractor) {
-		return new ICommandAbstractor() {
-
-			public String getPreferenceValue(String key) {
-				return commandAbstractor.getPreferenceValue(key);
-			}
-
-			public IProcessLauncherFactory getProcessLauncherFactory() {
-				final IProcessLauncherFactory launcherFactory = commandAbstractor.getProcessLauncherFactory();
-				IProcessLauncherFactory wrappedLauncherFactory = new IProcessLauncherFactory() {
-
-					public IProcessLauncher createProcessLaunchHandler(
-							IPath workingDirectory,
-							List<String> commandLine,
-							Properties environment) {
-						if (environment == null) {
-							environment = getStandardEnvironment();
-						}
-						
-						// fallback for cases where sbox is installed via .tar.gz with no softlinks into /usr/bin
-						String path = environment.getProperty("PATH");
-						if (path == null)
-							path = ":/usr/bin:/bin";
-						else if (!path.startsWith(":"))
-							path = ":" + path;
-						path = "/scratchbox/tools/bin" + path;
-						environment.put("PATH", path);
-						
-						return launcherFactory.createProcessLaunchHandler(workingDirectory, commandLine, environment);
-					}
-
-					public Properties getStandardEnvironment() {
-						return launcherFactory.getStandardEnvironment();
-					}
-					
-				};
-				return wrappedLauncherFactory;
-			}
-			
-			/* (non-Javadoc)
-			 * @see org.maemo.esbox.internal.core.command.ICommandAbstractor#getFileSystemAccess()
-			 */
-			public IFileSystemAccess getFileSystemAccess() {
-				return commandAbstractor.getFileSystemAccess();
-			}
-			
-		};
-	}
-	
-	/** Get a command abstractor for the host. */
-	public ICommandAbstractor getHostCommandAbstractor(final IMachine machine) throws ESboxException {
-		// ensure machine is alive
-		acquireMachine(machine);
-
-		return new ICommandAbstractor() {
-
-			public String getPreferenceValue(String key) {
-				return new UserAwarePreferenceProviderWrapper(
-						CorePreferenceManager.getInstance().getPreferenceProvider(),
-						machine).getPreferenceValue(key);
-			}
-
-			public IProcessLauncherFactory getProcessLauncherFactory() {
-				return machine.getProcessLauncherFactory();
-			}
-			
-			/* (non-Javadoc)
-			 * @see org.maemo.esbox.internal.core.command.ICommandAbstractor#getFileSystemAccess()
-			 */
-			public IFileSystemAccess getFileSystemAccess() {
-				return machine.getFileSystemAccess();
-			}
-		};
-	}
-
-	/** Get a command abstractor for an SDK.  Scratchbox commands can
-	 * run outside scratchbox, so launch these as native processes. */
-	public ICommandAbstractor getCommandAbstractor(final ISDK sdk) throws ESboxException {
-		// ensure machine is alive
-		acquireMachine(sdk.getMachine());
-		
-		ICommandAbstractor commandAbstractor = new ICommandAbstractor() {
-
-			public String getPreferenceValue(String key) {
-				return sdk.getPreferenceValue(key);
-			}
-
-			public IProcessLauncherFactory getProcessLauncherFactory() {
-				return sdk.getMachine().getProcessLauncherFactory();
-			}
-			
-			/* (non-Javadoc)
-			 * @see org.maemo.esbox.internal.core.command.ICommandAbstractor#getFileSystemAccess()
-			 */
-			public IFileSystemAccess getFileSystemAccess() {
-				return sdk.getMachineFileSystemAccess();
-			}
-		};
-
-		// be sure to account for possibly missing softlinks
-		if (sdk instanceof IScratchbox1SDK) {
-			commandAbstractor = getSb1WrappedCommandAbstractor(commandAbstractor);
-		}
-		
-		return commandAbstractor;
-	}
-	
-	/** Get a command launcher for an SDK target.  These must be executed
-	 * within the context of scratchbox.  */
-	public ICommandAbstractor getCommandAbstractor(final ISDKTarget sdkTarget) throws ESboxException {
-		// ensure machine is alive
-		acquireMachine(sdkTarget.getSDK().getMachine());
-		
-		return new ICommandAbstractor() {
-
-			public String getPreferenceValue(String key) {
-				return sdkTarget.getPreferenceValue(key);
-			}
-
-			public IProcessLauncherFactory getProcessLauncherFactory() {
-				return sdkTarget.getProcessLauncherFactory();
-			}
-			
-			/* (non-Javadoc)
-			 * @see org.maemo.esbox.internal.core.command.ICommandAbstractor#getFileSystemAccess()
-			 */
-			public IFileSystemAccess getFileSystemAccess() {
-				return sdkTarget.getTargetFileSystemAccess();
-			}
-		};
-	}
-
-	private void ensureCurrentMachine(String machineKey, IMachine machine) {
-		String current = (String) getCachedValue(machineKey);
-		if (current != null) {
-			String machineURI = machine.getURI().toString();
-			if (!current.equals(machineURI)) {
-				// just zap
-				clearCachedData();
-			}
-			setCachedValue(machineKey, machineURI);
-		}
-	}
-	/**
-	 * Return the current version of Scratchbox 1.
-	 * @param machine 
-	 * @return the current version of Scratchbox 1.
-	 * @throws ESboxException
-	 *             if any problem related to Scratchbox communication occurs,
-	 *             including no scratchbox 1 detected
-	 */
-	public synchronized String getCurrentSbox1Version(IMachine machine)
-			throws ESboxException {
-		// find cached value
-		ensureCurrentMachine(SB1_MACHINE, machine);
-		String version = (String) getCachedValue(SB1_VERSION);
-		if (version != null)
-			return version;
-		
-		// do the hard work
-		acquireMachine(machine);
-		ICommandAbstractor commandAbstractor = getHostCommandAbstractor(machine);
-		commandAbstractor = getSb1WrappedCommandAbstractor(commandAbstractor);
-		GetVersionScratchboxCommand getVersionCommand = new GetVersionScratchboxCommand(
-				commandAbstractor, 1);
-	
-		String currentVersion = getVersionCommand.performCommand(new ArrayList<String>());
-		
-		// remember cached value
-		setCachedValue(SB1_VERSION, currentVersion);
-		
-		return currentVersion;
-	}
-
-	/**
-	 * Return the current version of Scratchbox 2
-	 * @return the current version of Scratchbox 2.
-	 * @throws ESboxException
-	 *             if any problem related to Scratchbox communication occurs,
-	 *             including no scratchbox 2 detected
-	 */
-	public synchronized String getCurrentSbox2Version(IMachine machine)
-			throws ESboxException {
-		// find cached value
-		ensureCurrentMachine(SB2_MACHINE, machine);
-		String version = (String) getCachedValue(SB2_VERSION);
-		if (version != null)
-			return version;
-			
-		// do the hard work
-		acquireMachine(machine);
-		ICommandAbstractor commandAbstractor = getHostCommandAbstractor(machine); 
-		GetVersionScratchboxCommand getVersionCommand = new GetVersionScratchboxCommand(
-				commandAbstractor, 2);
-		
-		String currentVersion = getVersionCommand.performCommand(new ArrayList<String>());
-		
-		// remember cached value
-		setCachedValue(SB2_VERSION, currentVersion);
-			
-		return currentVersion;
-	}
-	
-	/**
-	 * Return the list of available compilers in Scratchbox 1.
-	 * @param sdk 
-	 * 
-	 * @return a list with the available compilers in Scratchbox.
-	 * @throws ESboxException
-	 *             if some problem related to Scratchbox communication occurs.
-	 */
-	public synchronized List<String> getCompilers(IScratchboxSDK sdk) throws ESboxException {
-		if (sdk instanceof IScratchbox1SDK) {
-			ListCompilersCommand listCompilersCommand = new ListCompilersCommand(getCommandAbstractor(sdk));
-			return listCompilersCommand.performCommand(emptyArguments);
-		}
-		else if (sdk instanceof IScratchbox2SDK) {
-			ListCompilersSb2Command listCompilersCommand = new ListCompilersSb2Command(getCommandAbstractor(sdk));
-			return listCompilersCommand.performCommand(emptyArguments);
-		}
-		else {
-			throwBadESboxException(sdk);
-			return null;
-		}
-	}
-
-	/**
-	 * Return the list of available cputransp method at Scratchbox.
-	 * @param sdk 
-	 * 
-	 * @return a list with the available cputransp method at Scratchbox.
-	 * @throws ESboxException
-	 *             if some problem related to Scratchbox communication occurs.
-	 */
-	public synchronized List<String> getCputransp(IScratchboxSDK sdk) throws ESboxException {
-		if (sdk instanceof IScratchbox1SDK) {
-			ListCputranspCommand listCputranspCommand = new ListCputranspCommand(getCommandAbstractor(sdk));
-			return listCputranspCommand.performCommand(emptyArguments);
-		}
-		else if (sdk instanceof IScratchbox2SDK) {
-			ListCputranspSb2Command listCputranspCommand = new ListCputranspSb2Command(getCommandAbstractor(sdk));
-			return listCputranspCommand.performCommand(emptyArguments);
-		}
-		else {
-			throwBadESboxException(sdk);
-			return null;
-		}
-	}
-
-	/**
-	 * Return the list of available devkits at Scratchbox.
-	 * @param sdk 
-	 * 
-	 * @return a list with the available devkits at Scratchbox.
-	 * @throws ESboxException
-	 *             if some problem related to Scratchbox communication occurs.
-	 */
-	public synchronized List<String> getDevkits(IScratchbox1SDK sdk) throws ESboxException {
-		ListDevkitsCommand listDevkitsCommand = new ListDevkitsCommand(getCommandAbstractor(sdk));
-		return listDevkitsCommand.performCommand(new ArrayList<String>());
-	}
-
-	/**
-	 * Return the list of available targets at Scratchbox.
-	 * 
-	 * @return a list with the available targets at Scratchbox.
-	 * @throws ESboxException
-	 *             if some problem related to Scratchbox communication occurs.
-	 */
-	public synchronized List<String> getTargets(IScratchboxSDK sdk) throws ESboxException {
-		int sboxVersion = getSboxVersion(sdk);
-		String machineKey, targetsKey;
-		if (sboxVersion == 1) {
-			machineKey = SB1_MACHINE;
-			targetsKey = SB1_TARGETS;
-		} else {
-			machineKey = SB2_MACHINE;
-			targetsKey = SB2_TARGETS;
-		}
-		ensureCurrentMachine(machineKey, sdk.getMachine());
-		
-		String[] targetsArray = (String[]) getCachedValue(targetsKey);
-		if (targetsArray != null)
-			return Arrays.asList(targetsArray);
-		
-		ListTargetsCommand listTargetsCommand = new ListTargetsCommand(
-				getCommandAbstractor(sdk), sboxVersion);
-		List<String> targets = listTargetsCommand.performCommand(new ArrayList<String>());
-		
-		setCachedValue(targetsKey, (String[]) targets.toArray(new String[targets.size()]));
-			
-		return targets;
-	}
-
-	private int getSboxVersion(IScratchboxSDK sdk) throws ESboxException {
-		int version = Integer.parseInt(sdk.getMainVersion());
-//		if (sdk instanceof IScratchbox1SDK)
-//			return 1;
-//		else if (sdk instanceof IScratchbox2SDK)
-//			return 2;
-//		else
-//			throwBadESboxException(sdk);
-		return version;
-	}
-
-	/**
-	 * Return the current sessions of Scratchbox.
-	 * 
-	 * @return a list with current sessions Scratchbox.
-	 * @throws ESboxException
-	 *             if some problem related to Scratchbox communication occurs.
-	 */
-	public synchronized List<String> getSessions(IScratchbox1SDK sdk) throws ESboxException {
-		ListSessionsCommand listSessionsCommand = new ListSessionsCommand(getCommandAbstractor(sdk));
-		return listSessionsCommand.performCommand(new ArrayList<String>());
-	}
-
-	/**
-	 * Return the current target name of Scratchbox 1 or 2.
-	 * @param sdk 
-	 * 
-	 * @return the current target of Scratchbox 1 or 2.
-	 * @throws ESboxException
-	 *             if some problem related to Scratchbox communication occurs.
-	 */
-	public synchronized String getCurrentTarget(IScratchboxSDK sdk) throws ESboxException {
-		ICommand getCurrentTargetCommand = null;
-		if (sdk instanceof IScratchbox1SDK)
-			getCurrentTargetCommand = new GetCurrentTargetCommand(getCommandAbstractor(sdk), sdk);
-		else if (sdk instanceof IScratchbox2SDK)
-			getCurrentTargetCommand = new GetCurrentTargetSb2Command(getCommandAbstractor(sdk));
-		else
-			throwBadESboxException(sdk);
-		return (String) getCurrentTargetCommand.performCommand(new ArrayList<String>());
-	}
-
-	/**
-	 * Return the current target of Scratchbox.
-	 * @param sdk 
-	 * 
-	 * @return the current target of Scratchbox.
-	 * @throws ESboxException
-	 *             if some problem related to Scratchbox communication occurs.
-	 */
-	public synchronized IScratchboxSDKTarget getCurrentSDKTarget(IScratchboxSDK sdk) throws ESboxException {
-		String targetName = getCurrentTarget(sdk);
-		return (IScratchboxSDKTarget) sdk.findSDKTarget(targetName);
-	}
-
-	/**
-	 * Create a new target for Scratchbox 1. An target must have a name, and the
-	 * compiler, devkits and cputransp must be available in Scratchbox.
-	 * @param sdk 
-	 * 
-	 * @param targetName
-	 *            the name of the new target.
-	 * @param compiler
-	 *            the compiler name of the new target.
-	 * @param devkits
-	 *            the devkits of the new target. The devkits must be split using
-	 *            ":";
-	 * @param cputransp
-	 *            the cputransp method of the new target.
-	 * @return true, if the target is created successfully.
-	 * @throws ESboxException
-	 *             if some problem related to Scratchbox communication occurs.
-	 */
-	public synchronized boolean createTarget(IScratchbox1SDK sdk, String targetName,
-			String compiler, String devkits, String cputransp)
-			throws ESboxException {
-		List<String> params = new ArrayList<String>();
-		params.add(targetName);
-		params.add(compiler);
-		params.add(devkits);
-		params.add(cputransp);
-
-		CreateTargetCommand createTargetCommand = new CreateTargetCommand(sdk, getCommandAbstractor(sdk));
-
-		setCachedValue(SB1_TARGETS, null);
-		
-		return (Boolean) createTargetCommand.performCommand(params);
-	}
-
-	/**
-	 * Create a new target for Scratchbox 2. An target must have a name, and the
-	 * compiler, and cputransp must be available in Scratchbox.
-	 * @param sdk 
-	 * 
-	 * @param targetName
-	 *            the name of the new target.
-	 * @param compiler
-	 *            the compiler path of the new target.
-	 * @param cputransp
-	 *            the cputransp method of the new target, or <code>null</code> for default
-	 * @return true, if the target is created successfully.
-	 * @throws ESboxException
-	 *             if some problem related to Scratchbox communication occurs.
-	 */
-	public synchronized boolean createTarget(IScratchbox2SDK sdk, String targetName,
-			String compiler, String cputransp)
-			throws ESboxException {
-		List<String> params = new ArrayList<String>();
-		params.add(targetName);
-		params.add(compiler);
-		params.add(cputransp);
-
-		CreateTargetSb2Command createTargetCommand = new CreateTargetSb2Command(sdk, getCommandAbstractor(sdk));
-
-		setCachedValue(SB2_TARGETS, null);
-
-		return (Boolean) createTargetCommand.performCommand(params);
-	}
-	
-	/**
-	 * Create a new rootstrap target for Scratchbox 2.  The target is named
-	 * after a maemo-rootstrap available target.  
-	 * @param sdk 
-	 * @param targetName
-	 *            the name of the new target.
-	 * @param useHostTools if true, use the host toolchain rather than installing devkits in the rootstrap 
-	 * @param force if true, then overwrite any existing rootstrap; if false, then let the user choose (in the console :/)
-	 * whether to overwrite or keep an existing one
-	 * @return true if succeeded, false if failed
-	 * @throws ESboxException
-	 *             if some problem related to Scratchbox communication occurs.
-	 */
-	public synchronized boolean createRootstrapTarget(IScratchbox2SDK sdk, String targetName, boolean useHostTools, boolean force, IProgressMonitor monitor)
-			throws ESboxException {
-		List<String> params = new ArrayList<String>();
-		params.add(targetName);
-		params.add(Boolean.toString(useHostTools));
-		params.add(Boolean.toString(force));
-
-		CreateMaemoRootstrapSb2Command createTargetCommand = 
-			new CreateMaemoRootstrapSb2Command(sdk, getCommandAbstractor(sdk), monitor);
-
-		setCachedValue(SB2_TARGETS, null);
-
-		return createTargetCommand.performCommand(params);
-	}
-
-	/**
-	 * Create a new rootstrap target for Scratchbox 2.  The target is named
-	 * after a maemo-rootstrap available target.  
-	 * @param sdk 
-	 * @param targetName
-	 *            the name of the new target.
-	 * @param force if true, then overwrite any existing rootstrap; if false, then let the user choose (in the console :/)
-	 * whether to overwrite or keep an existing one
-	 * @return true if succeeded, false if failed
-	 * @throws ESboxException
-	 *             if some problem related to Scratchbox communication occurs.
-	 */
-	public synchronized boolean removeRootstrap(IScratchbox2SDK sdk, String targetName, boolean force, IProgressMonitor monitor)
-			throws ESboxException {
-		List<String> params = new ArrayList<String>();
-		params.add(targetName);
-		params.add(Boolean.toString(force));
-
-		RemoveMaemoRootstrapSb2Command removeTargetCommand = 
-			new RemoveMaemoRootstrapSb2Command(getCommandAbstractor(sdk), monitor);
-
-		setCachedValue(SB2_TARGETS, null);
-		setCachedValue(SB2_TARGET_TO_ROOTSTRAP_MAP, null);
-		setCachedValue(SB2_TARGET_TO_PATH_MAPPINGS_MAP, null);
-
-		return removeTargetCommand.performCommand(params);
-	}
-
-	/**
-	 * Remove a target from Scratchbox 1 or 2. A target with the given name must exist.
-	 * @param isdk 
-	 * 
-	 * @param targetName
-	 *            the name of the target to be removed.
-	 * @return true, if the operation is performed successfully.
-	 * @throws ESboxException
-	 *             if the name of the target to be removed does not exist or if
-	 *             some problem related to Scratchbox communication occurs.
-	 */
-	public synchronized boolean removeTarget(IScratchboxSDK sdk, String targetName)
-			throws ESboxException {
-		List<String> params = new ArrayList<String>();
-		params.add(targetName);
-
-		ICommand removeTargetCommand;
-		if (sdk instanceof IScratchbox1SDK) {
-			removeTargetCommand = new RemoveTargetCommand(sdk, getCommandAbstractor(sdk));
-			setCachedValue(SB1_TARGETS, null);
-		}
-		else {
-			removeTargetCommand = new RemoveTargetSb2Command(sdk, getCommandAbstractor(sdk));
-			setCachedValue(SB2_TARGETS, null);
-			setCachedValue(SB2_TARGET_TO_PATH_MAPPINGS_MAP, null);
-			setCachedValue(SB2_TARGET_TO_ROOTSTRAP_MAP, null);
-		}
-
-		return (Boolean) removeTargetCommand.performCommand(params);
-	}
-
-	/**
-	 * Select another available target as current Scratchbox target.
-	 * @param sdk 
-	 * 
-	 * @param targetName
-	 *            the name of the new target.
-	 * @return true, if the operation is performed successfully.
-	 * @throws ESboxException
-	 *             if the target to be selected does not exists or if some
-	 *             problem related to Scratchbox communication occurs.
-	 */
-	public synchronized boolean selectTarget(IScratchbox1SDK sdk, String targetName)
-			throws ESboxException {
-		List<String> params = new ArrayList<String>();
-		params.add(targetName);
-
-		SelectTargetCommand selectTargetCommand = new SelectTargetCommand(getCommandAbstractor(sdk), sdk);
-
-		return (Boolean) selectTargetCommand.performCommand(params);
-	}
-
-	/**
-	 * Kill an Scratchbox process.
-	 * 
-	 * @param signal
-	 *            the signal emitted to scratchbox processes.
-	 * @return true, if the is performed successfully.
-	 * @throws ESboxException
-	 *             if some problem related to Scratchbox communication occurs.
-	 */
-	public synchronized boolean killProcess(IScratchbox1SDK sdk, String signal)
-			throws ESboxException {
-		List<String> params = new ArrayList<String>();
-		params.add(signal);
-
-		KillallCommand killallCommand = new KillallCommand(getCommandAbstractor(sdk));
-
-		return (Boolean) killallCommand.performCommand(params);
-	}
-	
-	/**
-	 * Kill an Scratchbox process.
-	 * @return true, if the is performed successfully.
-	 * @throws ESboxException
-	 *             if some problem related to Scratchbox communication occurs.
-	 */
-	public synchronized boolean killProcess(IScratchbox1SDK sdk)
-			throws ESboxException {
-		List<String> params = new ArrayList<String>();
-
-		KillallCommand killallCommand = new KillallCommand(getCommandAbstractor(sdk));
-
-		return (Boolean) killallCommand.performCommand(params);
-	}
-
-	/**
-	 * Configure sbrsh settings of an certain target.
-	 * @param sdk 
-	 * 
-	 * @param targetName
-	 *            the name of the target to be configured.
-	 * @param targetDeviceIP
-	 *            the IP of the device.
-	 * @param targetDevicePort
-	 *            the port of the device.
-	 * @param nfsServerAddr
-	 *            the IP of NFS server.
-	 * @return true, if the configuration is performed successfully; false,
-	 *         otherwise.
-	 * @throws ESboxException
-	 *             if any problem related to Scratchbox communication occurs.
-	 */
-	public synchronized boolean configureSbrsh(IScratchboxSDK sdk, String targetName,
-			String targetDeviceAddr, String nfsServerAddr)
-			throws ESboxException {
-		ConfigureSbrshCommand configureSbrshCommand = new ConfigureSbrshCommand(getCommandAbstractor(sdk));
-
-		List<String> params = new ArrayList<String>();
-
-		params.add(targetName);
-		params.add(targetDeviceAddr);
-		params.add(nfsServerAddr);
-
-		return (Boolean) configureSbrshCommand.performCommand(params);
-	}
-
-	/**
-	 * Add the target to an access list. Such list contains all targets that can
-	 * be access the remote device.
-	 * @param sdk 
-	 * 
-	 * @param targetNameProperty
-	 *            the target name to be added to the list.
-	 * @param username
-	 *            the user name.
-	 * @param ipAddr
-	 *            the IP of the desktop.
-	 * @return true, if the configuration is performed successfully; false,
-	 *         otherwise.
-	 * @throws ESboxException
-	 *             if any problem related to Scratchbox communication occurs.
-	 */
-	public synchronized boolean addSbrshAccessList(IScratchboxSDK sdk, String targetDeviceAddr,
-			String username, String ipAddr) throws ESboxException {
-		AddSbrshCommand addSbrshCommand = new AddSbrshCommand(getCommandAbstractor(sdk));
-
-		List<String> params = new ArrayList<String>();
-
-		params.add(targetDeviceAddr);
-		params.add(username);
-		params.add(ipAddr);
-
-		return (Boolean) addSbrshCommand.performCommand(params);
-	}
-
-	/**
-	 * Mount a target at the remove device.
-	 * 
-	 * @param targetName
-	 *            the name of the target to be mounted.
-	 * @return true, if the configuration is performed successfully; false,
-	 *         otherwise.
-	 * @throws ESboxException
-	 *             if any problem related to Scratchbox communication occurs.
-	 */
-	public synchronized boolean mountTarget(IScratchboxSDK sdk, String targetName)
-			throws ESboxException {
-		MountTargetSbrshCommand mountTargetCommand = new MountTargetSbrshCommand(getCommandAbstractor(sdk));
-
-		List<String> params = new ArrayList<String>();
-		params.add(targetName);
-
-		return (Boolean) mountTargetCommand.performCommand(params);
-	}
-
-	/**
-	 * Unmount a target at the remote device.
-	 * 
-	 * @param targetName
-	 *            the name of the target to be unmounted.
-	 * @return true, if the configuration is performed successfully; false,
-	 *         otherwise.
-	 * @throws ESboxException
-	 *             if any problem related to Scratchbox communication occurs.
-	 */
-	public synchronized boolean unmountTarget(IScratchboxSDK sdk, String targetName)
-			throws ESboxException {
-		UnmountTargetSbrshCommand unmountTargetCommand = new UnmountTargetSbrshCommand(getCommandAbstractor(sdk));
-
-		List<String> params = new ArrayList<String>();
-		params.add(targetName);
-
-		return (Boolean) unmountTargetCommand.performCommand(params);
-	}
-
-	/**
-	 * Show the configuration of the target.
-	 * 
-	 * @param targetName
-	 *            the target name to be shown.
-	 * @return a target representation which contains the configuration of the
-	 *         target with the given name.
-	 * @throws ESboxException
-	 *             if any problem related to Scratchbox communication occurs.
-	 */
-	/*
-	public synchronized ScratchboxTarget showTarget(IScratchboxSDK sdk, String targetName)
-			throws ESboxException {
-		ShowTargetCommand showTargetCommand = new ShowTargetCommand();
-
-		List<String> params = new ArrayList<String>();
-		params.add(targetName);
-
-		return showTargetCommand.performCommand(getCommandLauncher(sdk),  params);
-	}*/
-
-	/**
-	 * Start maemo.  This runs synchronously.
-	 * 
-	 * @param sdkTarget 
-	 * @return
-	 * @throws ESboxException
-	 */
-	public synchronized boolean startMaemoCommand(ISDKTarget sdkTarget)
-			throws ESboxException {
-		MaemoCommand maemoCommand = new MaemoCommand(getCommandAbstractor(sdkTarget), sdkTarget);
-		return (Boolean) maemoCommand.startMaemoCommand(sdkTarget);
-	}	
-	
-	/**
-	 * Restart maemo.  This runs synchronously.
-	 * 
-	 * @return
-	 * @throws ESboxException
-	 */
-	public synchronized boolean restartMaemoCommand(ISDKTarget sdkTarget) throws ESboxException {
-		MaemoCommand maemoCommand = new MaemoCommand(getCommandAbstractor(sdkTarget), sdkTarget);
-		return (Boolean) maemoCommand.restartMaemoCommand(sdkTarget);
-	}
-
-	/**
-	 * Stop maemo.  This runs synchronously.
-	 * @return
-	 * @throws ESboxException
-	 */
-	public synchronized boolean stopMaemoCommand(ISDKTarget sdkTarget) throws ESboxException {
-		MaemoCommand maemoCommand = new MaemoCommand(getCommandAbstractor(sdkTarget), sdkTarget);
-		return (Boolean) maemoCommand.stopMaemoCommand(sdkTarget);
-	}
-
-	/**
-	 * Execute a command inside Scratchbox.
-	 * 
-	 * @param cmdLine
-	 *            the command and arguments to be executed inside Scratchbox.
-	 * @return a List that contains the values returned by the command.
-	 * @throws ESboxException
-	 *             if any problem related to Scratchbox communication occurs.
-	 */
-	public synchronized List<String> execSimpleCommand(ISDKTarget sdkTarget, List<String> cmdLine)
-			throws ESboxException {
-		SimpleCommand commandToExec = new SimpleCommand(getCommandAbstractor(sdkTarget));
-	
-		return commandToExec.performCommand(cmdLine);
-	}
-
-	/**
-	 * Get the MaemoRootstrap items available for installation.  This includes any that
-	 * might already be defined.
-	 * @return List, never null
-	 * @throws ESboxException
-	 */
-	public synchronized List<MaemoRootstrap> getAvailableMaemoRootstraps(IMachine machine) throws ESboxException {
-		ListAvailableMaemoRootstrapsSb2Command command = new ListAvailableMaemoRootstrapsSb2Command(getHostCommandAbstractor(machine));
-		return command.performCommand(emptyArguments);
-	}
-
-	/**
-	 * Get the names of rootstraps already installed.  This may inclue those that do
-	 * not have targets associated.
-	 * @param sdk the SDK to check
-	 * @return List, never null
-	 * @throws ESboxException
-	 */
-	public synchronized List<String> getInstalledMaemoRootstraps(IScratchboxSDK sdk) throws ESboxException {
-		ListInstalledMaemoRootstrapsSb2Command command = new ListInstalledMaemoRootstrapsSb2Command(getHostCommandAbstractor(sdk.getMachine()));
-		return command.performCommand(emptyArguments);
-	}
-
-	/**
-	 * Invoke sb2-show path on the given path(s) to return the mappings.
-	 * @param hostPaths array of paths to map
-	 * @return map of resolved host paths to target paths
-	 * @throws ESboxException 
-	 */
-	public synchronized Map<IPath, IPath> getSb2PathMapping(IScratchboxSDKTarget sdkTarget, List<IPath> hostPaths) throws ESboxException {
-		// find cached value
-		ensureCurrentMachine(SB2_MACHINE, sdkTarget.getSDK().getMachine());
-		Map<String, Map<String, String>> targetToPathMappingsMap = null;
-		Map<String, String> storedPathMappings = null;
-		targetToPathMappingsMap = (Map<String, Map<String, String>>) getCachedValue(SB2_TARGET_TO_PATH_MAPPINGS_MAP);
-		if (targetToPathMappingsMap != null) {
-			storedPathMappings = targetToPathMappingsMap.get(sdkTarget.getName());
-		}
-
-		Map<IPath, IPath> returnedPathMappings = new HashMap<IPath, IPath>();
-
-		// locate entries known to the cache
-		List<IPath> needToLookupHostPaths;
-		if (storedPathMappings != null) {
-			needToLookupHostPaths = new ArrayList<IPath>();
-			for (IPath hostPath : hostPaths) {
-				String targetPath = storedPathMappings.get(hostPath.toPortableString());
-				if (targetPath != null) {
-					returnedPathMappings.put(hostPath, new Path(targetPath));
-				} else {
-					needToLookupHostPaths.add(hostPath);
-				}
-			}
-		} else {
-			needToLookupHostPaths = hostPaths;
-		}
-		
-		if (needToLookupHostPaths.size() == 0) {
-			return returnedPathMappings;
-		}
-		
-		// do the hard work for the paths not covered by the cache
-		ShowPathMappingSb2Command command = new ShowPathMappingSb2Command(getCommandAbstractor(sdkTarget));
-		List<String> paths = new ArrayList<String>(needToLookupHostPaths.size());
-		for (IPath path : needToLookupHostPaths) {
-			paths.add(path.toPortableString());
-		}
-		
-		Map<IPath, IPath> newPathMappings = (Map<IPath, IPath>) command.performCommand(paths);
-		returnedPathMappings.putAll(newPathMappings);
-		
-		// update cache
-		if (storedPathMappings == null) {
-			storedPathMappings = new HashMap<String, String>();
-		}
-		for (Map.Entry<IPath, IPath> entry : newPathMappings.entrySet()) {
-			storedPathMappings.put(entry.getKey().toPortableString(), entry.getValue().toPortableString());
-		}
-		if (targetToPathMappingsMap == null) {
-			targetToPathMappingsMap = new HashMap<String, Map<String,String>>();
-		}
-		targetToPathMappingsMap.put(sdkTarget.getName(), storedPathMappings);
-		
-		setCachedValue(SB2_TARGET_TO_PATH_MAPPINGS_MAP, targetToPathMappingsMap);
-		
-		return returnedPathMappings;
-	}
-
-	/**
-	 * Get the path where a maemo rootstrap is installed
-	 * @param scratchbox2SDK
-	 * @return path of rootstrap
-	 * @throws ESboxException if not located
-	 */
-	public synchronized IPath getMaemoRootstrapPath(IScratchbox2SDKTarget sdkTarget) throws ESboxException {
-		// find cached value
-		ensureCurrentMachine(SB2_MACHINE, sdkTarget.getSDK().getMachine());
-		Map<String, String> targetToRootstrapMap = null;
-		targetToRootstrapMap = (Map<String, String>) getCachedValue(SB2_TARGET_TO_ROOTSTRAP_MAP);
-		if (targetToRootstrapMap != null) {
-			String rootstrap = targetToRootstrapMap.get(sdkTarget.getName());
-			if (rootstrap != null) {
-				return new Path(rootstrap);
-			}
-		}
-
-		// do the hard work
-		GetMaemoRootstrapLocationCommand command = new GetMaemoRootstrapLocationCommand(
-				getCommandAbstractor(sdkTarget.getSDK()), sdkTarget);
-		IPath rootstrapPath;
-		
-		// be sure to record something in the cache for broken targets so
-		// we don't keep asking all the time
-		ESboxException caughtException = null;
-		try {
-			rootstrapPath = (IPath) command.performCommand(emptyArguments);
-		} catch (ESboxException e) {
-			rootstrapPath = Path.EMPTY;
-			caughtException = e;
-		}
-		
-		// store cached value
-		if (targetToRootstrapMap == null)
-			targetToRootstrapMap = new HashMap<String, String>();
-		targetToRootstrapMap.put(sdkTarget.getName(), rootstrapPath.toPortableString());
-		setCachedValue(SB2_TARGET_TO_ROOTSTRAP_MAP, targetToRootstrapMap);
-		
-		if (caughtException != null)
-			throw caughtException;
-			
-		return rootstrapPath;
-	}
-
-	/**
-	 * Get the command template for launching qemu under gdb with this target
-	 * @param sdkTarget
-	 * @param architecture one of {@link IScratchboxSDKTarget#ARCHITECTURE_ARMEL} or {@link IScratchboxSDKTarget#ARCHITECTURE_X86};
-	 * usually from sdkTarget.getArchitecture()
-	 * @return String or null if no cputransp used or not using qemu
-	 */
-	public synchronized String getGdbQemuCommandPattern(ISDKTarget sdkTarget, String architecture) throws ESboxException {
-		GetGdbQemuCommandPatternCommand command = new GetGdbQemuCommandPatternCommand(sdkTarget,
-				getCommandAbstractor(sdkTarget),
-				getSboxVersion((IScratchboxSDK) sdkTarget.getSDK()));
-		List<String> arguments = new ArrayList<String>(1);
-		arguments.add(architecture);
-		return command.performCommand(arguments);
-	}
-
-}

Deleted: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/scratchbox/ScratchboxTargetSwitcher.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/scratchbox/ScratchboxTargetSwitcher.java	2008-10-07 23:27:03 UTC (rev 840)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/scratchbox/ScratchboxTargetSwitcher.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -1,159 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Nokia Corporation.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *    Ed Swartz (Nokia) - initial API and implementation
- *******************************************************************************/
-package org.maemo.esbox.maemosdk.core.scratchbox;
-
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.swt.widgets.Display;
-import org.maemo.esbox.core.*;
-import org.maemo.esbox.core.process.*;
-import org.maemo.esbox.core.sdk.ISDKTarget;
-import org.maemo.esbox.internal.maemosdk.core.Activator;
-import org.maemo.esbox.maemosdk.core.sdk.IScratchbox1SDK;
-import org.maemo.esbox.maemosdk.core.sdk.IScratchbox1SDKTarget;
-import org.maemo.esbox.maemosdk.core.sdk.IScratchboxSDK;
-
-import java.text.MessageFormat;
-import java.util.List;
-
-/**
- * Utility class to handle switching scratchbox targets and 
- * get user approval to kill existing sessions if needed.
- * @author eswartz
- *
- */
-public abstract class ScratchboxTargetSwitcher1 {
-
-	/**
-	 * Ensure the current SDK target can host the given target, asking 
-	 * user for approval to terminate existing sessions if they are running.  
-	 * @param target an SDK target (SB1 or anything else)
-	 * @throws ESboxException if target could not be switched
-	 */
-	public static void ensureCurrentTarget(ISDKTarget target) throws ESboxException {
-		// only scratchbox 1 cares about "current targets"
-		if (!(target instanceof IScratchboxSDKTarget)) {
-			return;
-		}
-		
-		IScratchboxSDK sdk = ((IScratchboxSDK) target.getSDK());
-		final String currentTarget = ScratchboxFacade.getInstance().getCurrentTarget(sdk);
-		final String targetName = target.getName();
-		if (currentTarget.equals(targetName)) {
-			return;
-		}
-		
-		// see if maemo is running, since it needs to be killed to switch targets
-		// but isn't considered a "session" every time
-		boolean isMaemoRunning = ESboxScriptLauncher.getInstance().isMaemoStarted(target);
-		
-		// now try to switch and see if shells are open
-		boolean failedToSwitch = false;
-		try {
-			ScratchboxFacade.getInstance().selectTarget(sdk, targetName);
-		} catch (final ScratchboxException e) {
-			// sb-conf: You must close your other Scratchbox sessions first
-			// or 
-			// Note: Couldn't reselect the target. There are other Scratchbox sessions open.
-			if (e.getLocalizedMessage().contains("Scratchbox sessions")) {
-				failedToSwitch = true;
-			} else {
-				throw e;
-			}
-		}
-		
-		if (isMaemoRunning || failedToSwitch) {
-			final boolean[] ret = {false};
-			
-			if (!GeneralUtils.isJUnitRunning()) {
-				Display.getDefault().syncExec(new Runnable() {
-					public void run() {
-						ret[0] = MessageDialog.openQuestion(
-								null, 
-								"Scratchbox Target Conflict",
-								MessageFormat.format(
-										"The scratchbox 1 target needs to be switched from ''{0}'' to ''{1}'', but existing sessions are active.\n\n"+
-										"Kill existing Scratchbox sessions?  (You may manually close them first, if desired, then select 'No' to retry)",
-										currentTarget, targetName));
-					};
-				});
-			} else {
-				ret[0] = true;
-			}
-			
-			// if user accepts, kill existing ones
-			if (ret[0]) {
-				if (isMaemoRunning) {
-					// a target selection may succeed even if X and maemo are running... kill them first.
-					// We kill X too because some processes won't be killed by maemo-launcher.
-					try {
-						ESboxScriptLauncher.getInstance().killMaemo(target);
-					} catch (ESboxException e2) {
-						// ignore
-					}
-					try {
-						ESboxScriptLauncher.getInstance().stopX(target);
-					} catch (ESboxException e2) {
-						// ignore
-					}
-				}
-				
-				// now kill the scratchbox sessions the "approved" way
-				try {
-					ScratchboxFacade.getInstance().killProcess(sdk);
-					
-					// wait politely
-					try {
-						Thread.sleep(1000);
-					} catch (InterruptedException e1) {
-						
-					}
-					
-				} catch (ScratchboxException e2) {
-					// sb-conf killall can fail in the event there is some process with a space in its
-					// name... just log it and keep going
-					Activator.getErrorLogger().logError("Problem killing scratchbox sessions", e2);
-				}
-				
-				// double-check, since it doesn't really work!
-				List<String> sessions = ScratchboxFacade.getInstance().getSessions(sdk);
-				if (sessions.size() > 0) {
-					// forcibly kill processes
-					List<String> cmdLine = CommandLineArguments.createFromVarArgs(
-							"kill", "-9");
-					cmdLine.addAll(sessions);
-					
-					IProcessLauncher processLauncher = ProcessLauncherCreator.createProcessLauncher(
-							sdk.getMachineProcessLauncherFactory(), null, cmdLine);
-					Process process;
-					try {
-						process = processLauncher.createProcess();
-						process.waitFor();
-					} catch (final Exception e1) {
-						Display.getDefault().syncExec(new Runnable() {
-							public void run() {
-								MessageDialog.openError(
-										null, 
-										"Scratchbox Target Conflict",
-										MessageFormat.format(
-												"Couldn''t kill scratchbox processes:\n\n{0}\n\nRetrying the target selection anyway.",
-												e1.getLocalizedMessage()));
-							};
-						});
-					}
-				}
-				
-			}
-			
-			// always retry, and rethrow if fails
-			ScratchboxFacade.getInstance().selectTarget(sdk, targetName);
-		}
-	}
-}

Modified: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/scratchbox/XLauncher.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/scratchbox/XLauncher.java	2008-10-07 23:27:03 UTC (rev 840)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/scratchbox/XLauncher.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -12,24 +12,30 @@
 
 package org.maemo.esbox.maemosdk.core.scratchbox;
 
-import org.eclipse.core.runtime.*;
+import java.net.Socket;
+import java.text.MessageFormat;
+import java.util.List;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
 import org.eclipse.core.runtime.jobs.Job;
 import org.eclipse.swt.widgets.Display;
 import org.eclipse.ui.console.MessageConsole;
-import org.maemo.esbox.core.*;
-import org.maemo.esbox.core.env.*;
+import org.maemo.esbox.core.ESboxException;
+import org.maemo.esbox.core.Policy;
+import org.maemo.esbox.core.env.IEnvironmentModifierBlock;
 import org.maemo.esbox.core.machine.IMachine;
 import org.maemo.esbox.core.machine.MachineRegistry;
-import org.maemo.esbox.core.process.*;
+import org.maemo.esbox.core.process.CommandLineArguments;
+import org.maemo.esbox.core.process.IProcessLauncher;
+import org.maemo.esbox.core.process.IProcessLauncherFactory;
+import org.maemo.esbox.core.process.ProcessLauncherCreator;
+import org.maemo.esbox.core.process.ProcessLauncherUtils;
 import org.maemo.esbox.core.sdk.IPreferenceProvider;
 import org.maemo.esbox.internal.maemosdk.core.Activator;
 import org.maemo.esbox.maemosdk.core.MaemoPreferenceConstants;
 
-import java.net.Socket;
-import java.text.MessageFormat;
-import java.util.List;
-import java.util.Properties;
-
 /**
  * This class maintains knowledge about whether the X server is running in
  * the host, and controls access to starting, stopping, and querying status.
@@ -155,20 +161,18 @@
 			
 			IProcessLauncherFactory factory = localMachine.getProcessLauncherFactory();
 
-			Properties env = null;
+			IEnvironmentModifierBlock envBlock = null;
 			
-			// XXX: HOST$XSERVER_PATH is hack to get Cygwin visible from Windows
-			String path = getXServerPath(prefProvider);
-			if (path != null) {
-				env = factory.getStandardEnvironment();
-				env.put("PATH", path);
+			String path = prefProvider.getPreferenceValue(MaemoPreferenceConstants.X_PATH);
+			if (path != null && path.length() > 0) {
+				envBlock = ProcessLauncherUtils.addToPATH(localMachine, factory, path, true); 
 			}
 			
 			// launch command
 			IProcessLauncher processLauncher = ProcessLauncherCreator.createProcessLauncher(factory, 
 					null,
 					cmdLine,
-					env);
+					envBlock);
 			
 			final Process process = processLauncher.createProcess();
 			
@@ -256,25 +260,12 @@
 		return command;
 	}
 	
-	// TODO: see if this needs to be SDK-specific
 	private String getDisplayValue(IPreferenceProvider prefProvider) {
-		IEnvironmentVariableBlock envBlock = EnvironmentVariableManager.getInstance().getGlobalEnvironmentBlock();
-		IEnvironmentVariable variable = envBlock.getVariable(ESboxCommonVariables.DISPLAY);
-		if (variable == null)
-			return ESboxCommonVariables.DISPLAY_DEFAULT_VALUE;
-		else if (variable.getValue() != null)
-			return variable.getValue();
+		String value = prefProvider.getPreferenceValue(MaemoPreferenceConstants.X_DISPLAY);
+		if (value.length() > 0)
+			return value;
 		else
 			return System.getenv("DISPLAY"); // get from system
 	}
-	
-	// TODO: see if this needs to be SDK-specific
-	private String getXServerPath(IPreferenceProvider prefProvider) {
-		IEnvironmentVariableBlock envBlock = EnvironmentVariableManager.getInstance().getGlobalEnvironmentBlock();
-		IEnvironmentVariable variable = envBlock.getVariable(ESboxCommonVariables.XSERVER_PATH);
-		if (variable == null)
-			return null;
-		else
-			return variable.getValue();
-	}
 }
+

Added: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/sdk/AbstractScratchboxSDK.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/sdk/AbstractScratchboxSDK.java	                        (rev 0)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/sdk/AbstractScratchboxSDK.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -0,0 +1,381 @@
+package org.maemo.esbox.maemosdk.core.sdk;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Properties;
+
+import org.eclipse.core.filesystem.IFileInfo;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Platform;
+import org.maemo.esbox.core.CorePreferenceManager;
+import org.maemo.esbox.core.ESboxException;
+import org.maemo.esbox.core.env.IEnvironmentModifierBlock;
+import org.maemo.esbox.core.machine.IFileSystemAccess;
+import org.maemo.esbox.core.machine.ILocalMachine;
+import org.maemo.esbox.core.machine.IMachine;
+import org.maemo.esbox.core.machine.MachineManager;
+import org.maemo.esbox.core.process.IProcessLauncher;
+import org.maemo.esbox.core.process.IProcessLauncherFactory;
+import org.maemo.esbox.core.process.ProcessLauncherUtils;
+import org.maemo.esbox.core.sdk.IPreferenceProvider;
+import org.maemo.esbox.core.sdk.ISDKTarget;
+import org.maemo.esbox.internal.api.core.machine.HostUnixMachine;
+import org.maemo.esbox.internal.api.core.sdk.BaseSDK;
+import org.maemo.esbox.internal.api.core.sdk.UserAwarePreferenceProviderWrapper;
+import org.maemo.esbox.internal.maemosdk.core.Activator;
+import org.maemo.esbox.internal.maemosdk.core.command.ICommandAbstractor;
+import org.maemo.esbox.internal.maemosdk.core.command.scratchbox.MaemoCommand;
+import org.maemo.esbox.internal.maemosdk.core.command.scratchbox.sbrsh.AddSbrshCommand;
+import org.maemo.esbox.internal.maemosdk.core.command.scratchbox.sbrsh.ConfigureSbrshCommand;
+import org.maemo.esbox.internal.maemosdk.core.command.scratchbox.sbrsh.MountTargetSbrshCommand;
+import org.maemo.esbox.internal.maemosdk.core.command.scratchbox.sbrsh.UnmountTargetSbrshCommand;
+import org.maemo.esbox.internal.maemosdk.core.sdk.IScratchboxSDKPlatformArchitectureProvider;
+import org.maemo.esbox.maemosdk.core.scratchbox.PersistentCache;
+
+public abstract class AbstractScratchboxSDK extends BaseSDK implements IScratchboxSDK, IScratchboxSDKPlatformArchitectureProvider {
+
+	protected IPreferenceProvider prefProvider=null;
+	
+	//cache
+	private static boolean useCaching;
+	private static PersistentCache cache;
+	
+	protected final static List<String> EMPTY_ARGS = new ArrayList<String>();
+	
+	public AbstractScratchboxSDK(IMachine machine, String version, String name)
+	{
+		super(machine, version, name);
+	}
+
+	private String cachedCurrentTarget;
+
+	
+	
+	
+	public String getMainVersion() {
+		String version = getVersion();
+		int dotIndex = version.indexOf('.');
+		return version.substring(0,dotIndex);
+	}
+
+	/* (non-Javadoc)
+	 * @see org.maemo.esbox.core.sdk.ISDK#refresh()
+	 */
+	public void refresh() {
+		cachedCurrentTarget = null;
+	}
+	
+	/* (non-Javadoc)
+	 * @see org.maemo.esbox.core.scratchbox.sdk.IScratchboxSDK#getCachedCurrentTarget()
+	 */
+	public String getCachedCurrentTarget() {
+		// not (too) expensive to re-check, so don't invoke a process
+		if (getMachine() instanceof ILocalMachine)
+			return null;
+		return cachedCurrentTarget;
+	}
+	
+	/* (non-Javadoc)
+	 * @see org.maemo.esbox.core.scratchbox.sdk.IScratchboxSDK#setCachedCurrentTarget(java.lang.String)
+	 */
+	public void setCachedCurrentTarget(String currentTarget) {
+		cachedCurrentTarget = currentTarget;
+	}
+
+	public String getPreferenceValue(String key) {
+		return prefProvider.getPreferenceValue(key);
+	}
+
+	public ICommandAbstractor getCommandAbstractor() throws ESboxException {
+		acquireMachine(this.getMachine());
+		
+		ICommandAbstractor commandAbstractor = new ICommandAbstractor() {
+
+			public String getPreferenceValue(String key) {
+				return AbstractScratchboxSDK.this.getPreferenceValue(key);
+			}
+
+			public IProcessLauncherFactory getProcessLauncherFactory() {
+				return AbstractScratchboxSDK.this.getMachine().getProcessLauncherFactory();
+			}
+			
+			/* (non-Javadoc)
+			 * @see org.maemo.esbox.internal.core.command.ICommandAbstractor#getFileSystemAccess()
+			 */
+			public IFileSystemAccess getFileSystemAccess() {
+				return AbstractScratchboxSDK.this.getMachineFileSystemAccess();
+			}
+		};
+		return commandAbstractor;
+	}
+
+	public IScratchboxSDKTarget getCurrentSDKTarget() throws ESboxException {
+		String targetName = getCurrentTarget();
+		return (IScratchboxSDKTarget) this.findSDKTarget(targetName);
+	}
+
+	public boolean configureSbrsh(String targetName, String targetDeviceAddr,
+			String nfsServerAddr) throws ESboxException {
+		ConfigureSbrshCommand configureSbrshCommand = new ConfigureSbrshCommand(getCommandAbstractor());
+
+		List<String> params = new ArrayList<String>();
+		params.add(targetName);
+		params.add(targetDeviceAddr);
+		params.add(nfsServerAddr);
+
+		return (Boolean) configureSbrshCommand.performCommand(params);
+	}
+
+	public boolean addSbrshAccessList(String targetDeviceAddr, String username,
+			String ipAddr) throws ESboxException {
+		AddSbrshCommand addSbrshCommand = new AddSbrshCommand(getCommandAbstractor());
+
+		List<String> params = new ArrayList<String>();
+
+		params.add(targetDeviceAddr);
+		params.add(username);
+		params.add(ipAddr);
+
+		return (Boolean) addSbrshCommand.performCommand(params);
+	}
+
+	public boolean mountTarget(String targetName) throws ESboxException {
+		MountTargetSbrshCommand mountTargetCommand = new MountTargetSbrshCommand(getCommandAbstractor());
+
+		List<String> params = new ArrayList<String>();
+		params.add(targetName);
+
+		return (Boolean) mountTargetCommand.performCommand(params);
+	}
+
+	public boolean unmountTarget(String targetName) throws ESboxException {
+		UnmountTargetSbrshCommand unmountTargetCommand = new UnmountTargetSbrshCommand(getCommandAbstractor());
+
+		List<String> params = new ArrayList<String>();
+		params.add(targetName);
+
+		return (Boolean) unmountTargetCommand.performCommand(params);
+	}
+
+
+	public static ICommandAbstractor getCommandAbstractor(final ISDKTarget sdkTarget) throws ESboxException {
+		// ensure machine is alive
+		acquireMachine(sdkTarget.getSDK().getMachine());
+		
+		return new ICommandAbstractor() {
+
+			public String getPreferenceValue(String key) {
+				return sdkTarget.getPreferenceValue(key);
+			}
+
+			public IProcessLauncherFactory getProcessLauncherFactory() {
+				return sdkTarget.getProcessLauncherFactory();
+			}
+			
+			/* (non-Javadoc)
+			 * @see org.maemo.esbox.internal.core.command.ICommandAbstractor#getFileSystemAccess()
+			 */
+			public IFileSystemAccess getFileSystemAccess() {
+				return sdkTarget.getTargetFileSystemAccess();
+			}
+		};
+	}
+	
+	/** Get a command abstractor for the host. */
+	public static ICommandAbstractor getHostCommandAbstractor(final IMachine machine) throws ESboxException {
+		// ensure machine is alive
+		acquireMachine(machine);
+
+		return new ICommandAbstractor() {
+
+			public String getPreferenceValue(String key) {
+				return new UserAwarePreferenceProviderWrapper(
+						CorePreferenceManager.getInstance().getPreferenceProvider(),
+						machine).getPreferenceValue(key);
+			}
+
+			public IProcessLauncherFactory getProcessLauncherFactory() {
+				return machine.getProcessLauncherFactory();
+			}
+			
+			/* (non-Javadoc)
+			 * @see org.maemo.esbox.internal.core.command.ICommandAbstractor#getFileSystemAccess()
+			 */
+			public IFileSystemAccess getFileSystemAccess() {
+				return machine.getFileSystemAccess();
+			}
+		};
+	}
+	
+	public static synchronized void clearCachedData() {
+		if (useCaching) {
+			cache.clear();
+		}
+	}
+	
+	public static synchronized void saveCachedData() {
+		if (useCaching) {
+			cache.save();
+		}
+	}
+	
+	/**
+	 * Start maemo.  This runs synchronously.
+	 * 
+	 * @param sdkTarget 
+	 * @return
+	 * @throws ESboxException
+	 */
+	public static synchronized boolean startMaemoCommand(ISDKTarget sdkTarget)
+			throws ESboxException {
+		MaemoCommand maemoCommand = new MaemoCommand(getCommandAbstractor(sdkTarget), sdkTarget);
+		return (Boolean) maemoCommand.startMaemoCommand(sdkTarget);
+	}
+	
+	/**
+	 * Restart maemo.  This runs synchronously.
+	 * 
+	 * @return
+	 * @throws ESboxException
+	 */
+	public static synchronized boolean restartMaemoCommand(ISDKTarget sdkTarget) throws ESboxException {
+		MaemoCommand maemoCommand = new MaemoCommand(getCommandAbstractor(sdkTarget), sdkTarget);
+		return (Boolean) maemoCommand.restartMaemoCommand(sdkTarget);
+	}
+
+	/**
+	 * Stop maemo.  This runs synchronously.
+	 * @return
+	 * @throws ESboxException
+	 */
+	public static synchronized boolean stopMaemoCommand(ISDKTarget sdkTarget) throws ESboxException {
+		MaemoCommand maemoCommand = new MaemoCommand(getCommandAbstractor(sdkTarget), sdkTarget);
+		return (Boolean) maemoCommand.stopMaemoCommand(sdkTarget);
+	}
+	
+	// protected
+	protected static void acquireMachine(final IMachine machine) throws ESboxException {
+		if (!machine.isAlive()) {
+			IStatus status = MachineManager.getInstance().acquireMachine(machine, null);
+			if (!status.isOK()) {
+				ESboxException e = new ESboxException(status.getMessage(), status.getException());
+				Activator.getErrorLogger().logError("Failed to launch machine for scratchbox command",
+						e);
+				throw e;
+			}
+		}
+	}
+	
+	protected static void setCachedValue(String key, Object value) {
+		if (useCaching)
+			cache.set(key, value);
+	}
+	
+	protected static void ensureCurrentMachine(String machineKey, IMachine machine) {
+		String current = (String) getCachedValue(machineKey);
+		if (current != null) {
+			String machineURI = machine.getURI().toString();
+			if (!current.equals(machineURI)) {
+				// just zap
+				clearCachedData();
+			}
+			setCachedValue(machineKey, machineURI);
+		}
+	}
+	
+	protected static Object getCachedValue(String key) {
+		if (useCaching)
+			return cache.get(key);
+		else
+			return null;
+	}
+	
+	/**
+	 * For launching commands on the SDK's machine in order to control the machine, ensure
+	 * we can access the tools for that SDK.
+	 *  
+	 * SB1 is usually installed to contain softlinks into /usr/bin, but the .tar.gz
+	 * installation method doesn't do this.  So be sure to handle sb1 commands which might not be on /usr/bin. 
+	 * @param toolsPath 
+	 * 
+	 */
+	protected static ICommandAbstractor wrapCommandAbstractorForSDK(
+			final ICommandAbstractor commandAbstractor,
+			IMachine machine,
+			final String identifyingTool,
+			final String toolsPath) {
+		if (areToolsOnPath(machine, identifyingTool)) {
+			return commandAbstractor;
+		}
+		
+		return new ICommandAbstractor() {
+
+			public String getPreferenceValue(String key) {
+				return commandAbstractor.getPreferenceValue(key);
+			}
+
+			public IProcessLauncherFactory getProcessLauncherFactory() {
+				final IProcessLauncherFactory launcherFactory = commandAbstractor.getProcessLauncherFactory();
+				IProcessLauncherFactory wrappedLauncherFactory = new IProcessLauncherFactory() {
+
+					public IProcessLauncher createProcessLauncher(
+							IPath workingDirectory,
+							List<String> commandLine,
+							IEnvironmentModifierBlock envBlock) {
+						// fallback for cases where sbox is installed via .tar.gz with no softlinks into /usr/bin.
+						
+						envBlock = ProcessLauncherUtils.addToPATH(
+									new HostUnixMachine(Platform.OS_LINUX), 
+									getRawEnvironment(),
+									envBlock != null ? envBlock : defaultEnvironmentModifierBlock(),
+									toolsPath, 
+									true);
+						
+						return launcherFactory.createProcessLauncher(workingDirectory, commandLine, envBlock);
+					}
+
+					public IEnvironmentModifierBlock defaultEnvironmentModifierBlock() {
+						return launcherFactory.defaultEnvironmentModifierBlock();
+					}
+
+					public Properties getRawEnvironment() {
+						return launcherFactory.getRawEnvironment();
+					}
+					
+				};
+				return wrappedLauncherFactory;
+			}
+			
+			/* (non-Javadoc)
+			 * @see org.maemo.esbox.internal.core.command.ICommandAbstractor#getFileSystemAccess()
+			 */
+			public IFileSystemAccess getFileSystemAccess() {
+				return commandAbstractor.getFileSystemAccess();
+			}
+			
+		};
+	}
+	
+	private static boolean areToolsOnPath(IMachine machine, String identifyingTool) {
+		boolean toolsOnPath = false;
+		Properties env = machine.getStandardEnvironment();
+		String pathVar = env.getProperty("PATH");
+		if (pathVar == null) {
+			toolsOnPath = false;  // assume not!
+		} else {
+			String[] pathEntries = pathVar.split(":");
+			for (String pathEntry : pathEntries) {
+				IPath path = new Path(pathEntry).append(identifyingTool); 
+				IFileInfo info = machine.getFileSystemAccess().getFileStore(path).fetchInfo();
+				if (info.exists()) {
+					toolsOnPath = true;
+					break;
+				}
+			}
+			
+		}
+		return toolsOnPath;
+	}
+}

Added: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/sdk/AbstractScratchboxSDKTarget.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/sdk/AbstractScratchboxSDKTarget.java	                        (rev 0)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/sdk/AbstractScratchboxSDKTarget.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -0,0 +1,49 @@
+package org.maemo.esbox.maemosdk.core.sdk;
+
+import org.eclipse.core.runtime.Platform;
+import org.maemo.esbox.core.ESboxException;
+import org.maemo.esbox.core.machine.IFileSystemAccess;
+import org.maemo.esbox.core.process.IProcessLauncherFactory;
+import org.maemo.esbox.core.sdk.ISDK;
+import org.maemo.esbox.core.sdk.ISDKPlatform;
+import org.maemo.esbox.core.sdk.ISDKTarget;
+import org.maemo.esbox.internal.api.core.sdk.BaseSDKTarget;
+import org.maemo.esbox.internal.maemosdk.core.adapters.MaemoRunStandaloneSupportAdapterFactory;
+import org.maemo.esbox.internal.maemosdk.core.command.ICommandAbstractor;
+
+public abstract class AbstractScratchboxSDKTarget extends BaseSDKTarget implements
+		IScratchboxSDKTarget {
+
+	
+	
+	public AbstractScratchboxSDKTarget(ISDK sdk, ISDKPlatform platform,
+			String architecture, String name) {
+		super(sdk, platform, architecture, name);
+		Platform.getAdapterManager().registerAdapters(new MaemoRunStandaloneSupportAdapterFactory(), ISDKTarget.class);
+	}
+	
+	/** Get a command launcher for an SDK target.  These must be executed
+	 * within the context of scratchbox.  */
+	public ICommandAbstractor getCommandAbstractor() throws ESboxException {
+		// ensure machine is alive
+		AbstractScratchboxSDK.acquireMachine(this.getSDK().getMachine());
+		
+		return new ICommandAbstractor() {
+
+			public String getPreferenceValue(String key) {
+				return AbstractScratchboxSDKTarget.this.getPreferenceValue(key);
+			}
+
+			public IProcessLauncherFactory getProcessLauncherFactory() {
+				return AbstractScratchboxSDKTarget.this.getProcessLauncherFactory();
+			}
+			
+			/* (non-Javadoc)
+			 * @see org.maemo.esbox.internal.core.command.ICommandAbstractor#getFileSystemAccess()
+			 */
+			public IFileSystemAccess getFileSystemAccess() {
+				return AbstractScratchboxSDKTarget.this.getTargetFileSystemAccess();
+			}
+		};
+	}
+}

Deleted: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/sdk/IScratchbox1SDK.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/sdk/IScratchbox1SDK.java	2008-10-07 23:27:03 UTC (rev 840)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/sdk/IScratchbox1SDK.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -1,22 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Nokia Corporation.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *    Ed Swartz (Nokia) - initial API and implementation
- *******************************************************************************/
-package org.maemo.esbox.maemosdk.core.sdk;
-
-
-/**
- * This interface provides scratchbox 1-specific functionality to an ISDK
- * @author eswartz
- *
- */
-public interface IScratchbox1SDK extends IScratchboxSDK {
-	public static final String NAME = "Scratchbox 1"; //$NON-NLS-1$
-
-}

Deleted: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/sdk/IScratchbox1SDKTarget.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/sdk/IScratchbox1SDKTarget.java	2008-10-07 23:27:03 UTC (rev 840)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/sdk/IScratchbox1SDKTarget.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -1,20 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Nokia Corporation.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *    Ed Swartz (Nokia) - initial API and implementation
- *******************************************************************************/
-package org.maemo.esbox.maemosdk.core.sdk;
-
-
-/**
- * This interface provides scratchbox 1-specific functionality to an IScratchboxSDKTarget
- * @author eswartz
- *
- */
-public interface IScratchbox1SDKTarget extends IScratchboxSDKTarget {
-}

Deleted: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/sdk/IScratchbox2SDK.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/sdk/IScratchbox2SDK.java	2008-10-07 23:27:03 UTC (rev 840)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/sdk/IScratchbox2SDK.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Nokia Corporation.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *    Ed Swartz (Nokia) - initial API and implementation
- *******************************************************************************/
-package org.maemo.esbox.maemosdk.core.sdk;
-
-import org.eclipse.core.runtime.IPath;
-
-
-/**
- * This interface provides scratchbox 2-specific functionality to an ISDK
- * @author eswartz
- *
- */
-public interface IScratchbox2SDK extends IScratchboxSDK {
-	public static final String NAME = "Scratchbox 2"; //$NON-NLS-1$
-	
-	/**
-	 * Get the directory where Scratchbox 2 configuration files are located
-	 * (usually $HOME/.scratchbox2)
-	 * @return path
-	 */
-	public IPath getScratchbox2ConfigDirectory();
-}

Deleted: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/sdk/IScratchbox2SDKTarget.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/sdk/IScratchbox2SDKTarget.java	2008-10-07 23:27:03 UTC (rev 840)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/sdk/IScratchbox2SDKTarget.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -1,19 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Nokia Corporation.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *    Ed Swartz (Nokia) - initial API and implementation
- *******************************************************************************/
-package org.maemo.esbox.maemosdk.core.sdk;
-
-/**
- * This interface provides scratchbox 2-specific functionality to an IScratchboxSDKTarget.
- * @author eswartz
- *
- */
-public interface IScratchbox2SDKTarget extends IScratchboxSDKTarget {
-}

Modified: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/sdk/IScratchboxSDK.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/sdk/IScratchboxSDK.java	2008-10-07 23:27:03 UTC (rev 840)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/sdk/IScratchboxSDK.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -13,10 +13,8 @@
 import java.util.List;
 
 import org.maemo.esbox.core.ESboxException;
-import org.maemo.esbox.core.machine.IMachine;
 import org.maemo.esbox.core.sdk.ISDK;
-import org.maemo.esbox.core.sdk.ISDKTarget;
-import org.maemo.esbox.maemosdk.core.command.ICommandAbstractor;
+import org.maemo.esbox.internal.maemosdk.core.command.ICommandAbstractor;
 
 /**
  * This interface provides scratchbox-specific functionality to an ISDK
@@ -80,4 +78,6 @@
 		throws ESboxException;
 
 	public String getMainVersion();
+
+	int getSboxVersion();
 }

Modified: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/sdk/IScratchboxSDKTarget.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/sdk/IScratchboxSDKTarget.java	2008-10-07 23:27:03 UTC (rev 840)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/sdk/IScratchboxSDKTarget.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -11,8 +11,10 @@
 package org.maemo.esbox.maemosdk.core.sdk;
 
 import org.eclipse.core.runtime.IPath;
+import org.maemo.esbox.core.ESboxException;
 import org.maemo.esbox.core.process.IProcessLauncherFactory;
 import org.maemo.esbox.core.sdk.ISDKTarget;
+import org.maemo.esbox.internal.maemosdk.core.command.ICommandAbstractor;
 
 /**
  * This interface provides scratchbox-specific functionality to an ISDKTarget.
@@ -39,4 +41,7 @@
 	IProcessLauncherFactory getProcessLauncherFactoryForInstall();
 	
 
+	String getGdbQemuCommandPattern(String architecture) throws ESboxException;
+
+	ICommandAbstractor getCommandAbstractor() throws ESboxException;
 }

Modified: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/sdk/ScratchboxSDKFacade.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/sdk/ScratchboxSDKFacade.java	2008-10-07 23:27:03 UTC (rev 840)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/sdk/ScratchboxSDKFacade.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -11,10 +11,11 @@
 package org.maemo.esbox.maemosdk.core.sdk;
 
 import java.util.ArrayList;
-import java.util.Arrays;
 import java.util.List;
 
-import org.maemo.esbox.core.sdk.*;
+import org.maemo.esbox.core.sdk.ISDK;
+import org.maemo.esbox.core.sdk.ISDKTarget;
+import org.maemo.esbox.core.sdk.SDKFactory;
 import org.maemo.esbox.maemosdk.core.scratchbox.ScratchboxException;
 
 /**

Modified: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk1/conf/sb1_prefs.xml
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk1/conf/sb1_prefs.xml	2008-10-07 23:27:03 UTC (rev 840)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk1/conf/sb1_prefs.xml	2008-10-08 13:17:48 UTC (rev 841)
@@ -10,7 +10,7 @@
 		WHEN ANYTHING ELSE CHANGED which can be merged into existing prefs, 
 		adjust ESboxPreferenceInitializer#RPEFS_VERSION_MINOR -->
 		
-	<entry key="SB1_LOGIN_COMMAND">/scratchbox/login -d ${RUN_SCRIPT_DIRECTORY} "./run.sh ${{DIRECTORY}} \\\"${{{EXPORTS}}}\\\" \\\"${{{COMMAND}}} ${{{ARGS}}}\\\""</entry>
+	<entry key="SB1_LOGIN_COMMAND">/scratchbox/login -d ${RUN_SCRIPT_DIRECTORY} "./${RUN_SCRIPT} ${{DIRECTORY}} \\\"${{{EXPORTS}}}\\\" \\\"${{{COMMAND}}} ${{{ARGS}}}\\\""</entry>
 	<entry key="SB1_SBOX_COMMAND">sb-conf ${ACTIONS} ${OPTIONS}</entry>	
 
 	<entry key="RUN_SCRIPT_LOC">/scratchbox/users/${USER}/home/${USER}/.esbox/</entry>

Added: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk1/src/org/maemo/esbox/maemosdk/sdk1/command/GetGdbQemuCommandPatternCommand.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk1/src/org/maemo/esbox/maemosdk/sdk1/command/GetGdbQemuCommandPatternCommand.java	                        (rev 0)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk1/src/org/maemo/esbox/maemosdk/sdk1/command/GetGdbQemuCommandPatternCommand.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -0,0 +1,98 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Nokia Corporation
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    Ed Swartz (Nokia) - initial API and implementation
+ *******************************************************************************/
+package org.maemo.esbox.maemosdk.sdk1.command;
+
+import org.eclipse.core.runtime.IStatus;
+import org.maemo.esbox.core.*;
+import org.maemo.esbox.core.sdk.ISDKTarget;
+import org.maemo.esbox.internal.maemosdk.core.Activator;
+import org.maemo.esbox.internal.maemosdk.core.command.ICommandAbstractor;
+import org.maemo.esbox.internal.maemosdk.core.command.scratchbox.AbstractGetGdbQemuCommandPatternCommand;
+import org.maemo.esbox.internal.maemosdk.core.command.scratchbox.ScratchboxCommand;
+import org.maemo.esbox.internal.maemosdk.core.command.scratchbox.ScratchboxInvalidParameterException;
+import org.maemo.esbox.maemosdk.core.*;
+import org.maemo.esbox.maemosdk.core.scratchbox.ScratchboxException;
+import org.maemo.esbox.maemosdk.core.sdk.*;
+import org.maemo.esbox.maemosdk.sdk1.core.ScratchboxSDK1Target;
+import org.osgi.framework.Version;
+
+import java.util.List;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+/**
+ * Get the command pattern for launching qemu with the debugger  
+ * @author eswartz
+ * 
+ */
+public class GetGdbQemuCommandPatternCommand extends AbstractGetGdbQemuCommandPatternCommand<ScratchboxSDK1Target> {
+
+
+	public GetGdbQemuCommandPatternCommand(ScratchboxSDK1Target sdkTarget, ICommandAbstractor commandAbstractor, int sboxVersion) {
+		super(sdkTarget,commandAbstractor, sboxVersion);
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see embedded.core.scratchbox.command.IScratchboxCommand#performCommand(java.lang.Object)
+	 */	
+	public String performCommand(List<String> param)
+			throws ScratchboxException, ESboxException {
+		if (!this.checkParameters(param))
+			throw new ScratchboxInvalidParameterException(
+					"Invalid number of parameters");
+
+		String commandPattern = null;
+
+		String architecture = param.get(0);
+		
+		if (architecture.equals(IScratchboxSDKTarget.ARCHITECTURE_ARMEL))
+		{
+			// scratchbox often misconfigures the softlinks, so explicitly launch the qemu configured for the target
+			String qemu = getConfiguredQemu();
+			if (qemu == null) {
+				// fallback
+				Activator.getErrorLogger().log(IStatus.WARNING, 
+						"Target " + sdkTarget + " does not seem to use qemu, so assuming qemu-arm for debugging", null);
+				qemu = "qemu-arm";
+			}
+			// get the version
+			Version version = null;
+			Pattern versionPattern = Pattern.compile("qemu-.*((\\d+)\\.(\\d+)\\.(\\d+))-.*");
+			Matcher matcher = versionPattern.matcher(qemu);
+			if (matcher.matches()) {
+				version = new Version(matcher.group(1));
+			}
+			
+			// For ARM emulator debug, use "qemu-arm" command.
+			commandPattern = sdkTarget.getPreferenceValue(SB1PreferenceConstants.SB1_GDB_REMOTE_QEMU);
+			
+			if (version != null && version.compareTo(new Version(0, 8, 0)) < 0) {
+				// hide ${PORT}, which doesn't exist in 0.7.x
+				commandPattern = commandPattern.replace("${PORT}", "");
+				//Activator.getErrorLogger().log(IStatus.WARNING, 
+				//		"The version of qemu-arm in use (" + version + ") is too old -- debugging may not work.  Check your softlinks in /scratchbox/devkits/cputransp/bin/.", null);
+			}
+			
+			commandPattern = commandPattern.replace("${QEMU}", qemu);
+				
+			
+		}
+		else {
+			// The others, just standard "gdbserver" command.
+			commandPattern = sdkTarget.getPreferenceValue(MaemoPreferenceConstants.SBOX_GDB_REMOTE);
+		}
+		
+		return commandPattern;
+	}
+
+}

Added: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk1/src/org/maemo/esbox/maemosdk/sdk1/command/ListSessionsCommand.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk1/src/org/maemo/esbox/maemosdk/sdk1/command/ListSessionsCommand.java	                        (rev 0)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk1/src/org/maemo/esbox/maemosdk/sdk1/command/ListSessionsCommand.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -0,0 +1,81 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2008 INdT, (c) 2008 Nokia Corporation
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    Raul Herbster (UFCG) - initial API and implementation
+ *    Ed Swartz (Nokia)
+ *******************************************************************************/
+package org.maemo.esbox.maemosdk.sdk1.command;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.maemo.esbox.core.ESboxException;
+import org.maemo.esbox.internal.maemosdk.core.command.ICommandAbstractor;
+import org.maemo.esbox.internal.maemosdk.core.command.scratchbox.ScratchboxCommand;
+import org.maemo.esbox.internal.maemosdk.core.command.scratchbox.ScratchboxInvalidParameterException;
+import org.maemo.esbox.maemosdk.core.SB1PreferenceConstants;
+import org.maemo.esbox.maemosdk.core.scratchbox.ScratchboxException;
+
+/**
+ * List the current Scratchbox sessions.
+ * This command wraps the callback to service sb-conf list --sessions
+ * 
+ */
+public class ListSessionsCommand extends ScratchboxCommand {
+
+	public ListSessionsCommand(ICommandAbstractor commandAbstractor) {
+		super(commandAbstractor, 1);
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see embedded.core.scratchbox.command.IScratchboxCommand#performCommand(java.lang.Object)
+	 */	
+	public List<String> performCommand(List<String> param)
+			throws ScratchboxException, ESboxException {
+		if (!this.checkParameters(param))
+			throw new ScratchboxInvalidParameterException(
+					"Invalid number of parameters");
+
+		String listAction = commandAbstractor.getPreferenceValue(
+				SB1PreferenceConstants.SB1_LIST_ACT);
+		String sessionsOption = commandAbstractor.getPreferenceValue(
+				SB1PreferenceConstants.SB1_LIST_OPT_SESSIONS);
+		String listSessionsCommandString = this.replaceScratchboxConfigCommand(
+				listAction, new String[] { sessionsOption });
+
+		Process process = createProcess(listSessionsCommandString, null);
+
+		List<String> sessionLines = getLineInputFromProcessAndWait(process, true, 0);
+		
+		List<String> sessionsAvailable = new ArrayList<String>();
+		
+		// remove prefix text
+		for (String line : sessionLines) {
+			int idx = line.indexOf(':');
+			if (idx >= 0) {
+				String[] pids = line.substring(idx+1).split("\\s+");
+				for (String pid : pids) {
+					pid = pid.trim();
+					if (pid.length() > 0)
+						sessionsAvailable.add(pid);
+				}
+			}
+		}
+		
+
+		return sessionsAvailable;
+	}
+
+	@Override
+	public int getParametersSize() {
+		return 0;
+	}
+
+}

Modified: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk1/src/org/maemo/esbox/maemosdk/sdk1/core/IScratchboxSDK1.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk1/src/org/maemo/esbox/maemosdk/sdk1/core/IScratchboxSDK1.java	2008-10-07 23:27:03 UTC (rev 840)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk1/src/org/maemo/esbox/maemosdk/sdk1/core/IScratchboxSDK1.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -3,7 +3,6 @@
 import java.util.List;
 
 import org.maemo.esbox.core.ESboxException;
-import org.maemo.esbox.maemosdk.core.sdk.IScratchbox1SDK;
 
 public interface IScratchboxSDK1 {
 	public static final String NAME = "Scratchbox 1"; //$NON-NLS-1$

Added: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk1/src/org/maemo/esbox/maemosdk/sdk1/core/Scratchbox1FileSystemMapping.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk1/src/org/maemo/esbox/maemosdk/sdk1/core/Scratchbox1FileSystemMapping.java	                        (rev 0)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk1/src/org/maemo/esbox/maemosdk/sdk1/core/Scratchbox1FileSystemMapping.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -0,0 +1,66 @@
+/**
+ * (c) 2008 Nokia
+ */
+package org.maemo.esbox.maemosdk.sdk1.core;
+
+import java.util.List;
+
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.maemo.esbox.internal.api.core.machine.FileSystemMapping;
+
+import com.nokia.cpp.internal.api.utils.core.Pair;
+
+/**
+ * Represent the mappings from the machine to a Scratchbox 1 target running on the machine.
+ * This represents the direct mappings with all softlinks resolved (so, not "/scratchbox/users/user/usr"
+ * but "/scratchbox/users/user/targets/CHINOOK_ARMEL/usr") 
+ * @author eswartz
+ *
+ */
+public class Scratchbox1FileSystemMapping extends FileSystemMapping {
+
+	/**
+	 * Construct with default Linux path canonicalizers and add mappings for paths
+	 * known to be mapped.
+	 * @param targetRoot 
+	 * @param target
+	 */
+	public Scratchbox1FileSystemMapping(IPath scratchboxBase, String target, String user) {
+		
+		super(FileSystemMapping.getMachineCanonicalizer(true), FileSystemMapping.getMachineCanonicalizer(true));
+		
+		List<Pair<IPath, IPath>> mappings = getHostToTargetRootMappings();
+		mappings.clear();
+		
+		// directories that are the same for all targets
+		String[] topLevelDirs = {	
+				"dev", "home", "host_usr", "proc", "scratchbox", "sys", "targets"
+		};
+		
+		IPath sharedBase = scratchboxBase;
+		map(mappings, sharedBase, new Path("/"));
+		for (String topLevelDir : topLevelDirs) {
+			map(mappings, sharedBase.append(topLevelDir), new Path(topLevelDir).makeAbsolute());
+		}
+		
+		// directories that depend on the current target
+		String[] topLevelLinks = { 
+				"bin", "boot", "cdrom", "etc", "floppy", "initrd",
+				"lib", "media", "mnt", "opt", "root", "sbin", "srv", "usr", "var"
+		};
+		
+		IPath perTargetBase = scratchboxBase.append("targets").append(target);
+		for (String topLevelDir : topLevelLinks) {
+			map(mappings, perTargetBase.append(topLevelDir), new Path(topLevelDir).makeAbsolute());
+		}
+
+		setHostToTargetRootMappings(mappings);
+	}
+
+	private void map(List<Pair<IPath, IPath>> mappings, IPath from, IPath to) {
+		mappings.add(new Pair<IPath, IPath>(from, to));
+	}
+
+	
+}

Modified: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk1/src/org/maemo/esbox/maemosdk/sdk1/core/ScratchboxSDK1.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk1/src/org/maemo/esbox/maemosdk/sdk1/core/ScratchboxSDK1.java	2008-10-07 23:27:03 UTC (rev 840)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk1/src/org/maemo/esbox/maemosdk/sdk1/core/ScratchboxSDK1.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -3,20 +3,17 @@
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
-import java.util.Properties;
 
 import org.eclipse.core.runtime.IPath;
 import org.eclipse.core.runtime.Path;
 import org.maemo.esbox.core.ESboxException;
-import org.maemo.esbox.core.machine.IFileSystemAccess;
 import org.maemo.esbox.core.machine.IMachine;
-import org.maemo.esbox.core.process.IProcessLauncher;
-import org.maemo.esbox.core.process.IProcessLauncherFactory;
 import org.maemo.esbox.core.sdk.IPreferenceProvider;
 import org.maemo.esbox.core.sdk.ISDKPlatform;
 import org.maemo.esbox.core.sdk.ISDKTarget;
 import org.maemo.esbox.internal.api.core.sdk.BaseSDKPlatform;
 import org.maemo.esbox.internal.maemosdk.core.command.ICommand;
+import org.maemo.esbox.internal.maemosdk.core.command.ICommandAbstractor;
 import org.maemo.esbox.internal.maemosdk.core.command.scratchbox.CreateTargetCommand;
 import org.maemo.esbox.internal.maemosdk.core.command.scratchbox.GetCurrentTargetCommand;
 import org.maemo.esbox.internal.maemosdk.core.command.scratchbox.GetVersionScratchboxCommand;
@@ -24,13 +21,12 @@
 import org.maemo.esbox.internal.maemosdk.core.command.scratchbox.ListCompilersCommand;
 import org.maemo.esbox.internal.maemosdk.core.command.scratchbox.ListCputranspCommand;
 import org.maemo.esbox.internal.maemosdk.core.command.scratchbox.ListDevkitsCommand;
+import org.maemo.esbox.internal.maemosdk.core.command.scratchbox.ListTargetsCommand;
 import org.maemo.esbox.internal.maemosdk.core.command.scratchbox.RemoveTargetCommand;
 import org.maemo.esbox.internal.maemosdk.core.command.scratchbox.SelectTargetCommand;
 import org.maemo.esbox.maemosdk.core.MaemoSDKEngine;
 import org.maemo.esbox.maemosdk.core.MaemoSDKInfo;
 import org.maemo.esbox.maemosdk.core.SB1PreferenceConstants;
-import org.maemo.esbox.maemosdk.core.command.ICommandAbstractor;
-import org.maemo.esbox.maemosdk.core.command.ListTargetsCommand;
 import org.maemo.esbox.maemosdk.core.sdk.AbstractScratchboxSDK;
 import org.maemo.esbox.maemosdk.core.sdk.IScratchboxSDKTarget;
 import org.maemo.esbox.maemosdk.sdk1.Activator;
@@ -55,9 +51,11 @@
 //		this.platformArchitectureProvider = platformArchitectureProvider;
 	}
 	
+	@Override
+	public int getSboxVersion() {
+		return SB_VERSION;
+	}
 
-
-
 	@Override
 	public void refresh() {
 		super.refresh();
@@ -84,7 +82,7 @@
 
 	@Override
 	public ICommandAbstractor getCommandAbstractor() throws ESboxException {
-		return getSb1WrappedCommandAbstractor(super.getCommandAbstractor());
+		return getSb1WrappedAbstractor(super.getCommandAbstractor(),this.getMachine());
 	}
 
 	@Override
@@ -126,7 +124,7 @@
 		// do the hard work
 		acquireMachine(machine);
 		ICommandAbstractor commandAbstractor = getHostCommandAbstractor(machine);
-		commandAbstractor = getSb1WrappedCommandAbstractor(commandAbstractor);
+		commandAbstractor = getSb1WrappedAbstractor(commandAbstractor,machine);
 		GetVersionScratchboxCommand getVersionCommand = new GetVersionScratchboxCommand(
 				commandAbstractor, SB_VERSION);
 	
@@ -279,57 +277,22 @@
 
 
 
-	//private
-	/** SB1 is usually installed to contain softlinks into /usr/bin, but the .tar.gz
-	 * installation method doesn't do this.  So be sure to handle sb1 commands which might not be on /usr/bin. */
-	private static ICommandAbstractor getSb1WrappedCommandAbstractor(final ICommandAbstractor commandAbstractor) {
-		return new ICommandAbstractor() {
-
-			public String getPreferenceValue(String key) {
-				return commandAbstractor.getPreferenceValue(key);
-			}
-
-			public IProcessLauncherFactory getProcessLauncherFactory() {
-				final IProcessLauncherFactory launcherFactory = commandAbstractor.getProcessLauncherFactory();
-				IProcessLauncherFactory wrappedLauncherFactory = new IProcessLauncherFactory() {
-
-					public IProcessLauncher createProcessLaunchHandler(
-							IPath workingDirectory,
-							List<String> commandLine,
-							Properties environment) {
-						if (environment == null) {
-							environment = getStandardEnvironment();
-						}
-						
-						// fallback for cases where sbox is installed via .tar.gz with no softlinks into /usr/bin
-						String path = environment.getProperty("PATH");
-						if (path == null)
-							path = ":/usr/bin:/bin";
-						else if (!path.startsWith(":"))
-							path = ":" + path;
-						path = "/scratchbox/tools/bin" + path;
-						environment.put("PATH", path);
-						
-						return launcherFactory.createProcessLaunchHandler(workingDirectory, commandLine, environment);
-					}
-
-					public Properties getStandardEnvironment() {
-						return launcherFactory.getStandardEnvironment();
-					}
-					
-				};
-				return wrappedLauncherFactory;
-			}
-			
-			/* (non-Javadoc)
-			 * @see org.maemo.esbox.internal.core.command.ICommandAbstractor#getFileSystemAccess()
-			 */
-			public IFileSystemAccess getFileSystemAccess() {
-				return commandAbstractor.getFileSystemAccess();
-			}
-			
-		};
+	/**
+	 * Get a command abstractor that updates the PATH if sb1 tools are not on the path.
+	 * @param commandAbstractor
+	 * @param machine
+	 * @return 
+	 */
+	private static ICommandAbstractor getSb1WrappedAbstractor(ICommandAbstractor commandAbstractor,
+			IMachine machine) {
+		// XXX: the default path should be provided some other way
+		return wrapCommandAbstractorForSDK(
+				commandAbstractor,
+				machine, 
+				"sb-conf",
+				"/scratchbox/tools/bin");
 	}
+			
 	
 	
 	

Modified: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk1/src/org/maemo/esbox/maemosdk/sdk1/core/ScratchboxSDK1Target.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk1/src/org/maemo/esbox/maemosdk/sdk1/core/ScratchboxSDK1Target.java	2008-10-07 23:27:03 UTC (rev 840)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk1/src/org/maemo/esbox/maemosdk/sdk1/core/ScratchboxSDK1Target.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -1,10 +1,16 @@
 package org.maemo.esbox.maemosdk.sdk1.core;
 
+import java.util.ArrayList;
+import java.util.List;
+
 import org.eclipse.core.runtime.IPath;
 import org.maemo.esbox.core.CorePreferenceConstants;
+import org.maemo.esbox.core.ESboxException;
 import org.maemo.esbox.core.process.IProcessLauncherFactory;
 import org.maemo.esbox.core.sdk.ISDKPlatform;
 import org.maemo.esbox.maemosdk.core.sdk.AbstractScratchboxSDKTarget;
+import org.maemo.esbox.maemosdk.core.sdk.IScratchboxSDK;
+import org.maemo.esbox.maemosdk.sdk1.command.GetGdbQemuCommandPatternCommand;
 import org.maemo.esbox.maemosdk.sdk1.launcher.Scratchbox1ProcessLauncherFactory;
 
 public class ScratchboxSDK1Target extends AbstractScratchboxSDKTarget {
@@ -40,5 +46,15 @@
 	public IPath getSDKTargetRoot() {
 		return targetRoot;
 	}
+	
+	public synchronized String getGdbQemuCommandPattern(String architecture) throws ESboxException {
+		IScratchboxSDK sdk = (IScratchboxSDK)this.getSDK();
+		GetGdbQemuCommandPatternCommand command = new GetGdbQemuCommandPatternCommand(this,
+				this.getCommandAbstractor(),
+				sdk.getSboxVersion());
+		List<String> arguments = new ArrayList<String>(1);
+		arguments.add(architecture);
+		return command.performCommand(arguments);
+	}
 
 }

Added: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk1/src/org/maemo/esbox/maemosdk/sdk1/launcher/Scratchbox1EnvironmentProvider.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk1/src/org/maemo/esbox/maemosdk/sdk1/launcher/Scratchbox1EnvironmentProvider.java	                        (rev 0)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk1/src/org/maemo/esbox/maemosdk/sdk1/launcher/Scratchbox1EnvironmentProvider.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -0,0 +1,79 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Nokia Corporation
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    Ed Swartz (Nokia) - initial API and implementation
+ *******************************************************************************/
+
+package org.maemo.esbox.maemosdk.sdk1.launcher;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Properties;
+
+import org.maemo.esbox.core.ESboxException;
+import org.maemo.esbox.core.process.CommandLineArguments;
+import org.maemo.esbox.core.process.EnvironmentProperties;
+import org.maemo.esbox.core.process.ProcessLauncherUtils;
+import org.maemo.esbox.core.process.ProcessLauncherUtils.Results;
+import org.maemo.esbox.core.sdk.ISDKTarget;
+import org.maemo.esbox.internal.api.core.IStandardEnvironmentProvider;
+import org.maemo.esbox.internal.maemosdk.core.Activator;
+
+/**
+ * The standard environment provider for scratchbox caches the environment once
+ * per SDK target.
+ * @author eswartz
+ *
+ */
+public class Scratchbox1EnvironmentProvider implements
+		IStandardEnvironmentProvider {
+	public static Map<ISDKTarget, Properties> cachedStdEnvMap = new HashMap<ISDKTarget, Properties>();
+	private final ISDKTarget sdkTarget;
+	
+
+	/**
+	 * @param sdkTarget
+	 */
+	public Scratchbox1EnvironmentProvider(ISDKTarget sdkTarget) {
+		this.sdkTarget = sdkTarget;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.maemo.esbox.internal.api.core.IStandardEnvironmentProvider#getRawEnvironment()
+	 */
+	public Properties getRawEnvironment() {
+		Properties standardEnv = cachedStdEnvMap.get(sdkTarget);
+		if (standardEnv == null) {
+			// gather arguments by querying a typical shell launched in POSIX mode (sh instead of bash)
+			Scratchbox1ProcessLauncher launcher = new Scratchbox1ProcessLauncher(
+					sdkTarget, null, 
+					CommandLineArguments.createFromVarArgs("sh", "-c", "set"),
+					null);
+			
+			try {
+				Results results = ProcessLauncherUtils.launchAndReadStandardStreams(launcher, null);
+				standardEnv = EnvironmentProperties.createFromShellEnvDump(results.stdout);
+			} catch (ESboxException e) {
+				Activator.getErrorLogger().logError("Failed to read scratchbox environment; using system environment", e);
+				standardEnv = sdkTarget.getSDK().getMachine().getStandardEnvironment();
+			}
+			
+			cachedStdEnvMap.put(sdkTarget, standardEnv);
+		}
+		return standardEnv;
+	}
+	
+	
+	/* (non-Javadoc)
+	 * @see org.maemo.esbox.internal.api.core.IStandardEnvironmentProvider#flushRawEnvironment()
+	 */
+	public void flushRawEnvironment() {
+		cachedStdEnvMap.remove(sdkTarget);
+	}
+
+}

Added: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk1/src/org/maemo/esbox/maemosdk/sdk1/launcher/Scratchbox1ProcessLauncher.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk1/src/org/maemo/esbox/maemosdk/sdk1/launcher/Scratchbox1ProcessLauncher.java	                        (rev 0)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk1/src/org/maemo/esbox/maemosdk/sdk1/launcher/Scratchbox1ProcessLauncher.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -0,0 +1,213 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Nokia Corporation.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    Ed Swartz (Nokia) - initial API and implementation
+ *******************************************************************************/
+package org.maemo.esbox.maemosdk.sdk1.launcher;
+
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.filesystem.EFS;
+import org.eclipse.core.filesystem.IFileStore;
+import org.eclipse.core.filesystem.provider.FileInfo;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.maemo.esbox.core.ESboxException;
+import org.maemo.esbox.core.Policy;
+import org.maemo.esbox.core.env.IEnvironmentModifierBlock;
+import org.maemo.esbox.core.env.IEnvironmentOperation;
+import org.maemo.esbox.core.process.BaseProcessLauncher;
+import org.maemo.esbox.core.process.CommandLineArguments;
+import org.maemo.esbox.core.process.IProcessLauncher;
+import org.maemo.esbox.core.process.ShellTemplateSubstitutor;
+import org.maemo.esbox.core.sdk.ISDKTarget;
+import org.maemo.esbox.internal.maemosdk.core.Activator;
+import org.maemo.esbox.maemosdk.core.SB1PreferenceConstants;
+import org.maemo.esbox.maemosdk.core.scratchbox.ScratchboxException;
+
+/**
+ * For SB 1, we need to use a "run.sh" wrapper script.  The
+ * login program does not conserve variables set outside
+ * unless "-k" is passed, but we don't want to use that anyway,
+ * in order to have a clean SB environment.
+ * @author eswartz
+ *
+ */
+public class Scratchbox1ProcessLauncher extends BaseProcessLauncher implements
+		IProcessLauncher {
+
+	/**
+	 * The name of a file copied from the plugin to the sb environment and
+	 * used to ensure environment variables can be passed.  
+	 */
+	private static final String RUN_SCRIPT_NAME = "run.sh";
+	
+	private ISDKTarget sdkTarget;
+	private List<String> originalArguments;
+
+	public Scratchbox1ProcessLauncher(
+			ISDKTarget sdkTarget, 
+			IPath workingDirectory,
+			List<String> cmdLine, IEnvironmentModifierBlock environmentModifierBlock) {
+		// in SB 1, the working directory, executable, args, and environment
+		// are encoded in a single command to a wrapper script
+		super(encodeArgumentArray(sdkTarget, workingDirectory, 
+						cmdLine,
+						environmentModifierBlock), 
+				null,
+				null);
+		if (sdkTarget == null)
+			throw new IllegalArgumentException();
+		this.sdkTarget = sdkTarget;
+		this.originalArguments = cmdLine;
+	}
+	
+	/* (non-Javadoc)
+	 * @see org.maemo.esbox.internal.core.BaseProcessLauncher#getLaunchInfoPrefix()
+	 */
+	@Override
+	protected String getLaunchInfoPrefix() {
+		return sdkTarget + " ";
+	}
+	
+	@Override
+	public String getCommandLineString() {
+		return CommandLineArguments.toCommandLine(originalArguments);
+	}
+	
+	private static List<String> encodeArgumentArray(ISDKTarget sdkTarget, 
+			IPath workingDirectory,  
+			List<String> cmdLine,
+			IEnvironmentModifierBlock environmentModifierBlock) {
+				
+		// get the location where the launcher script will be copied on the target
+		String runScriptLocation = sdkTarget.getPreferenceValue(SB1PreferenceConstants.RUN_SCRIPT_LOC);
+	
+		// encode working directory inside scratchbox
+		if (workingDirectory == null) {
+			workingDirectory = new Path("/");
+		}
+		
+		List<String> envArgs = encodeEnvironmentModifier(environmentModifierBlock);
+		
+		// Encode the launch command by replacing the arguments
+		// representing template arguments with the actual values.
+		//
+		ShellTemplateSubstitutor substitutor = new ShellTemplateSubstitutor();
+		
+		substitutor.define("RUN_SCRIPT_DIRECTORY", runScriptLocation);
+		substitutor.define("RUN_SCRIPT", RUN_SCRIPT_NAME);
+		substitutor.define("DIRECTORY", workingDirectory.toPortableString());
+		
+		String exportsString = CommandLineArguments.toString(envArgs, ",", false); //$NON-NLS-1$
+
+		substitutor.define("EXPORTS", exportsString); 
+		substitutor.define("COMMAND", cmdLine.get(0));
+		substitutor.define("ARGS", CommandLineArguments.toCommandLine(cmdLine.subList(1, cmdLine.size())));
+
+		// get the Scratchbox invocation pattern
+		String commandPattern = sdkTarget.getPreferenceValue(SB1PreferenceConstants.SB1_LOGIN_COMMAND);
+
+		// replace variables
+		commandPattern = substitutor.substitute(commandPattern);
+		
+		List<String> commandArgs = CommandLineArguments.createFromCommandLine(commandPattern);
+		return commandArgs;
+	}
+
+
+	/**
+	 * Encode the add/replace and delete operations to run.sh
+	 * @param environmentModifierBlock
+	 * @return list of modifier flags
+	 */
+	private static List<String> encodeEnvironmentModifier(
+			IEnvironmentModifierBlock environmentModifierBlock) {
+		List<String> mods = new ArrayList<String>();
+		if (environmentModifierBlock != null) {
+			for (IEnvironmentOperation operation : environmentModifierBlock.getOperations()) {
+				if (operation.getValue() == null)
+					mods.add("-" + operation.getName());
+				else
+					mods.add(operation.getName() + "=" + operation.getValue());
+			}
+		}
+		if (mods.isEmpty()) {
+			mods.add("-");		// must have something for the argument to be detected by run.sh
+		}
+		return mods;
+	}
+
+	/* A flag is the best way to do this -- see below */
+	private static boolean copiedRunScript;
+	
+	@Override
+	protected void setupForLaunch() throws ESboxException {
+		// First, be sure we're running under the current target
+		ScratchboxTargetSwitcher.ensureCurrentTarget(sdkTarget);
+
+		// Ensure the run script is available.
+		//
+		// It's a little fishy to check the timestamps, since the timestamp of the
+		// script from the plugin may be extracted from a JAR and always look newer!
+		// So, just be cautious and set it up once per Eclipse session.
+		// 
+		// We don't want to waste time checking contents or being "smart" since this
+		// will just slow things down.
+		
+		if (!copiedRunScript) {
+			IFileStore runScriptLocation = sdkTarget.getMachineFileSystemAccess().getFileStore(new Path(
+					sdkTarget.getPreferenceValue(SB1PreferenceConstants.RUN_SCRIPT_LOC)));
+			IFileStore runScript = runScriptLocation.getChild(RUN_SCRIPT_NAME);
+			
+			try {
+				runScriptLocation.mkdir(EFS.NONE, null);
+				
+				OutputStream os = null;
+				InputStream is = null;
+				try {
+					os = runScript.openOutputStream(EFS.OVERWRITE, null);
+					is = Activator.getPluginRelativeInputStream("./conf/" + RUN_SCRIPT_NAME);
+					byte[] content = new byte[8192];
+					int len;
+					while ((len = is.read(content)) > 0) {
+						os.write(content, 0, len);
+					}
+				} finally {
+					Policy.close(os);
+					Policy.close(is);
+				}
+				
+				FileInfo info = new FileInfo();
+				info.setAttribute(EFS.ATTRIBUTE_EXECUTABLE, true);
+				runScript.putInfo(info, EFS.NONE, null);
+				
+				copiedRunScript = true;
+				
+			} catch (Exception e) {
+				throw (ScratchboxException) new ScratchboxException("Cannot copy run script to " + runScript).initCause(e);
+			}
+		}
+	}
+	
+
+	/* (non-Javadoc)
+	 * @see org.maemo.esbox.internal.core.BaseProcessLauncher#doCreateProcess()
+	 */
+	@Override
+	protected Process doCreateProcess() throws Exception {
+		return sdkTarget.getSDK().getMachine().createProcess(
+				getLaunchCurrentWorkingDirectory(), getLaunchCommandArguments(), 
+				getLaunchEnvironmentModifierBlock(), isUsePTY());
+	}
+	
+
+}

Added: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk1/src/org/maemo/esbox/maemosdk/sdk1/launcher/Scratchbox1ProcessLauncherFactory.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk1/src/org/maemo/esbox/maemosdk/sdk1/launcher/Scratchbox1ProcessLauncherFactory.java	                        (rev 0)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk1/src/org/maemo/esbox/maemosdk/sdk1/launcher/Scratchbox1ProcessLauncherFactory.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -0,0 +1,54 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Nokia Corporation.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    Ed Swartz (Nokia) - initial API and implementation
+ *******************************************************************************/
+package org.maemo.esbox.maemosdk.sdk1.launcher;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.runtime.IPath;
+import org.maemo.esbox.core.env.IEnvironmentModifierBlock;
+import org.maemo.esbox.core.process.IProcessLauncher;
+import org.maemo.esbox.core.sdk.ISDKTarget;
+import org.maemo.esbox.internal.api.core.BaseProcessLauncherFactory;
+
+/**
+ * @author eswartz
+ *
+ */
+public class Scratchbox1ProcessLauncherFactory extends
+		BaseProcessLauncherFactory {
+
+	protected ISDKTarget sdkTarget;
+	private final boolean runAsRoot;
+
+	public Scratchbox1ProcessLauncherFactory(ISDKTarget sdkTarget, boolean runAsRoot) {
+		super(new Scratchbox1EnvironmentProvider(sdkTarget), false);
+		this.sdkTarget = sdkTarget;
+		this.runAsRoot = runAsRoot;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.maemo.esbox.core.IProcessLauncherFactory#createProcessLauncher(org.eclipse.core.runtime.IPath, org.eclipse.core.runtime.IPath, org.maemo.esbox.core.List<String>, java.util.Properties)
+	 */
+	protected IProcessLauncher doCreateProcessLauncher(
+			IPath workingDirectory, List<String> cmdLine,
+			IEnvironmentModifierBlock envBlock) {
+
+		if (runAsRoot) {
+			cmdLine = new ArrayList<String>(cmdLine);
+			cmdLine.add(0, "fakeroot");
+		}
+		return new Scratchbox1ProcessLauncher(
+				sdkTarget,
+				workingDirectory, cmdLine,
+				envBlock); 
+	}
+}

Added: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk1/src/org/maemo/esbox/maemosdk/sdk1/launcher/ScratchboxTargetSwitcher.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk1/src/org/maemo/esbox/maemosdk/sdk1/launcher/ScratchboxTargetSwitcher.java	                        (rev 0)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk1/src/org/maemo/esbox/maemosdk/sdk1/launcher/ScratchboxTargetSwitcher.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -0,0 +1,163 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Nokia Corporation.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    Ed Swartz (Nokia) - initial API and implementation
+ *******************************************************************************/
+package org.maemo.esbox.maemosdk.sdk1.launcher;
+
+import java.text.MessageFormat;
+import java.util.List;
+
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.swt.widgets.Display;
+import org.maemo.esbox.core.ESboxException;
+import org.maemo.esbox.core.GeneralUtils;
+import org.maemo.esbox.core.process.CommandLineArguments;
+import org.maemo.esbox.core.process.IProcessLauncher;
+import org.maemo.esbox.core.process.ProcessLauncherCreator;
+import org.maemo.esbox.core.sdk.ISDKTarget;
+import org.maemo.esbox.internal.maemosdk.core.Activator;
+import org.maemo.esbox.maemosdk.core.scratchbox.ESboxScriptLauncher;
+import org.maemo.esbox.maemosdk.core.scratchbox.ScratchboxException;
+import org.maemo.esbox.maemosdk.sdk1.core.ScratchboxSDK1;
+import org.maemo.esbox.maemosdk.sdk1.core.ScratchboxSDK1Target;
+
+/**
+ * Utility class to handle switching scratchbox targets and 
+ * get user approval to kill existing sessions if needed.
+ * @author eswartz
+ *
+ */
+public abstract class ScratchboxTargetSwitcher {
+
+	/**
+	 * Ensure the current SDK target can host the given target, asking 
+	 * user for approval to terminate existing sessions if they are running.  
+	 * @param target an SDK target (SB1 or anything else)
+	 * @throws ESboxException if target could not be switched
+	 */
+	public static void ensureCurrentTarget(ISDKTarget target) throws ESboxException {
+		// only scratchbox 1 cares about "current targets"
+		if (!(target instanceof ScratchboxSDK1Target)) {
+			return;
+		}
+		
+		ScratchboxSDK1 sdk = ((ScratchboxSDK1) target.getSDK());
+		final String currentTarget = sdk.getCurrentTarget();
+		final String targetName = target.getName();
+		if (currentTarget.equals(targetName)) {
+			return;
+		}
+		
+		// see if maemo is running, since it needs to be killed to switch targets
+		// but isn't considered a "session" every time
+		boolean isMaemoRunning = ESboxScriptLauncher.getInstance().isMaemoStarted(target);
+		
+		// now try to switch and see if shells are open
+		boolean failedToSwitch = false;
+		try {
+			sdk.selectTarget(targetName);
+		} catch (final ScratchboxException e) {
+			// sb-conf: You must close your other Scratchbox sessions first
+			// or 
+			// Note: Couldn't reselect the target. There are other Scratchbox sessions open.
+			if (e.getLocalizedMessage().contains("Scratchbox sessions")) {
+				failedToSwitch = true;
+			} else {
+				throw e;
+			}
+		}
+		
+		if (isMaemoRunning || failedToSwitch) {
+			final boolean[] ret = {false};
+			
+			if (!GeneralUtils.isJUnitRunning()) {
+				Display.getDefault().syncExec(new Runnable() {
+					public void run() {
+						ret[0] = MessageDialog.openQuestion(
+								null, 
+								"Scratchbox Target Conflict",
+								MessageFormat.format(
+										"The scratchbox 1 target needs to be switched from ''{0}'' to ''{1}'', but existing sessions are active.\n\n"+
+										"Kill existing Scratchbox sessions?  (You may manually close them first, if desired, then select 'No' to retry)",
+										currentTarget, targetName));
+					};
+				});
+			} else {
+				ret[0] = true;
+			}
+			
+			// if user accepts, kill existing ones
+			if (ret[0]) {
+				if (isMaemoRunning) {
+					// a target selection may succeed even if X and maemo are running... kill them first.
+					// We kill X too because some processes won't be killed by maemo-launcher.
+					try {
+						ESboxScriptLauncher.getInstance().killMaemo(target);
+					} catch (ESboxException e2) {
+						// ignore
+					}
+					try {
+						ESboxScriptLauncher.getInstance().stopX(target);
+					} catch (ESboxException e2) {
+						// ignore
+					}
+				}
+				
+				// now kill the scratchbox sessions the "approved" way
+				try {
+					sdk.killProcess();
+					
+					// wait politely
+					try {
+						Thread.sleep(1000);
+					} catch (InterruptedException e1) {
+						
+					}
+					
+				} catch (ScratchboxException e2) {
+					// sb-conf killall can fail in the event there is some process with a space in its
+					// name... just log it and keep going
+					Activator.getErrorLogger().logError("Problem killing scratchbox sessions", e2);
+				}
+				
+				// double-check, since it doesn't really work!
+				List<String> sessions = sdk.getSessions();
+				if (sessions.size() > 0) {
+					// forcibly kill processes
+					List<String> cmdLine = CommandLineArguments.createFromVarArgs(
+							"kill", "-9");
+					cmdLine.addAll(sessions);
+					
+					IProcessLauncher processLauncher = ProcessLauncherCreator.createProcessLauncher(
+							sdk.getMachineProcessLauncherFactory(), null, cmdLine);
+					Process process;
+					try {
+						process = processLauncher.createProcess();
+						process.waitFor();
+					} catch (final Exception e1) {
+						Display.getDefault().syncExec(new Runnable() {
+							public void run() {
+								MessageDialog.openError(
+										null, 
+										"Scratchbox Target Conflict",
+										MessageFormat.format(
+												"Couldn''t kill scratchbox processes:\n\n{0}\n\nRetrying the target selection anyway.",
+												e1.getLocalizedMessage()));
+							};
+						});
+					}
+				}
+				
+			}
+			
+			// always retry, and rethrow if fails
+			sdk.selectTarget(targetName);
+		}
+	}
+}

Added: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk1/src/org/maemo/esbox/maemosdk/sdk1/ui/adapters/MaemoSDKInstallTargetAdapterFactory.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk1/src/org/maemo/esbox/maemosdk/sdk1/ui/adapters/MaemoSDKInstallTargetAdapterFactory.java	                        (rev 0)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk1/src/org/maemo/esbox/maemosdk/sdk1/ui/adapters/MaemoSDKInstallTargetAdapterFactory.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -0,0 +1,44 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Nokia Corporation
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    Ed Swartz (Nokia) - initial API and implementation
+ *******************************************************************************/
+
+package org.maemo.esbox.maemosdk.sdk1.ui.adapters;
+
+import org.eclipse.core.runtime.IAdapterFactory;
+import org.maemo.esbox.core.adapters.ISDKManageTargetAdapter;
+import org.maemo.esbox.maemosdk.sdk1.core.ScratchboxSDK1;
+
+/**
+ * @author eswartz
+ *
+ */
+public class MaemoSDKInstallTargetAdapterFactory implements IAdapterFactory {
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.core.runtime.IAdapterFactory#getAdapter(java.lang.Object, java.lang.Class)
+	 */
+	public Object getAdapter(Object adaptableObject, Class adapterType) {
+		if (adapterType.equals(ISDKManageTargetAdapter.class)) {
+			if (adaptableObject instanceof ScratchboxSDK1) {
+				return new MaemoScratchbox1SDKManageTargetAdapter((ScratchboxSDK1) adaptableObject);
+			}
+		}
+		return null;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.core.runtime.IAdapterFactory#getAdapterList()
+	 */
+	public Class[] getAdapterList() {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+}

Added: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk1/src/org/maemo/esbox/maemosdk/sdk1/ui/adapters/MaemoScratchbox1SDKManageTargetAdapter.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk1/src/org/maemo/esbox/maemosdk/sdk1/ui/adapters/MaemoScratchbox1SDKManageTargetAdapter.java	                        (rev 0)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk1/src/org/maemo/esbox/maemosdk/sdk1/ui/adapters/MaemoScratchbox1SDKManageTargetAdapter.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -0,0 +1,69 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Nokia Corporation
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    Ed Swartz (Nokia) - initial API and implementation
+ *******************************************************************************/
+
+package org.maemo.esbox.maemosdk.sdk1.ui.adapters;
+
+import java.util.List;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.swt.widgets.Shell;
+import org.maemo.esbox.core.Policy;
+import org.maemo.esbox.core.adapters.ISDKManageTargetAdapter;
+import org.maemo.esbox.core.sdk.ISDKTarget;
+import org.maemo.esbox.internal.maemosdk.ui.adapters.MaemoScratchboxSDKManageTargetAdapterBase;
+import org.maemo.esbox.maemosdk.sdk1.Activator;
+import org.maemo.esbox.maemosdk.sdk1.core.ScratchboxSDK1;
+import org.maemo.esbox.maemosdk.sdk1.ui.wizard.NewScratchbox1TargetWizard;
+
+/**
+ * @author eswartz
+ *
+ */
+public class MaemoScratchbox1SDKManageTargetAdapter extends MaemoScratchboxSDKManageTargetAdapterBase 
+	implements ISDKManageTargetAdapter {
+
+	private ScratchboxSDK1 sdk;
+
+	/**
+	 * @param adaptableObject
+	 */
+	public MaemoScratchbox1SDKManageTargetAdapter(ScratchboxSDK1 sdk) {
+		this.sdk = sdk;
+	}
+	
+	/* (non-Javadoc)
+	 * @see org.maemo.esbox.core.adapters.ISDKManageTargetAdapter#installSDKTargets(org.eclipse.swt.widgets.Shell, java.util.List)
+	 */
+	public IStatus installSDKTargets(Shell shell, List<ISDKTarget> installed) {
+		NewScratchbox1TargetWizard targetWizard;
+		
+		targetWizard = new NewScratchbox1TargetWizard(sdk);
+		WizardDialog dlg = new WizardDialog(
+				shell,
+				targetWizard);
+		if (dlg.open() == Dialog.OK) {
+			return Status.OK_STATUS;
+		}
+
+		return Policy.getCancelStatus(Activator.getDefault());
+	}
+
+	@Override
+	public IStatus removeSDKTarget(Shell shell, ISDKTarget selectedTarget) {
+		
+		return null;
+	}
+	
+
+}

Added: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk1/src/org/maemo/esbox/maemosdk/sdk1/ui/preferences/Scratchbox1PreferencesPage.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk1/src/org/maemo/esbox/maemosdk/sdk1/ui/preferences/Scratchbox1PreferencesPage.java	                        (rev 0)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk1/src/org/maemo/esbox/maemosdk/sdk1/ui/preferences/Scratchbox1PreferencesPage.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -0,0 +1,166 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2008 INdT.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    Paulo Romulo (UFCG) - initial API and implementation
+ *******************************************************************************/
+
+package org.maemo.esbox.maemosdk.sdk1.ui.preferences;
+
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.jface.preference.*;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPreferencePage;
+import org.maemo.esbox.core.machine.ILocalMachine;
+
+import org.maemo.esbox.core.sdk.SDKFactory;
+import org.maemo.esbox.maemosdk.core.SB1PreferenceConstants;
+import org.maemo.esbox.maemosdk.core.scratchbox.ScratchboxException;
+import org.maemo.esbox.maemosdk.core.sdk.IScratchboxSDK;
+import org.maemo.esbox.maemosdk.core.sdk.ScratchboxSDKFacade;
+import org.maemo.esbox.maemosdk.sdk1.core.ScratchboxSDK1;
+
+/**
+ * General preference page for scratchbox 1
+ * 
+ * @author romulo
+ */
+public class Scratchbox1PreferencesPage extends FieldEditorPreferencePage implements
+	IWorkbenchPreferencePage {
+
+	/**
+	 * Field for sandbox root
+	 */
+	private DirectoryFieldEditor feSandboxRoot = null;
+	private StringFieldEditor feSandboxRootStr = null;
+
+	/**
+	 * Field for run scratchbox commands
+	 */
+	private StringFieldEditor feSboxCommands = null;
+	protected boolean sdksChanged;
+	private String origSandboxRoot;
+
+	//private StringFieldEditor feGdbQemuCommand;	
+	
+	/**
+	 * The constructor
+	 */
+	public Scratchbox1PreferencesPage() {
+		super(GRID);
+		setPreferenceStore(SB1PreferenceConstants.getPreferenceStore());
+		setDescription("Options configuring scratchbox 1");
+		origSandboxRoot = getPreferenceStore().getString(SB1PreferenceConstants.SB1_SBOX_SANDBOX.toString());
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.eclipse.jface.preference.FieldEditorPreferencePage#createFieldEditors()
+	 */
+	public void createFieldEditors() {		
+		IScratchboxSDK sdk = null;
+		try {
+			sdk = ScratchboxSDKFacade.getInstance().getScratchboxSDK(ScratchboxSDK1.class).get(0);
+		} catch (ScratchboxException e) {
+		}
+		if (false && sdk != null && sdk.getMachine() instanceof ILocalMachine) {
+			feSandboxRoot = new DirectoryFieldEditor(
+					SB1PreferenceConstants.SB1_SBOX_SANDBOX.toString(), 
+					"Sandbox root directory:", 
+					getFieldEditorParent());
+			addField(feSandboxRoot);
+			feSandboxRoot.getTextControl(getFieldEditorParent()).addModifyListener(new ModifyListener() {
+
+				public void modifyText(ModifyEvent e) {
+					sdksChanged = true;
+				}
+				
+			});
+		}
+		else {
+			feSandboxRootStr = new StringFieldEditor(
+					SB1PreferenceConstants.SB1_SBOX_SANDBOX.toString(), 
+					"Sandbox root directory:", 
+					getFieldEditorParent());
+			addField(feSandboxRootStr);
+			feSandboxRootStr.getTextControl(getFieldEditorParent()).addModifyListener(new ModifyListener() {
+
+				public void modifyText(ModifyEvent e) {
+					sdksChanged = true;
+				}
+				
+			});
+		}
+
+		feSboxCommands = new StringFieldEditor(
+				SB1PreferenceConstants.SB1_LOGIN_COMMAND.toString(),
+				"Command template:", 
+				getFieldEditorParent());		
+
+		feSboxCommands.getTextControl(getFieldEditorParent()).setToolTipText(
+				"This setting should only be changed if you have very specific needs, like an alternate run script.");
+
+		/*
+		feGdbQemuCommand = new StringFieldEditor(
+				ESboxPreferenceConstants.SB1_GDB_REMOTE_QEMU.toString(),
+				"GDB QEMU command template:", 
+				getFieldEditorParent());		
+		
+		feGdbQemuCommand.getTextControl(getFieldEditorParent()).setToolTipText(
+				"This setting should only be changed if your version of qemu differs from the expected (0.8.2).");
+		*/
+		
+		// make this string manageable
+		int width;
+		GC gc = new GC(getFieldEditorParent().getShell()); 
+		width = gc.getAdvanceWidth('m') * 32;
+		gc.dispose();
+		
+		GridData gridData = new GridData(SWT.FILL, SWT.CENTER, true, false);
+		gridData.widthHint = width;
+		feSboxCommands.getTextControl(getFieldEditorParent()).setLayoutData(gridData);
+
+		/*
+		gridData = new GridData(SWT.FILL, SWT.CENTER, true, false);
+		gridData.widthHint = width;
+		feGdbQemuCommand.getTextControl(getFieldEditorParent()).setLayoutData(gridData);
+		 */
+		
+		addField(feSboxCommands);
+		
+		//addField(feGdbQemuCommand);
+	}	
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
+	 */
+	public void init(IWorkbench workbench) {
+		// Nothing to do
+	}
+	
+	@Override
+	public boolean performOk() {
+		boolean ret = super.performOk();
+		if (ret) {
+			if (sdksChanged) {
+				String curSandboxRoot = getPreferenceStore().getString(SB1PreferenceConstants.SB1_SBOX_SANDBOX.toString());
+				if (!curSandboxRoot.equals(origSandboxRoot)) {
+					SDKFactory.getInstance().refresh(new NullProgressMonitor());
+					origSandboxRoot = curSandboxRoot;
+				}
+			}
+		}
+		return ret;
+	}
+	
+}

Added: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk1/src/org/maemo/esbox/maemosdk/sdk1/ui/wizard/NewScratchbox1TargetWizard.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk1/src/org/maemo/esbox/maemosdk/sdk1/ui/wizard/NewScratchbox1TargetWizard.java	                        (rev 0)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk1/src/org/maemo/esbox/maemosdk/sdk1/ui/wizard/NewScratchbox1TargetWizard.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -0,0 +1,292 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2008 INdT, (c) 2008 Nokia Corporation
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    Raul Herbster (UFCG) - initial API and implementation
+ *    Carolina Nogueira de Souza (UFCG) - initial API and implementation
+ *    Ed Swartz (Nokia)
+ *******************************************************************************/
+package org.maemo.esbox.maemosdk.sdk1.ui.wizard;
+
+import java.net.InetAddress;
+import java.net.UnknownHostException;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.wizard.IWizardPage;
+import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.swt.widgets.TableItem;
+import org.eclipse.ui.INewWizard;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchWizard;
+import org.maemo.esbox.core.ESboxException;
+import org.maemo.esbox.core.ErrorLogger;
+import org.maemo.esbox.core.sdk.ISDKTarget;
+import org.maemo.esbox.maemosdk.sdk1.Activator;
+import org.maemo.esbox.maemosdk.sdk1.core.ScratchboxSDK1;
+import org.maemo.esbox.maemosdk.ui.targets.wizards.TargetWizardCPUMethod;
+import org.maemo.esbox.maemosdk.ui.targets.wizards.TargetWizardCompilerPage;
+import org.maemo.esbox.maemosdk.sdk1.ui.wizard.TargetWizardDevkitsPage;
+import org.maemo.esbox.maemosdk.ui.targets.wizards.TargetWizardNamePage;
+import org.maemo.esbox.maemosdk.ui.targets.wizards.TargetWizardPageFactory;
+import org.maemo.esbox.maemosdk.ui.targets.wizards.sbrsh.SbrshConfigurationNFSServer;
+import org.maemo.esbox.maemosdk.ui.targets.wizards.sbrsh.SbrshConfigurationTargetDevice;
+
+
+/**
+ * The target wizard provides a easy way to create a target
+ * for Scratchbox. As Scratchbox target configuration, the user
+ * can configure your target.
+ * 
+ */
+public class NewScratchbox1TargetWizard extends Wizard implements INewWizard {
+
+	protected WizardPage targetNamePage;	
+	protected WizardPage compilerNamePage;	
+	protected WizardPage devkitsName;	
+	protected WizardPage cpuMethodName;	
+	protected WizardPage sbrshConfigTargetDevice;	
+	protected WizardPage sbrshConfigNFSServer;	
+    protected IProject generatedProject;
+
+	private ScratchboxSDK1 sdk;
+
+	protected ISDKTarget createdTarget;
+
+	private void initialize() {
+		setNeedsProgressMonitor(true);
+		setWindowTitle("New Scratchbox 1 Target");
+		ImageDescriptor image = Activator.getImageDescriptor("./icons/full/wizban/newtarget_wiz.gif");		
+		setDefaultPageImageDescriptor(image);	
+		initPages();
+	}
+  
+	/**
+	 * Constructs a new target wizard for the given SDK (from the target configuration page)
+	 * @param sdk 
+	 */
+	public NewScratchbox1TargetWizard(ScratchboxSDK1 sdk) {
+		super();
+		this.sdk = sdk;
+		initialize();
+	}
+	
+	/**
+	 * Inicializes the content of the pages.
+	 */
+	private void initPages() {
+		if (sdk != null) {
+			targetNamePage = TargetWizardPageFactory.getInstance().createNamePage(sdk);		
+			addPage(targetNamePage);
+			compilerNamePage = TargetWizardPageFactory.getInstance().createCompilerPage(sdk);	
+			addPage(compilerNamePage);
+			devkitsName = new TargetWizardDevkitsPage(sdk);
+			addPage(devkitsName);
+			cpuMethodName = TargetWizardPageFactory.getInstance().createCPUMethod(sdk);
+			addPage(cpuMethodName);		
+			sbrshConfigTargetDevice = TargetWizardPageFactory.getInstance().createSbrshConfigDeviceTargetPage();
+			addPage(sbrshConfigTargetDevice);
+			sbrshConfigNFSServer = TargetWizardPageFactory.getInstance().createSbrshConfigNFSSServer();
+			addPage(sbrshConfigNFSServer);
+		} else {
+			addPage(TargetWizardPageFactory.getInstance().createBadInstallationPage());
+		}
+	}
+	
+	public boolean canFinish() {
+		if (sdk == null)
+			return false;
+		
+		boolean nonCustomRootstrap = true;
+		boolean cpuPage = ((TargetWizardCPUMethod) cpuMethodName).canFinish();
+		boolean configDevice = ((SbrshConfigurationTargetDevice) sbrshConfigTargetDevice).canFinish();
+		boolean NFSServer = ((SbrshConfigurationNFSServer) sbrshConfigNFSServer).canFinish();
+		boolean sbrshConfigAccepted = ((TargetWizardCPUMethod) cpuMethodName).getSbrshConfigure();
+		
+		if (!sbrshConfigAccepted && (nonCustomRootstrap || cpuPage) )
+			return true;
+		if (sbrshConfigAccepted && NFSServer && configDevice)			 
+			return true;
+		 
+		return false;
+	}
+	
+	@Override
+	public IWizardPage getNextPage(IWizardPage page) {
+		if(page == cpuMethodName) {			
+			boolean sbrshConfigAccepted = ((TargetWizardCPUMethod) cpuMethodName).getSbrshConfigure();
+			if(!sbrshConfigAccepted)  // user does not want to configure sbrsh
+				return null;
+			else  // user wants to configure sbrsh					
+				return super.getNextPage(page);
+		}
+		return super.getNextPage(page);        
+	}
+	
+	
+	
+	/*
+	 *  (non-Javadoc)
+	 * @see org.eclipse.jface.wizard.IWizard#performFinish()
+	 */
+	public boolean performFinish() {	
+		if (!setupTargetFromScratch())
+			return false;
+		
+		boolean sbrshConfigSelected = ((TargetWizardCPUMethod) cpuMethodName).getSbrshConfigure();
+		if (sbrshConfigSelected) {			
+			configureSbrshService();		
+			showsDialog();	
+		}				
+		
+		return true;
+	}
+
+	private boolean setupTargetFromScratch() {
+		String targetName;
+		// in this mode, construct a target from the user's settings
+		targetName = getTargetNameSelected();		
+		String compilerName = getCompilerNameSelected();
+		String cpuMethod = getCputranspSelected();	
+		try {
+			
+			String devkits = getDevkitsSelected();		
+//			ScratchboxFacade.getInstance().createTarget((IScratchbox1SDK) sdk, targetName, compilerName, devkits, cpuMethod);
+			sdk.createTarget(targetName, compilerName, devkits, cpuMethod);
+			
+			createdTarget = sdk.findSDKTarget(targetName);
+			return true;
+		} catch (ESboxException e) {
+			ErrorLogger errorLogger = Activator.getErrorLogger();
+			errorLogger.logAndShowError("Cannot get create target " + targetName, e);			
+			return false;
+		}
+	}
+
+	/**
+	 * Return the name of the target to be created.
+	 * @return the name of the target to be created.
+	 */
+	private String getTargetNameSelected() {
+		return ((TargetWizardNamePage) targetNamePage).getTextControl().getText();
+	}
+	
+	/**
+	 * Return the compiler name of the target to be created.
+	 * @return the compiler name of the target to be created.
+	 */
+	private String getCompilerNameSelected() {
+		TableItem item = ((TargetWizardCompilerPage) compilerNamePage).getTableControl().getSelection()[0];
+		return item.getText();
+	}
+	
+	/**
+	 * Return the devkits selected.
+	 * @return the devkits selected.
+	 */
+	private String getDevkitsSelected() {
+		String devkits = "";
+		TableItem devkitsSelected[] = ((TargetWizardDevkitsPage) devkitsName).table
+		.getSelection();
+		String separator = "";
+		for (int i = 0; i < devkitsSelected.length; i++) {
+			TableItem devkit = devkitsSelected[i];
+			devkits += separator + devkit.getText();
+			separator = ":";
+		}	
+		return devkits;
+	}	
+	
+	/**
+	 * Return the cputransp name of the target to be created.
+	 * @return the cputransp name of the target to be created.
+	 */
+	private String getCputranspSelected() {
+		TableItem item = ((TargetWizardCPUMethod) cpuMethodName).getTable().getSelection()[0];
+		return item.getText();
+	}
+	
+	/**
+	 * Configure sbrsh service.
+	 */
+	private void configureSbrshService() {
+		String targetName = getTargetNameSelected();
+		String deviceTargetAddr = ((SbrshConfigurationTargetDevice)sbrshConfigTargetDevice).getTargetDeviceAddr();
+		String nfsHostname = ((SbrshConfigurationNFSServer)sbrshConfigNFSServer).getNFSHostname();
+		
+		try {
+//			ScratchboxFacade.getInstance().configureSbrsh(sdk, targetName, deviceTargetAddr, nfsHostname);
+			sdk.configureSbrsh(targetName, deviceTargetAddr, nfsHostname);
+		} catch (ESboxException e) {
+			ErrorLogger errorLogger = Activator.getErrorLogger();
+			errorLogger.logAndShowError("Cannot configure sbrsh", e);			
+		}
+	}	
+		
+	
+	/**
+	 * Add user at access list of the sbrshd running at the target device.
+	 */
+	private void addUser() {	
+		String deviceTargetIP = ((SbrshConfigurationTargetDevice)sbrshConfigTargetDevice).getTargetDeviceIP();
+		String username = System.getProperty("user.name");	
+		ErrorLogger errorLogger = Activator.getErrorLogger();
+		
+		try {
+			String localAddr = getLocalIP();
+//			ScratchboxFacade.getInstance().addSbrshAccessList(sdk, deviceTargetIP, username, localAddr);
+			sdk.addSbrshAccessList(deviceTargetIP, username, localAddr);
+		} catch (ESboxException e) {
+			errorLogger.logAndShowError("Cannot add user to the access list of sbrshd at the target device", e);			
+		} catch (UnknownHostException e) {
+			errorLogger.logAndShowError("Cannot get local IP address", e);			
+		}
+	}
+	
+	/**
+	 * Shows the dialog to ask the user if s/he wants to add his/herself to the acess list of the 
+	 * sbrshd.
+	 */
+	private void showsDialog() {				
+		String deviceTargetAddr = ((SbrshConfigurationTargetDevice)sbrshConfigTargetDevice).getTargetDeviceIP();
+		String text = "Do you want to add yourself to the access list of the sbrshd running on target device? \n";
+		text += "(This requires that "+ deviceTargetAddr +" has ssh daemon running and sbrshd already installed, and that you have root access).";
+		boolean userAddedAtAccessList = MessageDialog.openQuestion(getShell(),"Scratchbox Configuration",text);		
+		if(userAddedAtAccessList) {
+			addUser();			
+		}
+	}
+	
+	/**
+	 * Get the local IP address.
+	 * @return the local IP address.
+	 * @throws UnknownHostException
+	 */
+	private String getLocalIP() throws UnknownHostException {
+		return InetAddress.getLocalHost().getHostAddress();
+	}
+
+	/**
+	 * We will accept the selection in the workbench to see if
+	 * we can initialize from it.
+	 * @see IWorkbenchWizard#init(IWorkbench, IStructuredSelection)
+	 */
+	public void init(IWorkbench workbench, IStructuredSelection selection) {
+	}
+
+	/**
+	 * Get the target created.  Only valid after wizard dialog completes.
+	 * @return newly created ISDKTarget or <code>null</code>
+	 */
+	public ISDKTarget getCreatedTarget() {
+		return createdTarget;
+	}
+	
+}
\ No newline at end of file

Added: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk1/src/org/maemo/esbox/maemosdk/sdk1/ui/wizard/TargetWizardDevkitsPage.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk1/src/org/maemo/esbox/maemosdk/sdk1/ui/wizard/TargetWizardDevkitsPage.java	                        (rev 0)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk1/src/org/maemo/esbox/maemosdk/sdk1/ui/wizard/TargetWizardDevkitsPage.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -0,0 +1,140 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2008 INdT, (c) 2008 Nokia Corporation
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    Raul Herbster (UFCG) - initial API and implementation
+ *    Carolina Nogueira de Souza (UFCG) - initial API and implementation
+ *    Ed Swartz (Nokia)
+ *******************************************************************************/
+
+package org.maemo.esbox.maemosdk.sdk1.ui.wizard;
+
+import java.util.List;
+
+import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableItem;
+import org.maemo.esbox.core.ESboxException;
+import org.maemo.esbox.core.ErrorLogger;
+import org.maemo.esbox.maemosdk.sdk1.Activator;
+import org.maemo.esbox.maemosdk.sdk1.core.ScratchboxSDK1;
+import org.maemo.esbox.maemosdk.ui.targets.wizards.IValidatePage;
+
+/**
+ * This pages shows the devkits that the user can choose for his/her
+ * target. 
+ * 
+ */
+public class TargetWizardDevkitsPage extends WizardPage implements IValidatePage {
+
+	protected Table table;
+	private ScratchboxSDK1 sdk;
+	
+	/**
+	 * Constructs a NewTargetWizardDevkitsPage.
+	 */
+	protected TargetWizardDevkitsPage(ScratchboxSDK1 sdk) {		
+		super("Devkit");
+		this.sdk = sdk;
+		setTitle("Devkit");
+		setDescription("Select devkits");
+		setPageComplete(false);
+	}
+	
+	/*
+	 *  (non-Javadoc)
+	 * @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite)
+	 */
+	public void createControl(Composite parent) {
+		Composite composite = new Composite(parent, SWT.NONE);
+		composite.setLayout(new GridLayout(1, false));
+			
+		Label label = new Label(composite,SWT.LEFT);
+		label.setText("Devkits"); 
+		
+		table = new Table(composite,SWT.MULTI | SWT.CHECK | SWT.BORDER);
+		table.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, true));
+		table.setHeaderVisible(false);
+		table.setLinesVisible(true);
+		table.addSelectionListener(new SelectionAdapter() {
+			public void widgetSelected(SelectionEvent event) {
+				validatePage();
+			}
+		});		
+		
+		inicializeTable();
+		
+		setControl(composite);
+	}
+
+	/**
+	 * Inicializes the contents of the table.
+	 */
+	private void inicializeTable() {
+		TableItem item = null;
+		List<String> devkits = null;
+		try {
+//			devkits = ScratchboxFacade.getInstance().getDevkits(sdk);
+			devkits = sdk.getDevkits();
+		} catch (ESboxException e) {			
+			ErrorLogger errorLogger = Activator.getErrorLogger();
+			errorLogger.logAndShowError("Cannot get list of devkits", e);
+			return;
+		}		
+		for (String devkit : devkits) {
+			item = new TableItem(table, SWT.NONE);			
+			item.setText(devkit);
+		}		
+	}
+	
+	/*
+	 *  (non-Javadoc)
+	 * @see br.edu.ufcg.dee.omapsdk.properties.target.wizard.pages.ValidateWizardPage#perfomeAction()
+	 */
+	public boolean validatePage() {
+		TableItem[] items = table.getItems();
+		boolean noneSelected = false;
+		boolean pageOK = false;
+		//verifies if at least one option was checked.
+		for (int i = 0; i < items.length; i++) {
+			TableItem item = items[i];
+			if(item.getChecked()) {
+				pageOK = true;
+				break;
+			}
+		}
+		//verifies if the options were choosen properly.
+		for (int i = 0; i < items.length; i++) {
+			TableItem item = items[i];
+			//verifies if any item was selected.
+			if(item.getChecked()) {
+				//verifies if "none" was selected.
+				if(item.getText().equals("none")) {
+					noneSelected = true;
+				//the user cant select another devkit if "none" was selected.
+				} else {
+					pageOK = !noneSelected;					
+				}
+			}			
+		}		
+		if(noneSelected && !pageOK) {
+			setErrorMessage("Selected corrects devkits.");
+		} else {
+			String msg = pageOK ? null : "Select at least one option";
+			setErrorMessage(msg);
+		}
+		setPageComplete(pageOK);
+		return pageOK;
+	}
+}
\ No newline at end of file

Modified: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk2/META-INF/MANIFEST.MF
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk2/META-INF/MANIFEST.MF	2008-10-07 23:27:03 UTC (rev 840)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk2/META-INF/MANIFEST.MF	2008-10-08 13:17:48 UTC (rev 841)
@@ -6,9 +6,12 @@
 Bundle-Activator: org.maemo.esbox.maemosdk.sdk2.Activator
 Require-Bundle: org.eclipse.core.runtime,
  org.maemo.esbox.maemosdk.core;bundle-version="1.5.0",
- org.eclipse.ui.ide;bundle-version="3.4.1"
+ org.eclipse.ui.ide;bundle-version="3.4.1",
+ org.maemo.esbox.maemosdk.ui;bundle-version="1.5.0"
 Bundle-ActivationPolicy: lazy
 Bundle-RequiredExecutionEnvironment: JavaSE-1.6
 Export-Package: org.maemo.esbox.maemosdk.sdk2.command,
  org.maemo.esbox.maemosdk.sdk2.core,
- org.maemo.esbox.maemosdk.sdk2.provider
+ org.maemo.esbox.maemosdk.sdk2.launcher,
+ org.maemo.esbox.maemosdk.sdk2.provider,
+ org.maemo.esbox.maemosdk.sdk2.ui.preferences

Added: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk2/conf/sb2_prefs.xml
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk2/conf/sb2_prefs.xml	                        (rev 0)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk2/conf/sb2_prefs.xml	2008-10-08 13:17:48 UTC (rev 841)
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
+
+<properties>
+	<comment>This file contains the default settings for Scratchbox 2 preferences; 
+	see the org.maemo.esbox.core.preference_set_provider extension</comment>
+
+	<!-- WHEN ANY DEFAULTS CHANGED warranting rewriting prefs, 
+		bump pref version in esbox_common.xml and adjust ESboxPreferenceInitializer#RPEFS_VERSION_MAJOR ;
+		WHEN ANYTHING ELSE CHANGED which can be merged into existing prefs, 
+		adjust ESboxPreferenceInitializer#RPEFS_VERSION_MINOR -->
+
+	<entry key="SB2_MAPPING_MODE">maemo</entry>
+	<entry key="SB2_INSTALL_MAPPING_MODE">emulate</entry>
+	<entry key="SB2_LOG_LEVEL"></entry>
+	
+	<entry key="SB2_EXEC_COMMAND">sb2 -Qx -m ${MAPPING_MODE} ${LOG_OPTION} -t ${TARGET} "${{COMMAND}} ${{ARGS}}"</entry>
+
+	<!-- this qemu-arm link is expected to be valid; we don't try to substitute unlike for sb1: see GetGdbQemuCommandPatternCommand -->
+	<entry key="SB2_GDB_REMOTE_QEMU">sb2-qemu-arm -g ${PORT}</entry>
+	
+	<!-- The hash-bang in these scripts don't properly launch bash! -->
+	<entry key="SB2_INIT_COMMAND">/bin/bash -c "sb2-init ${{OPTIONS}} ${{TARGET}} ${{COMPILER}}"</entry>	
+	<entry key="SB2_CONFIG_COMMAND">/bin/bash -c "sb2-config ${{ACTIONS}} ${{OPTIONS}}"</entry>	
+	<entry key="SB2_MAEMO_ROOTSTRAP_COMMAND">/bin/bash -c "maemo-rootstrap ${{OPTIONS}}"</entry>	
+	<entry key="SB2_SB2_SHOW_COMMAND">sb2-show</entry>	
+	
+	<!-- actions of command sb2-config -->	
+	
+	<entry key="SB2_VERSION_ACT">-v</entry>
+	<entry key="SB2_LIST_ACT">-l</entry>
+	
+	<!-- actions of command maemo-rootstrap -->	
+	<entry key="SB2_MAEMO_ROOTSTRAP_HOST_TOOLS_OPT">--host-tools</entry>	
+	<entry key="SB2_MAEMO_ROOTSTRAP_FORCE_OPT">--force</entry>	
+	<entry key="SB2_MAEMO_ROOTSTRAP_AVAILABLE_ACT">available</entry>
+	<entry key="SB2_MAEMO_ROOTSTRAP_LIST_ACT">list</entry>
+	<entry key="SB2_MAEMO_ROOTSTRAP_INSTALL_ACT">install</entry>
+	<entry key="SB2_MAEMO_ROOTSTRAP_REMOVE_ACT">remove</entry>
+	<entry key="SB2_MAEMO_ROOTSTRAP_PATH_ACT">path</entry>
+	
+	<!-- actions of command sb2-show -->	
+	<entry key="SB2_SB2_SHOW_PATH_ACTION">path</entry>	
+	<entry key="SB2_SB2_SHOW_PATH_OUTPUT_PATTERN">(.+)\s+=>\s+(\S+).*</entry>	
+	
+</properties>

Modified: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk2/plugin.xml
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk2/plugin.xml	2008-10-07 23:27:03 UTC (rev 840)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk2/plugin.xml	2008-10-08 13:17:48 UTC (rev 841)
@@ -16,5 +16,15 @@
             name="Scratchbox 2">
       </page>
    </extension>
+   <extension
+         point="org.eclipse.core.runtime.adapters">
+      <factory
+            adaptableType="org.maemo.esbox.core.sdk.ISDK"
+            class="org.maemo.esbox.maemosdk.sdk2.ui.adapters.MaemoSDKInstallTargetAdapterFactory">
+         <adapter
+               type="org.maemo.esbox.core.adapters.ISDKManageTargetAdapter">
+         </adapter>
+      </factory>
+   </extension>
 
 </plugin>

Modified: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk2/src/org/maemo/esbox/maemosdk/sdk2/Activator.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk2/src/org/maemo/esbox/maemosdk/sdk2/Activator.java	2008-10-07 23:27:03 UTC (rev 840)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk2/src/org/maemo/esbox/maemosdk/sdk2/Activator.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -1,6 +1,8 @@
 package org.maemo.esbox.maemosdk.sdk2;
 
 import org.eclipse.core.runtime.Plugin;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
 import org.maemo.esbox.core.ErrorLogger;
 import org.osgi.framework.BundleContext;
 
@@ -69,4 +71,15 @@
 
 		return new CoreErrorLogger();
 	}
+
+	/**
+	 * Returns an image descriptor for the image file at the given
+	 * plug-in relative path.
+	 *
+	 * @param path the path
+	 * @return the image descriptor
+	 */
+	public static ImageDescriptor getImageDescriptor(String path) {
+		return AbstractUIPlugin.imageDescriptorFromPlugin(PLUGIN_ID, path);
+	}
 }

Added: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk2/src/org/maemo/esbox/maemosdk/sdk2/command/GetGdbQemuCommandPatternCommand.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk2/src/org/maemo/esbox/maemosdk/sdk2/command/GetGdbQemuCommandPatternCommand.java	                        (rev 0)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk2/src/org/maemo/esbox/maemosdk/sdk2/command/GetGdbQemuCommandPatternCommand.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -0,0 +1,70 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Nokia Corporation
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    Ed Swartz (Nokia) - initial API and implementation
+ *******************************************************************************/
+package org.maemo.esbox.maemosdk.sdk2.command;
+
+import org.eclipse.core.runtime.IStatus;
+import org.maemo.esbox.core.*;
+import org.maemo.esbox.core.sdk.ISDKTarget;
+import org.maemo.esbox.internal.maemosdk.core.Activator;
+import org.maemo.esbox.internal.maemosdk.core.command.ICommandAbstractor;
+import org.maemo.esbox.internal.maemosdk.core.command.scratchbox.AbstractGetGdbQemuCommandPatternCommand;
+import org.maemo.esbox.internal.maemosdk.core.command.scratchbox.ScratchboxCommand;
+import org.maemo.esbox.internal.maemosdk.core.command.scratchbox.ScratchboxInvalidParameterException;
+import org.maemo.esbox.maemosdk.core.*;
+import org.maemo.esbox.maemosdk.core.scratchbox.ScratchboxException;
+import org.maemo.esbox.maemosdk.core.sdk.*;
+import org.maemo.esbox.maemosdk.sdk2.core.ScratchboxSDK2Target;
+import org.osgi.framework.Version;
+
+import java.util.List;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+/**
+ * Get the command pattern for launching qemu with the debugger  
+ * @author eswartz
+ * 
+ */
+public class GetGdbQemuCommandPatternCommand extends AbstractGetGdbQemuCommandPatternCommand<ScratchboxSDK2Target> {
+
+	public GetGdbQemuCommandPatternCommand(ScratchboxSDK2Target sdkTarget, ICommandAbstractor commandAbstractor, int sboxVersion) {
+		super(sdkTarget,commandAbstractor, sboxVersion);
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see embedded.core.scratchbox.command.IScratchboxCommand#performCommand(java.lang.Object)
+	 */	
+	public String performCommand(List<String> param)
+			throws ScratchboxException, ESboxException {
+		if (!this.checkParameters(param))
+			throw new ScratchboxInvalidParameterException(
+					"Invalid number of parameters");
+
+		String commandPattern = null;
+
+		String architecture = param.get(0);
+		
+		if (architecture.equals(IScratchboxSDKTarget.ARCHITECTURE_ARMEL))
+		{
+			// we think this always uses a new enough version, so keep ${PORT}
+			commandPattern = sdkTarget.getPreferenceValue(SB2PreferenceConstants.SB2_GDB_REMOTE_QEMU);
+		}
+		else {
+			// The others, just standard "gdbserver" command.
+			commandPattern = sdkTarget.getPreferenceValue(MaemoPreferenceConstants.SBOX_GDB_REMOTE);
+		}
+		
+		return commandPattern;
+	}
+
+}

Modified: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk2/src/org/maemo/esbox/maemosdk/sdk2/command/GetMaemoRootstrapLocationCommand.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk2/src/org/maemo/esbox/maemosdk/sdk2/command/GetMaemoRootstrapLocationCommand.java	2008-10-07 23:27:03 UTC (rev 840)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk2/src/org/maemo/esbox/maemosdk/sdk2/command/GetMaemoRootstrapLocationCommand.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -11,20 +11,19 @@
 
 package org.maemo.esbox.maemosdk.sdk2.command;
 
+import java.util.ArrayList;
+import java.util.List;
+
 import org.eclipse.core.filesystem.IFileStore;
 import org.eclipse.core.runtime.IPath;
 import org.eclipse.core.runtime.Path;
 import org.maemo.esbox.core.ESboxException;
+import org.maemo.esbox.internal.maemosdk.core.command.ICommandAbstractor;
+import org.maemo.esbox.internal.maemosdk.core.command.scratchbox.ScratchboxInvalidParameterException;
 import org.maemo.esbox.maemosdk.core.SB2PreferenceConstants;
-import org.maemo.esbox.maemosdk.core.ScratchboxInvalidParameterException;
-import org.maemo.esbox.maemosdk.core.command.ICommandAbstractor;
 import org.maemo.esbox.maemosdk.core.scratchbox.ScratchboxException;
-import org.maemo.esbox.maemosdk.core.sdk.IScratchbox2SDKTarget;
 import org.maemo.esbox.maemosdk.sdk2.core.ScratchboxSDK2Target;
 
-import java.util.ArrayList;
-import java.util.List;
-
 /**
  * @author eswartz
  *

Modified: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk2/src/org/maemo/esbox/maemosdk/sdk2/command/MaemoRootstrapSb2Command.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk2/src/org/maemo/esbox/maemosdk/sdk2/command/MaemoRootstrapSb2Command.java	2008-10-07 23:27:03 UTC (rev 840)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk2/src/org/maemo/esbox/maemosdk/sdk2/command/MaemoRootstrapSb2Command.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -12,14 +12,14 @@
 
 import java.util.Collections;
 import java.util.List;
-import java.util.Properties;
 
 import org.maemo.esbox.core.ESboxException;
+import org.maemo.esbox.core.env.IEnvironmentModifierBlock;
 import org.maemo.esbox.core.process.CommandLineArguments;
 import org.maemo.esbox.core.process.ShellTemplateSubstitutor;
+import org.maemo.esbox.internal.maemosdk.core.command.ICommandAbstractor;
+import org.maemo.esbox.internal.maemosdk.core.command.scratchbox.ScratchboxCommand;
 import org.maemo.esbox.maemosdk.core.SB2PreferenceConstants;
-import org.maemo.esbox.maemosdk.core.command.ICommandAbstractor;
-import org.maemo.esbox.maemosdk.core.command.ScratchboxCommand;
 import org.maemo.esbox.maemosdk.core.scratchbox.ScratchboxException;
 
 /**
@@ -49,13 +49,13 @@
 	 * Perform the command with the given params as command line arguments,
 	 * with an optional timeout (triggering ScratchboxException if reached)
 	 * @param params command line parameters to maemo-rootstrap
-	 * @param env any environment needed or <code>null</code>
+	 * @param envBlock any environment needed or <code>null</code>
 	 * @param timeout if not 0, timeout in milliseconds
 	 * @return lines from stdout
 	 * @throws ScratchboxException if command execution fails or if timeout reached
 	 */
 	@SuppressWarnings("unchecked")
-	protected List<String> doPerformCommand(List<String> params, Properties env, long timeout)
+	protected List<String> doPerformCommand(List<String> params, IEnvironmentModifierBlock envBlock, long timeout)
 			throws ESboxException {
 		String rootstrapCommand = commandAbstractor.getPreferenceValue(
 					SB2PreferenceConstants.SB2_MAEMO_ROOTSTRAP_COMMAND);
@@ -68,11 +68,11 @@
 		rootstrapCommand = substitutor.substitute(rootstrapCommand);
 		
 		if (console == null) {
-			Process process = createProcess(rootstrapCommand, env);
+			Process process = createProcess(rootstrapCommand, envBlock);
 			List<String> results = getLineInputFromProcessAndWait(process, allowErrors(), timeout);
 			return results;
 		} else {
-			runAndWaitForProcess("Running " + rootstrapCommand, rootstrapCommand, env, timeout);
+			runAndWaitForProcess("Running " + rootstrapCommand, rootstrapCommand, envBlock, timeout);
 			return Collections.EMPTY_LIST;
 		}
 	}

Added: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk2/src/org/maemo/esbox/maemosdk/sdk2/command/RemoveTargetSb2Command.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk2/src/org/maemo/esbox/maemosdk/sdk2/command/RemoveTargetSb2Command.java	                        (rev 0)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk2/src/org/maemo/esbox/maemosdk/sdk2/command/RemoveTargetSb2Command.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -0,0 +1,98 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Nokia Corporation
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    Ed Swartz (Nokia) - initial API and implementation
+ *******************************************************************************/
+package org.maemo.esbox.maemosdk.sdk2.command;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.filesystem.EFS;
+import org.eclipse.core.filesystem.IFileStore;
+import org.eclipse.core.runtime.CoreException;
+import org.maemo.esbox.core.ESboxException;
+import org.maemo.esbox.core.sdk.ISDK;
+import org.maemo.esbox.internal.maemosdk.core.command.ICommandAbstractor;
+import org.maemo.esbox.internal.maemosdk.core.command.scratchbox.ListTargetsCommand;
+import org.maemo.esbox.internal.maemosdk.core.command.scratchbox.ScratchboxCommand;
+import org.maemo.esbox.internal.maemosdk.core.command.scratchbox.ScratchboxInvalidParameterException;
+import org.maemo.esbox.maemosdk.core.scratchbox.ScratchboxException;
+import org.maemo.esbox.maemosdk.sdk2.core.ScratchboxSDK2;
+
+/**
+ * Remove a Scratchbox 2 target.
+ * There's no known command for this, but we can manually fix up the system.
+ * 
+ */
+public class RemoveTargetSb2Command extends ScratchboxCommand {
+
+	private ScratchboxSDK2 sdk;
+
+	public RemoveTargetSb2Command(ISDK sdk, ICommandAbstractor commandAbstractor) {
+		super(commandAbstractor, 2);
+		this.sdk = (ScratchboxSDK2) sdk;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see embedded.core.scratchbox.command.IScratchboxCommand#performCommand(java.lang.Object)
+	 */	
+	public Object performCommand(List<String> param) throws ScratchboxException, ESboxException {
+		if (!this.checkParameters(param))
+			throw new ScratchboxInvalidParameterException(
+					"Invalid number of parameters");
+
+		String targetToRemove = param.get(0);
+		if (!targetExist(targetToRemove))
+			throw new ScratchboxInvalidParameterException("Target "
+					+ targetToRemove + " does not exist.");
+
+		IFileStore sb2Dir = commandAbstractor.getFileSystemAccess().getFileStore(
+				sdk.getScratchbox2ConfigDirectory());
+		IFileStore targetDir = sb2Dir.getChild(targetToRemove);
+		
+		if (!targetDir.fetchInfo().exists()) {
+			throw new ScratchboxInvalidParameterException("Target "
+					+ targetToRemove + " does not exist at the expected location: " + targetDir);
+		}
+		
+		try {
+			targetDir.delete(EFS.NONE, null);
+		} catch (CoreException e) {
+			throw new ScratchboxException("Failed to delete rootstrap", e);
+		} finally {
+			sdk.refresh();
+		}
+		
+		return true;
+	}
+
+	/**
+	 * Verify if a target exists.
+	 * @param targetToRemove
+	 *            the target to verify.
+	 * 
+	 * @return true, if the target exists in Scratchbox; false, otherwise.
+	 * @throws ScratchboxException
+	 *             if some problem occurrs while requesting Scratchbox services.
+	 */
+	private boolean targetExist(String targetToRemove)
+			throws ESboxException {
+		List<String> targetsAvailable = new ListTargetsCommand(commandAbstractor, sboxVersion)
+				.performCommand(new ArrayList<String>());
+		return targetsAvailable.contains(targetToRemove);
+	}
+
+	@Override
+	public int getParametersSize() {
+		return 1;
+	}
+
+}

Modified: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk2/src/org/maemo/esbox/maemosdk/sdk2/core/IScratchboxSDK2.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk2/src/org/maemo/esbox/maemosdk/sdk2/core/IScratchboxSDK2.java	2008-10-07 23:27:03 UTC (rev 840)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk2/src/org/maemo/esbox/maemosdk/sdk2/core/IScratchboxSDK2.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -1,10 +1,15 @@
 package org.maemo.esbox.maemosdk.sdk2.core;
 
+import java.util.List;
+
 import org.eclipse.core.runtime.IPath;
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.maemo.esbox.core.ESboxException;
+import org.maemo.esbox.core.machine.IMachine;
+import org.maemo.esbox.maemosdk.core.scratchbox.MaemoRootstrap;
+import org.maemo.esbox.maemosdk.core.sdk.IScratchboxSDK;
 
-public interface IScratchboxSDK2 {
+public interface IScratchboxSDK2 extends IScratchboxSDK{
 
 	
 	/** String for URI of machine where we detected scratchbox 2 */
@@ -25,4 +30,9 @@
 	public boolean createRootstrapTarget(String targetName, boolean useHostTools, boolean force, IProgressMonitor monitor) throws ESboxException;
 	
 	public boolean removeRootstrap(String targetName, boolean force, IProgressMonitor monitor)throws ESboxException;
+
+	public List<String> getInstalledMaemoRootstraps() throws ESboxException;
+
+	public List<MaemoRootstrap> getAvailableMaemoRootstraps(IMachine machine)throws ESboxException;
+	
 }

Modified: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk2/src/org/maemo/esbox/maemosdk/sdk2/core/ScratchboxSDK2.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk2/src/org/maemo/esbox/maemosdk/sdk2/core/ScratchboxSDK2.java	2008-10-07 23:27:03 UTC (rev 840)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk2/src/org/maemo/esbox/maemosdk/sdk2/core/ScratchboxSDK2.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -19,18 +19,20 @@
 import org.maemo.esbox.core.sdk.ISDKTarget;
 import org.maemo.esbox.internal.api.core.sdk.BaseSDKPlatform;
 import org.maemo.esbox.internal.maemosdk.core.command.ICommand;
+import org.maemo.esbox.internal.maemosdk.core.command.ICommandAbstractor;
 import org.maemo.esbox.internal.maemosdk.core.command.scratchbox.CreateMaemoRootstrapSb2Command;
 import org.maemo.esbox.internal.maemosdk.core.command.scratchbox.CreateTargetSb2Command;
 import org.maemo.esbox.internal.maemosdk.core.command.scratchbox.GetCurrentTargetSb2Command;
 import org.maemo.esbox.internal.maemosdk.core.command.scratchbox.GetVersionScratchboxCommand;
+import org.maemo.esbox.internal.maemosdk.core.command.scratchbox.ListAvailableMaemoRootstrapsSb2Command;
 import org.maemo.esbox.internal.maemosdk.core.command.scratchbox.ListCompilersSb2Command;
 import org.maemo.esbox.internal.maemosdk.core.command.scratchbox.ListCputranspSb2Command;
+import org.maemo.esbox.internal.maemosdk.core.command.scratchbox.ListInstalledMaemoRootstrapsSb2Command;
+import org.maemo.esbox.internal.maemosdk.core.command.scratchbox.ListTargetsCommand;
 import org.maemo.esbox.internal.maemosdk.core.command.scratchbox.RemoveMaemoRootstrapSb2Command;
 import org.maemo.esbox.internal.maemosdk.core.command.scratchbox.ShowPathMappingSb2Command;
-import org.maemo.esbox.maemosdk.core.command.ICommandAbstractor;
-import org.maemo.esbox.maemosdk.core.command.ListTargetsCommand;
+import org.maemo.esbox.maemosdk.core.scratchbox.MaemoRootstrap;
 import org.maemo.esbox.maemosdk.core.sdk.AbstractScratchboxSDK;
-import org.maemo.esbox.maemosdk.core.sdk.IScratchboxSDK;
 import org.maemo.esbox.maemosdk.core.sdk.IScratchboxSDKTarget;
 import org.maemo.esbox.maemosdk.sdk2.Activator;
 import org.maemo.esbox.maemosdk.sdk2.command.GetMaemoRootstrapLocationCommand;
@@ -52,6 +54,10 @@
 		this.prefProvider = prefProvider;
 	}
 
+	@Override
+	public int getSboxVersion() {
+		return SB_VERSION;
+	}
 
 	@Override
 	public void refresh() {
@@ -88,8 +94,14 @@
 		this.targets = newTargets;
 	}
 
+	
 
+	@Override
+	public ICommandAbstractor getCommandAbstractor() throws ESboxException {
+		return getSb2WrappedAbstractor(super.getCommandAbstractor(), this.getMachine());
+	}
 
+
 	@Override
 	public IPath getScratchbox2ConfigDirectory() {
 		String userName = prefProvider.getPreferenceValue(CorePreferenceConstants.USER);
@@ -199,7 +211,27 @@
 		}
 	}
 
+	/**
+	 * Get the names of rootstraps already installed.  This may inclue those that do
+	 * not have targets associated.
+	 * @param sdk the SDK to check
+	 * @return List, never null
+	 * @throws ESboxException
+	 */
+	public synchronized List<String> getInstalledMaemoRootstraps() throws ESboxException {
+		ListInstalledMaemoRootstrapsSb2Command command = new ListInstalledMaemoRootstrapsSb2Command(getHostCommandAbstractor(this.getMachine()));
+		return command.performCommand(EMPTY_ARGS);
+	}
+	
+	
+	
 	@Override
+	public List<MaemoRootstrap> getAvailableMaemoRootstraps(IMachine machine) throws ESboxException{
+		ListAvailableMaemoRootstrapsSb2Command command = new ListAvailableMaemoRootstrapsSb2Command(getHostCommandAbstractor(machine));
+		return command.performCommand(EMPTY_ARGS);
+	}
+
+	@Override
 	public boolean createRootstrapTarget(String targetName,
 			boolean useHostTools, boolean force, IProgressMonitor monitor)
 			throws ESboxException {
@@ -354,4 +386,22 @@
 		return rootstrapPath;
 	}
 	
+	/**
+	 * Get a command abstractor that updates the PATH if sb2 tools are not on the path.
+	 * @param commandAbstractor
+	 * @param machine
+	 * @return
+	 */
+	private static ICommandAbstractor getSb2WrappedAbstractor(ICommandAbstractor commandAbstractor,
+			IMachine machine) {
+		// XXX: the default path should be provided some other way
+		return wrapCommandAbstractorForSDK(
+				commandAbstractor,
+				machine, 
+				"sb2",
+				"/usr/bin");
+	}
+	
+	
+	
 }

Modified: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk2/src/org/maemo/esbox/maemosdk/sdk2/core/ScratchboxSDK2Target.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk2/src/org/maemo/esbox/maemosdk/sdk2/core/ScratchboxSDK2Target.java	2008-10-07 23:27:03 UTC (rev 840)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk2/src/org/maemo/esbox/maemosdk/sdk2/core/ScratchboxSDK2Target.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -1,12 +1,19 @@
 package org.maemo.esbox.maemosdk.sdk2.core;
 
+import java.util.ArrayList;
+import java.util.List;
+
 import org.eclipse.core.runtime.IPath;
 import org.maemo.esbox.core.CorePreferenceConstants;
+import org.maemo.esbox.core.ESboxException;
 import org.maemo.esbox.core.process.IProcessLauncherFactory;
 import org.maemo.esbox.core.sdk.ISDKPlatform;
-import org.maemo.esbox.internal.maemosdk.core.sdk.Scratchbox2ProcessLauncherFactory;
 import org.maemo.esbox.maemosdk.core.SB2PreferenceConstants;
 import org.maemo.esbox.maemosdk.core.sdk.AbstractScratchboxSDKTarget;
+import org.maemo.esbox.maemosdk.core.sdk.IScratchboxSDK;
+import org.maemo.esbox.maemosdk.core.sdk.IScratchboxSDKTarget;
+import org.maemo.esbox.maemosdk.sdk2.command.GetGdbQemuCommandPatternCommand;
+import org.maemo.esbox.maemosdk.sdk2.launcher.Scratchbox2ProcessLauncherFactory;
 
 public class ScratchboxSDK2Target extends AbstractScratchboxSDKTarget {
 	private IPath targetRoot;
@@ -47,7 +54,33 @@
 	public IPath getSDKTargetRoot() {
 		return targetRoot;
 	}
+	
+	
+	
+	@Override
+	public String getArchitecture() {
+		// sb2 doesn't YET ship an x86 emulator
+		return IScratchboxSDKTarget.ARCHITECTURE_ARMEL;
+	}
 
+	/**
+	 * Get the command template for launching qemu under gdb with this target
+	 * @param sdkTarget
+	 * @param architecture one of {@link IScratchboxSDKTarget#ARCHITECTURE_ARMEL} or {@link IScratchboxSDKTarget#ARCHITECTURE_X86};
+	 * usually from sdkTarget.getArchitecture()
+	 * @return String or null if no cputransp used or not using qemu
+	 */
+	public synchronized String getGdbQemuCommandPattern(String architecture) throws ESboxException {
+		ScratchboxSDK2 sdk = (ScratchboxSDK2)this.getSDK();
+		GetGdbQemuCommandPatternCommand command = new GetGdbQemuCommandPatternCommand(this,
+				this.getCommandAbstractor(),
+				sdk.getSboxVersion());
+		List<String> arguments = new ArrayList<String>(1);
+		arguments.add(architecture);
+		return command.performCommand(arguments);
+	}
+	
+	
 	/** Not API!  The targets should be refreshed from ISDK#refresh() */
 	void setRootstrapPath(IPath rootstrapPath) {
 		this.rootstrapRoot = rootstrapPath;

Added: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk2/src/org/maemo/esbox/maemosdk/sdk2/launcher/Scratchbox2EnvironmentProvider.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk2/src/org/maemo/esbox/maemosdk/sdk2/launcher/Scratchbox2EnvironmentProvider.java	                        (rev 0)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk2/src/org/maemo/esbox/maemosdk/sdk2/launcher/Scratchbox2EnvironmentProvider.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -0,0 +1,79 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Nokia Corporation
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    Ed Swartz (Nokia) - initial API and implementation
+ *******************************************************************************/
+
+package org.maemo.esbox.maemosdk.sdk2.launcher;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Properties;
+
+import org.maemo.esbox.core.ESboxException;
+import org.maemo.esbox.core.process.CommandLineArguments;
+import org.maemo.esbox.core.process.EnvironmentProperties;
+import org.maemo.esbox.core.process.ProcessLauncherUtils;
+import org.maemo.esbox.core.process.ProcessLauncherUtils.Results;
+import org.maemo.esbox.core.sdk.ISDKTarget;
+import org.maemo.esbox.internal.api.core.IStandardEnvironmentProvider;
+import org.maemo.esbox.internal.maemosdk.core.Activator;
+import org.maemo.esbox.maemosdk.core.SB2PreferenceConstants;
+
+/**
+ * @author eswartz
+ *
+ */
+public class Scratchbox2EnvironmentProvider implements
+		IStandardEnvironmentProvider {
+	public static Map<ISDKTarget, Properties> cachedStdEnvMap = new HashMap<ISDKTarget, Properties>();
+	private final ISDKTarget sdkTarget;
+	
+
+	/**
+	 * @param sdkTarget
+	 */
+	public Scratchbox2EnvironmentProvider(ISDKTarget sdkTarget) {
+		this.sdkTarget = sdkTarget;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.maemo.esbox.internal.api.core.IStandardEnvironmentProvider#flushRawEnvironment()
+	 */
+	public void flushRawEnvironment() {
+		cachedStdEnvMap.remove(sdkTarget);
+	}
+
+	/* (non-Javadoc)
+	 * @see org.maemo.esbox.internal.api.core.IStandardEnvironmentProvider#getRawEnvironment()
+	 */
+	public Properties getRawEnvironment() {
+		Properties standardEnv = cachedStdEnvMap.get(sdkTarget);
+		if (standardEnv == null) {
+			// gather arguments by querying a typical shell launched in POSIX mode (sh instead of bash)
+			Scratchbox2ProcessLauncher launcher = new Scratchbox2ProcessLauncher(
+					sdkTarget, null, 
+					CommandLineArguments.createFromVarArgs("sh", "-c", "set"),
+					null, 
+					SB2PreferenceConstants.SB2_MAPPING_MODE,
+					false);
+			
+			try {
+				Results results = ProcessLauncherUtils.launchAndReadStandardStreams(launcher, null);
+				standardEnv = EnvironmentProperties.createFromShellEnvDump(results.stdout);
+			} catch (ESboxException e) {
+				Activator.getErrorLogger().logError("Failed to read scratchbox environment; using system environment", e);
+				standardEnv = sdkTarget.getSDK().getMachine().getStandardEnvironment();
+			}
+			
+			cachedStdEnvMap.put(sdkTarget, standardEnv);
+		}
+		return standardEnv;
+	}
+
+}

Added: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk2/src/org/maemo/esbox/maemosdk/sdk2/launcher/Scratchbox2ProcessLauncher.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk2/src/org/maemo/esbox/maemosdk/sdk2/launcher/Scratchbox2ProcessLauncher.java	                        (rev 0)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk2/src/org/maemo/esbox/maemosdk/sdk2/launcher/Scratchbox2ProcessLauncher.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -0,0 +1,105 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Nokia Corporation.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    Ed Swartz (Nokia) - initial API and implementation
+ *******************************************************************************/
+package org.maemo.esbox.maemosdk.sdk2.launcher;
+
+import org.eclipse.core.runtime.IPath;
+import org.maemo.esbox.core.env.IEnvironmentModifierBlock;
+import org.maemo.esbox.core.process.*;
+import org.maemo.esbox.core.sdk.ISDKTarget;
+import org.maemo.esbox.maemosdk.core.SB2PreferenceConstants;
+import org.maemo.esbox.maemosdk.core.scratchbox.ScratchboxException;
+
+import java.util.*;
+
+/**
+ * For SB 2, launching is easy and follows the same pattern as a normal
+ * program invocation.  
+ * @author eswartz
+ *
+ */
+public class Scratchbox2ProcessLauncher extends BaseProcessLauncher implements
+		IProcessLauncher {
+
+	private ISDKTarget sdkTarget;
+
+	public Scratchbox2ProcessLauncher(
+			ISDKTarget sdkTarget, 
+			IPath workingDirectory,
+			List<String> cmdLine, 
+			IEnvironmentModifierBlock environmentModifierBlock,
+			String modeKey, boolean runAsRoot) {
+		super(encodeArgumentArray(sdkTarget, cmdLine, modeKey), 
+				environmentModifierBlock, workingDirectory);
+		if (runAsRoot) {
+			getLaunchCommandArguments().add(0, "sudo");
+		}
+		if (sdkTarget == null)
+			throw new IllegalArgumentException();
+		this.sdkTarget = sdkTarget;
+	}
+	
+	/* (non-Javadoc)
+	 * @see org.maemo.esbox.internal.core.BaseProcessLauncher#getLaunchInfoPrefix()
+	 */
+	@Override
+	protected String getLaunchInfoPrefix() {
+		return sdkTarget + " ";
+	}
+	
+	private static List<String> encodeArgumentArray(
+			ISDKTarget sdkTarget,
+			List<String> cmdLine,
+			String modeKey) {
+				
+		// Encode the launch command by replacing the arguments
+		// representing template arguments with the actual values.
+		//
+		ShellTemplateSubstitutor substitutor = new ShellTemplateSubstitutor();
+		
+		substitutor.define("TARGET", sdkTarget.getName());
+		substitutor.define("COMMAND", cmdLine.get(0));
+		substitutor.define("ARGS", CommandLineArguments.toCommandLine(cmdLine.subList(1, cmdLine.size())));
+
+		String level = sdkTarget.getPreferenceValue(SB2PreferenceConstants.SB2_LOG_LEVEL);
+		if (level.length() > 0) {
+			substitutor.define("LOG_OPTION", "-L " + level);
+		} else {
+			substitutor.define("LOG_OPTION", "");
+		}
+
+		String mapMode = sdkTarget.getPreferenceValue(modeKey);
+		substitutor.define("MAPPING_MODE", mapMode);
+
+		// get the Scratchbox invocation pattern
+		String commandPattern = sdkTarget.getPreferenceValue(SB2PreferenceConstants.SB2_EXEC_COMMAND);
+
+		// replace variables
+		commandPattern = substitutor.substitute(commandPattern);
+		
+		List<String> commandArgs = CommandLineArguments.createFromCommandLine(commandPattern);
+		return commandArgs;
+	}
+
+	@Override
+	protected void setupForLaunch() throws ScratchboxException {
+		// nothing
+	}
+
+	/* (non-Javadoc)
+	 * @see org.maemo.esbox.internal.core.BaseProcessLauncher#doCreateProcess()
+	 */
+	@Override
+	protected Process doCreateProcess() throws Exception {
+		return sdkTarget.getSDK().getMachine().createProcess(
+				getLaunchCurrentWorkingDirectory(), getLaunchCommandArguments(),
+				getLaunchEnvironmentModifierBlock(), isUsePTY());
+	}
+}

Added: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk2/src/org/maemo/esbox/maemosdk/sdk2/launcher/Scratchbox2ProcessLauncherFactory.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk2/src/org/maemo/esbox/maemosdk/sdk2/launcher/Scratchbox2ProcessLauncherFactory.java	                        (rev 0)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk2/src/org/maemo/esbox/maemosdk/sdk2/launcher/Scratchbox2ProcessLauncherFactory.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -0,0 +1,66 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Nokia Corporation.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    Ed Swartz (Nokia) - initial API and implementation
+ *******************************************************************************/
+package org.maemo.esbox.maemosdk.sdk2.launcher;
+
+import org.eclipse.core.runtime.IPath;
+import org.maemo.esbox.core.*;
+import org.maemo.esbox.core.env.IEnvironmentModifierBlock;
+import org.maemo.esbox.core.process.*;
+import org.maemo.esbox.core.process.ProcessLauncherUtils.Results;
+import org.maemo.esbox.core.sdk.ISDKTarget;
+import org.maemo.esbox.internal.api.core.BaseProcessLauncherFactory;
+import org.maemo.esbox.internal.maemosdk.core.Activator;
+
+import java.util.*;
+
+/**
+ * @author eswartz
+ *
+ */
+public class Scratchbox2ProcessLauncherFactory extends
+		BaseProcessLauncherFactory {
+
+	protected ISDKTarget sdkTarget;
+	private String mappingModeKey;
+	private final boolean runAsRoot;
+	
+	/**
+	 * Create a factory and specify whether it is creating commands in build
+	 * mode (sb2 -m maemo) or installation mode (sb2 -e)
+	 * @param sdkTarget
+	 * @param mappingModeKey one of SB2PreferenceConstants.MAPPING_MODE or SB2PreferenceConstants.INSTALL_MAPPING_MODE
+	 * @param isBuildMode true: build mode, false: installation mode
+	 */
+	public Scratchbox2ProcessLauncherFactory(ISDKTarget sdkTarget, String mappingModeKey, boolean runAsRoot) {
+		super(new Scratchbox2EnvironmentProvider(sdkTarget), false);
+		if (sdkTarget == null)
+			throw new IllegalArgumentException();
+		this.sdkTarget = sdkTarget;
+		this.mappingModeKey = mappingModeKey; 
+		this.runAsRoot = runAsRoot;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.maemo.esbox.core.IProcessLauncherFactory#createProcessLauncher(org.eclipse.core.runtime.IPath, org.eclipse.core.runtime.IPath, org.maemo.esbox.core.List<String>, java.util.Properties)
+	 */
+	protected IProcessLauncher doCreateProcessLauncher(
+			IPath workingDirectory, List<String> cmdLine,
+			IEnvironmentModifierBlock environmentModifierBlock) {
+
+		return new Scratchbox2ProcessLauncher(
+				sdkTarget,
+				workingDirectory, cmdLine,
+				environmentModifierBlock,
+				mappingModeKey,
+				runAsRoot); 
+	}
+
+}

Added: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk2/src/org/maemo/esbox/maemosdk/sdk2/ui/adapters/ESboxTargetRemover.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk2/src/org/maemo/esbox/maemosdk/sdk2/ui/adapters/ESboxTargetRemover.java	                        (rev 0)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk2/src/org/maemo/esbox/maemosdk/sdk2/ui/adapters/ESboxTargetRemover.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -0,0 +1,304 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Nokia Corporation.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    Ed Swartz (Nokia) - initial API and implementation
+ *******************************************************************************/
+
+package org.maemo.esbox.maemosdk.sdk2.ui.adapters;
+
+import java.text.MessageFormat;
+import java.util.HashSet;
+import java.util.Set;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.SubProgressMonitor;
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerFilter;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Shell;
+import org.maemo.esbox.core.ESboxException;
+import org.maemo.esbox.core.sdk.ISDKTarget;
+import org.maemo.esbox.internal.maemosdk.ui.UIActivator;
+import org.maemo.esbox.maemosdk.core.sdk.IScratchboxSDK;
+import org.maemo.esbox.maemosdk.sdk2.core.IScratchboxSDK2;
+import org.maemo.esbox.project.core.ESboxBuildConfigurationParameters;
+import org.maemo.esbox.project.core.IESboxBuildConfiguration;
+import org.maemo.esbox.project.core.IESboxProjectHandle;
+import org.maemo.esbox.project.core.ProjectManager;
+import org.maemo.esbox.ui.ESboxBuildTargetUI;
+
+import com.nokia.cpp.internal.api.utils.core.TextUtils;
+
+/**
+ * This class handles updating projects when they depend on an SDK target we're about
+ * to delete.
+ * @author eswartz
+ *
+ */
+public class ESboxTargetRemover {
+
+	private final ISDKTarget sdkTarget;
+	private final boolean deleteRootstrap;
+	private final Shell shell;
+
+	public ESboxTargetRemover(Shell shell, ISDKTarget sdkTarget, boolean deleteRootstrap) {
+		this.shell = shell;
+		this.sdkTarget = sdkTarget;
+		this.deleteRootstrap = deleteRootstrap;
+	}
+
+	/**
+	 * Remove the target selected.
+	 */
+	public void run(IProgressMonitor monitor) throws ESboxException {
+		monitor.beginTask("Removing target " + sdkTarget.getName(), 3);
+		IScratchboxSDK2 sdk = (IScratchboxSDK2) sdkTarget.getSDK(); 
+		String targetName = sdkTarget.getName();
+		
+		// update all the projects to use another SDK Target
+		if (!updateProjectsForRemovedTarget(sdkTarget, new SubProgressMonitor(monitor, 1)))
+			return;
+		if (monitor.isCanceled())
+			return;
+		
+		// remove the rootstrap
+		if (deleteRootstrap) {
+			try {
+				sdk.removeRootstrap(sdkTarget.getName(), true, 
+						new SubProgressMonitor(monitor, 1));
+			} catch (ESboxException e) {
+				// don't worry -- it may be a bogus target or one without a rootstrap
+				UIActivator.getErrorLogger().logError("Problem removing rootstrap", e);
+			}
+		
+			if (monitor.isCanceled())
+				return;
+		} else {
+			monitor.worked(1);
+		}
+		
+		// and remove the target
+		sdk.removeTarget(targetName);
+		monitor.worked(1);
+		if (monitor.isCanceled())
+			return;
+
+
+	}	
+		
+	/** 
+	 * Ask user to reassign SDK target for any project which is using the
+	 * to-be-deleted target.  If user cancels or there are no other targets to
+	 * use, returns false.
+	 * @param monitor 
+	 * @param sdk
+	 * @param oldTargetName target name to be removed
+	 * @return true if reassigning succeeded
+	 * @throws ESboxException
+	 */
+	private boolean updateProjectsForRemovedTarget(ISDKTarget sdkTarget, IProgressMonitor monitor) throws ESboxException {
+		monitor.beginTask("", 10);
+		try {
+			monitor.subTask("Checking projects using build target");
+			
+			IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects();
+			Set<IESboxProjectHandle> projectsUsingTarget = new HashSet<IESboxProjectHandle>();
+			Set<IESboxProjectHandle> projectsOnlyUsingTarget = new HashSet<IESboxProjectHandle>();
+			for (IProject project : projects) {
+				if (!project.isOpen())
+					continue;
+				IESboxProjectHandle projectHandle = ProjectManager.getInstance().getProjectHandle(project);
+				if (projectHandle != null) {
+					boolean allUseTarget = true;
+					for (IESboxBuildConfiguration config : projectHandle.getBuildConfigurations()) {
+						if (config.getSDKTargetName().equals(sdkTarget.getName())) {
+							projectsUsingTarget.add(projectHandle);
+						} else {
+							allUseTarget = false;
+						}
+					}
+					if (allUseTarget) {
+						projectsOnlyUsingTarget.add(projectHandle);
+					}
+				}
+			}
+			if (projectsUsingTarget.isEmpty())
+				return true;
+			monitor.worked(1);
+			
+			ISDKTarget replacement = null;
+			if (!projectsOnlyUsingTarget.isEmpty()) {
+				monitor.subTask("Selecting alternate build target");
+				replacement = selectAlternateSDKTarget(projectsOnlyUsingTarget, sdkTarget);
+				if (replacement == null)
+					return false;
+				monitor.worked(1);
+			}
+			
+			monitor.subTask("Migrating build targets");
+			for (IESboxProjectHandle projectHandle : projectsUsingTarget) {
+				updateBuildConfigurations(projectHandle, sdkTarget, replacement);
+			}
+			monitor.worked(1);
+
+			monitor.subTask("Saving projects");
+			for (IESboxProjectHandle projectHandle : projectsUsingTarget) {
+				try {
+					projectHandle.save(new SubProgressMonitor(monitor, 1));
+				} catch (CoreException e) {
+					UIActivator.getErrorLogger().logAndShowError("Failed to update project", e);
+				}
+			}
+
+			// build system should handle this
+			//// target removal requires a rebuild
+			//cleanProjects(projectsUsingTarget, new SubProgressMonitor(monitor, 7));
+		} finally {		
+			monitor.done();
+		}
+		return true;
+	}
+
+	/**
+	 * For the given project, remove the configurations using sdkTarget.
+	 * If there are no build configurations left, then add one using the replacement.   
+	 * @param projectHandle
+	 * @param sdkTarget
+	 * @param replacement
+	 */
+	private void updateBuildConfigurations(IESboxProjectHandle projectHandle,
+			ISDKTarget sdkTarget, ISDKTarget replacement) {
+		IESboxBuildConfiguration lastConfig = null;
+		
+		for (IESboxBuildConfiguration config : projectHandle.getBuildConfigurations()) {
+			if (config.getSDKTarget().equals(sdkTarget)) {
+				try {
+					lastConfig = config;
+					projectHandle.removeBuildConfiguration(config);
+				} catch (CoreException e) {
+					UIActivator.getErrorLogger().logAndShowError("Could not remove build configuration", e);
+				}
+			}
+		}
+		if (projectHandle.getBuildConfigurations().length == 0) {
+			// need to add one for replacement
+			ESboxBuildConfigurationParameters parameters = new ESboxBuildConfigurationParameters(replacement.getName(), replacement);
+			try {
+				/*IESboxBuildConfiguration newConfig =*/ projectHandle.createBuildConfiguration(parameters, lastConfig);
+			} catch (CoreException e) {
+				UIActivator.getErrorLogger().logAndShowError("Failed to add replacement build configuration", e);
+			}
+		}
+	}
+
+	private ISDKTarget selectAlternateSDKTarget(
+			final Set<IESboxProjectHandle> projectsOnlyUsingTarget, final ISDKTarget sdkTarget) {
+		final ISDKTarget[] replacement = { null };
+		final Dialog dialog = new Dialog(shell) {
+			private Button okButton;
+
+			@Override
+			protected void configureShell(Shell newShell) {
+				super.configureShell(newShell);
+				newShell.setText("Replace Build Target");
+			}
+			@Override
+			protected Control createDialogArea(Composite parent) {
+				Composite contents = (Composite) super.createDialogArea(parent);
+				Label label = new Label(contents, SWT.NONE);
+				label.setText(MessageFormat.format(
+						"Some existing projects build only against ''{0}'':\n\n\t{1}\n\nSpecify an alternate build target:",
+						TextUtils.catenateStrings(projectsOnlyUsingTarget.toArray(), "\n\t"),
+						sdkTarget.getName()));
+				label.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
+				
+				TreeViewer targetViewer = ESboxBuildTargetUI.createConfiguredBuildTargetViewer(contents, ESboxBuildTargetUI.DEFAULT_STYLE);
+				targetViewer.setFilters(new ViewerFilter[] {
+					new ViewerFilter() {
+
+						@Override
+						public boolean select(Viewer viewer,
+								Object parentElement, Object element) {
+							return !element.equals(sdkTarget);
+						}
+					}
+				});
+				targetViewer.getTree().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+				targetViewer.addSelectionChangedListener(new ISelectionChangedListener() {
+
+					public void selectionChanged(SelectionChangedEvent event) {
+						Object element = ((IStructuredSelection) event.getSelection()).getFirstElement();
+						if (element instanceof ISDKTarget) {
+							replacement[0] = (ISDKTarget) element;
+						} else {
+							replacement[0] = null;
+						}
+						if (okButton != null) {
+							okButton.setEnabled(replacement[0] != null);
+						}
+					}
+					
+				});
+				targetViewer.setInput(new Object());
+				return contents;
+			}
+			
+			@Override
+			protected void createButtonsForButtonBar(Composite parent) {
+				okButton = createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
+				okButton.setEnabled(false);
+				createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);
+			}
+		};
+		
+		shell.getDisplay().syncExec(new Runnable() {
+
+			public void run() {
+				if (dialog.open() != IDialogConstants.OK_ID) {
+					replacement[0] = null;
+				}
+			}
+			
+		});
+		return replacement[0];
+	}
+
+	/*
+	private void cleanProjects(final Set<IESboxProjectHandle> projects, IProgressMonitor monitor) {
+		// clean the target
+		monitor.beginTask("", projects.size());
+		monitor.subTask("Cleaning affected projects");
+		try {
+			for (IESboxProjectHandle projectHandle : projects) {
+				projectHandle.getProject().build(IncrementalProjectBuilder.CLEAN_BUILD, monitor);
+				monitor.worked(1);
+			}
+		} catch (CoreException e) {
+			ErrorLogger errorLogger = Activator.getErrorLogger();
+			errorLogger.logAndShowError("Error cleaning project", e);
+		} finally {
+			monitor.done();
+		}
+	}
+	*/
+	
+}

Added: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk2/src/org/maemo/esbox/maemosdk/sdk2/ui/adapters/MaemoSDKInstallTargetAdapterFactory.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk2/src/org/maemo/esbox/maemosdk/sdk2/ui/adapters/MaemoSDKInstallTargetAdapterFactory.java	                        (rev 0)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk2/src/org/maemo/esbox/maemosdk/sdk2/ui/adapters/MaemoSDKInstallTargetAdapterFactory.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -0,0 +1,44 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Nokia Corporation
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    Ed Swartz (Nokia) - initial API and implementation
+ *******************************************************************************/
+
+package org.maemo.esbox.maemosdk.sdk2.ui.adapters;
+
+import org.eclipse.core.runtime.IAdapterFactory;
+import org.maemo.esbox.core.adapters.ISDKManageTargetAdapter;
+import org.maemo.esbox.maemosdk.sdk2.core.IScratchboxSDK2;
+
+/**
+ * @author eswartz
+ *
+ */
+public class MaemoSDKInstallTargetAdapterFactory implements IAdapterFactory {
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.core.runtime.IAdapterFactory#getAdapter(java.lang.Object, java.lang.Class)
+	 */
+	public Object getAdapter(Object adaptableObject, Class adapterType) {
+		if (adapterType.equals(ISDKManageTargetAdapter.class)) {
+			if (adaptableObject instanceof IScratchboxSDK2) {
+				return new MaemoScratchbox2SDKManageTargetAdapter((IScratchboxSDK2) adaptableObject);
+			}
+		}
+		return null;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.core.runtime.IAdapterFactory#getAdapterList()
+	 */
+	public Class[] getAdapterList() {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+}

Added: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk2/src/org/maemo/esbox/maemosdk/sdk2/ui/adapters/MaemoScratchbox2SDKManageTargetAdapter.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk2/src/org/maemo/esbox/maemosdk/sdk2/ui/adapters/MaemoScratchbox2SDKManageTargetAdapter.java	                        (rev 0)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk2/src/org/maemo/esbox/maemosdk/sdk2/ui/adapters/MaemoScratchbox2SDKManageTargetAdapter.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -0,0 +1,175 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Nokia Corporation
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    Ed Swartz (Nokia) - initial API and implementation
+ *******************************************************************************/
+
+package org.maemo.esbox.maemosdk.sdk2.ui.adapters;
+
+import java.lang.reflect.InvocationTargetException;
+import java.text.MessageFormat;
+import java.util.List;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.dialogs.ProgressMonitorDialog;
+import org.eclipse.jface.operation.IRunnableWithProgress;
+import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Shell;
+import org.maemo.esbox.core.ESboxException;
+import org.maemo.esbox.core.Policy;
+import org.maemo.esbox.core.adapters.ISDKManageTargetAdapter;
+import org.maemo.esbox.core.sdk.ISDKTarget;
+import org.maemo.esbox.internal.maemosdk.ui.UIActivator;
+import org.maemo.esbox.internal.maemosdk.ui.adapters.MaemoScratchboxSDKManageTargetAdapterBase;
+import org.maemo.esbox.maemosdk.core.scratchbox.MaemoRootstrap;
+import org.maemo.esbox.maemosdk.sdk2.Activator;
+import org.maemo.esbox.maemosdk.sdk2.core.IScratchboxSDK2;
+import org.maemo.esbox.maemosdk.sdk2.ui.wizard.NewScratchbox2TargetWizard;
+
+/**
+ * @author eswartz
+ *
+ */
+public class MaemoScratchbox2SDKManageTargetAdapter extends MaemoScratchboxSDKManageTargetAdapterBase 
+	implements ISDKManageTargetAdapter {
+
+	private final IScratchboxSDK2 sdk;
+
+	/**
+	 * @param sdk
+	 */
+	public MaemoScratchbox2SDKManageTargetAdapter(IScratchboxSDK2 sdk) {
+		this.sdk = sdk;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.maemo.esbox.core.adapters.ISDKManageTargetAdapter#installSDKTargets(org.eclipse.swt.widgets.Shell, java.util.List)
+	 */
+	public IStatus installSDKTargets(Shell shell, List<ISDKTarget> installed) {
+		NewScratchbox2TargetWizard targetWizard;
+		
+		targetWizard = new NewScratchbox2TargetWizard(sdk);
+		WizardDialog dlg = new WizardDialog(
+				shell,
+				targetWizard);
+		if (dlg.open() == Dialog.OK) {
+			return Status.OK_STATUS;
+		}
+
+		return Policy.getCancelStatus(Activator.getDefault());
+	}
+	
+	/* (non-Javadoc)
+	 * @see org.maemo.esbox.core.adapters.ISDKTargetInstallerAdapter#removeSDKTarget(org.eclipse.swt.widgets.Shell, org.maemo.esbox.core.sdk.ISDKTarget)
+	 */
+	public IStatus removeSDKTarget(Shell shell, ISDKTarget selectedTarget) {
+		final boolean[] deleteRootstrap = { false };
+		boolean rootstrapUsed_ = false;
+		try {
+			// see if a rootstrap -- possibly disconnected from the target -- exists
+			List<MaemoRootstrap> rootstraps = 
+				sdk.getAvailableMaemoRootstraps(selectedTarget.getSDK().getMachine());
+			for (MaemoRootstrap rootstrap : rootstraps) {
+				if (rootstrap.getName().equals(selectedTarget.getName())) {
+					rootstrapUsed_ = true;
+					break;
+				}
+			}
+		} catch (ESboxException e1) {
+			UIActivator.getErrorLogger().logError("Failure scanning maemo rootstraps", e1);
+		}
+
+		final boolean rootstrapUsed = rootstrapUsed_;
+		String message;
+		if (rootstrapUsed) {
+			message = "Really delete SDK target ''{0}''?\n\n"+
+				"This will remove the entry from {1}.\n\n"+
+				"If existing projects use this target, you will be asked to select an alternate target.";
+		} else {
+			message = "Really delete SDK target ''{0}''?\n\n"+
+			"This will remove the entry from {1} and delete the rootstrap.\n\n"+
+			"If existing projects use this target, you will be asked to select an alternate target.";
+		}
+		String title = MessageFormat.format("Delete target from {0}?",
+				selectedTarget.getSDK().getDisplayName());
+		
+		MessageDialog dialog = new MessageDialog(shell, 
+				title, 
+				null, 
+				MessageFormat.format(
+						message,
+						selectedTarget.getName(),
+						selectedTarget.getSDK().getName()),
+				MessageDialog.WARNING,
+				new String[] { IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL },
+				1) {
+			@Override
+			protected Control createDialogArea(Composite parent) {
+				Composite composite = (Composite) super.createDialogArea(parent);
+				if (rootstrapUsed) {
+					Label spacer = new Label(composite, SWT.NONE);
+					spacer.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
+					
+					final Button removeRootstrap = new Button(composite, SWT.CHECK);
+					removeRootstrap.setText("Also delete rootstrap (target filesystem)");
+					removeRootstrap.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
+					removeRootstrap.addSelectionListener(new SelectionAdapter() {
+						@Override
+						public void widgetSelected(SelectionEvent e) {
+							deleteRootstrap[0] = removeRootstrap.getSelection();
+						}
+					});
+				}
+				return composite;
+			}
+		};
+		
+		if (dialog.open() == 0) {
+			return removeTarget(shell, selectedTarget, deleteRootstrap[0]);
+		} else {
+			return Policy.getCancelStatus(UIActivator.getDefault());
+		}
+	}
+
+	protected IStatus removeTarget(final Shell shell, final ISDKTarget selectedTarget, final boolean deleteRootstrap) {
+		ProgressMonitorDialog dialog = new ProgressMonitorDialog(shell);
+		try {
+			dialog.run(true, true, new IRunnableWithProgress() {
+
+				public void run(IProgressMonitor monitor)
+						throws InvocationTargetException, InterruptedException {
+					ESboxTargetRemover remover = new ESboxTargetRemover(shell, selectedTarget, deleteRootstrap);
+					try {
+						remover.run(monitor);
+					} catch (ESboxException e) {
+						throw new InvocationTargetException(e);
+					}
+				}
+			});
+			return Status.OK_STATUS;
+		} catch (Exception e) {
+			if (e.getCause() instanceof ESboxException) 
+				e = (Exception) e.getCause();
+			return UIActivator.createErrorStatus("Error removing target", e);
+		}
+	}
+
+}

Added: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk2/src/org/maemo/esbox/maemosdk/sdk2/ui/preferences/Scratchbox2PreferencesPage.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk2/src/org/maemo/esbox/maemosdk/sdk2/ui/preferences/Scratchbox2PreferencesPage.java	                        (rev 0)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk2/src/org/maemo/esbox/maemosdk/sdk2/ui/preferences/Scratchbox2PreferencesPage.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -0,0 +1,120 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Nokia Corporation
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    Ed Swartz (Nokia) - initial implementation
+ *******************************************************************************/
+
+package org.maemo.esbox.maemosdk.sdk2.ui.preferences;
+
+import org.eclipse.jface.preference.*;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPreferencePage;
+import org.maemo.esbox.maemosdk.core.SB2PreferenceConstants;
+
+
+/**
+ * General preference page for scratchbox 2
+ * 
+ * @author eswartz
+ */
+public class Scratchbox2PreferencesPage extends FieldEditorPreferencePage implements
+	IWorkbenchPreferencePage {
+
+	/**
+	 * Field for build mapping mode
+	 */
+	private StringFieldEditor feSbox2BuildMappingMode = null;	
+	/**
+	 * Field for install mapping mode
+	 */
+	private StringFieldEditor feSbox2InstallMappingMode = null;	
+
+	/**
+	 * Field for log level
+	 */
+	private RadioGroupFieldEditor feSbox2LogLevel = null;
+
+	private StringFieldEditor feSbox2CommandLine;	
+
+	/**
+	 * The constructor
+	 */
+	public Scratchbox2PreferencesPage() {
+		super(GRID);
+		setPreferenceStore(SB2PreferenceConstants.getPreferenceStore());
+		setDescription("Options configuring scratchbox 2");
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.eclipse.jface.preference.FieldEditorPreferencePage#createFieldEditors()
+	 */
+	public void createFieldEditors() {		
+
+		feSbox2BuildMappingMode = new StringFieldEditor(
+				SB2PreferenceConstants.SB2_MAPPING_MODE.toString(),
+				"Build mapping mode:", 
+				getFieldEditorParent());		
+
+		feSbox2InstallMappingMode = new StringFieldEditor(
+				SB2PreferenceConstants.SB2_INSTALL_MAPPING_MODE.toString(),
+				"Install mapping mode:", 
+				getFieldEditorParent());		
+
+		feSbox2LogLevel = new RadioGroupFieldEditor(
+				SB2PreferenceConstants.SB2_LOG_LEVEL.toString(),
+				"Logging level:", 
+				1,
+				new String[][] {
+					{  "none", 
+						"" }, //$NON-NLS-1$
+					{  "error", 
+						"error" }, //$NON-NLS-1$
+					{  "warning", 
+						"warning" }, //$NON-NLS-1$
+					{  "notice", 
+						"notice" }, //$NON-NLS-1$
+					{  "info", 
+						"info" }, //$NON-NLS-1$
+					{  "debug", 
+						"debug" }, //$NON-NLS-1$
+					{  "noise", 
+						"noise" }, //$NON-NLS-1$
+				},
+				getFieldEditorParent());		
+
+		feSbox2CommandLine = new StringFieldEditor(
+				SB2PreferenceConstants.SB2_EXEC_COMMAND.toString(),
+				"Command template:", 
+				getFieldEditorParent());		
+
+		// make this string manageable
+		GC gc = new GC(getFieldEditorParent().getShell()); 
+		GridData gridData = new GridData(SWT.FILL, SWT.CENTER, true, false);
+		gridData.widthHint = gc.getAdvanceWidth('m') * 32;
+		gc.dispose();
+		feSbox2CommandLine.getTextControl(getFieldEditorParent()).setLayoutData(gridData);
+
+		addField(feSbox2BuildMappingMode);
+		addField(feSbox2InstallMappingMode);
+		addField(feSbox2LogLevel);
+		addField(feSbox2CommandLine);
+	}	
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
+	 */
+	public void init(IWorkbench workbench) {
+		// Nothing to do
+	}
+	
+}
\ No newline at end of file

Added: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk2/src/org/maemo/esbox/maemosdk/sdk2/ui/wizard/MaemoRootstrapContentLabelProvider.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk2/src/org/maemo/esbox/maemosdk/sdk2/ui/wizard/MaemoRootstrapContentLabelProvider.java	                        (rev 0)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk2/src/org/maemo/esbox/maemosdk/sdk2/ui/wizard/MaemoRootstrapContentLabelProvider.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -0,0 +1,181 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Nokia Corporation.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    Ed Swartz (Nokia) - initial API and implementation
+ *******************************************************************************/
+
+package org.maemo.esbox.maemosdk.sdk2.ui.wizard;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.resource.JFaceResources;
+import org.eclipse.jface.viewers.IColorProvider;
+import org.eclipse.jface.viewers.IFontProvider;
+import org.eclipse.jface.viewers.ITableLabelProvider;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.viewers.LabelProviderChangedEvent;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.widgets.Display;
+import org.maemo.esbox.core.ESboxException;
+import org.maemo.esbox.core.machine.IMachine;
+import org.maemo.esbox.maemosdk.core.scratchbox.MaemoRootstrap;
+import org.maemo.esbox.maemosdk.sdk2.core.IScratchboxSDK2;
+
+/**
+ * This class provides installable rootstraps, descriptions, etc. from
+ * the result of 'maemo-rootstrap'.
+ * @author eswartz
+ *
+ */
+public class MaemoRootstrapContentLabelProvider extends LabelProvider implements ITreeContentProvider, ITableLabelProvider,
+	IColorProvider, IFontProvider {
+	static final int COLUMN_NAME = 0;
+	static final int COLUMN_ARCHITECTURE = 1;
+	static final int COLUMN_DESCRIPTION = 2;
+	
+	public static Object NO_ROOTSTRAP = new Object();
+	public static Object LOADING_LABEL = new Object();
+	
+	private boolean rootstrapsFetched;
+	// either MaemoRootstrap or NO_ROOTSTRAP
+	private List<Object> rootstraps;
+	private Thread rootstrapThread;
+	private final IScratchboxSDK2 sdk;
+	
+	public MaemoRootstrapContentLabelProvider(IScratchboxSDK2 sdk) {
+		this.sdk = sdk;
+	}
+	
+	public Object[] getElements(Object inputElement) {
+		if (!rootstrapsFetched) {
+			rootstraps = new ArrayList<Object>();
+			rootstraps.add(NO_ROOTSTRAP);
+			rootstraps.add(LOADING_LABEL);
+			
+			if (rootstrapThread == null) {
+				rootstrapThread = new Thread(new Runnable() {
+
+					public void run() {
+						try {
+							List<MaemoRootstrap> realRootstraps = 
+								sdk.getAvailableMaemoRootstraps(sdk.getMachine());
+							synchronized (rootstraps) {
+								rootstraps.remove(1);
+								rootstraps.addAll(realRootstraps);
+							}
+						} catch (final ESboxException e) {
+							Display.getDefault().syncExec(new Runnable() {
+
+								public void run() {
+									MessageDialog.openError(null, "Rootstrap lookup failed",
+											"Error fetching rootstraps: check proxy settings?\n\n" + e.getMessage());
+								}
+								
+							});
+						}
+						rootstrapsFetched = true;
+						rootstrapThread = null;
+						Display.getDefault().asyncExec(new Runnable() {
+
+							public void run() {
+								fireLabelProviderChanged(new LabelProviderChangedEvent(MaemoRootstrapContentLabelProvider.this));
+							}
+							
+						});
+					}
+					
+				});
+				rootstrapThread.start();
+			}
+		}
+		synchronized (rootstraps) {
+			return rootstraps.toArray();
+		}
+	}
+
+	public Object[] getChildren(Object parentElement) {
+		return new Object[0];
+	}
+
+	public Object getParent(Object element) {
+		return null;
+	}
+
+	public boolean hasChildren(Object element) {
+		return false;
+	}
+
+	public void dispose() {
+		
+	}
+
+	public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+		viewer.refresh();
+	}
+
+	public Image getColumnImage(Object element, int columnIndex) {
+		return null;
+	}
+
+	public String getColumnText(Object element, int columnIndex) {
+		switch (columnIndex) {
+		case COLUMN_NAME:
+			if (element == NO_ROOTSTRAP) {
+				return "Custom target";
+			} else if (element == LOADING_LABEL) {
+				return "Loading...";
+			} else {
+				return ((MaemoRootstrap) element).getName();
+			}
+
+		case COLUMN_ARCHITECTURE:
+			if (element == NO_ROOTSTRAP || element == LOADING_LABEL) {
+				return null;
+			}
+			return ((MaemoRootstrap) element).getArchitecture();
+
+		case COLUMN_DESCRIPTION:
+			if (element == NO_ROOTSTRAP) {
+				return "User-defined name and compiler, manually installed rootstrap";
+			} else if (element == LOADING_LABEL) {
+				return null;
+			} else {
+				return ((MaemoRootstrap) element).getDescription();
+			}
+		}
+		return null;
+	}
+	
+
+	public Color getBackground(Object element) {
+		return null;
+	}
+	
+	public Color getForeground(Object element) {
+		if (element == LOADING_LABEL)
+			return Display.getDefault().getSystemColor(SWT.COLOR_GRAY);
+		else
+			return null;
+	}
+	
+	public Font getFont(Object element) {
+		if (element == LOADING_LABEL)
+			return JFaceResources.getFontRegistry().getItalic(
+					JFaceResources.DIALOG_FONT);
+		else
+			return null;
+	}
+	
+}

Added: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk2/src/org/maemo/esbox/maemosdk/sdk2/ui/wizard/NewScratchbox2TargetWizard.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk2/src/org/maemo/esbox/maemosdk/sdk2/ui/wizard/NewScratchbox2TargetWizard.java	                        (rev 0)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk2/src/org/maemo/esbox/maemosdk/sdk2/ui/wizard/NewScratchbox2TargetWizard.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -0,0 +1,367 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2008 INdT, (c) 2008 Nokia Corporation
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    Raul Herbster (UFCG) - initial API and implementation
+ *    Carolina Nogueira de Souza (UFCG) - initial API and implementation
+ *    Ed Swartz (Nokia)
+ *******************************************************************************/
+package org.maemo.esbox.maemosdk.sdk2.ui.wizard;
+
+import java.lang.reflect.InvocationTargetException;
+import java.net.InetAddress;
+import java.net.UnknownHostException;
+import java.text.MessageFormat;
+import java.util.List;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.SubProgressMonitor;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.operation.IRunnableWithProgress;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.wizard.IWizardPage;
+import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.swt.widgets.TableItem;
+import org.eclipse.ui.INewWizard;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchWizard;
+import org.maemo.esbox.core.ESboxException;
+import org.maemo.esbox.core.ErrorLogger;
+import org.maemo.esbox.core.sdk.ISDKTarget;
+import org.maemo.esbox.maemosdk.core.scratchbox.MaemoRootstrap;
+import org.maemo.esbox.maemosdk.core.scratchbox.ScratchboxException;
+import org.maemo.esbox.maemosdk.sdk2.Activator;
+import org.maemo.esbox.maemosdk.sdk2.core.IScratchboxSDK2;
+import org.maemo.esbox.maemosdk.sdk2.core.ScratchboxSDK2;
+import org.maemo.esbox.maemosdk.ui.targets.wizards.TargetWizardCPUMethod;
+import org.maemo.esbox.maemosdk.ui.targets.wizards.TargetWizardCompilerPage;
+import org.maemo.esbox.maemosdk.ui.targets.wizards.TargetWizardNamePage;
+import org.maemo.esbox.maemosdk.ui.targets.wizards.TargetWizardPageFactory;
+import org.maemo.esbox.maemosdk.ui.targets.wizards.sbrsh.SbrshConfigurationNFSServer;
+import org.maemo.esbox.maemosdk.ui.targets.wizards.sbrsh.SbrshConfigurationTargetDevice;
+
+
+/**
+ * The target wizard provides a easy way to create a target
+ * for Scratchbox. As Scratchbox target configuration, the user
+ * can configure your target.
+ * 
+ */
+public class NewScratchbox2TargetWizard extends Wizard implements INewWizard {
+
+	protected WizardPage targetNamePage;	
+	protected WizardPage compilerNamePage;	
+	protected WizardPage cpuMethodName;	
+	protected WizardPage sbrshConfigTargetDevice;	
+	protected WizardPage sbrshConfigNFSServer;	
+    protected IProject generatedProject;
+
+	private IScratchboxSDK2 sdk;
+
+	private WizardPage maemoRootstrapPage;
+
+	protected ISDKTarget createdTarget;
+
+	private void initialize() {
+		setNeedsProgressMonitor(true);
+		setWindowTitle("New Scratchbox 2 Target");
+		ImageDescriptor image = Activator.getImageDescriptor("./icons/full/wizban/newtarget_wiz.gif");		
+		setDefaultPageImageDescriptor(image);	
+		initPages();
+	}
+  
+	/**
+	 * Constructs a new target wizard for the given SDK (from the target configuration page)
+	 * @param sdk 
+	 */
+	public NewScratchbox2TargetWizard(IScratchboxSDK2 sdk) {
+		super();
+		this.sdk = sdk;
+		initialize();
+	}
+	
+	/**
+	 * Inicializes the content of the pages.
+	 */
+	private void initPages() {
+		if (sdk != null) {
+			maemoRootstrapPage = new TargetWizardRootstrapSb2Page(sdk);		
+			addPage(maemoRootstrapPage);
+			targetNamePage = TargetWizardPageFactory.getInstance().createNamePage(sdk);		
+			addPage(targetNamePage);
+			compilerNamePage = TargetWizardPageFactory.getInstance().createCompilerPage(sdk);	
+			addPage(compilerNamePage);
+			cpuMethodName = TargetWizardPageFactory.getInstance().createCPUMethod(sdk);
+			addPage(cpuMethodName);		
+			sbrshConfigTargetDevice = TargetWizardPageFactory.getInstance().createSbrshConfigDeviceTargetPage();
+			addPage(sbrshConfigTargetDevice);
+			sbrshConfigNFSServer = TargetWizardPageFactory.getInstance().createSbrshConfigNFSSServer();
+			addPage(sbrshConfigNFSServer);
+		} else {
+			addPage(TargetWizardPageFactory.getInstance().createBadInstallationPage());
+		}
+	}
+	
+	public boolean canFinish() {
+		if (sdk == null)
+			return false;
+		
+		boolean nonCustomRootstrap = true;
+		if (maemoRootstrapPage != null)
+			nonCustomRootstrap = ((TargetWizardRootstrapSb2Page) maemoRootstrapPage).canFinish();
+		boolean cpuPage = ((TargetWizardCPUMethod) cpuMethodName).canFinish();
+		boolean configDevice = ((SbrshConfigurationTargetDevice) sbrshConfigTargetDevice).canFinish();
+		boolean NFSServer = ((SbrshConfigurationNFSServer) sbrshConfigNFSServer).canFinish();
+		boolean sbrshConfigAccepted = ((TargetWizardCPUMethod) cpuMethodName).getSbrshConfigure();
+		
+		if (!sbrshConfigAccepted && (nonCustomRootstrap || cpuPage) )
+			return true;
+		if (sbrshConfigAccepted && NFSServer && configDevice)			 
+			return true;
+		 
+		return false;
+	}
+	
+	@Override
+	public IWizardPage getNextPage(IWizardPage page) {
+		if (page == maemoRootstrapPage) {
+			boolean nonCustomRootstrap = ((TargetWizardRootstrapSb2Page) maemoRootstrapPage).canFinish();
+			if (nonCustomRootstrap)
+				return null;
+			else
+				return super.getNextPage(page);
+		}
+		if(page == cpuMethodName) {			
+			boolean sbrshConfigAccepted = ((TargetWizardCPUMethod) cpuMethodName).getSbrshConfigure();
+			if(!sbrshConfigAccepted)  // user does not want to configure sbrsh
+				return null;
+			else  // user wants to configure sbrsh					
+				return super.getNextPage(page);
+		}
+		return super.getNextPage(page);        
+	}
+	
+	
+	
+	/*
+	 *  (non-Javadoc)
+	 * @see org.eclipse.jface.wizard.IWizard#performFinish()
+	 */
+	public boolean performFinish() {	
+		if (getRootstrap() != null) {
+			if (!setupTargetFromRootstrap())
+				return false;
+		} else {
+			if (!setupTargetFromScratch())
+				return false;
+		}
+		
+		boolean sbrshConfigSelected = ((TargetWizardCPUMethod) cpuMethodName).getSbrshConfigure();
+		if (sbrshConfigSelected) {			
+			configureSbrshService();		
+			showsDialog();	
+		}				
+		
+		return true;
+	}
+
+	private boolean setupTargetFromScratch() {
+		String targetName;
+		// in this mode, construct a target from the user's settings
+		targetName = getTargetNameSelected();		
+		String compilerName = getCompilerNameSelected();
+		String cpuMethod = getCputranspSelected();	
+		try {
+			sdk.createTarget(targetName, compilerName, null,cpuMethod);
+			createdTarget = sdk.findSDKTarget(targetName);
+			return true;
+		} catch (ESboxException e) {
+			ErrorLogger errorLogger = Activator.getErrorLogger();
+			errorLogger.logAndShowError("Cannot get create target " + targetName, e);			
+			return false;
+		}
+	}
+
+	private boolean setupTargetFromRootstrap() {
+		String targetName;
+		// in this mode, make a predefined target from a maemo rootstrap
+		targetName = getRootstrap().getName();
+		boolean create = true;
+		
+		if (true) {
+			// see if the rootstrap (not necessarily the target) already exists,
+			// and ask user, in case this will overwrite their customizations
+			try {
+				List<String> installedRootstraps = 
+					sdk.getInstalledMaemoRootstraps();
+				if (installedRootstraps.contains(targetName)) {
+					create = MessageDialog.openConfirm(getShell(), "Reinstall rootstrap?", 
+							MessageFormat.format("The rootstrap ''{0}'' appears to be already installed, though it may be disconnected from scratchbox.\n\n"+
+									"At this time, we can't recreate a target for this rootstrap, but " +
+									"you could do it manually with 'sb2-init'.\n\n" +
+									"Do you want to overwrite the rootstrap?",
+									targetName));
+				}
+			} catch (ESboxException e) {
+				ErrorLogger errorLogger = Activator.getErrorLogger();
+				errorLogger.logError("Cannot detect installed rootstraps", e);			
+			}
+		}
+		
+		if (create) {
+			try {
+				createRootstrap(targetName, useHostTools());
+			} catch (ESboxException e) {
+				ErrorLogger errorLogger = Activator.getErrorLogger();
+				errorLogger.logAndShowError("Cannot get create rootstrap target " + targetName, e);			
+				return false;
+			}
+		}
+		return true;
+	}
+
+	private void createRootstrap(final String targetName, final boolean useHostTools) throws ScratchboxException {
+		try {
+			getContainer().run(true, true, new IRunnableWithProgress() {
+
+					public void run(IProgressMonitor monitor)
+							throws InvocationTargetException,
+							InterruptedException {
+						monitor.beginTask("Creating rootstrap", IProgressMonitor.UNKNOWN);
+						try {
+							sdk.createRootstrapTarget(
+									targetName, useHostTools, true, 
+									new SubProgressMonitor(monitor, 1));
+							createdTarget = sdk.findSDKTarget(targetName);
+						} catch (ESboxException e) {
+							throw new InvocationTargetException(e);
+						}
+						monitor.done();
+					}
+					
+				});
+		} catch (InvocationTargetException e) {
+			if (e.getCause() instanceof ScratchboxException)
+				throw (ScratchboxException) e.getCause();
+			else
+				throw new ScratchboxException(e);
+		} catch (InterruptedException e) {
+			throw new ScratchboxException(e);
+		}
+	}
+	
+	private MaemoRootstrap getRootstrap() {
+		return ((TargetWizardRootstrapSb2Page) maemoRootstrapPage).getRootstrap();
+	}
+	private boolean useHostTools() {
+		return ((TargetWizardRootstrapSb2Page) maemoRootstrapPage).useHostTools();
+	}
+	
+	/**
+	 * Return the name of the target to be created.
+	 * @return the name of the target to be created.
+	 */
+	private String getTargetNameSelected() {
+		return ((TargetWizardNamePage) targetNamePage).getTextControl().getText();
+	}
+	
+	/**
+	 * Return the compiler name of the target to be created.
+	 * @return the compiler name of the target to be created.
+	 */
+	private String getCompilerNameSelected() {
+		TableItem item = ((TargetWizardCompilerPage) compilerNamePage).getTableControl().getSelection()[0];
+		return item.getText();
+	}
+	
+	/**
+	 * Return the cputransp name of the target to be created.
+	 * @return the cputransp name of the target to be created.
+	 */
+	private String getCputranspSelected() {
+		TableItem item = ((TargetWizardCPUMethod) cpuMethodName).getTable().getSelection()[0];
+		return item.getText();
+	}
+	
+	/**
+	 * Configure sbrsh service.
+	 */
+	private void configureSbrshService() {
+		String targetName = getTargetNameSelected();
+		String deviceTargetAddr = ((SbrshConfigurationTargetDevice)sbrshConfigTargetDevice).getTargetDeviceAddr();
+		String nfsHostname = ((SbrshConfigurationNFSServer)sbrshConfigNFSServer).getNFSHostname();
+		
+		try {
+			sdk.configureSbrsh(targetName, deviceTargetAddr, nfsHostname);
+		} catch (ESboxException e) {
+			ErrorLogger errorLogger = Activator.getErrorLogger();
+			errorLogger.logAndShowError("Cannot configure sbrsh", e);			
+		}
+	}	
+		
+	
+	/**
+	 * Add user at access list of the sbrshd running at the target device.
+	 */
+	private void addUser() {	
+		String deviceTargetIP = ((SbrshConfigurationTargetDevice)sbrshConfigTargetDevice).getTargetDeviceIP();
+		String username = System.getProperty("user.name");	
+		ErrorLogger errorLogger = Activator.getErrorLogger();
+		
+		try {
+			String localAddr = getLocalIP();
+			sdk.addSbrshAccessList(deviceTargetIP, username, localAddr);
+		} catch (ESboxException e) {
+			errorLogger.logAndShowError("Cannot add user to the access list of sbrshd at the target device", e);			
+		} catch (UnknownHostException e) {
+			errorLogger.logAndShowError("Cannot get local IP address", e);			
+		}
+	}
+	
+	/**
+	 * Shows the dialog to ask the user if s/he wants to add his/herself to the acess list of the 
+	 * sbrshd.
+	 */
+	private void showsDialog() {				
+		String deviceTargetAddr = ((SbrshConfigurationTargetDevice)sbrshConfigTargetDevice).getTargetDeviceIP();
+		String text = "Do you want to add yourself to the access list of the sbrshd running on target device? \n";
+		text += "(This requires that "+ deviceTargetAddr +" has ssh daemon running and sbrshd already installed, and that you have root access).";
+		boolean userAddedAtAccessList = MessageDialog.openQuestion(getShell(),"Scratchbox Configuration",text);		
+		if(userAddedAtAccessList) {
+			addUser();			
+		}
+	}
+	
+	/**
+	 * Get the local IP address.
+	 * @return the local IP address.
+	 * @throws UnknownHostException
+	 */
+	private String getLocalIP() throws UnknownHostException {
+		return InetAddress.getLocalHost().getHostAddress();
+	}
+
+	/**
+	 * We will accept the selection in the workbench to see if
+	 * we can initialize from it.
+	 * @see IWorkbenchWizard#init(IWorkbench, IStructuredSelection)
+	 */
+	public void init(IWorkbench workbench, IStructuredSelection selection) {
+	}
+
+	/**
+	 * Get the target created.  Only valid after wizard dialog completes.
+	 * @return newly created ISDKTarget or <code>null</code>
+	 */
+	public ISDKTarget getCreatedTarget() {
+		return createdTarget;
+	}
+	
+}
\ No newline at end of file

Added: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk2/src/org/maemo/esbox/maemosdk/sdk2/ui/wizard/TargetWizardRootstrapSb2Page.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk2/src/org/maemo/esbox/maemosdk/sdk2/ui/wizard/TargetWizardRootstrapSb2Page.java	                        (rev 0)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sdk2/src/org/maemo/esbox/maemosdk/sdk2/ui/wizard/TargetWizardRootstrapSb2Page.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -0,0 +1,205 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Nokia Corporation
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    Ed Swartz (Nokia) - initial API and implementation
+ *******************************************************************************/
+
+package org.maemo.esbox.maemosdk.sdk2.ui.wizard;
+
+import org.eclipse.jface.viewers.ILabelProviderListener;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.LabelProviderChangedEvent;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerFilter;
+import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.swt.widgets.TreeColumn;
+import org.maemo.esbox.maemosdk.core.scratchbox.MaemoRootstrap;
+import org.maemo.esbox.maemosdk.core.sdk.IScratchboxSDK;
+import org.maemo.esbox.maemosdk.sdk2.core.IScratchboxSDK2;
+import org.maemo.esbox.maemosdk.sdk2.core.ScratchboxSDK2;
+import org.maemo.esbox.maemosdk.ui.targets.wizards.IValidatePage;
+
+/**
+ * This page allows the user to select a rootstrap (which defines the target name,
+ * compiler, devkits, and cpu method all at once) for use with sb2, or to explicitly
+ * select to configure all the aspects himself.
+ * @author eswartz
+ *
+ */
+public class TargetWizardRootstrapSb2Page extends WizardPage implements IValidatePage {
+	
+	protected TreeViewer rootstrapTargetViewer;
+	protected Text text;	
+	/*private*/ IScratchboxSDK2 sdk;	// in case we use it later
+	protected Object selection;
+	private MaemoRootstrapContentLabelProvider provider;
+	private Button showExistingTargets;
+	private Button useHostTools;
+	
+	/**
+	 * Constructs a NewTargetWizardNamePage.
+	 */
+	protected TargetWizardRootstrapSb2Page(IScratchboxSDK2 sdk) {		
+		super("Target Name");
+		this.sdk = sdk;
+		if (!(sdk instanceof ScratchboxSDK2)) {
+			throw new IllegalArgumentException("This page only expects a scratchbox 2 SDK");
+		}
+		setTitle("Select maemo SDK+ Rootstrap");
+		setDescription("Select the maemo rootstrap to install, or manually configure a target.");
+		setPageComplete(false);		
+	}	
+		
+	/*
+	 *  (non-Javadoc)
+	 * @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite)
+	 */
+	public void createControl(Composite parent) {
+		Composite composite = new Composite(parent, SWT.NONE);
+		composite.setLayout(new GridLayout(1, false));
+		
+		Label label = new Label(composite, SWT.LEFT);
+		label.setText("Select a rootstrap:"); 
+		
+		rootstrapTargetViewer = new TreeViewer(composite, SWT.SINGLE | SWT.BORDER);
+		rootstrapTargetViewer.getTree().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+		
+		showExistingTargets = new Button(composite, SWT.CHECK);
+		showExistingTargets.setText("Show existing targets");
+		showExistingTargets.setSelection(false);
+		showExistingTargets.setToolTipText("If checked, rootstraps with names matching existing targets will be shown.  This is the only way to reinstall a target.");
+
+		useHostTools = new Button(composite, SWT.CHECK);
+		useHostTools.setText("Use host's build tools");
+		useHostTools.setSelection(false);
+		useHostTools.setToolTipText("If checked, configure the rootstrap to use the host versions of autotools, bison, flex, docbook, etc. instead of standard versions (c.f. devkits in scratchbox 1).  We recommend leaving this unchecked and invoking maemo-tools to install official build tools.");
+
+		/// setup rootstrap target tree
+		
+		provider = new MaemoRootstrapContentLabelProvider(sdk);
+		rootstrapTargetViewer.setContentProvider(provider);
+		rootstrapTargetViewer.setLabelProvider(provider);
+
+		rootstrapTargetViewer.addSelectionChangedListener(new ISelectionChangedListener() {
+
+			public void selectionChanged(SelectionChangedEvent event) {
+				selection = ((IStructuredSelection) event.getSelection()).getFirstElement();
+				validatePage();
+			}
+			
+		});
+		
+		provider.addListener(new ILabelProviderListener() {
+
+			public void labelProviderChanged(LabelProviderChangedEvent event) {
+				rootstrapTargetViewer.refresh();
+			}
+			
+		});
+		
+		rootstrapTargetViewer.getTree().setLinesVisible(true);
+		rootstrapTargetViewer.getTree().setHeaderVisible(true);
+		
+		TreeColumn nameColumn = new TreeColumn(rootstrapTargetViewer.getTree(), SWT.LEFT);
+		nameColumn.setText("Target Name");
+		nameColumn.setWidth(200);
+		nameColumn.setResizable(true);
+		
+		TreeColumn archColumn = new TreeColumn(rootstrapTargetViewer.getTree(), SWT.LEFT);
+		archColumn.setText("Architecture");
+		archColumn.setWidth(100);
+		archColumn.setResizable(true);
+		
+		TreeColumn descColumn = new TreeColumn(rootstrapTargetViewer.getTree(), SWT.LEFT);
+		descColumn.setText("Description");
+		descColumn.setWidth(200);
+		descColumn.setResizable(true);
+
+		
+		rootstrapTargetViewer.setInput(new Object());
+		
+		rootstrapTargetViewer.setSelection(StructuredSelection.EMPTY);
+
+		showExistingTargets.addSelectionListener(new SelectionAdapter() {
+			@Override
+			public void widgetSelected(SelectionEvent e) {
+				updateViewerFilters();
+			}
+		});
+		
+		updateViewerFilters();
+		setControl(composite);
+	}
+	
+	protected void updateViewerFilters() {
+		if (!showExistingTargets.getSelection()) {
+			rootstrapTargetViewer.setFilters(new ViewerFilter[] {
+					new ViewerFilter() {
+
+						@Override
+						public boolean select(Viewer viewer,
+								Object parentElement, Object element) {
+							if (element instanceof MaemoRootstrap) {
+								MaemoRootstrap rootstrap = (MaemoRootstrap) element;
+								if (sdk.findSDKTarget(rootstrap.getName()) != null)
+									return false;
+							}
+							return true;
+						}
+						
+					}
+			});
+		} else {
+			rootstrapTargetViewer.setFilters(new ViewerFilter[0]);
+		}
+			
+		rootstrapTargetViewer.refresh();
+		
+	}
+
+	/*
+	 *  (non-Javadoc)
+	 * @see br.edu.ufcg.dee.omapsdk.properties.target.wizard.pages.ValidateWizardPage#perfomeAction()
+	 */
+	public boolean validatePage() {		
+		setPageComplete(selection instanceof MaemoRootstrap || selection == MaemoRootstrapContentLabelProvider.NO_ROOTSTRAP);
+		return true;
+	}
+	
+	public boolean canFinish() {
+		return selection instanceof MaemoRootstrap;
+	}
+
+	public MaemoRootstrap getRootstrap() {
+		if (!(selection instanceof MaemoRootstrap))
+			return null;
+		return (MaemoRootstrap) selection;
+	}
+	
+	public boolean isShowingExisting() {
+		return showExistingTargets.getSelection();
+	}
+	
+	public boolean useHostTools() {
+		return useHostTools.getSelection();
+	}
+		
+}
\ No newline at end of file

Modified: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/AllTests.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/AllTests.java	2008-10-07 23:27:03 UTC (rev 840)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/AllTests.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -11,7 +11,9 @@
 
 package org.maemo.esbox.maemosdk.tests;
 
-import junit.framework.*;
+import junit.framework.JUnit4TestAdapter;
+import junit.framework.Test;
+import junit.framework.TestSuite;
 
 /**
  * @author eswartz

Modified: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/TestOProfileValgrindSupport.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/TestOProfileValgrindSupport.java	2008-10-07 23:27:03 UTC (rev 840)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/TestOProfileValgrindSupport.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -11,7 +11,8 @@
 
 package org.maemo.esbox.maemosdk.tests;
 
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
 
 import org.junit.Test;
 import org.maemo.esbox.analysis.adapters.IOProfileSupportAdapter;

Modified: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/TestProcessLauncher.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/TestProcessLauncher.java	2008-10-07 23:27:03 UTC (rev 840)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/TestProcessLauncher.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -23,7 +23,6 @@
 import org.maemo.esbox.core.sdk.*;
 import org.maemo.esbox.core.tests.core.BaseTest;
 import org.maemo.esbox.internal.api.core.sdk.HostSDK;
-import org.maemo.esbox.maemosdk.core.sdk.IScratchboxSDKTarget;
 
 import java.io.ByteArrayOutputStream;
 import java.io.OutputStream;
@@ -67,7 +66,9 @@
 			int count = MAX_TARGETS;
 			ISDKTarget[] targets = sdk.getSDKTargets();
 			for (ISDKTarget target : targets) {
-				if (target.getName().contains("libtool"))
+				if (target.getName().contains("libtool") 
+						|| target.getName().contains("REMOVE")
+						|| target.getName().contains("bora"))
 					continue;
 				if (!validateMachine(target.getSDK().getMachine()))
 					continue;
@@ -88,27 +89,31 @@
 
 			public void run(ISDKTarget target) throws Exception {
 
-				String cmdText = "echo $CC $LDFLAGS =$SPACEY= \"$LAST\"";
-				Properties envVars = new Properties();
-				envVars.put("CC", "gcc");
-				envVars.put("LDFLAGS", "-lm");
-				envVars.put("SPACEY", "-a -b larry's -d");	// the ' should not cause a problem
-				envVars.put("LAST", "*");  // this should not be expanded
+				String cmdText = "echo $CC $LDFLAGS =$SPACEY= \"$LAST\" $LANG$MAIL$IFS .";
+				IEnvironmentModifierBlock envVarBlock = EnvironmentManager.getInstance().createEnvironmentModifierBlock();
+				envVarBlock.define("CC", "gcc");
+				envVarBlock.define("LDFLAGS", "-lm");
+				envVarBlock.define("SPACEY", "-a -b larry's -d");	// the ' should not cause a problem
+				envVarBlock.define("LAST", "*");  // this should not be expanded
+				envVarBlock.undefine("LANG");
+				envVarBlock.undefine("MAIL");
+				envVarBlock.undefine("IFS");
+				
 				IProcessLauncher processLauncher = createAndLaunchStockProcessForScript(
-						target, null, cmdText, envVars);
+						target, null, cmdText, envVarBlock);
 
 				ByteArrayOutputStream out = new ByteArrayOutputStream();
 				ByteArrayOutputStream err = new ByteArrayOutputStream();
 				int exit = processLauncher.waitAndRead(out, err);
 				assertEquals(target.getName() + ": " + err.toString(), 0, exit);	// some targets can't handle export $@
 				assertEquals("", err.toString());
-				assertStdTextEquals("gcc -lm =-a -b larry's -d= *\n", out.toString());
+				assertStdTextEquals("gcc -lm =-a -b larry's -d= * .\n", out.toString());
 			}
 
 		});
 	}
 
-	/** Make sure env vars are not lost entirely */
+	/** Make sure env vars are not lost entirely when passing null envBlock */
 	@Test
 	public void testEnvVars2() throws Exception {
 		runOverTargets(new IRunner() {
@@ -122,7 +127,7 @@
 				ByteArrayOutputStream out = new ByteArrayOutputStream();
 				ByteArrayOutputStream err = new ByteArrayOutputStream();
 				int exit = processLauncher.waitAndRead(out, err);
-				assertEquals(0, exit);
+				assertEquals(target+":\n"+err.toString(), 0, exit);
 
 				assertEquals("", err.toString());
 				assertTrue(out.toString().contains(":"));
@@ -146,7 +151,7 @@
 				ByteArrayOutputStream out = new ByteArrayOutputStream();
 				ByteArrayOutputStream err = new ByteArrayOutputStream();
 				int exit = processLauncher.waitAndRead(out, err);
-				assertEquals(0, exit);
+				assertEquals(target+":\n"+err.toString(), 0, exit);
 
 				assertStdTextEquals("stderr1\nstderr2\nstderr3\nstderr4\n", err
 						.toString());
@@ -190,12 +195,12 @@
 	 * @param target SDK target to use
 	 * @param cwd target-relative CWD or null
 	 * @param cmdText text to copy into script
-	 * @param envVars environment variables
+	 * @param envVarBlock environment variables
 	 * @param pty pty or null
 	 * @return new process launcher
 	 */
 	IProcessLauncher createAndLaunchStockProcessForScript(
-			ISDKTarget target, IPath cwd, String cmdText, Properties envVars)
+			ISDKTarget target, IPath cwd, String cmdText, IEnvironmentModifierBlock envVarBlock)
 			throws Exception {
 		IProcessLauncherFactory processLauncherFactory = target
 				.getProcessLauncherFactory();
@@ -203,11 +208,11 @@
 		return createAndLaunchStockProcessForScript(
 				processLauncherFactory,
 				target, cwd, cmdText,
-				envVars);
+				envVarBlock);
 	}
 
 	IProcessLauncher createAndLaunchStockProcessForScript(IProcessLauncherFactory processLauncherFactory,
-			ISDKTarget target, IPath cwd, String cmdText, Properties envVars)
+			ISDKTarget target, IPath cwd, String cmdText, IEnvironmentModifierBlock envVarBlock)
 			throws Exception {
 		createStockScript(target, cmdText);
 
@@ -216,7 +221,7 @@
 		IProcessLauncher processLauncher = ProcessLauncherCreator.createProcessLauncher(
 				processLauncherFactory, cwd, 
 				CommandLineArguments.wrapScriptCommandLineForShell(cmdLine),
-				envVars);
+				envVarBlock);
 		// System.out.println(processLauncher.getLaunchCommandArguments().toCommandLine());
 
 		theProcess = processLauncher.createProcess();
@@ -295,7 +300,7 @@
 				ByteArrayOutputStream out = new ByteArrayOutputStream();
 				ByteArrayOutputStream err = new ByteArrayOutputStream();
 				int exit = processLauncher.waitAndRead(out, err);
-				assertEquals(0, exit);
+				assertEquals(target+":\n"+err.toString(), 0, exit);
 
 				assertStdTextEquals("", err.toString());
 				assertEquals(target.getName(), "/usr/games", out.toString().trim());
@@ -321,7 +326,7 @@
 				ByteArrayOutputStream out = new ByteArrayOutputStream();
 				ByteArrayOutputStream err = new ByteArrayOutputStream();
 				int exit = processLauncher.waitAndRead(out, err);
-				assertEquals(0, exit);
+				assertEquals(target+":\n"+err.toString(), 0, exit);
 				
 				// some sdks don't have sed
 				if (!err.toString().contains("command not found")) {
@@ -340,42 +345,37 @@
 		runOverTargets(new IRunner() {
 			
 			public void run(ISDKTarget target) throws Exception {
-				// the local host launcher does not pass ESbox variables.
-				if (!(target instanceof IScratchboxSDKTarget))
-					return;
-				
-				IEnvironmentVariableBlock envBlockOrig = new EnvironmentVariableBlock();
-				IEnvironmentVariableBlock envBlock = EnvironmentVariableManager.getInstance().getGlobalEnvironmentBlock();
-				envBlock.copyTo(envBlockOrig);
+				IEnvironmentModifierBlock globalBlock = EnvironmentManager.getInstance().getGlobalEnvironmentModifierBlock();
+				IEnvironmentModifierBlock envBlockOrig = globalBlock.copy();
 
 				try {
 					// DISPLAY comes from the .bashrc in scratchbox or from the X11 environment
-					envBlock.clear();
+					globalBlock.clear();
 					
 					// set ESbox variables
-					envBlock.define("ESBOXONLY", "fromesbox_original");
-					envBlock.define("ESBOXOVERRIDE", "fromesbox_original");
-					envBlock.define("DISPLAY", "esbox:3");
+					globalBlock.define("ESBOXONLY", "fromesbox_original");
+					globalBlock.define("ESBOXOVERRIDE", "fromesbox_original");
+					globalBlock.define("DISPLAY", "esbox:3");
 					
 					// construct an environment that consists of overrides of the standard environment
 					IProcessLauncherFactory factory = target.getProcessLauncherFactory(); 
-					Properties envVars = factory.getStandardEnvironment();
+					IEnvironmentModifierBlock envVarBlock = factory.defaultEnvironmentModifierBlock();
 					
-					assertTrue(envVars.containsKey("ESBOXONLY"));
-					assertTrue(envVars.containsKey("ESBOXOVERRIDE"));
-					assertTrue(envVars.containsKey("DISPLAY"));
+					assertNotNull(envVarBlock.findOperation("ESBOXONLY"));
+					assertNotNull(envVarBlock.findOperation("ESBOXOVERRIDE"));
+					assertNotNull(envVarBlock.findOperation("DISPLAY"));
 					
-					envVars.put("ESBOXOVERRIDE", "launch_override");
-					envVars.put("PASSEDIN", "launch_passedin");
+					envVarBlock.define("ESBOXOVERRIDE", "launch_override");
+					envVarBlock.define("PASSEDIN", "launch_passedin");
 					
 					String cmdText = "echo $DISPLAY,$ESBOXONLY,$ESBOXOVERRIDE,$PASSEDIN\necho $USER\n";
 					IProcessLauncher processLauncher = createAndLaunchStockProcessForScript(
-							factory, target, null, cmdText, envVars);
+							factory, target, null, cmdText, envVarBlock);
 	
 					ByteArrayOutputStream out = new ByteArrayOutputStream();
 					ByteArrayOutputStream err = new ByteArrayOutputStream();
 					int exit = processLauncher.waitAndRead(out, err);
-					assertEquals(0, exit);
+					assertEquals(target+":\n"+err.toString(), 0, exit);
 	
 					assertStdTextEquals("", err.toString());
 					String[] lines = out.toString().trim().split("\r\n|\n");
@@ -386,23 +386,24 @@
 					//////////
 	
 					// construct an environment that consists of a clean environment
-					envVars = new Properties(); 
-					envVars.put("ESBOXOVERRIDE", "launch_override");
-					envVars.put("PASSEDIN", "launch_passedin");
+					envVarBlock = EnvironmentManager.getInstance().createEnvironmentModifierBlock(); 
+					envVarBlock.define("ESBOXOVERRIDE", "launch_override");
+					envVarBlock.define("PASSEDIN", "launch_passedin");
 					
 					cmdText = "echo $ESBOXONLY,$ESBOXOVERRIDE,$PASSEDIN";
 					processLauncher = createAndLaunchStockProcessForScript(
-							target, null, cmdText, envVars);
+							target, null, cmdText, envVarBlock);
 	
 					out = new ByteArrayOutputStream();
 					err = new ByteArrayOutputStream();
 					exit = processLauncher.waitAndRead(out, err);
-					assertEquals(0, exit);
+					assertEquals(target+":\n"+err.toString(), 0, exit);
 	
 					assertEquals("", err.toString());
 					assertStdTextEquals(",launch_override,launch_passedin\n", out.toString());
 				} finally {
-					envBlockOrig.copyTo(EnvironmentVariableManager.getInstance().getGlobalEnvironmentBlock());
+					EnvironmentManager.getInstance().getGlobalEnvironmentModifierBlock().clear();
+					EnvironmentManager.getInstance().getGlobalEnvironmentModifierBlock().apply(envBlockOrig);
 				}
 			}
 		});
@@ -420,21 +421,24 @@
 				createStockScript(target, "echo hello\n");
 				
 				// make an overridden environment that has the script directory in its PATH
-				Properties env = target.getProcessLauncherFactory().getStandardEnvironment();
-				env.put("PATH", env.get("PATH") + ":" + new Path(STOCK_SCRIPT_NAME).removeLastSegments(1));
+				String scriptDir = new Path(STOCK_SCRIPT_NAME).removeLastSegments(1).toPortableString();
+				IEnvironmentModifierBlock envVarBlock =
+					ProcessLauncherUtils.addToPATH(target.getSDK().getMachine(),
+							target.getProcessLauncherFactory(), 
+							scriptDir, true);
 				
 				IProcessLauncher processLauncher = ProcessLauncherCreator.createProcessLauncher(
 						target.getProcessLauncherFactory(),
 						null,
 						CommandLineArguments.createFromCommandLine(new Path(STOCK_SCRIPT_NAME).lastSegment()),
-						env);
+						envVarBlock);
 				
 				processLauncher.createProcess();
 				
 				ByteArrayOutputStream out = new ByteArrayOutputStream();
 				ByteArrayOutputStream err = new ByteArrayOutputStream();
 				int exit = processLauncher.waitAndRead(out, err);
-				assertEquals(0, exit);
+				assertEquals(target+":\n"+err.toString(), 0, exit);
 				
 				assertStdTextEquals("hello\n", out.toString());
 			}

Modified: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/TestRunStandalone.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/TestRunStandalone.java	2008-10-07 23:27:03 UTC (rev 840)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/TestRunStandalone.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -11,7 +11,8 @@
 
 package org.maemo.esbox.maemosdk.tests;
 
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
 
 import org.junit.Test;
 import org.maemo.esbox.core.process.ProcessLauncherParameters;

Modified: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/TestSB1ProcessLauncher.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/TestSB1ProcessLauncher.java	2008-10-07 23:27:03 UTC (rev 840)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/TestSB1ProcessLauncher.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -20,6 +20,8 @@
 import org.eclipse.core.runtime.Platform;
 import org.junit.Test;
 import org.maemo.esbox.core.ESboxException;
+import org.maemo.esbox.core.env.EnvironmentManager;
+import org.maemo.esbox.core.env.IEnvironmentModifierBlock;
 import org.maemo.esbox.core.process.CommandLineArguments;
 import org.maemo.esbox.core.process.IProcessLauncher;
 import org.maemo.esbox.core.process.IProcessLauncherFactory;
@@ -85,21 +87,17 @@
 			public void run(ISDKTarget target) throws Exception {
 				IProcessLauncherFactory processLauncherFactory = target
 						.getProcessLauncherFactory();
-				IProcessLauncher processLauncher = ProcessLauncherCreator.createProcessLauncher(processLauncherFactory, "ls");
+				IProcessLauncher processLauncher = ProcessLauncherCreator.createProcessLauncher(
+						processLauncherFactory, "ls");
 				List<String> args = processLauncher.getLaunchCommandArguments();
 				assertNotNull(args);
 
 				// be sure no variables are left unexpanded
 				assertFalse(CommandLineArguments.toCommandLine(args).contains("${"));
 
-				// assume the pattern is still /scratchbox/login -d ...
-				// ".../run.sh ... \".... <command>\""
-				// (basically verifying the command is wrapped)
+				// assume the pattern is still /scratchbox/login ... 
 				assertEquals("/scratchbox/login", args.get(0));
-				String last = args.get(args.size() - 1);
-				// System.out.println(last);
-				assertTrue(last
-						.matches("\\Q./run.sh /\\E\\s+\\S+=\\S+\\s+\\Q\\\"ls \\\"\\E"));
+			
 			}
 		});
 	}
@@ -112,11 +110,12 @@
 			public void run(ISDKTarget target) throws Exception {
 				IProcessLauncherFactory processLauncherFactory = target
 						.getProcessLauncherFactory();
-				Properties envVars = new Properties();
-				envVars.put("CC", "gcc");
-				envVars.put("LDFLAGS", "-lm");
-				envVars.put("SPACEY", "a b c");
-				envVars.put("WILD", "*");
+				IEnvironmentModifierBlock envVars = EnvironmentManager.getInstance().createEnvironmentModifierBlock();
+				envVars.define("CC", "gcc");
+				envVars.define("LDFLAGS", "-lm");
+				envVars.define("SPACEY", "a b c");
+				envVars.define("WILD", "*");
+				envVars.undefine("FOOBAR");
 				IPath tempPath = new Path("/tmp");
 				IProcessLauncher processLauncher = ProcessLauncherCreator.createProcessLauncher(processLauncherFactory,
 						tempPath, 
@@ -126,8 +125,8 @@
 
 				// the env vars are encoded into run.sh, not passed outside the
 				// process
-				Properties launchEnvironment = processLauncher
-						.getLaunchEnvironment();
+				IEnvironmentModifierBlock launchEnvironment = processLauncher
+						.getLaunchEnvironmentModifierBlock();
 				assertNull(launchEnvironment);
 
 				List<String> args = processLauncher.getLaunchCommandArguments();
@@ -143,7 +142,7 @@
 				String last = args.get(args.size() - 1);
 				// System.out.println(last);
 				assertEquals(
-						"./run.sh " + tempPath.toPortableString() + " \\\"CC=gcc,LDFLAGS=-lm,SPACEY=a b c,WILD=*\\\" \\\"./configure --enable-maintainer-mode --disable-gtk\\\"",
+						"./run.sh " + tempPath.toPortableString() + " \\\"CC=gcc,LDFLAGS=-lm,SPACEY=a b c,WILD=*,-FOOBAR\\\" \\\"./configure --enable-maintainer-mode --disable-gtk\\\"",
 						last);
 
 			}
@@ -151,21 +150,17 @@
 	}
 
 	
-	/** Test that the Esbox environment variables are passed properly.
-	 * DISPLAY is defined on the user account */
+	/** Test that the Esbox environment variables are passed properly. */
 	@Test
-	public void testEnvironmentDefaultsSb1() throws Exception {
+	public void testEnvironmentPassingSb1() throws Exception {
 		runOverTargets(new IRunner() {
 			
 			public void run(ISDKTarget target) throws Exception {
-				// DISPLAY comes from the .bashrc in scratchbox or from the X11 environment
-
-				// construct an environment that consists of a clean environment
-				Properties envVars = new Properties(); 
+				IEnvironmentModifierBlock envVars = EnvironmentManager.getInstance().createEnvironmentModifierBlock();
 				
-				envVars.put("DISPLAY", ":2");
-				envVars.put("ESBOXOVERRIDE", "launch_override");
-				envVars.put("PASSEDIN", "launch_passedin");
+				envVars.define("DISPLAY", ":2");
+				envVars.define("ESBOXOVERRIDE", "launch_override");
+				envVars.define("PASSEDIN", "launch_passedin");
 				
 				String cmdText = "echo $DISPLAY,$ESBOXONLY,$ESBOXOVERRIDE,$PASSEDIN";
 				IProcessLauncher processLauncher = createAndLaunchStockProcessForScript(

Modified: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/TestSB2SDKProvider.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/TestSB2SDKProvider.java	2008-10-07 23:27:03 UTC (rev 840)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/TestSB2SDKProvider.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -10,19 +10,24 @@
  *******************************************************************************/
 package org.maemo.esbox.maemosdk.tests;
 
+import java.util.List;
+
+import junit.framework.TestCase;
+
 import org.eclipse.core.filesystem.IFileStore;
-import org.eclipse.core.runtime.*;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Platform;
 import org.junit.Test;
 import org.maemo.esbox.core.ESboxException;
 import org.maemo.esbox.core.machine.ILocalMachine;
-import org.maemo.esbox.core.sdk.*;
+import org.maemo.esbox.core.sdk.ISDK;
+import org.maemo.esbox.core.sdk.ISDKProvider;
+import org.maemo.esbox.core.sdk.ISDKTarget;
+import org.maemo.esbox.core.sdk.SDKFactory;
 import org.maemo.esbox.maemosdk.core.sdk.IScratchboxSDKTarget;
 import org.maemo.esbox.maemosdk.sdk2.provider.ScratchboxSDK2Provider;
 
-import java.util.List;
-
-import junit.framework.TestCase;
-
 /**
  * If SB2 is installed, make sure its SDKs and targets
  * are properly detected, and that it launches processes

Modified: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/commands/BaseTest.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/commands/BaseTest.java	2008-10-07 23:27:03 UTC (rev 840)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/commands/BaseTest.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -14,9 +14,8 @@
 
 import org.junit.Before;
 import org.maemo.esbox.core.sdk.ISDKTarget;
-import org.maemo.esbox.maemosdk.core.command.ICommandAbstractor;
+import org.maemo.esbox.internal.maemosdk.core.command.ICommandAbstractor;
 import org.maemo.esbox.maemosdk.core.sdk.AbstractScratchboxSDK;
-import org.maemo.esbox.maemosdk.core.sdk.IScratchbox2SDK;
 import org.maemo.esbox.maemosdk.core.sdk.IScratchboxSDK;
 import org.maemo.esbox.maemosdk.core.sdk.IScratchboxSDKTarget;
 import org.maemo.esbox.maemosdk.core.sdk.ScratchboxSDKFacade;

Modified: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/commands/MockCommandAbstractor.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/commands/MockCommandAbstractor.java	2008-10-07 23:27:03 UTC (rev 840)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/commands/MockCommandAbstractor.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -11,16 +11,16 @@
 
 package org.maemo.esbox.maemosdk.tests.commands;
 
+import java.util.List;
+
 import org.maemo.esbox.core.machine.IFileSystemAccess;
 import org.maemo.esbox.core.process.HostProcessLauncherFactory;
 import org.maemo.esbox.core.process.IProcessLauncherFactory;
 import org.maemo.esbox.core.sdk.ISDKTarget;
-import org.maemo.esbox.internal.maemosdk.core.sdk.Scratchbox2ProcessLauncherFactory;
+import org.maemo.esbox.internal.maemosdk.core.command.ICommandAbstractor;
 import org.maemo.esbox.maemosdk.core.SB2PreferenceConstants;
-import org.maemo.esbox.maemosdk.core.command.ICommandAbstractor;
+import org.maemo.esbox.maemosdk.sdk2.launcher.Scratchbox2ProcessLauncherFactory;
 
-import java.util.List;
-
 public class MockCommandAbstractor implements ICommandAbstractor {
 	private final ISDKTarget target;
 	private final ICommandAbstractor wrapped;

Modified: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/commands/MockProcessLauncher.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/commands/MockProcessLauncher.java	2008-10-07 23:27:03 UTC (rev 840)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/commands/MockProcessLauncher.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -11,19 +11,20 @@
 
 package org.maemo.esbox.maemosdk.tests.commands;
 
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.util.List;
+import java.util.Properties;
+
 import org.eclipse.core.runtime.IPath;
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.ui.console.MessageConsole;
-import org.maemo.esbox.core.*;
+import org.maemo.esbox.core.ESboxException;
+import org.maemo.esbox.core.env.IEnvironmentModifierBlock;
 import org.maemo.esbox.core.process.IProcessLauncher;
 import org.maemo.esbox.core.process.IStreamLineMonitor;
 import org.maemo.esbox.core.sdk.ISDKTarget;
 
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.util.List;
-import java.util.Properties;
-
 /**
  * This process launcher does not actually launch anything but allows
  * access to the generated arguments and environment.
@@ -102,8 +103,8 @@
 	/* (non-Javadoc)
 	 * @see org.maemo.esbox.core.IProcessLauncher#getLaunchEnvironment()
 	 */
-	public Properties getLaunchEnvironment() {
-		return wrapped.getLaunchEnvironment();
+	public IEnvironmentModifierBlock getLaunchEnvironmentModifierBlock() {
+		return wrapped.getLaunchEnvironmentModifierBlock();
 	}
 
 	/* (non-Javadoc)

Modified: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/commands/MockProcessLauncherFactory.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/commands/MockProcessLauncherFactory.java	2008-10-07 23:27:03 UTC (rev 840)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/commands/MockProcessLauncherFactory.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -11,13 +11,14 @@
 
 package org.maemo.esbox.maemosdk.tests.commands;
 
+import java.util.List;
+import java.util.Properties;
+
 import org.eclipse.core.runtime.IPath;
+import org.maemo.esbox.core.env.IEnvironmentModifierBlock;
 import org.maemo.esbox.core.process.IProcessLauncher;
 import org.maemo.esbox.core.process.IProcessLauncherFactory;
 
-import java.util.List;
-import java.util.Properties;
-
 /**
  * This factory creates process launchers that do not actually execute anything 
  * but allow for testing the generated command line through the process launcher.
@@ -33,20 +34,27 @@
 		this.wrapped = wrapped;
 	}
 	/* (non-Javadoc)
-	 * @see org.maemo.esbox.core.IProcessLauncherFactory#createProcessLaunchHandler(org.eclipse.core.runtime.IPath, java.util.List, java.util.Properties, org.eclipse.cdt.utils.pty.PTY)
+	 * @see org.maemo.esbox.core.IProcessLauncherFactory#createProcessLauncher(org.eclipse.core.runtime.IPath, java.util.List, java.util.Properties, org.eclipse.cdt.utils.pty.PTY)
 	 */
-	public IProcessLauncher createProcessLaunchHandler(IPath workingDirectory,
-			List<String> commandLine, Properties environment) {
-		lastProcessLauncher = wrapped.createProcessLaunchHandler(workingDirectory, commandLine, environment);
+	public IProcessLauncher createProcessLauncher(IPath workingDirectory,
+			List<String> commandLine, IEnvironmentModifierBlock environment) {
+		lastProcessLauncher = wrapped.createProcessLauncher(workingDirectory, commandLine, environment);
 		return new MockProcessLauncher(lastProcessLauncher);
 	}
-
 	/* (non-Javadoc)
-	 * @see org.maemo.esbox.core.IProcessLauncherFactory#getStandardEnvironment()
+	 * @see org.maemo.esbox.core.process.IProcessLauncherFactory#getDefaultEnvironmentModifierBlock()
 	 */
-	public Properties getStandardEnvironment() {
-		return wrapped.getStandardEnvironment();
+	public IEnvironmentModifierBlock defaultEnvironmentModifierBlock() {
+		return wrapped.defaultEnvironmentModifierBlock();
 	}
+	/* (non-Javadoc)
+	 * @see org.maemo.esbox.core.process.IProcessLauncherFactory#getRawEnvironment()
+	 */
+	public Properties getRawEnvironment() {
+		return wrapped.getRawEnvironment();
+	}
+
+
 	public List<String> getLastCommandLine() {
 		return lastProcessLauncher.getLaunchCommandArguments();
 	}

Modified: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/commands/TestCreateTargetCommand.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/commands/TestCreateTargetCommand.java	2008-10-07 23:27:03 UTC (rev 840)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/commands/TestCreateTargetCommand.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -11,17 +11,18 @@
  *******************************************************************************/
 package org.maemo.esbox.maemosdk.tests.commands;
 
+import java.util.ArrayList;
+import java.util.List;
+
 import org.maemo.esbox.core.ESboxException;
 import org.maemo.esbox.core.sdk.ISDK;
-import org.maemo.esbox.internal.maemosdk.core.command.scratchbox.*;
+import org.maemo.esbox.internal.maemosdk.core.command.ICommandAbstractor;
+import org.maemo.esbox.internal.maemosdk.core.command.scratchbox.CreateTargetCommand;
+import org.maemo.esbox.internal.maemosdk.core.command.scratchbox.ListTargetsCommand;
+import org.maemo.esbox.internal.maemosdk.core.command.scratchbox.RemoveTargetCommand;
+import org.maemo.esbox.internal.maemosdk.core.command.scratchbox.ScratchboxCommand;
 import org.maemo.esbox.maemosdk.core.SB1PreferenceConstants;
-import org.maemo.esbox.maemosdk.core.command.ICommandAbstractor;
-import org.maemo.esbox.maemosdk.core.command.ListTargetsCommand;
-import org.maemo.esbox.maemosdk.core.command.ScratchboxCommand;
 
-import java.util.ArrayList;
-import java.util.List;
-
 /**
  * Please, read file TESTS.txt for more instructions about test.
  */

Modified: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/commands/TestCreateTargetSb2Command.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/commands/TestCreateTargetSb2Command.java	2008-10-07 23:27:03 UTC (rev 840)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/commands/TestCreateTargetSb2Command.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -1,13 +1,13 @@
 package org.maemo.esbox.maemosdk.tests.commands;
 
+import java.util.ArrayList;
+import java.util.List;
+
 import org.maemo.esbox.core.ESboxException;
 import org.maemo.esbox.internal.maemosdk.core.command.scratchbox.CreateTargetSb2Command;
-import org.maemo.esbox.maemosdk.core.command.ScratchboxCommand;
+import org.maemo.esbox.internal.maemosdk.core.command.scratchbox.ScratchboxCommand;
 
-import java.util.ArrayList;
-import java.util.List;
 
-
 public class TestCreateTargetSb2Command extends BaseTest {
 
 	private final String TARGET_NAME = "TEST_TARGET";

Modified: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/commands/TestGetCurrentTargetCommand.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/commands/TestGetCurrentTargetCommand.java	2008-10-07 23:27:03 UTC (rev 840)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/commands/TestGetCurrentTargetCommand.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -11,12 +11,12 @@
  *******************************************************************************/
 package org.maemo.esbox.maemosdk.tests.commands;
 
+import java.util.ArrayList;
+
 import org.maemo.esbox.core.ESboxException;
 import org.maemo.esbox.internal.maemosdk.core.command.scratchbox.GetCurrentTargetCommand;
 import org.maemo.esbox.internal.maemosdk.core.command.scratchbox.ScratchboxInvalidOperationException;
 
-import java.util.ArrayList;
-
 /**
  *  Please, read file TESTS.txt for more instructions about test.
  */

Modified: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/commands/TestListCommands.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/commands/TestListCommands.java	2008-10-07 23:27:03 UTC (rev 840)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/commands/TestListCommands.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -23,7 +23,7 @@
 import org.maemo.esbox.internal.maemosdk.core.command.scratchbox.ListCompilersCommand;
 import org.maemo.esbox.internal.maemosdk.core.command.scratchbox.ListCputranspCommand;
 import org.maemo.esbox.internal.maemosdk.core.command.scratchbox.ListDevkitsCommand;
-import org.maemo.esbox.maemosdk.core.command.ListTargetsCommand;
+import org.maemo.esbox.internal.maemosdk.core.command.scratchbox.ListTargetsCommand;
 import org.maemo.esbox.maemosdk.core.sdk.ScratchboxSDKFacade;
 import org.maemo.esbox.maemosdk.sdk1.command.ListSessionsCommand;
 import org.maemo.esbox.maemosdk.sdk1.core.ScratchboxSDK1;

Modified: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/commands/TestListSb2Commands.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/commands/TestListSb2Commands.java	2008-10-07 23:27:03 UTC (rev 840)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/commands/TestListSb2Commands.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -10,21 +10,25 @@
  *******************************************************************************/
 package org.maemo.esbox.maemosdk.tests.commands;
 
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Properties;
+
 import org.eclipse.core.runtime.IPath;
 import org.eclipse.core.runtime.Path;
 import org.eclipse.jface.preference.IPreferenceStore;
 import org.maemo.esbox.core.*;
+import org.maemo.esbox.core.env.IEnvironmentModifierBlock;
 import org.maemo.esbox.core.machine.IFileSystemAccess;
-
 import org.maemo.esbox.core.process.IProcessLauncher;
 import org.maemo.esbox.core.process.IProcessLauncherFactory;
-import org.maemo.esbox.internal.maemosdk.core.command.scratchbox.*;
-import org.maemo.esbox.maemosdk.core.command.ICommandAbstractor;
-import org.maemo.esbox.maemosdk.core.command.ListTargetsCommand;
+import org.maemo.esbox.internal.maemosdk.core.command.ICommandAbstractor;
+import org.maemo.esbox.internal.maemosdk.core.command.scratchbox.ListAvailableMaemoRootstrapsSb2Command;
+import org.maemo.esbox.internal.maemosdk.core.command.scratchbox.ListCompilersSb2Command;
+import org.maemo.esbox.internal.maemosdk.core.command.scratchbox.ListCputranspSb2Command;
+import org.maemo.esbox.internal.maemosdk.core.command.scratchbox.ListTargetsCommand;
 import org.maemo.esbox.maemosdk.core.scratchbox.MaemoRootstrap;
 
-import java.util.*;
-
 /**
  */
 public class TestListSb2Commands extends BaseTest {
@@ -184,19 +188,19 @@
 					final IProcessLauncherFactory factory = sb2Command.getProcessLauncherFactory();
 					return new IProcessLauncherFactory() {
 
-						public IProcessLauncher createProcessLaunchHandler(
+						public IProcessLauncher createProcessLauncher(
 								IPath workingDirectory,
 								List<String> commandLine,
-								Properties environment) {
-							return factory.createProcessLaunchHandler(workingDirectory, commandLine, environment);
+								IEnvironmentModifierBlock environment) {
+							return factory.createProcessLauncher(workingDirectory, commandLine, environment);
 						}
 
-						public Properties getStandardEnvironment() {
-							Properties stdenv = factory.getStandardEnvironment();
-							stdenv.put("http_proxy", "http://10.241.32.11:8080");
-							return stdenv;
+						public IEnvironmentModifierBlock defaultEnvironmentModifierBlock() {
+							return factory.defaultEnvironmentModifierBlock();
 						}
-						
+						public Properties getRawEnvironment() {
+							return factory.getRawEnvironment();
+						}
 					};
 				}
 				

Modified: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/commands/TestRemoveCommand.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/commands/TestRemoveCommand.java	2008-10-07 23:27:03 UTC (rev 840)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/commands/TestRemoveCommand.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -11,13 +11,14 @@
  *******************************************************************************/
 package org.maemo.esbox.maemosdk.tests.commands;
 
-import org.maemo.esbox.core.ESboxException;
-import org.maemo.esbox.internal.maemosdk.core.command.scratchbox.*;
-import org.maemo.esbox.maemosdk.core.command.ScratchboxCommand;
-
 import java.util.ArrayList;
 import java.util.List;
 
+import org.maemo.esbox.core.ESboxException;
+import org.maemo.esbox.internal.maemosdk.core.command.scratchbox.RemoveTargetCommand;
+import org.maemo.esbox.internal.maemosdk.core.command.scratchbox.ScratchboxCommand;
+import org.maemo.esbox.internal.maemosdk.core.command.scratchbox.ScratchboxInvalidOperationException;
+
 /**
  * Please, read file TESTS.txt for more instructions about test.
  */

Modified: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/commands/TestRemoveSb2Command.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/commands/TestRemoveSb2Command.java	2008-10-07 23:27:03 UTC (rev 840)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/commands/TestRemoveSb2Command.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -15,7 +15,7 @@
 import java.util.List;
 
 import org.maemo.esbox.core.ESboxException;
-import org.maemo.esbox.maemosdk.core.command.ScratchboxCommand;
+import org.maemo.esbox.internal.maemosdk.core.command.scratchbox.ScratchboxCommand;
 import org.maemo.esbox.maemosdk.core.sdk.AbstractScratchboxSDK;
 import org.maemo.esbox.maemosdk.sdk2.command.RemoveTargetSb2Command;
 

Modified: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/commands/TestScratchboxCommand.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/commands/TestScratchboxCommand.java	2008-10-07 23:27:03 UTC (rev 840)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/commands/TestScratchboxCommand.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -11,13 +11,13 @@
  *******************************************************************************/
 package org.maemo.esbox.maemosdk.tests.commands;
 
+import java.util.List;
+
 import org.maemo.esbox.core.ESboxException;
+import org.maemo.esbox.internal.maemosdk.core.command.ICommandAbstractor;
+import org.maemo.esbox.internal.maemosdk.core.command.scratchbox.ScratchboxCommand;
 import org.maemo.esbox.maemosdk.core.SB1PreferenceConstants;
-import org.maemo.esbox.maemosdk.core.command.ICommandAbstractor;
-import org.maemo.esbox.maemosdk.core.command.ScratchboxCommand;
 
-import java.util.List;
-
 /**
  * Please, read file TESTS.txt for more instructions about test.
  */

Modified: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/commands/TestSelectTargetCommand.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/commands/TestSelectTargetCommand.java	2008-10-07 23:27:03 UTC (rev 840)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/commands/TestSelectTargetCommand.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -11,14 +11,15 @@
  *******************************************************************************/
 package org.maemo.esbox.maemosdk.tests.commands;
 
-import org.maemo.esbox.core.ESboxException;
-import org.maemo.esbox.internal.maemosdk.core.command.scratchbox.*;
-import org.maemo.esbox.maemosdk.core.command.ListTargetsCommand;
-import org.maemo.esbox.maemosdk.core.command.ScratchboxCommand;
-
 import java.util.ArrayList;
 import java.util.List;
 
+import org.maemo.esbox.core.ESboxException;
+import org.maemo.esbox.internal.maemosdk.core.command.scratchbox.GetCurrentTargetCommand;
+import org.maemo.esbox.internal.maemosdk.core.command.scratchbox.ListTargetsCommand;
+import org.maemo.esbox.internal.maemosdk.core.command.scratchbox.ScratchboxCommand;
+import org.maemo.esbox.internal.maemosdk.core.command.scratchbox.SelectTargetCommand;
+
 /**
  * Please, read file TESTS.txt for more instructions about test.
  */

Modified: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/commands/TestShowPathMappingSb2Command.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/commands/TestShowPathMappingSb2Command.java	2008-10-07 23:27:03 UTC (rev 840)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/commands/TestShowPathMappingSb2Command.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -1,12 +1,14 @@
 package org.maemo.esbox.maemosdk.tests.commands;
 
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
 import org.eclipse.core.runtime.IPath;
 import org.maemo.esbox.core.ESboxException;
 import org.maemo.esbox.core.machine.IFileSystemAccess;
 import org.maemo.esbox.internal.maemosdk.core.command.scratchbox.ShowPathMappingSb2Command;
 
-import java.util.*;
-
 public class TestShowPathMappingSb2Command extends BaseTest {
 
 	public void testPerformCommand() throws ESboxException {

Modified: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/commands/TestShowTargetCommand.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/commands/TestShowTargetCommand.java	2008-10-07 23:27:03 UTC (rev 840)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/commands/TestShowTargetCommand.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -15,8 +15,8 @@
 import java.util.List;
 
 import org.maemo.esbox.core.ESboxException;
+import org.maemo.esbox.internal.maemosdk.core.command.scratchbox.ScratchboxCommand;
 import org.maemo.esbox.internal.maemosdk.core.command.scratchbox.ShowTargetCommand;
-import org.maemo.esbox.maemosdk.core.command.ScratchboxCommand;
 import org.maemo.esbox.maemosdk.core.scratchbox.ScratchboxTarget;
 import org.maemo.esbox.maemosdk.sdk1.core.ScratchboxSDK1;
 

Modified: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.ui/META-INF/MANIFEST.MF
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.ui/META-INF/MANIFEST.MF	2008-10-07 23:27:03 UTC (rev 840)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.ui/META-INF/MANIFEST.MF	2008-10-08 13:17:48 UTC (rev 841)
@@ -8,14 +8,15 @@
 Require-Bundle: org.eclipse.core.runtime,
  org.maemo.esbox.core;bundle-version="1.5.0",
  org.maemo.esbox.maemosdk.core;bundle-version="1.5.0",
- org.maemo.esbox.ui;bundle-version="1.5.0",
- org.maemo.esbox.project.core;bundle-version="1.5.0",
+ org.maemo.esbox.ui;bundle-version="1.5.0";visibility:=reexport,
+ org.maemo.esbox.project.core;bundle-version="1.5.0";visibility:=reexport,
  org.eclipse.ui.ide;bundle-version="3.4.0"
 Bundle-RequiredExecutionEnvironment: J2SE-1.5
 Bundle-ActivationPolicy: lazy
-Export-Package: org.maemo.esbox.maemosdk.ui,
+Export-Package: org.maemo.esbox.internal.maemosdk.ui,
+ org.maemo.esbox.internal.maemosdk.ui.adapters,
+ org.maemo.esbox.maemosdk.ui,
  org.maemo.esbox.maemosdk.ui.actions,
- org.maemo.esbox.maemosdk.ui.adapters,
  org.maemo.esbox.maemosdk.ui.preferences,
  org.maemo.esbox.maemosdk.ui.targets.wizards,
  org.maemo.esbox.maemosdk.ui.targets.wizards.sbrsh

Modified: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.ui/plugin.xml
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.ui/plugin.xml	2008-10-07 23:27:03 UTC (rev 840)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.ui/plugin.xml	2008-10-08 13:17:48 UTC (rev 841)
@@ -92,16 +92,6 @@
       </menuContribution>
    </extension>
    
-   <extension
-         point="org.eclipse.core.runtime.adapters">
-      <factory
-            adaptableType="org.maemo.esbox.core.sdk.ISDK"
-            class="org.maemo.esbox.internal.maemosdk.ui.adapters.MaemoSDKInstallTargetAdapterFactory">
-         <adapter
-               type="org.maemo.esbox.core.adapters.ISDKManageTargetAdapter">
-         </adapter>
-      </factory>
-   </extension>
  
       
 </plugin>

Modified: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/UIActivator.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/UIActivator.java	2008-10-07 23:27:03 UTC (rev 840)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/UIActivator.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -1,13 +1,19 @@
 package org.maemo.esbox.internal.maemosdk.ui;
 
-import org.eclipse.core.runtime.*;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+
+import org.eclipse.core.runtime.FileLocator;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Plugin;
+import org.eclipse.core.runtime.Status;
 import org.eclipse.jface.resource.ImageDescriptor;
 import org.eclipse.ui.plugin.AbstractUIPlugin;
 import org.maemo.esbox.core.ErrorLogger;
 import org.osgi.framework.BundleContext;
 
-import java.io.*;
-
 /**
  * The activator class controls the plug-in life cycle
  */

Deleted: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/adapters/ESboxTargetRemover.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/adapters/ESboxTargetRemover.java	2008-10-07 23:27:03 UTC (rev 840)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/adapters/ESboxTargetRemover.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -1,294 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Nokia Corporation.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *    Ed Swartz (Nokia) - initial API and implementation
- *******************************************************************************/
-
-package org.maemo.esbox.internal.maemosdk.ui.adapters;
-
-import com.nokia.cpp.internal.api.utils.core.TextUtils;
-
-import org.eclipse.core.resources.*;
-import org.eclipse.core.runtime.*;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.viewers.*;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.*;
-import org.maemo.esbox.core.*;
-import org.maemo.esbox.core.sdk.ISDKTarget;
-import org.maemo.esbox.internal.maemosdk.ui.UIActivator;
-import org.maemo.esbox.maemosdk.core.scratchbox.ScratchboxFacade;
-import org.maemo.esbox.maemosdk.core.sdk.IScratchbox2SDK;
-import org.maemo.esbox.maemosdk.core.sdk.IScratchboxSDK;
-import org.maemo.esbox.project.core.*;
-import org.maemo.esbox.ui.ESboxBuildTargetUI;
-
-import java.text.MessageFormat;
-import java.util.*;
-
-/**
- * This class handles updating projects when they depend on an SDK target we're about
- * to delete.
- * @author eswartz
- *
- */
-public class ESboxTargetRemover {
-
-	private final ISDKTarget sdkTarget;
-	private final boolean deleteRootstrap;
-	private final Shell shell;
-
-	public ESboxTargetRemover(Shell shell, ISDKTarget sdkTarget, boolean deleteRootstrap) {
-		this.shell = shell;
-		this.sdkTarget = sdkTarget;
-		this.deleteRootstrap = deleteRootstrap;
-	}
-
-	/**
-	 * Remove the target selected.
-	 */
-	public void run(IProgressMonitor monitor) throws ESboxException {
-		monitor.beginTask("Removing target " + sdkTarget.getName(), 3);
-		IScratchboxSDK sdk = (IScratchboxSDK) sdkTarget.getSDK(); 
-		String targetName = sdkTarget.getName();
-		
-		// update all the projects to use another SDK Target
-		if (!updateProjectsForRemovedTarget(sdkTarget, new SubProgressMonitor(monitor, 1)))
-			return;
-		if (monitor.isCanceled())
-			return;
-		
-		// remove the rootstrap
-		if (deleteRootstrap) {
-			if (sdk instanceof IScratchbox2SDK) {
-				try {
-					ScratchboxFacade.getInstance().removeRootstrap(
-							(IScratchbox2SDK) sdk, sdkTarget.getName(), true, 
-							new SubProgressMonitor(monitor, 1));
-				} catch (ESboxException e) {
-					// don't worry -- it may be a bogus target or one without a rootstrap
-					UIActivator.getErrorLogger().logError("Problem removing rootstrap", e);
-				}
-			} else {
-				monitor.worked(1);
-			}
-			if (monitor.isCanceled())
-				return;
-		} else {
-			monitor.worked(1);
-		}
-		
-		// and remove the target
-		ScratchboxFacade.getInstance().removeTarget(
-				sdk, targetName);
-		monitor.worked(1);
-		if (monitor.isCanceled())
-			return;
-
-
-	}	
-		
-	/** 
-	 * Ask user to reassign SDK target for any project which is using the
-	 * to-be-deleted target.  If user cancels or there are no other targets to
-	 * use, returns false.
-	 * @param monitor 
-	 * @param sdk
-	 * @param oldTargetName target name to be removed
-	 * @return true if reassigning succeeded
-	 * @throws ESboxException
-	 */
-	private boolean updateProjectsForRemovedTarget(ISDKTarget sdkTarget, IProgressMonitor monitor) throws ESboxException {
-		monitor.beginTask("", 10);
-		try {
-			monitor.subTask("Checking projects using build target");
-			
-			IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects();
-			Set<IESboxProjectHandle> projectsUsingTarget = new HashSet<IESboxProjectHandle>();
-			Set<IESboxProjectHandle> projectsOnlyUsingTarget = new HashSet<IESboxProjectHandle>();
-			for (IProject project : projects) {
-				if (!project.isOpen())
-					continue;
-				IESboxProjectHandle projectHandle = ProjectManager.getInstance().getProjectHandle(project);
-				if (projectHandle != null) {
-					boolean allUseTarget = true;
-					for (IESboxBuildConfiguration config : projectHandle.getBuildConfigurations()) {
-						if (config.getSDKTargetName().equals(sdkTarget.getName())) {
-							projectsUsingTarget.add(projectHandle);
-						} else {
-							allUseTarget = false;
-						}
-					}
-					if (allUseTarget) {
-						projectsOnlyUsingTarget.add(projectHandle);
-					}
-				}
-			}
-			if (projectsUsingTarget.isEmpty())
-				return true;
-			monitor.worked(1);
-			
-			ISDKTarget replacement = null;
-			if (!projectsOnlyUsingTarget.isEmpty()) {
-				monitor.subTask("Selecting alternate build target");
-				replacement = selectAlternateSDKTarget(projectsOnlyUsingTarget, sdkTarget);
-				if (replacement == null)
-					return false;
-				monitor.worked(1);
-			}
-			
-			monitor.subTask("Migrating build targets");
-			for (IESboxProjectHandle projectHandle : projectsUsingTarget) {
-				updateBuildConfigurations(projectHandle, sdkTarget, replacement);
-			}
-			monitor.worked(1);
-
-			monitor.subTask("Saving projects");
-			for (IESboxProjectHandle projectHandle : projectsUsingTarget) {
-				try {
-					projectHandle.save(new SubProgressMonitor(monitor, 1));
-				} catch (CoreException e) {
-					UIActivator.getErrorLogger().logAndShowError("Failed to update project", e);
-				}
-			}
-
-			// build system should handle this
-			//// target removal requires a rebuild
-			//cleanProjects(projectsUsingTarget, new SubProgressMonitor(monitor, 7));
-		} finally {		
-			monitor.done();
-		}
-		return true;
-	}
-
-	/**
-	 * For the given project, remove the configurations using sdkTarget.
-	 * If there are no build configurations left, then add one using the replacement.   
-	 * @param projectHandle
-	 * @param sdkTarget
-	 * @param replacement
-	 */
-	private void updateBuildConfigurations(IESboxProjectHandle projectHandle,
-			ISDKTarget sdkTarget, ISDKTarget replacement) {
-		IESboxBuildConfiguration lastConfig = null;
-		
-		for (IESboxBuildConfiguration config : projectHandle.getBuildConfigurations()) {
-			if (config.getSDKTarget().equals(sdkTarget)) {
-				try {
-					lastConfig = config;
-					projectHandle.removeBuildConfiguration(config);
-				} catch (CoreException e) {
-					UIActivator.getErrorLogger().logAndShowError("Could not remove build configuration", e);
-				}
-			}
-		}
-		if (projectHandle.getBuildConfigurations().length == 0) {
-			// need to add one for replacement
-			ESboxBuildConfigurationParameters parameters = new ESboxBuildConfigurationParameters(replacement.getName(), replacement);
-			try {
-				/*IESboxBuildConfiguration newConfig =*/ projectHandle.createBuildConfiguration(parameters, lastConfig);
-			} catch (CoreException e) {
-				UIActivator.getErrorLogger().logAndShowError("Failed to add replacement build configuration", e);
-			}
-		}
-	}
-
-	private ISDKTarget selectAlternateSDKTarget(
-			final Set<IESboxProjectHandle> projectsOnlyUsingTarget, final ISDKTarget sdkTarget) {
-		final ISDKTarget[] replacement = { null };
-		final Dialog dialog = new Dialog(shell) {
-			private Button okButton;
-
-			@Override
-			protected void configureShell(Shell newShell) {
-				super.configureShell(newShell);
-				newShell.setText("Replace Build Target");
-			}
-			@Override
-			protected Control createDialogArea(Composite parent) {
-				Composite contents = (Composite) super.createDialogArea(parent);
-				Label label = new Label(contents, SWT.NONE);
-				label.setText(MessageFormat.format(
-						"Some existing projects build only against ''{0}'':\n\n\t{1}\n\nSpecify an alternate build target:",
-						TextUtils.catenateStrings(projectsOnlyUsingTarget.toArray(), "\n\t"),
-						sdkTarget.getName()));
-				label.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
-				
-				TreeViewer targetViewer = ESboxBuildTargetUI.createConfiguredBuildTargetViewer(contents, ESboxBuildTargetUI.DEFAULT_STYLE);
-				targetViewer.setFilters(new ViewerFilter[] {
-					new ViewerFilter() {
-
-						@Override
-						public boolean select(Viewer viewer,
-								Object parentElement, Object element) {
-							return !element.equals(sdkTarget);
-						}
-					}
-				});
-				targetViewer.getTree().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
-				targetViewer.addSelectionChangedListener(new ISelectionChangedListener() {
-
-					public void selectionChanged(SelectionChangedEvent event) {
-						Object element = ((IStructuredSelection) event.getSelection()).getFirstElement();
-						if (element instanceof ISDKTarget) {
-							replacement[0] = (ISDKTarget) element;
-						} else {
-							replacement[0] = null;
-						}
-						if (okButton != null) {
-							okButton.setEnabled(replacement[0] != null);
-						}
-					}
-					
-				});
-				targetViewer.setInput(new Object());
-				return contents;
-			}
-			
-			@Override
-			protected void createButtonsForButtonBar(Composite parent) {
-				okButton = createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
-				okButton.setEnabled(false);
-				createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);
-			}
-		};
-		
-		shell.getDisplay().syncExec(new Runnable() {
-
-			public void run() {
-				if (dialog.open() != IDialogConstants.OK_ID) {
-					replacement[0] = null;
-				}
-			}
-			
-		});
-		return replacement[0];
-	}
-
-	/*
-	private void cleanProjects(final Set<IESboxProjectHandle> projects, IProgressMonitor monitor) {
-		// clean the target
-		monitor.beginTask("", projects.size());
-		monitor.subTask("Cleaning affected projects");
-		try {
-			for (IESboxProjectHandle projectHandle : projects) {
-				projectHandle.getProject().build(IncrementalProjectBuilder.CLEAN_BUILD, monitor);
-				monitor.worked(1);
-			}
-		} catch (CoreException e) {
-			ErrorLogger errorLogger = Activator.getErrorLogger();
-			errorLogger.logAndShowError("Error cleaning project", e);
-		} finally {
-			monitor.done();
-		}
-	}
-	*/
-	
-}

Deleted: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/adapters/MaemoSDKInstallTargetAdapterFactory.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/adapters/MaemoSDKInstallTargetAdapterFactory.java	2008-10-07 23:27:03 UTC (rev 840)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/adapters/MaemoSDKInstallTargetAdapterFactory.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -1,47 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Nokia Corporation
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *    Ed Swartz (Nokia) - initial API and implementation
- *******************************************************************************/
-
-package org.maemo.esbox.internal.maemosdk.ui.adapters;
-
-import org.eclipse.core.runtime.IAdapterFactory;
-import org.maemo.esbox.core.adapters.ISDKManageTargetAdapter;
-import org.maemo.esbox.maemosdk.core.sdk.*;
-
-/**
- * @author eswartz
- *
- */
-public class MaemoSDKInstallTargetAdapterFactory implements IAdapterFactory {
-
-	/* (non-Javadoc)
-	 * @see org.eclipse.core.runtime.IAdapterFactory#getAdapter(java.lang.Object, java.lang.Class)
-	 */
-	public Object getAdapter(Object adaptableObject, Class adapterType) {
-		if (adapterType.equals(ISDKManageTargetAdapter.class)) {
-			if (adaptableObject instanceof IScratchbox1SDK) {
-				return new MaemoScratchbox1SDKManageTargetAdapter((IScratchbox1SDK) adaptableObject);
-			}
-			if (adaptableObject instanceof IScratchbox2SDK) {
-				return new MaemoScratchbox2SDKManageTargetAdapter((IScratchbox2SDK) adaptableObject);
-			}
-		}
-		return null;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.eclipse.core.runtime.IAdapterFactory#getAdapterList()
-	 */
-	public Class[] getAdapterList() {
-		// TODO Auto-generated method stub
-		return null;
-	}
-
-}

Deleted: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/adapters/MaemoScratchbox1SDKManageTargetAdapter.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/adapters/MaemoScratchbox1SDKManageTargetAdapter.java	2008-10-07 23:27:03 UTC (rev 840)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/adapters/MaemoScratchbox1SDKManageTargetAdapter.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Nokia Corporation
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *    Ed Swartz (Nokia) - initial API and implementation
- *******************************************************************************/
-
-package org.maemo.esbox.internal.maemosdk.ui.adapters;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.wizard.WizardDialog;
-import org.eclipse.swt.widgets.Shell;
-import org.maemo.esbox.core.Policy;
-import org.maemo.esbox.core.adapters.ISDKManageTargetAdapter;
-import org.maemo.esbox.core.sdk.ISDKTarget;
-import org.maemo.esbox.internal.maemosdk.ui.UIActivator;
-import org.maemo.esbox.maemosdk.core.sdk.IScratchbox1SDK;
-import org.maemo.esbox.maemosdk.ui.adapters.MaemoScratchboxSDKManageTargetAdapterBase;
-import org.maemo.esbox.maemosdk.ui.targets.wizards.NewScratchbox1TargetWizard;
-
-import java.util.List;
-
-/**
- * @author eswartz
- *
- */
-public class MaemoScratchbox1SDKManageTargetAdapter extends MaemoScratchboxSDKManageTargetAdapterBase 
-	implements ISDKManageTargetAdapter {
-
-	private IScratchbox1SDK sdk;
-
-	/**
-	 * @param adaptableObject
-	 */
-	public MaemoScratchbox1SDKManageTargetAdapter(IScratchbox1SDK sdk) {
-		this.sdk = sdk;
-	}
-	
-	/* (non-Javadoc)
-	 * @see org.maemo.esbox.core.adapters.ISDKManageTargetAdapter#installSDKTargets(org.eclipse.swt.widgets.Shell, java.util.List)
-	 */
-	public IStatus installSDKTargets(Shell shell, List<ISDKTarget> installed) {
-		NewScratchbox1TargetWizard targetWizard;
-		
-		targetWizard = new NewScratchbox1TargetWizard(sdk);
-		WizardDialog dlg = new WizardDialog(
-				shell,
-				targetWizard);
-		if (dlg.open() == Dialog.OK) {
-			return Status.OK_STATUS;
-		}
-
-		return Policy.getCancelStatus(UIActivator.getDefault());
-	}
-	
-
-}

Deleted: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/adapters/MaemoScratchbox2SDKManageTargetAdapter.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/adapters/MaemoScratchbox2SDKManageTargetAdapter.java	2008-10-07 23:27:03 UTC (rev 840)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/adapters/MaemoScratchbox2SDKManageTargetAdapter.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Nokia Corporation
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *    Ed Swartz (Nokia) - initial API and implementation
- *******************************************************************************/
-
-package org.maemo.esbox.internal.maemosdk.ui.adapters;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.wizard.WizardDialog;
-import org.eclipse.swt.widgets.Shell;
-import org.maemo.esbox.core.Policy;
-import org.maemo.esbox.core.adapters.ISDKManageTargetAdapter;
-import org.maemo.esbox.core.sdk.ISDKTarget;
-import org.maemo.esbox.internal.maemosdk.ui.UIActivator;
-import org.maemo.esbox.maemosdk.core.sdk.IScratchbox2SDK;
-import org.maemo.esbox.maemosdk.ui.adapters.MaemoScratchboxSDKManageTargetAdapterBase;
-import org.maemo.esbox.maemosdk.ui.targets.wizards.NewScratchbox2TargetWizard;
-
-import java.util.List;
-
-/**
- * @author eswartz
- *
- */
-public class MaemoScratchbox2SDKManageTargetAdapter extends MaemoScratchboxSDKManageTargetAdapterBase 
-	implements ISDKManageTargetAdapter {
-
-	private final IScratchbox2SDK sdk;
-
-	/**
-	 * @param sdk
-	 */
-	public MaemoScratchbox2SDKManageTargetAdapter(IScratchbox2SDK sdk) {
-		this.sdk = sdk;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.maemo.esbox.core.adapters.ISDKManageTargetAdapter#installSDKTargets(org.eclipse.swt.widgets.Shell, java.util.List)
-	 */
-	public IStatus installSDKTargets(Shell shell, List<ISDKTarget> installed) {
-		NewScratchbox2TargetWizard targetWizard;
-		
-		targetWizard = new NewScratchbox2TargetWizard(sdk);
-		WizardDialog dlg = new WizardDialog(
-				shell,
-				targetWizard);
-		if (dlg.open() == Dialog.OK) {
-			return Status.OK_STATUS;
-		}
-
-		return Policy.getCancelStatus(UIActivator.getDefault());
-	}
-	
-
-}

Modified: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/adapters/MaemoScratchboxSDKManageTargetAdapterBase.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/adapters/MaemoScratchboxSDKManageTargetAdapterBase.java	2008-10-07 23:27:03 UTC (rev 840)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/adapters/MaemoScratchboxSDKManageTargetAdapterBase.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -11,132 +11,47 @@
 
 package org.maemo.esbox.internal.maemosdk.ui.adapters;
 
-import org.eclipse.core.runtime.*;
-import org.eclipse.jface.dialogs.*;
+import java.lang.reflect.InvocationTargetException;
+import java.text.MessageFormat;
+import java.util.List;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.dialogs.ProgressMonitorDialog;
 import org.eclipse.jface.operation.IRunnableWithProgress;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.events.SelectionAdapter;
 import org.eclipse.swt.events.SelectionEvent;
 import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.*;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Shell;
 import org.maemo.esbox.core.ESboxException;
 import org.maemo.esbox.core.Policy;
 import org.maemo.esbox.core.adapters.ISDKManageTargetAdapter;
 import org.maemo.esbox.core.sdk.ISDKTarget;
 import org.maemo.esbox.internal.maemosdk.ui.UIActivator;
 import org.maemo.esbox.maemosdk.core.scratchbox.MaemoRootstrap;
-import org.maemo.esbox.maemosdk.core.scratchbox.ScratchboxFacade;
+import org.maemo.esbox.maemosdk.core.sdk.AbstractScratchboxSDK;
 
-import java.lang.reflect.InvocationTargetException;
-import java.text.MessageFormat;
-import java.util.List;
-
 /**
  * @author eswartz
  *
  */
 public abstract class MaemoScratchboxSDKManageTargetAdapterBase implements ISDKManageTargetAdapter {
 
-	/* (non-Javadoc)
-	 * @see org.maemo.esbox.core.adapters.ISDKTargetInstallerAdapter#removeSDKTarget(org.eclipse.swt.widgets.Shell, org.maemo.esbox.core.sdk.ISDKTarget)
-	 */
-	public IStatus removeSDKTarget(Shell shell, ISDKTarget selectedTarget) {
-		final boolean[] deleteRootstrap = { false };
-		boolean rootstrapUsed_ = false;
-		try {
-			// see if a rootstrap -- possibly disconnected from the target -- exists
-			List<MaemoRootstrap> rootstraps = 
-				ScratchboxFacade.getInstance().getAvailableMaemoRootstraps(selectedTarget.getSDK().getMachine());
-			for (MaemoRootstrap rootstrap : rootstraps) {
-				if (rootstrap.getName().equals(selectedTarget.getName())) {
-					rootstrapUsed_ = true;
-					break;
-				}
-			}
-		} catch (ESboxException e1) {
-			UIActivator.getErrorLogger().logError("Failure scanning maemo rootstraps", e1);
-		}
+	
 
-		final boolean rootstrapUsed = rootstrapUsed_;
-		String message;
-		if (rootstrapUsed) {
-			message = "Really delete SDK target ''{0}''?\n\n"+
-				"This will remove the entry from {1}.\n\n"+
-				"If existing projects use this target, you will be asked to select an alternate target.";
-		} else {
-			message = "Really delete SDK target ''{0}''?\n\n"+
-			"This will remove the entry from {1} and delete the rootstrap.\n\n"+
-			"If existing projects use this target, you will be asked to select an alternate target.";
-		}
-		String title = MessageFormat.format("Delete target from {0}?",
-				selectedTarget.getSDK().getDisplayName());
-		
-		MessageDialog dialog = new MessageDialog(shell, 
-				title, 
-				null, 
-				MessageFormat.format(
-						message,
-						selectedTarget.getName(),
-						selectedTarget.getSDK().getName()),
-				MessageDialog.WARNING,
-				new String[] { IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL },
-				1) {
-			@Override
-			protected Control createDialogArea(Composite parent) {
-				Composite composite = (Composite) super.createDialogArea(parent);
-				if (rootstrapUsed) {
-					Label spacer = new Label(composite, SWT.NONE);
-					spacer.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
-					
-					final Button removeRootstrap = new Button(composite, SWT.CHECK);
-					removeRootstrap.setText("Also delete rootstrap (target filesystem)");
-					removeRootstrap.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
-					removeRootstrap.addSelectionListener(new SelectionAdapter() {
-						@Override
-						public void widgetSelected(SelectionEvent e) {
-							deleteRootstrap[0] = removeRootstrap.getSelection();
-						}
-					});
-				}
-				return composite;
-			}
-		};
-		
-		if (dialog.open() == 0) {
-			return removeTarget(shell, selectedTarget, deleteRootstrap[0]);
-		} else {
-			return Policy.getCancelStatus(UIActivator.getDefault());
-		}
-	}
-
-	protected IStatus removeTarget(final Shell shell, final ISDKTarget selectedTarget, final boolean deleteRootstrap) {
-		ProgressMonitorDialog dialog = new ProgressMonitorDialog(shell);
-		try {
-			dialog.run(true, true, new IRunnableWithProgress() {
-
-				public void run(IProgressMonitor monitor)
-						throws InvocationTargetException, InterruptedException {
-					ESboxTargetRemover remover = new ESboxTargetRemover(shell, selectedTarget, deleteRootstrap);
-					try {
-						remover.run(monitor);
-					} catch (ESboxException e) {
-						throw new InvocationTargetException(e);
-					}
-				}
-			});
-			return Status.OK_STATUS;
-		} catch (Exception e) {
-			if (e.getCause() instanceof ESboxException) 
-				e = (Exception) e.getCause();
-			return UIActivator.createErrorStatus("Error removing target", e);
-		}
-	}
-
 	/* (non-Javadoc)
 	 * @see org.maemo.esbox.core.adapters.ISDKManageTargetAdapter#prepareRefresh()
 	 */
 	public void prepareRefresh() {
 		// this clears for both SB1 and SB2... oh well
-		ScratchboxFacade.getInstance().clearCachedData();
+		AbstractScratchboxSDK.clearCachedData();
 	}
 }

Deleted: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/maemosdk/ui/MaemoRootstrapContentLabelProvider.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/maemosdk/ui/MaemoRootstrapContentLabelProvider.java	2008-10-07 23:27:03 UTC (rev 840)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/maemosdk/ui/MaemoRootstrapContentLabelProvider.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -1,172 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Nokia Corporation.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *    Ed Swartz (Nokia) - initial API and implementation
- *******************************************************************************/
-
-package org.maemo.esbox.maemosdk.ui;
-
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.resource.JFaceResources;
-import org.eclipse.jface.viewers.*;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.*;
-import org.eclipse.swt.widgets.Display;
-import org.maemo.esbox.core.ESboxException;
-import org.maemo.esbox.core.machine.IMachine;
-import org.maemo.esbox.maemosdk.core.scratchbox.*;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * This class provides installable rootstraps, descriptions, etc. from
- * the result of 'maemo-rootstrap'.
- * @author eswartz
- *
- */
-public class MaemoRootstrapContentLabelProvider extends LabelProvider implements ITreeContentProvider, ITableLabelProvider,
-	IColorProvider, IFontProvider {
-	static final int COLUMN_NAME = 0;
-	static final int COLUMN_ARCHITECTURE = 1;
-	static final int COLUMN_DESCRIPTION = 2;
-	
-	public static Object NO_ROOTSTRAP = new Object();
-	public static Object LOADING_LABEL = new Object();
-	
-	private boolean rootstrapsFetched;
-	// either MaemoRootstrap or NO_ROOTSTRAP
-	private List<Object> rootstraps;
-	private Thread rootstrapThread;
-	private final IMachine machine;
-	
-	public MaemoRootstrapContentLabelProvider(IMachine machine) {
-		this.machine = machine;
-	}
-	
-	public Object[] getElements(Object inputElement) {
-		if (!rootstrapsFetched) {
-			rootstraps = new ArrayList<Object>();
-			rootstraps.add(NO_ROOTSTRAP);
-			rootstraps.add(LOADING_LABEL);
-			
-			if (rootstrapThread == null) {
-				rootstrapThread = new Thread(new Runnable() {
-
-					public void run() {
-						try {
-							List<MaemoRootstrap> realRootstraps = 
-								ScratchboxFacade.getInstance().getAvailableMaemoRootstraps(machine);
-							synchronized (rootstraps) {
-								rootstraps.remove(1);
-								rootstraps.addAll(realRootstraps);
-							}
-						} catch (final ESboxException e) {
-							Display.getDefault().syncExec(new Runnable() {
-
-								public void run() {
-									MessageDialog.openError(null, "Rootstrap lookup failed",
-											"Error fetching rootstraps: check proxy settings?\n\n" + e.getMessage());
-								}
-								
-							});
-						}
-						rootstrapsFetched = true;
-						rootstrapThread = null;
-						Display.getDefault().asyncExec(new Runnable() {
-
-							public void run() {
-								fireLabelProviderChanged(new LabelProviderChangedEvent(MaemoRootstrapContentLabelProvider.this));
-							}
-							
-						});
-					}
-					
-				});
-				rootstrapThread.start();
-			}
-		}
-		synchronized (rootstraps) {
-			return rootstraps.toArray();
-		}
-	}
-
-	public Object[] getChildren(Object parentElement) {
-		return new Object[0];
-	}
-
-	public Object getParent(Object element) {
-		return null;
-	}
-
-	public boolean hasChildren(Object element) {
-		return false;
-	}
-
-	public void dispose() {
-		
-	}
-
-	public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
-		viewer.refresh();
-	}
-
-	public Image getColumnImage(Object element, int columnIndex) {
-		return null;
-	}
-
-	public String getColumnText(Object element, int columnIndex) {
-		switch (columnIndex) {
-		case COLUMN_NAME:
-			if (element == NO_ROOTSTRAP) {
-				return "Custom target";
-			} else if (element == LOADING_LABEL) {
-				return "Loading...";
-			} else {
-				return ((MaemoRootstrap) element).getName();
-			}
-
-		case COLUMN_ARCHITECTURE:
-			if (element == NO_ROOTSTRAP || element == LOADING_LABEL) {
-				return null;
-			}
-			return ((MaemoRootstrap) element).getArchitecture();
-
-		case COLUMN_DESCRIPTION:
-			if (element == NO_ROOTSTRAP) {
-				return "User-defined name and compiler, manually installed rootstrap";
-			} else if (element == LOADING_LABEL) {
-				return null;
-			} else {
-				return ((MaemoRootstrap) element).getDescription();
-			}
-		}
-		return null;
-	}
-	
-
-	public Color getBackground(Object element) {
-		return null;
-	}
-	
-	public Color getForeground(Object element) {
-		if (element == LOADING_LABEL)
-			return Display.getDefault().getSystemColor(SWT.COLOR_GRAY);
-		else
-			return null;
-	}
-	
-	public Font getFont(Object element) {
-		if (element == LOADING_LABEL)
-			return JFaceResources.getFontRegistry().getItalic(
-					JFaceResources.DIALOG_FONT);
-		else
-			return null;
-	}
-	
-}

Modified: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/maemosdk/ui/actions/MaemoDropdownMenuAction.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/maemosdk/ui/actions/MaemoDropdownMenuAction.java	2008-10-07 23:27:03 UTC (rev 840)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/maemosdk/ui/actions/MaemoDropdownMenuAction.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -11,16 +11,34 @@
  *******************************************************************************/
 package org.maemo.esbox.maemosdk.ui.actions;
 
-import org.eclipse.core.resources.*;
-import org.eclipse.core.runtime.*;
+import java.text.MessageFormat;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
 import org.eclipse.core.runtime.jobs.Job;
 import org.eclipse.jface.action.IAction;
 import org.eclipse.jface.dialogs.MessageDialog;
 import org.eclipse.jface.viewers.ISelection;
 import org.eclipse.jface.viewers.IStructuredSelection;
 import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.*;
-import org.eclipse.ui.*;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.MenuItem;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.IWorkbenchWindowPulldownDelegate;
+import org.eclipse.ui.PlatformUI;
 import org.eclipse.ui.part.FileEditorInput;
 import org.maemo.esbox.core.ESboxException;
 import org.maemo.esbox.core.sdk.ISDKTarget;
@@ -30,8 +48,6 @@
 import org.maemo.esbox.project.core.ProjectManager;
 import org.maemo.esbox.ui.dialogs.SelectSDKTargetDialog;
 
-import java.text.MessageFormat;
-
 /**
  * @author reijula
  * modified by Raul Fernandes Herbster

Modified: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/maemosdk/ui/actions/ValidateVirtualMachineCommand.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/maemosdk/ui/actions/ValidateVirtualMachineCommand.java	2008-10-07 23:27:03 UTC (rev 840)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/maemosdk/ui/actions/ValidateVirtualMachineCommand.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -11,29 +11,45 @@
 
 package org.maemo.esbox.maemosdk.ui.actions;
 
-import org.eclipse.core.commands.*;
+import java.io.OutputStream;
+import java.lang.reflect.InvocationTargetException;
+import java.text.MessageFormat;
+import java.util.List;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
 import org.eclipse.core.filesystem.EFS;
 import org.eclipse.core.filesystem.IFileStore;
-import org.eclipse.core.runtime.*;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Platform;
 import org.eclipse.jface.dialogs.MessageDialog;
 import org.eclipse.jface.dialogs.ProgressMonitorDialog;
 import org.eclipse.jface.operation.IRunnableWithProgress;
 import org.eclipse.swt.widgets.Display;
 import org.eclipse.swt.widgets.Shell;
 import org.eclipse.ui.console.MessageConsole;
-import org.maemo.esbox.core.*;
-import org.maemo.esbox.core.machine.*;
-
-import org.maemo.esbox.core.process.*;
+import org.maemo.esbox.core.CorePlugin;
+import org.maemo.esbox.core.ESboxException;
+import org.maemo.esbox.core.Policy;
+import org.maemo.esbox.core.machine.IMachine;
+import org.maemo.esbox.core.machine.IVirtualMachine;
+import org.maemo.esbox.core.machine.MachineManager;
+import org.maemo.esbox.core.machine.MachineRegistry;
+import org.maemo.esbox.core.process.IProcessLauncher;
+import org.maemo.esbox.core.process.IProcessLauncherFactory;
+import org.maemo.esbox.core.process.ProcessLauncherCreator;
 import org.maemo.esbox.core.sdk.ISDKTarget;
 import org.maemo.esbox.core.sdk.SDKFactory;
 import org.maemo.esbox.maemosdk.core.scratchbox.ScratchboxException;
+import org.maemo.esbox.maemosdk.core.sdk.IScratchboxSDK;
+import org.maemo.esbox.maemosdk.core.sdk.IScratchboxSDKTarget;
 import org.maemo.esbox.maemosdk.core.sdk.ScratchboxSDKFacade;
 
-import java.io.OutputStream;
-import java.lang.reflect.InvocationTargetException;
-import java.text.MessageFormat;
-
 /**
  * @author eswartz
  *
@@ -238,7 +254,7 @@
 	 */
 	private boolean testScratchboxTargets(String path) {
 		IFileStore remoteStore;
-		ISDKTarget[] sdkTargets = ScratchboxSDKFacade.getInstance().getScratchboxSDKTargets();
+		IScratchboxSDKTarget[] sdkTargets = ScratchboxSDKFacade.getInstance().getScratchboxSDKTargets();
 		
 		if (sdkTargets.length == 0) {
 			info("Could not locate any scratchbox SDK targets in virtual build machine.\n\nRetrying ...");
@@ -264,21 +280,22 @@
 				return false;
 			}
 		}
+
+//		redundancy 		
+//		try {
+//			ScratchboxSDKFacade.getInstance().getScratchbox1SDK();
+//		} catch (ScratchboxException e) {
+//			fail("Found some scratchbox targets but not scratchbox 1... the build machine is probably misconfigured or broken.");
+//			return false;
+//		}
+//		
+//		try {
+//			ScratchboxSDKFacade.getInstance().getScratchbox2SDK();
+//		} catch (ScratchboxException e) {
+//			fail("Found some scratchbox targets but not scratchbox 2... the build machine is probably misconfigured or broken.");
+//			return false;
+//		}
 	
-		try {
-			ScratchboxSDKFacade.getInstance().getScratchbox1SDK();
-		} catch (ScratchboxException e) {
-			fail("Found some scratchbox targets but not scratchbox 1... the build machine is probably misconfigured or broken.");
-			return false;
-		}
-		
-		try {
-			ScratchboxSDKFacade.getInstance().getScratchbox2SDK();
-		} catch (ScratchboxException e) {
-			fail("Found some scratchbox targets but not scratchbox 2... the build machine is probably misconfigured or broken.");
-			return false;
-		}
-	
 		// make sure we can see the shared folder in all targets
 		for (ISDKTarget target : sdkTargets) {
 			// now test the file

Modified: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/maemosdk/ui/actions/XDropdownMenuAction.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/maemosdk/ui/actions/XDropdownMenuAction.java	2008-10-07 23:27:03 UTC (rev 840)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/maemosdk/ui/actions/XDropdownMenuAction.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -15,19 +15,24 @@
  */
 package org.maemo.esbox.maemosdk.ui.actions;
 
+import java.text.MessageFormat;
+
 import org.eclipse.jface.action.IAction;
 import org.eclipse.jface.dialogs.MessageDialog;
 import org.eclipse.jface.viewers.ISelection;
 import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.*;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.MenuItem;
+import org.eclipse.swt.widgets.Shell;
 import org.eclipse.ui.IWorkbenchWindow;
 import org.eclipse.ui.IWorkbenchWindowPulldownDelegate;
 import org.maemo.esbox.core.ESboxException;
 import org.maemo.esbox.internal.maemosdk.ui.UIActivator;
 import org.maemo.esbox.maemosdk.core.scratchbox.ESboxScriptLauncher;
 
-import java.text.MessageFormat;
-
 /**
  * @author reijula
  * modified by Raul Fernandes Herbster

Modified: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/maemosdk/ui/preferences/ESboxXServerPreferencePage.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/maemosdk/ui/preferences/ESboxXServerPreferencePage.java	2008-10-07 23:27:03 UTC (rev 840)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/maemosdk/ui/preferences/ESboxXServerPreferencePage.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -16,6 +16,8 @@
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.graphics.GC;
 import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Label;
 import org.eclipse.ui.IWorkbench;
 import org.eclipse.ui.IWorkbenchPreferencePage;
 import org.maemo.esbox.maemosdk.core.MaemoPreferenceConstants;
@@ -28,7 +30,9 @@
  */
 public class ESboxXServerPreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage, IPreferencePage {
 	
-	private StringFieldEditor xServerSyntax = null;	
+	private StringFieldEditor xServerSyntax = null;
+	private StringFieldEditor xDisplay;
+	private StringFieldEditor xPath;	
 	
 	/**
 	 * The constructor
@@ -36,7 +40,8 @@
 	public ESboxXServerPreferencePage() {
 		super(GRID);		
 		setPreferenceStore(MaemoPreferenceConstants.getPreferenceStore());
-		setDescription("Preferences for Running Graphical Programs inside Scratchbox:");
+		setDescription("Preferences for running X:\n\n"
+				+ "(The X server is launched on the host machine, so use a command syntax and display appropriate to the host.)\n");
 	}
 
 	/*
@@ -45,8 +50,8 @@
 	 */
 	public void createFieldEditors() {
 		xServerSyntax = new StringFieldEditor(
-				MaemoPreferenceConstants.DISPLAY_X_COMMAND.toString(),
-				"Command template for X server:", 
+				MaemoPreferenceConstants.DISPLAY_X_COMMAND,
+				"Command template to launch server:", 
 				getFieldEditorParent());		
 		
 		// make this string manageable
@@ -55,33 +60,32 @@
 		gridData.widthHint = gc.getAdvanceWidth('m') * 32;
 		gc.dispose();
 		xServerSyntax.getTextControl(getFieldEditorParent()).setLayoutData(gridData);
+
+		xDisplay = new StringFieldEditor(
+				MaemoPreferenceConstants.X_DISPLAY,
+				"DISPLAY setting for server:", 
+				getFieldEditorParent());		
 		
-		addField(xServerSyntax);		
+		// make this string manageable
+		xDisplay.getTextControl(getFieldEditorParent()).setLayoutData(gridData);
 		
-		initializeValues();
+		
+		xPath = new StringFieldEditor(
+				MaemoPreferenceConstants.X_PATH,
+				"Additional PATH entries for server:", 
+				getFieldEditorParent());		
+		
+		// make this string manageable
+		xPath.getTextControl(getFieldEditorParent()).setLayoutData(gridData);
+		
+		
+		addField(xServerSyntax);
+		addField(xDisplay);
+		addField(xPath);
 	}
 	
-	/**
-	 * Initializes the values of the fields
-	 */
-	private void initializeValues() {
-		IPreferenceStore store = getPreferenceStore();
-		xServerSyntax.setStringValue(store.getDefaultString(MaemoPreferenceConstants.DISPLAY_X_COMMAND.toString()));
-	}
-	
 	/*
 	 * (non-Javadoc)
-	 * @see org.eclipse.jface.preference.FieldEditorPreferencePage#performOk()
-	 */
-	@Override	
-	public boolean performOk() {
-		IPreferenceStore store = getPreferenceStore();
-		store.setValue(MaemoPreferenceConstants.DISPLAY_X_COMMAND.toString(), xServerSyntax.getStringValue());		
-		return super.performOk();
-	};
-
-	/*
-	 * (non-Javadoc)
 	 * @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
 	 */
 	public void init(IWorkbench workbench) {

Deleted: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/maemosdk/ui/preferences/Scratchbox1PreferencesPage.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/maemosdk/ui/preferences/Scratchbox1PreferencesPage.java	2008-10-07 23:27:03 UTC (rev 840)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/maemosdk/ui/preferences/Scratchbox1PreferencesPage.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -1,165 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007-2008 INdT.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *    Paulo Romulo (UFCG) - initial API and implementation
- *******************************************************************************/
-
-package org.maemo.esbox.maemosdk.ui.preferences;
-
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.jface.preference.*;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.graphics.GC;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPreferencePage;
-import org.maemo.esbox.core.machine.ILocalMachine;
-
-import org.maemo.esbox.core.sdk.SDKFactory;
-import org.maemo.esbox.maemosdk.core.SB1PreferenceConstants;
-import org.maemo.esbox.maemosdk.core.scratchbox.ScratchboxException;
-import org.maemo.esbox.maemosdk.core.sdk.IScratchboxSDK;
-import org.maemo.esbox.maemosdk.core.sdk.ScratchboxSDKFacade;
-
-/**
- * General preference page for scratchbox 1
- * 
- * @author romulo
- */
-public class Scratchbox1PreferencesPage extends FieldEditorPreferencePage implements
-	IWorkbenchPreferencePage {
-
-	/**
-	 * Field for sandbox root
-	 */
-	private DirectoryFieldEditor feSandboxRoot = null;
-	private StringFieldEditor feSandboxRootStr = null;
-
-	/**
-	 * Field for run scratchbox commands
-	 */
-	private StringFieldEditor feSboxCommands = null;
-	protected boolean sdksChanged;
-	private String origSandboxRoot;
-
-	//private StringFieldEditor feGdbQemuCommand;	
-	
-	/**
-	 * The constructor
-	 */
-	public Scratchbox1PreferencesPage() {
-		super(GRID);
-		setPreferenceStore(SB1PreferenceConstants.getPreferenceStore());
-		setDescription("Options configuring scratchbox 1");
-		origSandboxRoot = getPreferenceStore().getString(SB1PreferenceConstants.SB1_SBOX_SANDBOX.toString());
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * @see org.eclipse.jface.preference.FieldEditorPreferencePage#createFieldEditors()
-	 */
-	public void createFieldEditors() {		
-		IScratchboxSDK sdk = null;
-		try {
-			sdk = ScratchboxSDKFacade.getInstance().getScratchbox1SDK();
-		} catch (ScratchboxException e) {
-		}
-		if (false && sdk != null && sdk.getMachine() instanceof ILocalMachine) {
-			feSandboxRoot = new DirectoryFieldEditor(
-					SB1PreferenceConstants.SB1_SBOX_SANDBOX.toString(), 
-					"Sandbox root directory:", 
-					getFieldEditorParent());
-			addField(feSandboxRoot);
-			feSandboxRoot.getTextControl(getFieldEditorParent()).addModifyListener(new ModifyListener() {
-
-				public void modifyText(ModifyEvent e) {
-					sdksChanged = true;
-				}
-				
-			});
-		}
-		else {
-			feSandboxRootStr = new StringFieldEditor(
-					SB1PreferenceConstants.SB1_SBOX_SANDBOX.toString(), 
-					"Sandbox root directory:", 
-					getFieldEditorParent());
-			addField(feSandboxRootStr);
-			feSandboxRootStr.getTextControl(getFieldEditorParent()).addModifyListener(new ModifyListener() {
-
-				public void modifyText(ModifyEvent e) {
-					sdksChanged = true;
-				}
-				
-			});
-		}
-
-		feSboxCommands = new StringFieldEditor(
-				SB1PreferenceConstants.SB1_LOGIN_COMMAND.toString(),
-				"Command template:", 
-				getFieldEditorParent());		
-
-		feSboxCommands.getTextControl(getFieldEditorParent()).setToolTipText(
-				"This setting should only be changed if you have very specific needs, like an alternate run script.");
-
-		/*
-		feGdbQemuCommand = new StringFieldEditor(
-				ESboxPreferenceConstants.SB1_GDB_REMOTE_QEMU.toString(),
-				"GDB QEMU command template:", 
-				getFieldEditorParent());		
-		
-		feGdbQemuCommand.getTextControl(getFieldEditorParent()).setToolTipText(
-				"This setting should only be changed if your version of qemu differs from the expected (0.8.2).");
-		*/
-		
-		// make this string manageable
-		int width;
-		GC gc = new GC(getFieldEditorParent().getShell()); 
-		width = gc.getAdvanceWidth('m') * 32;
-		gc.dispose();
-		
-		GridData gridData = new GridData(SWT.FILL, SWT.CENTER, true, false);
-		gridData.widthHint = width;
-		feSboxCommands.getTextControl(getFieldEditorParent()).setLayoutData(gridData);
-
-		/*
-		gridData = new GridData(SWT.FILL, SWT.CENTER, true, false);
-		gridData.widthHint = width;
-		feGdbQemuCommand.getTextControl(getFieldEditorParent()).setLayoutData(gridData);
-		 */
-		
-		addField(feSboxCommands);
-		
-		//addField(feGdbQemuCommand);
-	}	
-	
-	/*
-	 * (non-Javadoc)
-	 * @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
-	 */
-	public void init(IWorkbench workbench) {
-		// Nothing to do
-	}
-	
-	@Override
-	public boolean performOk() {
-		boolean ret = super.performOk();
-		if (ret) {
-			if (sdksChanged) {
-				String curSandboxRoot = getPreferenceStore().getString(SB1PreferenceConstants.SB1_SBOX_SANDBOX.toString());
-				if (!curSandboxRoot.equals(origSandboxRoot)) {
-					SDKFactory.getInstance().refresh(new NullProgressMonitor());
-					origSandboxRoot = curSandboxRoot;
-				}
-			}
-		}
-		return ret;
-	}
-	
-}

Deleted: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/maemosdk/ui/targets/wizards/NewScratchbox1TargetWizard.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/maemosdk/ui/targets/wizards/NewScratchbox1TargetWizard.java	2008-10-07 23:27:03 UTC (rev 840)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/maemosdk/ui/targets/wizards/NewScratchbox1TargetWizard.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -1,285 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007-2008 INdT, (c) 2008 Nokia Corporation
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *    Raul Herbster (UFCG) - initial API and implementation
- *    Carolina Nogueira de Souza (UFCG) - initial API and implementation
- *    Ed Swartz (Nokia)
- *******************************************************************************/
-package org.maemo.esbox.maemosdk.ui.targets.wizards;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.wizard.*;
-import org.eclipse.swt.widgets.TableItem;
-import org.eclipse.ui.*;
-import org.maemo.esbox.core.ESboxException;
-import org.maemo.esbox.core.ErrorLogger;
-import org.maemo.esbox.core.sdk.ISDKTarget;
-import org.maemo.esbox.internal.maemosdk.ui.UIActivator;
-import org.maemo.esbox.maemosdk.core.scratchbox.ScratchboxFacade;
-import org.maemo.esbox.maemosdk.core.sdk.IScratchbox1SDK;
-import org.maemo.esbox.maemosdk.core.sdk.IScratchbox2SDK;
-import org.maemo.esbox.maemosdk.ui.targets.wizards.sbrsh.SbrshConfigurationNFSServer;
-import org.maemo.esbox.maemosdk.ui.targets.wizards.sbrsh.SbrshConfigurationTargetDevice;
-
-import java.net.InetAddress;
-import java.net.UnknownHostException;
-
-
-/**
- * The target wizard provides a easy way to create a target
- * for Scratchbox. As Scratchbox target configuration, the user
- * can configure your target.
- * 
- */
-public class NewScratchbox1TargetWizard extends Wizard implements INewWizard {
-
-	protected WizardPage targetNamePage;	
-	protected WizardPage compilerNamePage;	
-	protected WizardPage devkitsName;	
-	protected WizardPage cpuMethodName;	
-	protected WizardPage sbrshConfigTargetDevice;	
-	protected WizardPage sbrshConfigNFSServer;	
-    protected IProject generatedProject;
-
-	private IScratchbox1SDK sdk;
-
-	protected ISDKTarget createdTarget;
-
-	private void initialize() {
-		setNeedsProgressMonitor(true);
-		setWindowTitle("New Scratchbox 1 Target");
-		ImageDescriptor image = UIActivator.getImageDescriptor("./icons/full/wizban/newtarget_wiz.gif");		
-		setDefaultPageImageDescriptor(image);	
-		initPages();
-	}
-  
-	/**
-	 * Constructs a new target wizard for the given SDK (from the target configuration page)
-	 * @param sdk 
-	 */
-	public NewScratchbox1TargetWizard(IScratchbox1SDK sdk) {
-		super();
-		this.sdk = sdk;
-		initialize();
-	}
-	
-	/**
-	 * Inicializes the content of the pages.
-	 */
-	private void initPages() {
-		if (sdk != null) {
-			targetNamePage = TargetWizardPageFactory.getInstance().createNamePage(sdk);		
-			addPage(targetNamePage);
-			compilerNamePage = TargetWizardPageFactory.getInstance().createCompilerPage(sdk);	
-			addPage(compilerNamePage);
-			devkitsName = TargetWizardPageFactory.getInstance().createDevkitsPage((IScratchbox1SDK) sdk);
-			addPage(devkitsName);
-			cpuMethodName = TargetWizardPageFactory.getInstance().createCPUMethod(sdk);
-			addPage(cpuMethodName);		
-			sbrshConfigTargetDevice = TargetWizardPageFactory.getInstance().createSbrshConfigDeviceTargetPage();
-			addPage(sbrshConfigTargetDevice);
-			sbrshConfigNFSServer = TargetWizardPageFactory.getInstance().createSbrshConfigNFSSServer();
-			addPage(sbrshConfigNFSServer);
-		} else {
-			addPage(TargetWizardPageFactory.getInstance().createBadInstallationPage());
-		}
-	}
-	
-	public boolean canFinish() {
-		if (sdk == null)
-			return false;
-		
-		boolean nonCustomRootstrap = true;
-		boolean cpuPage = ((TargetWizardCPUMethod) cpuMethodName).canFinish();
-		boolean configDevice = ((SbrshConfigurationTargetDevice) sbrshConfigTargetDevice).canFinish();
-		boolean NFSServer = ((SbrshConfigurationNFSServer) sbrshConfigNFSServer).canFinish();
-		boolean sbrshConfigAccepted = ((TargetWizardCPUMethod) cpuMethodName).getSbrshConfigure();
-		
-		if (!sbrshConfigAccepted && (nonCustomRootstrap || cpuPage) )
-			return true;
-		if (sbrshConfigAccepted && NFSServer && configDevice)			 
-			return true;
-		 
-		return false;
-	}
-	
-	@Override
-	public IWizardPage getNextPage(IWizardPage page) {
-		if(page == cpuMethodName) {			
-			boolean sbrshConfigAccepted = ((TargetWizardCPUMethod) cpuMethodName).getSbrshConfigure();
-			if(!sbrshConfigAccepted)  // user does not want to configure sbrsh
-				return null;
-			else  // user wants to configure sbrsh					
-				return super.getNextPage(page);
-		}
-		return super.getNextPage(page);        
-	}
-	
-	
-	
-	/*
-	 *  (non-Javadoc)
-	 * @see org.eclipse.jface.wizard.IWizard#performFinish()
-	 */
-	public boolean performFinish() {	
-		if (!setupTargetFromScratch())
-			return false;
-		
-		boolean sbrshConfigSelected = ((TargetWizardCPUMethod) cpuMethodName).getSbrshConfigure();
-		if (sbrshConfigSelected) {			
-			configureSbrshService();		
-			showsDialog();	
-		}				
-		
-		return true;
-	}
-
-	private boolean setupTargetFromScratch() {
-		String targetName;
-		// in this mode, construct a target from the user's settings
-		targetName = getTargetNameSelected();		
-		String compilerName = getCompilerNameSelected();
-		String cpuMethod = getCputranspSelected();	
-		try {
-			if (sdk instanceof IScratchbox1SDK) {
-				String devkits = getDevkitsSelected();		
-				ScratchboxFacade.getInstance().createTarget((IScratchbox1SDK) sdk, targetName, compilerName, devkits, cpuMethod);
-			}
-			else {
-				ScratchboxFacade.getInstance().createTarget((IScratchbox2SDK) sdk, targetName, compilerName, cpuMethod);
-			}
-			createdTarget = sdk.findSDKTarget(targetName);
-			return true;
-		} catch (ESboxException e) {
-			ErrorLogger errorLogger = UIActivator.getErrorLogger();
-			errorLogger.logAndShowError("Cannot get create target " + targetName, e);			
-			return false;
-		}
-	}
-
-	/**
-	 * Return the name of the target to be created.
-	 * @return the name of the target to be created.
-	 */
-	private String getTargetNameSelected() {
-		return ((TargetWizardNamePage) targetNamePage).text.getText();
-	}
-	
-	/**
-	 * Return the compiler name of the target to be created.
-	 * @return the compiler name of the target to be created.
-	 */
-	private String getCompilerNameSelected() {
-		TableItem item = ((TargetWizardCompilerPage) compilerNamePage).table.getSelection()[0];
-		return item.getText();
-	}
-	
-	/**
-	 * Return the devkits selected.
-	 * @return the devkits selected.
-	 */
-	private String getDevkitsSelected() {
-		String devkits = "";
-		TableItem devkitsSelected[] = ((TargetWizardDevkitsPage) devkitsName).table
-		.getSelection();
-		String separator = "";
-		for (int i = 0; i < devkitsSelected.length; i++) {
-			TableItem devkit = devkitsSelected[i];
-			devkits += separator + devkit.getText();
-			separator = ":";
-		}	
-		return devkits;
-	}	
-	
-	/**
-	 * Return the cputransp name of the target to be created.
-	 * @return the cputransp name of the target to be created.
-	 */
-	private String getCputranspSelected() {
-		TableItem item = ((TargetWizardCPUMethod) cpuMethodName).table.getSelection()[0];
-		return item.getText();
-	}
-	
-	/**
-	 * Configure sbrsh service.
-	 */
-	private void configureSbrshService() {
-		String targetName = getTargetNameSelected();
-		String deviceTargetAddr = ((SbrshConfigurationTargetDevice)sbrshConfigTargetDevice).getTargetDeviceAddr();
-		String nfsHostname = ((SbrshConfigurationNFSServer)sbrshConfigNFSServer).getNFSHostname();
-		
-		try {
-			ScratchboxFacade.getInstance().configureSbrsh(sdk, targetName, deviceTargetAddr, nfsHostname);
-		} catch (ESboxException e) {
-			ErrorLogger errorLogger = UIActivator.getErrorLogger();
-			errorLogger.logAndShowError("Cannot configure sbrsh", e);			
-		}
-	}	
-		
-	
-	/**
-	 * Add user at access list of the sbrshd running at the target device.
-	 */
-	private void addUser() {	
-		String deviceTargetIP = ((SbrshConfigurationTargetDevice)sbrshConfigTargetDevice).getTargetDeviceIP();
-		String username = System.getProperty("user.name");	
-		ErrorLogger errorLogger = UIActivator.getErrorLogger();
-		
-		try {
-			String localAddr = getLocalIP();
-			ScratchboxFacade.getInstance().addSbrshAccessList(sdk, deviceTargetIP, username, localAddr);
-		} catch (ESboxException e) {
-			errorLogger.logAndShowError("Cannot add user to the access list of sbrshd at the target device", e);			
-		} catch (UnknownHostException e) {
-			errorLogger.logAndShowError("Cannot get local IP address", e);			
-		}
-	}
-	
-	/**
-	 * Shows the dialog to ask the user if s/he wants to add his/herself to the acess list of the 
-	 * sbrshd.
-	 */
-	private void showsDialog() {				
-		String deviceTargetAddr = ((SbrshConfigurationTargetDevice)sbrshConfigTargetDevice).getTargetDeviceIP();
-		String text = "Do you want to add yourself to the access list of the sbrshd running on target device? \n";
-		text += "(This requires that "+ deviceTargetAddr +" has ssh daemon running and sbrshd already installed, and that you have root access).";
-		boolean userAddedAtAccessList = MessageDialog.openQuestion(getShell(),"Scratchbox Configuration",text);		
-		if(userAddedAtAccessList) {
-			addUser();			
-		}
-	}
-	
-	/**
-	 * Get the local IP address.
-	 * @return the local IP address.
-	 * @throws UnknownHostException
-	 */
-	private String getLocalIP() throws UnknownHostException {
-		return InetAddress.getLocalHost().getHostAddress();
-	}
-
-	/**
-	 * We will accept the selection in the workbench to see if
-	 * we can initialize from it.
-	 * @see IWorkbenchWizard#init(IWorkbench, IStructuredSelection)
-	 */
-	public void init(IWorkbench workbench, IStructuredSelection selection) {
-	}
-
-	/**
-	 * Get the target created.  Only valid after wizard dialog completes.
-	 * @return newly created ISDKTarget or <code>null</code>
-	 */
-	public ISDKTarget getCreatedTarget() {
-		return createdTarget;
-	}
-	
-}
\ No newline at end of file

Deleted: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/maemosdk/ui/targets/wizards/NewScratchbox2TargetWizard.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/maemosdk/ui/targets/wizards/NewScratchbox2TargetWizard.java	2008-10-07 23:27:03 UTC (rev 840)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/maemosdk/ui/targets/wizards/NewScratchbox2TargetWizard.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -1,356 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007-2008 INdT, (c) 2008 Nokia Corporation
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *    Raul Herbster (UFCG) - initial API and implementation
- *    Carolina Nogueira de Souza (UFCG) - initial API and implementation
- *    Ed Swartz (Nokia)
- *******************************************************************************/
-package org.maemo.esbox.maemosdk.ui.targets.wizards;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.SubProgressMonitor;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.wizard.*;
-import org.eclipse.swt.widgets.TableItem;
-import org.eclipse.ui.*;
-import org.maemo.esbox.core.*;
-import org.maemo.esbox.core.sdk.ISDKTarget;
-import org.maemo.esbox.internal.maemosdk.ui.UIActivator;
-import org.maemo.esbox.maemosdk.core.scratchbox.*;
-import org.maemo.esbox.maemosdk.core.sdk.*;
-import org.maemo.esbox.maemosdk.ui.targets.wizards.sbrsh.SbrshConfigurationNFSServer;
-import org.maemo.esbox.maemosdk.ui.targets.wizards.sbrsh.SbrshConfigurationTargetDevice;
-
-import java.lang.reflect.InvocationTargetException;
-import java.net.InetAddress;
-import java.net.UnknownHostException;
-import java.text.MessageFormat;
-import java.util.List;
-
-
-/**
- * The target wizard provides a easy way to create a target
- * for Scratchbox. As Scratchbox target configuration, the user
- * can configure your target.
- * 
- */
-public class NewScratchbox2TargetWizard extends Wizard implements INewWizard {
-
-	protected WizardPage targetNamePage;	
-	protected WizardPage compilerNamePage;	
-	protected WizardPage cpuMethodName;	
-	protected WizardPage sbrshConfigTargetDevice;	
-	protected WizardPage sbrshConfigNFSServer;	
-    protected IProject generatedProject;
-
-	private IScratchbox2SDK sdk;
-
-	private WizardPage maemoRootstrapPage;
-
-	protected ISDKTarget createdTarget;
-
-	private void initialize() {
-		setNeedsProgressMonitor(true);
-		setWindowTitle("New Scratchbox 2 Target");
-		ImageDescriptor image = UIActivator.getImageDescriptor("./icons/full/wizban/newtarget_wiz.gif");		
-		setDefaultPageImageDescriptor(image);	
-		initPages();
-	}
-  
-	/**
-	 * Constructs a new target wizard for the given SDK (from the target configuration page)
-	 * @param sdk 
-	 */
-	public NewScratchbox2TargetWizard(IScratchbox2SDK sdk) {
-		super();
-		this.sdk = sdk;
-		initialize();
-	}
-	
-	/**
-	 * Inicializes the content of the pages.
-	 */
-	private void initPages() {
-		if (sdk != null) {
-			maemoRootstrapPage = TargetWizardPageFactory.getInstance().createMaemoRootstrapPage(sdk);		
-			addPage(maemoRootstrapPage);
-			targetNamePage = TargetWizardPageFactory.getInstance().createNamePage(sdk);		
-			addPage(targetNamePage);
-			compilerNamePage = TargetWizardPageFactory.getInstance().createCompilerPage(sdk);	
-			addPage(compilerNamePage);
-			cpuMethodName = TargetWizardPageFactory.getInstance().createCPUMethod(sdk);
-			addPage(cpuMethodName);		
-			sbrshConfigTargetDevice = TargetWizardPageFactory.getInstance().createSbrshConfigDeviceTargetPage();
-			addPage(sbrshConfigTargetDevice);
-			sbrshConfigNFSServer = TargetWizardPageFactory.getInstance().createSbrshConfigNFSSServer();
-			addPage(sbrshConfigNFSServer);
-		} else {
-			addPage(TargetWizardPageFactory.getInstance().createBadInstallationPage());
-		}
-	}
-	
-	public boolean canFinish() {
-		if (sdk == null)
-			return false;
-		
-		boolean nonCustomRootstrap = true;
-		if (maemoRootstrapPage != null)
-			nonCustomRootstrap = ((TargetWizardRootstrapSb2Page) maemoRootstrapPage).canFinish();
-		boolean cpuPage = ((TargetWizardCPUMethod) cpuMethodName).canFinish();
-		boolean configDevice = ((SbrshConfigurationTargetDevice) sbrshConfigTargetDevice).canFinish();
-		boolean NFSServer = ((SbrshConfigurationNFSServer) sbrshConfigNFSServer).canFinish();
-		boolean sbrshConfigAccepted = ((TargetWizardCPUMethod) cpuMethodName).getSbrshConfigure();
-		
-		if (!sbrshConfigAccepted && (nonCustomRootstrap || cpuPage) )
-			return true;
-		if (sbrshConfigAccepted && NFSServer && configDevice)			 
-			return true;
-		 
-		return false;
-	}
-	
-	@Override
-	public IWizardPage getNextPage(IWizardPage page) {
-		if (page == maemoRootstrapPage) {
-			boolean nonCustomRootstrap = ((TargetWizardRootstrapSb2Page) maemoRootstrapPage).canFinish();
-			if (nonCustomRootstrap)
-				return null;
-			else
-				return super.getNextPage(page);
-		}
-		if(page == cpuMethodName) {			
-			boolean sbrshConfigAccepted = ((TargetWizardCPUMethod) cpuMethodName).getSbrshConfigure();
-			if(!sbrshConfigAccepted)  // user does not want to configure sbrsh
-				return null;
-			else  // user wants to configure sbrsh					
-				return super.getNextPage(page);
-		}
-		return super.getNextPage(page);        
-	}
-	
-	
-	
-	/*
-	 *  (non-Javadoc)
-	 * @see org.eclipse.jface.wizard.IWizard#performFinish()
-	 */
-	public boolean performFinish() {	
-		if (getRootstrap() != null) {
-			if (!setupTargetFromRootstrap())
-				return false;
-		} else {
-			if (!setupTargetFromScratch())
-				return false;
-		}
-		
-		boolean sbrshConfigSelected = ((TargetWizardCPUMethod) cpuMethodName).getSbrshConfigure();
-		if (sbrshConfigSelected) {			
-			configureSbrshService();		
-			showsDialog();	
-		}				
-		
-		return true;
-	}
-
-	private boolean setupTargetFromScratch() {
-		String targetName;
-		// in this mode, construct a target from the user's settings
-		targetName = getTargetNameSelected();		
-		String compilerName = getCompilerNameSelected();
-		String cpuMethod = getCputranspSelected();	
-		try {
-			ScratchboxFacade.getInstance().createTarget(sdk, targetName, compilerName, cpuMethod);
-			createdTarget = sdk.findSDKTarget(targetName);
-			return true;
-		} catch (ESboxException e) {
-			ErrorLogger errorLogger = UIActivator.getErrorLogger();
-			errorLogger.logAndShowError("Cannot get create target " + targetName, e);			
-			return false;
-		}
-	}
-
-	private boolean setupTargetFromRootstrap() {
-		String targetName;
-		// in this mode, make a predefined target from a maemo rootstrap
-		targetName = getRootstrap().getName();
-		boolean create = true;
-		
-		if (true) {
-			// see if the rootstrap (not necessarily the target) already exists,
-			// and ask user, in case this will overwrite their customizations
-			try {
-				List<String> installedRootstraps = 
-					ScratchboxFacade.getInstance().getInstalledMaemoRootstraps(sdk);
-				if (installedRootstraps.contains(targetName)) {
-					create = MessageDialog.openConfirm(getShell(), "Reinstall rootstrap?", 
-							MessageFormat.format("The rootstrap ''{0}'' appears to be already installed, though it may be disconnected from scratchbox.\n\n"+
-									"At this time, we can't recreate a target for this rootstrap, but " +
-									"you could do it manually with 'sb2-init'.\n\n" +
-									"Do you want to overwrite the rootstrap?",
-									targetName));
-				}
-			} catch (ESboxException e) {
-				ErrorLogger errorLogger = UIActivator.getErrorLogger();
-				errorLogger.logError("Cannot detect installed rootstraps", e);			
-			}
-		}
-		
-		if (create) {
-			try {
-				createRootstrap(targetName, useHostTools());
-			} catch (ESboxException e) {
-				ErrorLogger errorLogger = UIActivator.getErrorLogger();
-				errorLogger.logAndShowError("Cannot get create rootstrap target " + targetName, e);			
-				return false;
-			}
-		}
-		return true;
-	}
-
-	private void createRootstrap(final String targetName, final boolean useHostTools) throws ScratchboxException {
-		try {
-			getContainer().run(true, true, new IRunnableWithProgress() {
-
-					public void run(IProgressMonitor monitor)
-							throws InvocationTargetException,
-							InterruptedException {
-						monitor.beginTask("Creating rootstrap", IProgressMonitor.UNKNOWN);
-						try {
-							ScratchboxFacade.getInstance().createRootstrapTarget(
-									(IScratchbox2SDK) sdk, targetName, useHostTools, true, 
-									new SubProgressMonitor(monitor, 1));
-							createdTarget = sdk.findSDKTarget(targetName);
-						} catch (ESboxException e) {
-							throw new InvocationTargetException(e);
-						}
-						monitor.done();
-					}
-					
-				});
-		} catch (InvocationTargetException e) {
-			if (e.getCause() instanceof ScratchboxException)
-				throw (ScratchboxException) e.getCause();
-			else
-				throw new ScratchboxException(e);
-		} catch (InterruptedException e) {
-			throw new ScratchboxException(e);
-		}
-	}
-	
-	private MaemoRootstrap getRootstrap() {
-		return ((TargetWizardRootstrapSb2Page) maemoRootstrapPage).getRootstrap();
-	}
-	private boolean useHostTools() {
-		return ((TargetWizardRootstrapSb2Page) maemoRootstrapPage).useHostTools();
-	}
-	
-	/**
-	 * Return the name of the target to be created.
-	 * @return the name of the target to be created.
-	 */
-	private String getTargetNameSelected() {
-		return ((TargetWizardNamePage) targetNamePage).text.getText();
-	}
-	
-	/**
-	 * Return the compiler name of the target to be created.
-	 * @return the compiler name of the target to be created.
-	 */
-	private String getCompilerNameSelected() {
-		TableItem item = ((TargetWizardCompilerPage) compilerNamePage).table.getSelection()[0];
-		return item.getText();
-	}
-	
-	/**
-	 * Return the cputransp name of the target to be created.
-	 * @return the cputransp name of the target to be created.
-	 */
-	private String getCputranspSelected() {
-		TableItem item = ((TargetWizardCPUMethod) cpuMethodName).table.getSelection()[0];
-		return item.getText();
-	}
-	
-	/**
-	 * Configure sbrsh service.
-	 */
-	private void configureSbrshService() {
-		String targetName = getTargetNameSelected();
-		String deviceTargetAddr = ((SbrshConfigurationTargetDevice)sbrshConfigTargetDevice).getTargetDeviceAddr();
-		String nfsHostname = ((SbrshConfigurationNFSServer)sbrshConfigNFSServer).getNFSHostname();
-		
-		try {
-			ScratchboxFacade.getInstance().configureSbrsh(sdk, targetName, deviceTargetAddr, nfsHostname);
-		} catch (ESboxException e) {
-			ErrorLogger errorLogger = UIActivator.getErrorLogger();
-			errorLogger.logAndShowError("Cannot configure sbrsh", e);			
-		}
-	}	
-		
-	
-	/**
-	 * Add user at access list of the sbrshd running at the target device.
-	 */
-	private void addUser() {	
-		String deviceTargetIP = ((SbrshConfigurationTargetDevice)sbrshConfigTargetDevice).getTargetDeviceIP();
-		String username = System.getProperty("user.name");	
-		ErrorLogger errorLogger = UIActivator.getErrorLogger();
-		
-		try {
-			String localAddr = getLocalIP();
-			ScratchboxFacade.getInstance().addSbrshAccessList(sdk, deviceTargetIP, username, localAddr);
-		} catch (ESboxException e) {
-			errorLogger.logAndShowError("Cannot add user to the access list of sbrshd at the target device", e);			
-		} catch (UnknownHostException e) {
-			errorLogger.logAndShowError("Cannot get local IP address", e);			
-		}
-	}
-	
-	/**
-	 * Shows the dialog to ask the user if s/he wants to add his/herself to the acess list of the 
-	 * sbrshd.
-	 */
-	private void showsDialog() {				
-		String deviceTargetAddr = ((SbrshConfigurationTargetDevice)sbrshConfigTargetDevice).getTargetDeviceIP();
-		String text = "Do you want to add yourself to the access list of the sbrshd running on target device? \n";
-		text += "(This requires that "+ deviceTargetAddr +" has ssh daemon running and sbrshd already installed, and that you have root access).";
-		boolean userAddedAtAccessList = MessageDialog.openQuestion(getShell(),"Scratchbox Configuration",text);		
-		if(userAddedAtAccessList) {
-			addUser();			
-		}
-	}
-	
-	/**
-	 * Get the local IP address.
-	 * @return the local IP address.
-	 * @throws UnknownHostException
-	 */
-	private String getLocalIP() throws UnknownHostException {
-		return InetAddress.getLocalHost().getHostAddress();
-	}
-
-	/**
-	 * We will accept the selection in the workbench to see if
-	 * we can initialize from it.
-	 * @see IWorkbenchWizard#init(IWorkbench, IStructuredSelection)
-	 */
-	public void init(IWorkbench workbench, IStructuredSelection selection) {
-	}
-
-	/**
-	 * Get the target created.  Only valid after wizard dialog completes.
-	 * @return newly created ISDKTarget or <code>null</code>
-	 */
-	public ISDKTarget getCreatedTarget() {
-		return createdTarget;
-	}
-	
-}
\ No newline at end of file

Deleted: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/maemosdk/ui/targets/wizards/TargetWizardDevkitsPage.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/maemosdk/ui/targets/wizards/TargetWizardDevkitsPage.java	2008-10-07 23:27:03 UTC (rev 840)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/maemosdk/ui/targets/wizards/TargetWizardDevkitsPage.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -1,136 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007-2008 INdT, (c) 2008 Nokia Corporation
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *    Raul Herbster (UFCG) - initial API and implementation
- *    Carolina Nogueira de Souza (UFCG) - initial API and implementation
- *    Ed Swartz (Nokia)
- *******************************************************************************/
-
-package org.maemo.esbox.maemosdk.ui.targets.wizards;
-
-import org.eclipse.jface.wizard.WizardPage;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.*;
-import org.maemo.esbox.core.ESboxException;
-import org.maemo.esbox.core.ErrorLogger;
-import org.maemo.esbox.internal.maemosdk.ui.UIActivator;
-import org.maemo.esbox.maemosdk.core.scratchbox.ScratchboxFacade;
-import org.maemo.esbox.maemosdk.core.sdk.IScratchbox1SDK;
-
-import java.util.List;
-
-/**
- * This pages shows the devkits that the user can choose for his/her
- * target. 
- * 
- */
-public class TargetWizardDevkitsPage extends WizardPage implements IValidatePage {
-
-	protected Table table;
-	private IScratchbox1SDK sdk;
-	
-	/**
-	 * Constructs a NewTargetWizardDevkitsPage.
-	 */
-	protected TargetWizardDevkitsPage(IScratchbox1SDK sdk) {		
-		super("Devkit");
-		this.sdk = sdk;
-		setTitle("Devkit");
-		setDescription("Select devkits");
-		setPageComplete(false);
-	}
-	
-	/*
-	 *  (non-Javadoc)
-	 * @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite)
-	 */
-	public void createControl(Composite parent) {
-		Composite composite = new Composite(parent, SWT.NONE);
-		composite.setLayout(new GridLayout(1, false));
-			
-		Label label = new Label(composite,SWT.LEFT);
-		label.setText("Devkits"); 
-		
-		table = new Table(composite,SWT.MULTI | SWT.CHECK | SWT.BORDER);
-		table.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, true));
-		table.setHeaderVisible(false);
-		table.setLinesVisible(true);
-		table.addSelectionListener(new SelectionAdapter() {
-			public void widgetSelected(SelectionEvent event) {
-				validatePage();
-			}
-		});		
-		
-		inicializeTable();
-		
-		setControl(composite);
-	}
-
-	/**
-	 * Inicializes the contents of the table.
-	 */
-	private void inicializeTable() {
-		TableItem item = null;
-		List<String> devkits = null;
-		try {
-			devkits = ScratchboxFacade.getInstance().getDevkits(sdk);
-		} catch (ESboxException e) {			
-			ErrorLogger errorLogger = UIActivator.getErrorLogger();
-			errorLogger.logAndShowError("Cannot get list of devkits", e);
-			return;
-		}		
-		for (String devkit : devkits) {
-			item = new TableItem(table, SWT.NONE);			
-			item.setText(devkit);
-		}		
-	}
-	
-	/*
-	 *  (non-Javadoc)
-	 * @see br.edu.ufcg.dee.omapsdk.properties.target.wizard.pages.ValidateWizardPage#perfomeAction()
-	 */
-	public boolean validatePage() {
-		TableItem[] items = table.getItems();
-		boolean noneSelected = false;
-		boolean pageOK = false;
-		//verifies if at least one option was checked.
-		for (int i = 0; i < items.length; i++) {
-			TableItem item = items[i];
-			if(item.getChecked()) {
-				pageOK = true;
-				break;
-			}
-		}
-		//verifies if the options were choosen properly.
-		for (int i = 0; i < items.length; i++) {
-			TableItem item = items[i];
-			//verifies if any item was selected.
-			if(item.getChecked()) {
-				//verifies if "none" was selected.
-				if(item.getText().equals("none")) {
-					noneSelected = true;
-				//the user cant select another devkit if "none" was selected.
-				} else {
-					pageOK = !noneSelected;					
-				}
-			}			
-		}		
-		if(noneSelected && !pageOK) {
-			setErrorMessage("Selected corrects devkits.");
-		} else {
-			String msg = pageOK ? null : "Select at least one option";
-			setErrorMessage(msg);
-		}
-		setPageComplete(pageOK);
-		return pageOK;
-	}
-}
\ No newline at end of file

Modified: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/maemosdk/ui/targets/wizards/TargetWizardNamePage.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/maemosdk/ui/targets/wizards/TargetWizardNamePage.java	2008-10-07 23:27:03 UTC (rev 840)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/maemosdk/ui/targets/wizards/TargetWizardNamePage.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -19,7 +19,9 @@
 import org.eclipse.swt.events.KeyListener;
 import org.eclipse.swt.layout.GridData;
 import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.*;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
 import org.maemo.esbox.maemosdk.core.sdk.IScratchboxSDK;
 
 /**

Modified: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/maemosdk/ui/targets/wizards/TargetWizardPageFactory.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/maemosdk/ui/targets/wizards/TargetWizardPageFactory.java	2008-10-07 23:27:03 UTC (rev 840)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/maemosdk/ui/targets/wizards/TargetWizardPageFactory.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -15,7 +15,6 @@
 
 import org.eclipse.jface.wizard.IWizardPage;
 import org.eclipse.jface.wizard.WizardPage;
-import org.maemo.esbox.maemosdk.core.sdk.IScratchbox1SDK;
 import org.maemo.esbox.maemosdk.core.sdk.IScratchboxSDK;
 import org.maemo.esbox.maemosdk.ui.targets.wizards.sbrsh.SbrshConfigurationNFSServer;
 import org.maemo.esbox.maemosdk.ui.targets.wizards.sbrsh.SbrshConfigurationTargetDevice;
@@ -69,13 +68,13 @@
 		return new TargetWizardCPUMethod(sdk);
 	}
 	
-	/**
-	 * Creates a new devkit page.
-	 * @return a new devkit page.
-	 */
-	public WizardPage createDevkitsPage(IScratchbox1SDK sdk) {
-		return new TargetWizardDevkitsPage(sdk);
-	}
+//	/**
+//	 * Creates a new devkit page.
+//	 * @return a new devkit page.
+//	 */
+//	public WizardPage createDevkitsPage(IScratchbox1SDK sdk) {
+//		return new TargetWizardDevkitsPage(sdk);
+//	}
 	
 	/**
 	 * Create a new page to configure sbrsh device target.
@@ -97,7 +96,7 @@
 		return new BadInstallationPage();
 	}
 
-	public WizardPage createMaemoRootstrapPage(IScratchboxSDK sdk) {
-		return new TargetWizardRootstrapSb2Page(sdk);
-	}
+//	public WizardPage createMaemoRootstrapPage(IScratchboxSDK sdk) {
+//		return new TargetWizardRootstrapSb2Page(sdk);
+//	}
 }

Deleted: branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/maemosdk/ui/targets/wizards/TargetWizardRootstrapSb2Page.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/maemosdk/ui/targets/wizards/TargetWizardRootstrapSb2Page.java	2008-10-07 23:27:03 UTC (rev 840)
+++ branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/maemosdk/ui/targets/wizards/TargetWizardRootstrapSb2Page.java	2008-10-08 13:17:48 UTC (rev 841)
@@ -1,192 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Nokia Corporation
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- *    Ed Swartz (Nokia) - initial API and implementation
- *******************************************************************************/
-
-package org.maemo.esbox.maemosdk.ui.targets.wizards;
-
-import org.eclipse.jface.viewers.*;
-import org.eclipse.jface.wizard.WizardPage;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.*;
-import org.maemo.esbox.maemosdk.core.scratchbox.MaemoRootstrap;
-import org.maemo.esbox.maemosdk.core.sdk.IScratchbox2SDK;
-import org.maemo.esbox.maemosdk.core.sdk.IScratchboxSDK;
-import org.maemo.esbox.maemosdk.ui.MaemoRootstrapContentLabelProvider;
-
-/**
- * This page allows the user to select a rootstrap (which defines the target name,
- * compiler, devkits, and cpu method all at once) for use with sb2, or to explicitly
- * select to configure all the aspects himself.
- * @author eswartz
- *
- */
-public class TargetWizardRootstrapSb2Page extends WizardPage implements IValidatePage {
-	
-	protected TreeViewer rootstrapTargetViewer;
-	protected Text text;	
-	/*private*/ IScratchboxSDK sdk;	// in case we use it later
-	protected Object selection;
-	private MaemoRootstrapContentLabelProvider provider;
-	private Button showExistingTargets;
-	private Button useHostTools;
-	
-	/**
-	 * Constructs a NewTargetWizardNamePage.
-	 */
-	protected TargetWizardRootstrapSb2Page(IScratchboxSDK sdk) {		
-		super("Target Name");
-		this.sdk = sdk;
-		if (!(sdk instanceof IScratchbox2SDK)) {
-			throw new IllegalArgumentException("This page only expects a scratchbox 2 SDK");
-		}
-		setTitle("Select maemo SDK+ Rootstrap");
-		setDescription("Select the maemo rootstrap to install, or manually configure a target.");
-		setPageComplete(false);		
-	}	
-		
-	/*
-	 *  (non-Javadoc)
-	 * @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite)
-	 */
-	public void createControl(Composite parent) {
-		Composite composite = new Composite(parent, SWT.NONE);
-		composite.setLayout(new GridLayout(1, false));
-		
-		Label label = new Label(composite, SWT.LEFT);
-		label.setText("Select a rootstrap:"); 
-		
-		rootstrapTargetViewer = new TreeViewer(composite, SWT.SINGLE | SWT.BORDER);
-		rootstrapTargetViewer.getTree().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
-		
-		showExistingTargets = new Button(composite, SWT.CHECK);
-		showExistingTargets.setText("Show existing targets");
-		showExistingTargets.setSelection(false);
-		showExistingTargets.setToolTipText("If checked, rootstraps with names matching existing targets will be shown.  This is the only way to reinstall a target.");
-
-		useHostTools = new Button(composite, SWT.CHECK);
-		useHostTools.setText("Use host's build tools");
-		useHostTools.setSelection(false);
-		useHostTools.setToolTipText("If checked, configure the rootstrap to use the host versions of autotools, bison, flex, docbook, etc. instead of standard versions (c.f. devkits in scratchbox 1).  We recommend leaving this unchecked and invoking maemo-tools to install official build tools.");
-
-		/// setup rootstrap target tree
-		
-		provider = new MaemoRootstrapContentLabelProvider(sdk.getMachine());
-		rootstrapTargetViewer.setContentProvider(provider);
-		rootstrapTargetViewer.setLabelProvider(provider);
-
-		rootstrapTargetViewer.addSelectionChangedListener(new ISelectionChangedListener() {
-
-			public void selectionChanged(SelectionChangedEvent event) {
-				selection = ((IStructuredSelection) event.getSelection()).getFirstElement();
-				validatePage();
-			}
-			
-		});
-		
-		provider.addListener(new ILabelProviderListener() {
-
-			public void labelProviderChanged(LabelProviderChangedEvent event) {
-				rootstrapTargetViewer.refresh();
-			}
-			
-		});
-		
-		rootstrapTargetViewer.getTree().setLinesVisible(true);
-		rootstrapTargetViewer.getTree().setHeaderVisible(true);
-		
-		TreeColumn nameColumn = new TreeColumn(rootstrapTargetViewer.getTree(), SWT.LEFT);
-		nameColumn.setText("Target Name");
-		nameColumn.setWidth(200);
-		nameColumn.setResizable(true);
-		
-		TreeColumn archColumn = new TreeColumn(rootstrapTargetViewer.getTree(), SWT.LEFT);
-		archColumn.setText("Architecture");
-		archColumn.setWidth(100);
-		archColumn.setResizable(true);
-		
-		TreeColumn descColumn = new TreeColumn(rootstrapTargetViewer.getTree(), SWT.LEFT);
-		descColumn.setText("Description");
-		descColumn.setWidth(200);
-		descColumn.setResizable(true);
-
-		
-		rootstrapTargetViewer.setInput(new Object());
-		
-		rootstrapTargetViewer.setSelection(StructuredSelection.EMPTY);
-
-		showExistingTargets.addSelectionListener(new SelectionAdapter() {
-			@Override
-			public void widgetSelected(SelectionEvent e) {
-				updateViewerFilters();
-			}
-		});
-		
-		updateViewerFilters();
-		setControl(composite);
-	}
-	
-	protected void updateViewerFilters() {
-		if (!showExistingTargets.getSelection()) {
-			rootstrapTargetViewer.setFilters(new ViewerFilter[] {
-					new ViewerFilter() {
-
-						@Override
-						public boolean select(Viewer viewer,
-								Object parentElement, Object element) {
-							if (element instanceof MaemoRootstrap) {
-								MaemoRootstrap rootstrap = (MaemoRootstrap) element;
-								if (sdk.findSDKTarget(rootstrap.getName()) != null)
-									return false;
-							}
-							return true;
-						}
-						
-					}
-			});
-		} else {
-			rootstrapTargetViewer.setFilters(new ViewerFilter[0]);
-		}
-			
-		rootstrapTargetViewer.refresh();
-		
-	}
-
-	/*
-	 *  (non-Javadoc)
-	 * @see br.edu.ufcg.dee.omapsdk.properties.target.wizard.pages.ValidateWizardPage#perfomeAction()
-	 */
-	public boolean validatePage() {		
-		setPageComplete(selection instanceof MaemoRootstrap || selection == MaemoRootstrapContentLabelProvider.NO_ROOTSTRAP);
-		return true;
-	}
-	
-	public boolean canFinish() {
-		return selection instanceof MaemoRootstrap;
-	}
-
-	public MaemoRootstrap getRootstrap() {
-		if (!(selection instanceof MaemoRootstrap))
-			return null;
-		return (MaemoRootstrap) selection;
-	}
-	
-	public boolean isShowingExisting() {
-		return showExistingTargets.getSelection();
-	}
-	
-	public boolean useHostTools() {
-		return useHostTools.getSelection();
-	}
-		
-}
\ No newline at end of file



More information about the Esbox-commits mailing list