[Esbox-commits] r877 - in trunk: cpp/org.maemo.esbox.cpp.tests/META-INF cpp/org.maemo.esbox.cpp.tests/src/org/maemo/esbox/cpp/tests cpp/org.maemo.esbox.cpp.tests/src/org/maemo/esbox/cpp/tests/ui device/org.maemo.esbox.device.tests/src/org/maemo/esbox/device/tests/sbrsh maemosdk maemosdk/org.maemo.esbox.maemosdk-feature maemosdk/org.maemo.esbox.maemosdk.analysis/src/org/maemo/esbox/internal/maemosdk/analysis maemosdk/org.maemo.esbox.maemosdk.core maemosdk/org.maemo.esbox.maemosdk.core/META-INF maemosdk/org.maemo.esbox.maemosdk.core/conf maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/api maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/api/core maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/api/core/commands maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/api/core/sdk maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/adapters maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/sbrsh maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/scratchbox maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/sdk maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/command maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/execEnv maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/platform maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/scratchbox maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/sdk maemosdk/org.maemo.esbox.maemosdk.sb1 maemosdk/org.maemo.esbox.maemosdk.sb1/META-INF maemosdk/org.maemo.esbox.maemosdk.sb1/conf maemosdk/org.maemo.esbox.maemosdk.sb1/src maemosdk/org.maemo.esbox.maemosdk.sb1/src/org maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1 maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/command maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/core maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/launcher maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/provider maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/ui maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/ui/adapters maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/ui/preferences maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/ui/wizard maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/maemosdk maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/maemosdk/sb1 maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/maemosdk/sb1/sdk maemosdk/org.maemo.esbox.maemosdk.tests/META-INF maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/commands maemosdk/org.maemo.esbox.maemosdk.ui maemosdk/org.maemo.esbox.maemosdk.ui/META-INF maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/actions maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/adapters maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/preferences maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/targets maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/targets/wizards maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/targets/wizards/sbrsh maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/maemosdk/ui maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/maemosdk/ui/targets/wizards python/org.maemo.esbox.python.tests/META-INF python/org.maemo.esbox.python.tests/src/org/maemo/esbox/python/tests

eswartz at garage.maemo.org eswartz at garage.maemo.org
Wed Oct 15 22:30:32 EEST 2008


Author: eswartz
Date: 2008-10-15 22:30:29 +0300 (Wed, 15 Oct 2008)
New Revision: 877

Added:
   trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/api/
   trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/api/core/
   trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/api/core/MaemoPreferenceConstantsPrivate.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/api/core/MaemoPreferenceMigrator.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/api/core/commands/
   trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/api/core/commands/ICommandAbstractor.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/api/core/sdk/
   trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/api/core/sdk/AbstractScratchboxSDK.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/api/core/sdk/AbstractScratchboxSDKTarget.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/api/core/sdk/CacheUtils.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/api/core/sdk/MachineUtils.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/api/core/sdk/MaemoUtils.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/OldStyleProjectProperties.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/OldStyleWorkspaceProjectPropertiesProvider.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/ScratchboxPackageManagerProvider.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/ScratchboxPropertyTester.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/scratchbox/
   trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/scratchbox/MaemoLauncher.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/scratchbox/PersistentCache.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/scratchbox/XLauncher.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/MaemoPreferenceConstants.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/command/
   trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/command/AbstractSDKCommand.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/command/ScratchboxCommand.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/command/ScratchboxInvalidParameterException.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/
   trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/.classpath
   trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/.project
   trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/.settings/
   trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/META-INF/
   trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/META-INF/MANIFEST.MF
   trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/build.properties
   trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/conf/
   trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/conf/run.sh
   trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/conf/sb1_prefs.xml
   trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/plugin.xml
   trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/
   trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/
   trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/
   trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/
   trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/
   trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/
   trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/
   trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/Activator.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/command/
   trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/command/AbstractSB1Command.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/command/CreateTargetCommand.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/command/GetCurrentTargetCommand.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/command/GetGdbQemuCommandPatternCommand.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/command/GetVersionScratchboxCommand.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/command/KillallCommand.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/command/ListCompilersCommand.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/command/ListCputranspCommand.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/command/ListDevkitsCommand.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/command/ListSessionsCommand.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/command/ListTargetsCommand.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/command/RemoveTargetCommand.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/command/ResetTargetCommand.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/command/RootstrapCommand.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/command/SelectTargetCommand.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/command/ShowTargetCommand.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/core/
   trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/core/SB1PreferenceConstants.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/core/Scratchbox1FileSystemMapping.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/core/Scratchbox1SDK.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/core/Scratchbox1SDKTarget.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/launcher/
   trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/launcher/Scratchbox1EnvironmentProvider.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/launcher/Scratchbox1ProcessLauncher.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/launcher/Scratchbox1ProcessLauncherFactory.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/launcher/ScratchboxTargetSwitcher.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/provider/
   trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/provider/Scratchbox1SDKProvider.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/ui/
   trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/ui/adapters/
   trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/ui/adapters/MaemoSDKInstallTargetAdapterFactory.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/ui/adapters/MaemoScratchbox1SDKManageTargetAdapter.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/ui/preferences/
   trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/ui/preferences/Scratchbox1PreferencesPage.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/ui/wizard/
   trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/ui/wizard/NewScratchbox1TargetWizard.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/ui/wizard/TargetWizardDevkitsPage.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/maemosdk/
   trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/maemosdk/sb1/
   trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/maemosdk/sb1/sdk/
   trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/maemosdk/sb1/sdk/IScratchbox1SDK.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/actions/
   trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/adapters/ESboxTargetRemover.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/adapters/MaemoScratchboxSDKManageTargetAdapterBase.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/preferences/
   trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/targets/
   trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/targets/wizards/
   trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/targets/wizards/BadInstallationPage.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/targets/wizards/IValidatePage.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/targets/wizards/TargetListener.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/targets/wizards/TargetWizardCPUMethod.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/targets/wizards/TargetWizardCompilerPage.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/targets/wizards/TargetWizardNamePage.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/targets/wizards/TargetWizardPageFactory.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/targets/wizards/sbrsh/
Removed:
   trunk/maemosdk/org.maemo.esbox.maemosdk.core/conf/run.sh
   trunk/maemosdk/org.maemo.esbox.maemosdk.core/conf/sb1_prefs.xml
   trunk/maemosdk/org.maemo.esbox.maemosdk.core/conf/sb2_prefs.xml
   trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/api/core/commands/ICommandAbstractor.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/ICommandAbstractor.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/CreateMaemoRootstrapSb2Command.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/CreateTargetCommand.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/CreateTargetSb2Command.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/GetCurrentTargetCommand.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/GetCurrentTargetSb2Command.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/GetGdbQemuCommandPatternCommand.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/GetMaemoRootstrapLocationCommand.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/GetVersionScratchboxCommand.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/KillallCommand.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/ListAvailableMaemoRootstrapsSb2Command.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/ListCompilersCommand.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/ListCompilersSb2Command.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/ListCputranspCommand.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/ListCputranspSb2Command.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/ListDevkitsCommand.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/ListInstalledMaemoRootstrapsSb2Command.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/ListSessionsCommand.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/ListTargetsCommand.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/MaemoRootstrapSb2Command.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/RemoveMaemoRootstrapSb2Command.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/RemoveTargetCommand.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/RemoveTargetSb2Command.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/ResetTargetCommand.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/RootstrapCommand.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/ScratchboxCommand.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/ScratchboxInvalidParameterException.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/SelectTargetCommand.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/ShowPathMappingSb2Command.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/ShowTargetCommand.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/sdk/Scratchbox1EnvironmentProvider.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/sdk/Scratchbox1FileSystemMapping.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/sdk/Scratchbox1ProcessLauncher.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/sdk/Scratchbox1ProcessLauncherFactory.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/sdk/Scratchbox1SDK.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/sdk/Scratchbox1SDKTarget.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/sdk/Scratchbox2EnvironmentProvider.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/sdk/Scratchbox2FileSystemMapping.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/sdk/Scratchbox2ProcessLauncher.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/sdk/Scratchbox2ProcessLauncherFactory.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/sdk/Scratchbox2SDK.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/sdk/Scratchbox2SDKTarget.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/sdk/providers/
   trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/MaemoPreferenceConstants.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/MaemoPreferenceMigrator.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/OldStyleProjectProperties.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/OldStyleWorkspaceProjectPropertiesProvider.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/SB1PreferenceConstants.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/SB2PreferenceConstants.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/ScratchboxPackageManagerProvider.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/ScratchboxPropertyTester.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/command/AbstractSDKCommand.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/command/ScratchboxCommand.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/command/ScratchboxInvalidParameterException.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/scratchbox/MaemoLauncher.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/scratchbox/PersistentCache.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/scratchbox/ScratchboxFacade.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/scratchbox/ScratchboxTargetSwitcher.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/scratchbox/XLauncher.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/sdk/IScratchbox1SDK.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/sdk/IScratchbox1SDKTarget.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/sdk/IScratchbox2SDK.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/sdk/IScratchbox2SDKTarget.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/.classpath
   trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/.project
   trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/.settings/
   trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/META-INF/
   trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/META-INF/MANIFEST.MF
   trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/build.properties
   trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/conf/
   trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/conf/run.sh
   trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/conf/sb1_prefs.xml
   trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/plugin.xml
   trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/
   trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/
   trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/
   trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/
   trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/launcher/Scratchbox1EnvironmentProvider.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/launcher/Scratchbox1ProcessLauncher.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/launcher/Scratchbox1ProcessLauncherFactory.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/launcher/ScratchboxTargetSwitcher.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/provider/Scratchbox1SDKProvider.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/ui/adapters/MaemoSDKInstallTargetAdapterFactory.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/ui/adapters/MaemoScratchbox1SDKManageTargetAdapter.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/ui/preferences/Scratchbox1PreferencesPage.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/ui/wizard/NewScratchbox1TargetWizard.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/ui/wizard/TargetWizardDevkitsPage.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/maemosdk/
   trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/maemosdk/sb1/
   trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/maemosdk/sb1/sdk/IScratchbox1SDK.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/adapters/ESboxTargetRemover.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/adapters/MaemoSDKInstallTargetAdapterFactory.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/adapters/MaemoScratchbox1SDKManageTargetAdapter.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/adapters/MaemoScratchbox2SDKManageTargetAdapter.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/adapters/MaemoScratchboxSDKManageTargetAdapterBase.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/preferences/Scratchbox1PreferencesPage.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/preferences/Scratchbox2PreferencesPage.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/maemosdk/ui/MaemoRootstrapContentLabelProvider.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/maemosdk/ui/actions/
   trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/maemosdk/ui/preferences/
   trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/maemosdk/ui/targets/wizards/BadInstallationPage.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/maemosdk/ui/targets/wizards/IValidatePage.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/maemosdk/ui/targets/wizards/NewScratchbox1TargetWizard.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/maemosdk/ui/targets/wizards/NewScratchbox2TargetWizard.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/maemosdk/ui/targets/wizards/TargetListener.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/maemosdk/ui/targets/wizards/TargetWizardCPUMethod.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/maemosdk/ui/targets/wizards/TargetWizardCompilerPage.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/maemosdk/ui/targets/wizards/TargetWizardDevkitsPage.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/maemosdk/ui/targets/wizards/TargetWizardNamePage.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/maemosdk/ui/targets/wizards/TargetWizardPageFactory.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/maemosdk/ui/targets/wizards/TargetWizardRootstrapSb2Page.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/maemosdk/ui/targets/wizards/sbrsh/
Modified:
   trunk/cpp/org.maemo.esbox.cpp.tests/META-INF/MANIFEST.MF
   trunk/cpp/org.maemo.esbox.cpp.tests/src/org/maemo/esbox/cpp/tests/TestESboxProjectInfo.java
   trunk/cpp/org.maemo.esbox.cpp.tests/src/org/maemo/esbox/cpp/tests/ui/TestBuildConfigProjectConverter.java
   trunk/cpp/org.maemo.esbox.cpp.tests/src/org/maemo/esbox/cpp/tests/ui/TestBuildConfigProjectCreator.java
   trunk/device/org.maemo.esbox.device.tests/src/org/maemo/esbox/device/tests/sbrsh/ManualTestSBRSHMachine.java
   trunk/device/org.maemo.esbox.device.tests/src/org/maemo/esbox/device/tests/sbrsh/ManualTestSBRSHProcessLauncherFactory.java
   trunk/maemosdk/org.maemo.esbox.maemosdk-feature/feature.xml
   trunk/maemosdk/org.maemo.esbox.maemosdk.analysis/src/org/maemo/esbox/internal/maemosdk/analysis/Activator.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.core/META-INF/MANIFEST.MF
   trunk/maemosdk/org.maemo.esbox.maemosdk.core/plugin.xml
   trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/Activator.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/MaemoEnvironmentUtils.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/adapters/MaemoDefaultExecutionEnvironmentAdapter.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/adapters/MaemoDefaultExecutionEnvironmentFactory.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/adapters/MaemoGdbServerSupportAdapter.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/adapters/MaemoGdbServerSupportAdapterFactory.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/adapters/MaemoRunStandaloneAdapter.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/adapters/MaemoRunStandaloneSupportAdapterFactory.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/adapters/MaemoSbrshAutoconfigurationAdapter.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/adapters/MaemoSbrshAutoconfigurationAdapterFactory.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/adapters/MaemoTargetEnvironmentModifierAdapter.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/ICommand.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/MaemoCommand.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/ScratchboxInvalidOperationException.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/SimpleCommand.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/sbrsh/AddSbrshCommand.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/sbrsh/ConfigureSbrshCommand.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/sbrsh/MountTargetSbrshCommand.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/sbrsh/UnmountTargetSbrshCommand.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/sdk/BaseScratchboxSDKTarget.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/sdk/IScratchboxSDKPlatformArchitectureProvider.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/sdk/ScratchboxSDK.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/MaemoSDKEngine.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/MaemoSDKInfo.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/execEnv/BaseScratchboxExecutionEnvironment.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/execEnv/GTKExecutionEnvironment.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/execEnv/MaemoExecutionEnvironment.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/execEnv/X11ExecutionEnvironment.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/platform/PlatformEngine.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/platform/PlatformInfo.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/scratchbox/ESboxScriptLauncher.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/scratchbox/MaemoRootstrap.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/scratchbox/ScratchboxException.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/scratchbox/ScratchboxTarget.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/sdk/IScratchboxSDK.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/sdk/IScratchboxSDKTarget.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/sdk/ScratchboxSDKFacade.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.tests/META-INF/MANIFEST.MF
   trunk/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/AllTests.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/ESboxProductTestSuite.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/TestOProfileValgrindSupport.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/TestProcessLauncher.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/TestRunStandalone.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/TestSB1ProcessLauncher.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/TestSB1SDKProvider.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/TestSB2ProcessLauncher.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/TestSB2SDKProvider.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/commands/BaseTest.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/commands/MockCommandAbstractor.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/commands/MockProcessLauncher.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/commands/MockProcessLauncherFactory.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/commands/TestCreateTargetCommand.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/commands/TestCreateTargetSb2Command.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/commands/TestGdbQemuCommand.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/commands/TestGetCurrentTargetCommand.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/commands/TestListCommands.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/commands/TestListSb2Commands.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/commands/TestRemoveCommand.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/commands/TestRemoveSb2Command.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/commands/TestScratchboxCommand.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/commands/TestScratchboxFacade.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/commands/TestSelectTargetCommand.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/commands/TestShowPathMappingSb2Command.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/commands/TestShowTargetCommand.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/commands/TestSimpleCommand.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.ui/META-INF/MANIFEST.MF
   trunk/maemosdk/org.maemo.esbox.maemosdk.ui/plugin.xml
   trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/UIActivator.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/actions/MaemoDropdownMenuAction.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/actions/ValidateVirtualMachineCommand.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/actions/XDropdownMenuAction.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/preferences/ESboxGazpachoPreferencePage.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/preferences/ESboxXServerPreferencePage.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/targets/wizards/sbrsh/SbrshConfigurationNFSServer.java
   trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/targets/wizards/sbrsh/SbrshConfigurationTargetDevice.java
   trunk/python/org.maemo.esbox.python.tests/META-INF/MANIFEST.MF
   trunk/python/org.maemo.esbox.python.tests/src/org/maemo/esbox/python/tests/TestPythonProjectConverter.java
   trunk/python/org.maemo.esbox.python.tests/src/org/maemo/esbox/python/tests/TestPythonProjectCreator.java
   trunk/python/org.maemo.esbox.python.tests/src/org/maemo/esbox/python/tests/TestPythonProjectProperties.java
Log:
Merged Petr's sdkPlugins branch (rev 874) and adapted to package naming conventions.

Modified: trunk/cpp/org.maemo.esbox.cpp.tests/META-INF/MANIFEST.MF
===================================================================
--- trunk/cpp/org.maemo.esbox.cpp.tests/META-INF/MANIFEST.MF	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/cpp/org.maemo.esbox.cpp.tests/META-INF/MANIFEST.MF	2008-10-15 19:30:29 UTC (rev 877)
@@ -17,7 +17,8 @@
  org.eclipse.cdt.ui;bundle-version="5.0.1",
  org.maemo.esbox.cpp.project.ui;bundle-version="1.5.0",
  org.maemo.esbox.maemosdk.core;bundle-version="1.5.0",
- org.maemo.esbox.project.core;bundle-version="1.5.0"
+ org.maemo.esbox.project.core;bundle-version="1.5.0",
+ org.maemo.esbox.maemosdk.sb1;bundle-version="1.5.0"
 Bundle-RequiredExecutionEnvironment: J2SE-1.5
 Bundle-ActivationPolicy: lazy
 Export-Package: org.maemo.esbox.cpp.tests,

Modified: trunk/cpp/org.maemo.esbox.cpp.tests/src/org/maemo/esbox/cpp/tests/TestESboxProjectInfo.java
===================================================================
--- trunk/cpp/org.maemo.esbox.cpp.tests/src/org/maemo/esbox/cpp/tests/TestESboxProjectInfo.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/cpp/org.maemo.esbox.cpp.tests/src/org/maemo/esbox/cpp/tests/TestESboxProjectInfo.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -27,7 +27,7 @@
 import org.maemo.esbox.cpp.project.core.ESboxCppProjectType;
 import org.maemo.esbox.internal.cpp.tests.TestActivator;
 import org.maemo.esbox.maemosdk.core.execEnv.GTKExecutionEnvironment;
-import org.maemo.esbox.maemosdk.core.sdk.IScratchbox1SDK;
+import org.maemo.esbox.maemosdk.sb1.sdk.IScratchbox1SDK;
 import org.maemo.esbox.project.core.*;
 
 import java.io.File;

Modified: trunk/cpp/org.maemo.esbox.cpp.tests/src/org/maemo/esbox/cpp/tests/ui/TestBuildConfigProjectConverter.java
===================================================================
--- trunk/cpp/org.maemo.esbox.cpp.tests/src/org/maemo/esbox/cpp/tests/ui/TestBuildConfigProjectConverter.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/cpp/org.maemo.esbox.cpp.tests/src/org/maemo/esbox/cpp/tests/ui/TestBuildConfigProjectConverter.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -53,7 +53,8 @@
 		sdkTargets = ScratchboxSDKFacade.getInstance().getScratchboxSDKTargets();
 		for (ISDKTarget target : sdkTargets) {
 			// TODO: check platform/target
-			if (target instanceof IScratchbox1SDKTarget 
+			if (target instanceof IScratchboxSDKTarget
+					&& ((IScratchboxSDKTarget) target).getSboxVersion() == 1
 					&& target.getName().equals("CHINOOK_ARMEL")) {
 				theSB1SDKTarget = target;
 			}

Modified: trunk/cpp/org.maemo.esbox.cpp.tests/src/org/maemo/esbox/cpp/tests/ui/TestBuildConfigProjectCreator.java
===================================================================
--- trunk/cpp/org.maemo.esbox.cpp.tests/src/org/maemo/esbox/cpp/tests/ui/TestBuildConfigProjectCreator.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/cpp/org.maemo.esbox.cpp.tests/src/org/maemo/esbox/cpp/tests/ui/TestBuildConfigProjectCreator.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -66,11 +66,13 @@
 		sdkTargets = ScratchboxSDKFacade.getInstance().getScratchboxSDKTargets();
 		for (ISDKTarget target : sdkTargets) {
 			// TODO: check platform/target
-			if (target instanceof IScratchbox1SDKTarget 
+			if (target instanceof IScratchboxSDKTarget
+					&& ((IScratchboxSDKTarget) target).getSboxVersion() == 1 
 					&& target.getName().matches("(CHINOOK|DIABLO)_ARMEL")) {
 				theSB1SDKTarget = target;
 			}
-			if (target instanceof IScratchbox2SDKTarget 
+			if (target instanceof IScratchboxSDKTarget
+					&& ((IScratchboxSDKTarget) target).getSboxVersion() == 2
 					&& ((IScratchboxSDKTarget) target).getRootstrapPath() != null
 					&& target.getName().matches("(chinook|diablo).*armel")) {
 				theSB2SDKTarget = target;

Modified: trunk/device/org.maemo.esbox.device.tests/src/org/maemo/esbox/device/tests/sbrsh/ManualTestSBRSHMachine.java
===================================================================
--- trunk/device/org.maemo.esbox.device.tests/src/org/maemo/esbox/device/tests/sbrsh/ManualTestSBRSHMachine.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/device/org.maemo.esbox.device.tests/src/org/maemo/esbox/device/tests/sbrsh/ManualTestSBRSHMachine.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -57,7 +57,8 @@
 		sdkTargets = ScratchboxSDKFacade.getInstance().getScratchboxSDKTargets();
 		for (ISDKTarget target : sdkTargets) {
 			// TODO: check platform/target
-			if (target instanceof IScratchbox1SDKTarget 
+			if (target instanceof IScratchboxSDKTarget
+					&& ((IScratchboxSDKTarget) target).getSboxVersion() == 1
 					&& target.getName().equals("CHINOOK_ARMEL")) {
 				theSB1SDKTarget = (IScratchboxSDKTarget) target;
 			}

Modified: trunk/device/org.maemo.esbox.device.tests/src/org/maemo/esbox/device/tests/sbrsh/ManualTestSBRSHProcessLauncherFactory.java
===================================================================
--- trunk/device/org.maemo.esbox.device.tests/src/org/maemo/esbox/device/tests/sbrsh/ManualTestSBRSHProcessLauncherFactory.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/device/org.maemo.esbox.device.tests/src/org/maemo/esbox/device/tests/sbrsh/ManualTestSBRSHProcessLauncherFactory.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -54,7 +54,8 @@
 		sdkTargets = ScratchboxSDKFacade.getInstance().getScratchboxSDKTargets();
 		for (ISDKTarget target : sdkTargets) {
 			// TODO: check platform/target
-			if (target instanceof IScratchbox1SDKTarget 
+			if (target instanceof IScratchboxSDKTarget
+					&& ((IScratchboxSDKTarget) target).getSboxVersion() == 1 
 					&& target.getName().equals("CHINOOK_ARMEL")) {
 				theSB1SDKTarget = (IScratchboxSDKTarget) target;
 			}

Modified: trunk/maemosdk/org.maemo.esbox.maemosdk-feature/feature.xml
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk-feature/feature.xml	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk-feature/feature.xml	2008-10-15 19:30:29 UTC (rev 877)
@@ -73,4 +73,18 @@
          version="0.0.0"
          unpack="false"/>
 
+   <plugin
+         id="org.maemo.esbox.maemosdk.sb1"
+         download-size="0"
+         install-size="0"
+         version="0.0.0"
+         unpack="false"/>
+
+   <plugin
+         id="org.maemo.esbox.maemosdk.sb2"
+         download-size="0"
+         install-size="0"
+         version="0.0.0"
+         unpack="false"/>
+
 </feature>

Modified: trunk/maemosdk/org.maemo.esbox.maemosdk.analysis/src/org/maemo/esbox/internal/maemosdk/analysis/Activator.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.analysis/src/org/maemo/esbox/internal/maemosdk/analysis/Activator.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.analysis/src/org/maemo/esbox/internal/maemosdk/analysis/Activator.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -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: trunk/maemosdk/org.maemo.esbox.maemosdk.core/META-INF/MANIFEST.MF
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.core/META-INF/MANIFEST.MF	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.core/META-INF/MANIFEST.MF	2008-10-15 19:30:29 UTC (rev 877)
@@ -6,7 +6,7 @@
 Bundle-Activator: org.maemo.esbox.internal.maemosdk.core.Activator
 Bundle-Vendor: INdT / Nokia
 Require-Bundle: org.eclipse.core.runtime,
- org.maemo.esbox.core;bundle-version="1.5.0",
+ org.maemo.esbox.core;bundle-version="1.5.0";visibility:=reexport,
  org.eclipse.core.expressions;bundle-version="3.4.0",
  org.maemo.esbox.project.core;bundle-version="1.5.0",
  org.maemo.esbox.launch;bundle-version="1.5.0",
@@ -14,13 +14,17 @@
  org.maemo.esbox.linux.packages.core;bundle-version="1.5.0"
 Bundle-RequiredExecutionEnvironment: J2SE-1.5
 Bundle-ActivationPolicy: lazy
-Export-Package: org.maemo.esbox.maemosdk.core,
- org.maemo.esbox.maemosdk.core.execEnv,
- org.maemo.esbox.maemosdk.core.platform,
- org.maemo.esbox.maemosdk.core.scratchbox,
- org.maemo.esbox.maemosdk.core.sdk,
+Export-Package: org.maemo.esbox.internal.api.core.commands;x-friends:="org.maemo.esbox.maemosdk.sb1,org.maemo.esbox.maemosdk.sb2,org.maemo.esbox.maemosdk.tests",
+ org.maemo.esbox.internal.api.core.sdk,
+ org.maemo.esbox.internal.maemosdk.core;x-friends:="org.maemo.esbox.maemosdk.tests",
+ org.maemo.esbox.internal.maemosdk.core.adapters;x-friends:="org.maemo.esbox.maemosdk.tests",
  org.maemo.esbox.internal.maemosdk.core.command;x-friends:="org.maemo.esbox.maemosdk.tests",
  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,
+ org.maemo.esbox.maemosdk.core.sdk

Deleted: trunk/maemosdk/org.maemo.esbox.maemosdk.core/conf/run.sh
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.core/conf/run.sh	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.core/conf/run.sh	2008-10-15 19:30:29 UTC (rev 877)
@@ -1,43 +0,0 @@
-#!/bin/sh
-
-#/*******************************************************************************
-# * Copyright (c) 2007-2008 INdT, (c) 2008 Nokia.
-# * 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 (raul at embedded.ufcg.edu.br) (UFCG) - initial API and implementation
-# *    Ed Swartz (Nokia) - additions and changes
-# *******************************************************************************/
-
-__version=0.5
-__release=1.2
-__location=$1
-__export_list=$2
-shift
-shift
-__command="$@"
-
-if [ ! -d $__location ] ; then
-        echo "E: Directory $__location not found"
-        exit 1
-fi
-
-cd $__location
-
-# 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
-

Deleted: trunk/maemosdk/org.maemo.esbox.maemosdk.core/conf/sb1_prefs.xml
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.core/conf/sb1_prefs.xml	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.core/conf/sb1_prefs.xml	2008-10-15 19:30:29 UTC (rev 877)
@@ -1,77 +0,0 @@
-<?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 1 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="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>
-
-	<!-- this uses ${QEMU} because the default qemu-arm is an often misconfigured softlink: see GetGdbQemuCommandPatternCommand -->
-	<entry key="SB1_GDB_REMOTE_QEMU">${QEMU} -g ${PORT}</entry>
-	
-	<!-- actions of command sb-conf  -->	
-	
-	<entry key="SB1_VERSION_ACT">version</entry>
-	<entry key="SB1_SETUP_ACT">setup</entry>
-	<entry key="SB1_INSTALL_ACT">install</entry>	
-	<entry key="SB1_ROOTSTRAP_ACT">rootstrap</entry>
-	<entry key="SB1_SELECT_ACT">select</entry>
-	<entry key="SB1_RESET_ACT">reset</entry>
-	<entry key="SB1_KILLALL_ACT">killall</entry>
-	<entry key="SB1_REMOVE_ACT">remove</entry>
-	<entry key="SB1_SHOW_ACT">show</entry>
-	<entry key="SB1_LIST_ACT">list</entry>
-	<entry key="SB1_CURRENT_ACT">current</entry>
-	
-	<!-- options for action rootstrap -->
-	<entry key="SB1_ROOTSTRAP_OPT_FORCE">--force</entry>
-	<entry key="SB1_SETUP_ACT">setup</entry>
-	
-	<!-- options for action remove -->
-	<entry key="SB1_REMOVE_OPT_FORCE">--force</entry>
-	
-	<!-- options for action setup -->
-	<entry key="SB1_SETUP_OPT_COMPILER">--compiler=${COMPILER}</entry>
-	<entry key="SB1_SETUP_OPT_DEVKITS">--devkits=${LIST}</entry>
-	<entry key="SB1_SETUP_OPT_CPUTRANSP">--cputransp=${METHOD}</entry>
-	<entry key="SB1_SETUP_OPT_FORCE">--force</entry>
-	
-	<!-- options for action killall -->
-	<entry key="SB1_KILLALL_OPT_SIGNAL">signal=${SIGNAL}</entry>	
-	
-	<!-- options for action install -->
-	<entry key="SB1_INSTALL_OPT_CLIB">--clibrary</entry>
-	<entry key="SB1_INSTALL_OPT_ETC">--etc</entry>
-	<entry key="SB1_INSTALL_OPT_DEVKITS">--devkits</entry>
-	<entry key="SB1_INSTALL_OPT_FAKE">--fakeroot</entry>
-	<entry key="SB1_INSTALL_OPT_GDB">--gdb</entry>
-	<entry key="SB1_INSTALL_OPT_STRACE">--strace</entry>	
-	
-	<!-- options for action show -->
-	<entry key="SB1_SHOW_OPT_COMPILERS">--compilers</entry>
-	<entry key="SB1_SHOW_OPT_DEVKITS">--devkits</entry>
-	<entry key="SB1_SHOW_OPT_CPU">--cputransp</entry>
-	<entry key="SB1_SHOW_OPT_COMP_ARCH">--compiler-arch</entry>
-	<entry key="SB1_SHOW_OPT_COMP_SUBARCH">--compiler-subarch</entry>
-	<entry key="SB1_SHOW_OPT_COMP_CLIB">--compiler-clib</entry>
-	
-	<!-- options for action list -->
-	<entry key="SB1_LIST_OPT_COMPILERS">--compilers</entry>
-	<entry key="SB1_LIST_OPT_DEVKITS">--devkits</entry>
-	<entry key="SB1_LIST_OPT_CPU">--cputransps</entry>
-	<entry key="SB1_LIST_OPT_TARGETS">--targets</entry>
-	<entry key="SB1_LIST_OPT_SESSIONS">--sessions</entry>
-	
-	<!-- setting such as Scratchbox location and user name -->
-	<entry key="SB1_SBOX_SANDBOX">/scratchbox/users/${USER}</entry>
-	
-</properties>

Deleted: trunk/maemosdk/org.maemo.esbox.maemosdk.core/conf/sb2_prefs.xml
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.core/conf/sb2_prefs.xml	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.core/conf/sb2_prefs.xml	2008-10-15 19:30:29 UTC (rev 877)
@@ -1,46 +0,0 @@
-<?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: trunk/maemosdk/org.maemo.esbox.maemosdk.core/plugin.xml
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.core/plugin.xml	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.core/plugin.xml	2008-10-15 19:30:29 UTC (rev 877)
@@ -8,21 +8,12 @@
          <propertyTester namespace="org.maemo.esbox.maemosdk" 
 	         properties="isRemoteTarget,isEmulatorTarget,isX86Target,isARMELTarget" 
 	         type="org.eclipse.core.runtime.IAdaptable" 
-	         class="org.maemo.esbox.maemosdk.core.ScratchboxPropertyTester" 
+	         class="org.maemo.esbox.internal.maemosdk.core.ScratchboxPropertyTester" 
 	         id="org.maemo.esbox.scratchbox.PropertyTester">
 		</propertyTester>
 			
    </extension>
    
-   <extension
-         point="org.maemo.esbox.core.sdk_provider">
-      <sdk_provider
-            class="org.maemo.esbox.internal.maemosdk.core.sdk.providers.Scratchbox1SDKProvider">
-      </sdk_provider>
-      <sdk_provider
-            class="org.maemo.esbox.internal.maemosdk.core.sdk.providers.Scratchbox2SDKProvider">
-      </sdk_provider>
-   </extension>
    
    <extension
          id="org.maemo.esbox.core.execution_environments"
@@ -305,13 +296,13 @@
   <extension
         point="org.maemo.esbox.linux.packages.core.packageManagerProvider">
      <packageManagerProvider
-           class="org.maemo.esbox.maemosdk.core.ScratchboxPackageManagerProvider">
+           class="org.maemo.esbox.internal.maemosdk.core.ScratchboxPackageManagerProvider">
      </packageManagerProvider>
   </extension>
   <extension
         point="org.maemo.esbox.project.core.oldStyleProjectPropertiesProvider">
      <projectPropertiesProvider
-           class="org.maemo.esbox.maemosdk.core.OldStyleWorkspaceProjectPropertiesProvider">
+           class="org.maemo.esbox.internal.maemosdk.core.OldStyleWorkspaceProjectPropertiesProvider">
      </projectPropertiesProvider>
   </extension>
 
@@ -360,24 +351,10 @@
      <preferenceSetProvider
            defaultsXMLFile="conf/maemo_prefs.xml"
            preferenceConstantsClass="org.maemo.esbox.maemosdk.core.MaemoPreferenceConstants"
-           preferenceMigratorClass="org.maemo.esbox.maemosdk.core.MaemoPreferenceMigrator"
+           preferenceMigratorClass="org.maemo.esbox.internal.api.core.MaemoPreferenceMigrator"
            preferenceStoreBundle="org.maemo.esbox.maemosdk.core"
            version="17">
      </preferenceSetProvider>
-     <preferenceSetProvider
-           defaultsXMLFile="conf/sb1_prefs.xml"
-           preferenceConstantsClass="org.maemo.esbox.maemosdk.core.SB1PreferenceConstants"
-           preferenceMigratorClass="org.maemo.esbox.internal.api.core.OldESboxPreferenceMigrator"
-           preferenceStoreBundle="org.maemo.esbox.maemosdk.core"
-           version="17">
-     </preferenceSetProvider>
-     <preferenceSetProvider
-           defaultsXMLFile="conf/sb2_prefs.xml"
-           preferenceConstantsClass="org.maemo.esbox.maemosdk.core.SB2PreferenceConstants"
-           preferenceMigratorClass="org.maemo.esbox.internal.api.core.OldESboxPreferenceMigrator"
-           preferenceStoreBundle="org.maemo.esbox.maemosdk.core"
-           version="17">
-     </preferenceSetProvider>
   </extension>
     
 </plugin>

Copied: trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/api (from rev 873, branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/api)

Added: trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/api/core/MaemoPreferenceConstantsPrivate.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/api/core/MaemoPreferenceConstantsPrivate.java	                        (rev 0)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/api/core/MaemoPreferenceConstantsPrivate.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -0,0 +1,27 @@
+/*******************************************************************************
+ * 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.api.core;
+
+/**
+ * Private constants for preference migration 
+ * @author eswartz
+ *
+ */
+public class MaemoPreferenceConstantsPrivate {
+	/* 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";
+
+
+}

Copied: trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/api/core/MaemoPreferenceMigrator.java (from rev 873, trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/MaemoPreferenceMigrator.java)
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/api/core/MaemoPreferenceMigrator.java	                        (rev 0)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/api/core/MaemoPreferenceMigrator.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -0,0 +1,58 @@
+/*******************************************************************************
+ * 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.api.core;
+
+import org.maemo.esbox.core.HostUtils;
+import org.maemo.esbox.core.IPreferenceMigrator;
+import org.maemo.esbox.internal.api.core.OldESboxPreferenceMigrator;
+import org.maemo.esbox.maemosdk.core.MaemoPreferenceConstants;
+
+import java.util.Properties;
+
+/**
+ * To migrate preferences, we use the 1.4 -> newer conversion and also pick an
+ * OS-specific initial value for the X server command.
+ * 
+ * @author eswartz
+ * 
+ */
+public class MaemoPreferenceMigrator extends OldESboxPreferenceMigrator
+		implements IPreferenceMigrator {
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @seeorg.maemo.esbox.internal.api.core.OldESboxPreferenceMigrator#
+	 * adjustDefaultSettings(java.util.Properties)
+	 */
+	@Override
+	public void adjustDefaultSettings(Properties newPropertyDefaults) {
+		super.adjustDefaultSettings(newPropertyDefaults);
+		// adjust any environment-dependent defaults
+		String hostEnvKey;
+		if (HostUtils.isWindows())
+			hostEnvKey = MaemoPreferenceConstantsPrivate.DISPLAY_X_COMMAND_WIN32;
+		else
+			hostEnvKey = MaemoPreferenceConstantsPrivate.DISPLAY_X_COMMAND_UNIX;
+		newPropertyDefaults.put(MaemoPreferenceConstants.DISPLAY_X_COMMAND,
+				newPropertyDefaults.getProperty(hostEnvKey));
+		
+		if (HostUtils.isWindows())
+			hostEnvKey = MaemoPreferenceConstantsPrivate.X_PATH_WIN32;
+		else
+			hostEnvKey = MaemoPreferenceConstantsPrivate.X_PATH_UNIX;
+		newPropertyDefaults.put(MaemoPreferenceConstants.X_PATH, 
+				newPropertyDefaults.getProperty(hostEnvKey));
+		
+	}
+
+}

Copied: trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/api/core/commands (from rev 873, branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/api/commands)


Property changes on: trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/api/core/commands
___________________________________________________________________
Name: svn:mergeinfo
   + 

Deleted: trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/api/core/commands/ICommandAbstractor.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/api/commands/ICommandAbstractor.java	2008-10-15 06:30:08 UTC (rev 873)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/api/core/commands/ICommandAbstractor.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -1,51 +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.api.commands;
-
-import org.maemo.esbox.core.machine.IFileSystemAccess;
-import org.maemo.esbox.core.process.IProcessLauncherFactory;
-
-/**
- * This interface is used to abstract the way an ICommand is constructed and
- * launched, and the means by which it gets the values to substitute into
- * commands. It may, for instance, either be run in the context of an
- * ISDKTarget, ISDK, or run natively. Similarly, it may be controlled entirely
- * by unit tests.
- * 
- * @author eswartz
- * 
- */
-public interface ICommandAbstractor {
-
-	/**
-	 * Read a preference for the implicit category of the abstractor.
-	 * 
-	 * @param key
-	 *            the key to search
-	 * @return preference value or "" if undefined
-	 */
-	String getPreferenceValue(String key);
-
-	/**
-	 * Get the factory for creating process launchers to run programs in the
-	 * context of the SDK.
-	 * 
-	 * @return the process launcher factory, never <code>null</code>
-	 */
-	IProcessLauncherFactory getProcessLauncherFactory();
-
-	/**
-	 * Get the file system access for the filesystem used by the command
-	 * 
-	 * @return IFilesystemAccess, never <code>null</code>
-	 */
-	IFileSystemAccess getFileSystemAccess();
-}
\ No newline at end of file

Copied: trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/api/core/commands/ICommandAbstractor.java (from rev 873, branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/api/commands/ICommandAbstractor.java)
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/api/core/commands/ICommandAbstractor.java	                        (rev 0)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/api/core/commands/ICommandAbstractor.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -0,0 +1,51 @@
+/*******************************************************************************
+ * 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.api.core.commands;
+
+import org.maemo.esbox.core.machine.IFileSystemAccess;
+import org.maemo.esbox.core.process.IProcessLauncherFactory;
+
+/**
+ * This interface is used to abstract the way an ICommand is constructed and
+ * launched, and the means by which it gets the values to substitute into
+ * commands. It may, for instance, either be run in the context of an
+ * ISDKTarget, ISDK, or run natively. Similarly, it may be controlled entirely
+ * by unit tests.
+ * 
+ * @author eswartz
+ * 
+ */
+public interface ICommandAbstractor {
+
+	/**
+	 * Read a preference for the implicit category of the abstractor.
+	 * 
+	 * @param key
+	 *            the key to search
+	 * @return preference value or "" if undefined
+	 */
+	String getPreferenceValue(String key);
+
+	/**
+	 * Get the factory for creating process launchers to run programs in the
+	 * context of the SDK.
+	 * 
+	 * @return the process launcher factory, never <code>null</code>
+	 */
+	IProcessLauncherFactory getProcessLauncherFactory();
+
+	/**
+	 * Get the file system access for the filesystem used by the command
+	 * 
+	 * @return IFilesystemAccess, never <code>null</code>
+	 */
+	IFileSystemAccess getFileSystemAccess();
+}
\ No newline at end of file

Copied: trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/api/core/sdk/AbstractScratchboxSDK.java (from rev 873, branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/sdk/AbstractScratchboxSDK.java)
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/api/core/sdk/AbstractScratchboxSDK.java	                        (rev 0)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/api/core/sdk/AbstractScratchboxSDK.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -0,0 +1,313 @@
+/*******************************************************************************
+ * 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:
+ *    Petr Baranov (Nokia) - API and implementation from ScratchboxFacade
+ *******************************************************************************/
+package org.maemo.esbox.internal.api.core.sdk;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Properties;
+
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Platform;
+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.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.internal.api.core.commands.ICommandAbstractor;
+import org.maemo.esbox.internal.api.core.machine.HostUnixMachine;
+import org.maemo.esbox.internal.api.core.sdk.BaseSDK;
+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.sdk.IScratchboxSDK;
+import org.maemo.esbox.maemosdk.core.sdk.IScratchboxSDKTarget;
+
+public abstract class AbstractScratchboxSDK extends BaseSDK implements
+		IScratchboxSDK, IScratchboxSDKPlatformArchitectureProvider {
+
+	protected IPreferenceProvider prefProvider = null;
+
+	protected final String NAME; //$NON-NLS-1$
+	/** String for URI of machine where we detected scratchbox VERSION */
+	protected final String SB_MACHINE;
+	/** String for scratchbox VERSION version or <code>null</code> */
+	protected final String SB_VERSION;
+	/** String[] scratchbox VERSION target name array */
+	protected final String SB_TARGETS;
+	protected final int VERSION_NUMBER;
+
+	private String cachedCurrentTarget;
+
+	protected final static List<String> EMPTY_ARGS = new ArrayList<String>();
+
+	public AbstractScratchboxSDK(IMachine machine, String version, String name,
+			String sb_machine, String sb_version, String sb_targets,
+			int versionNumber) {
+		super(machine, version, name);
+		NAME = name;
+		SB_MACHINE = sb_machine;
+		SB_VERSION = sb_version;
+		SB_TARGETS = sb_targets;
+		VERSION_NUMBER = versionNumber;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.maemo.esbox.maemosdk.core.sdk.IScratchboxSDK#getSboxVersion()
+	 */
+	public int getSboxVersion() {
+		return VERSION_NUMBER;
+	}
+
+	/*
+	 * (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;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see
+	 * org.maemo.esbox.core.sdk.IPreferenceProvider#getPreferenceValue(java.
+	 * lang.String)
+	 */
+	public String getPreferenceValue(String key) {
+		return prefProvider.getPreferenceValue(key);
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see
+	 * org.maemo.esbox.maemosdk.core.sdk.IScratchboxSDK#getCommandAbstractor()
+	 */
+	public ICommandAbstractor getCommandAbstractor() throws ESboxException {
+		MachineUtils.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)
+			 * 
+			 * @seeorg.maemo.esbox.internal.core.command.ICommandAbstractor#
+			 * getFileSystemAccess()
+			 */
+			public IFileSystemAccess getFileSystemAccess() {
+				return AbstractScratchboxSDK.this.getMachineFileSystemAccess();
+			}
+		};
+		return commandAbstractor;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see
+	 * org.maemo.esbox.maemosdk.core.sdk.IScratchboxSDK#getCurrentSDKTarget()
+	 */
+	public IScratchboxSDKTarget getCurrentSDKTarget() throws ESboxException {
+		String targetName = getCurrentTarget();
+		return (IScratchboxSDKTarget) this.findSDKTarget(targetName);
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see
+	 * org.maemo.esbox.maemosdk.core.sdk.IScratchboxSDK#configureSbrsh(java.
+	 * lang.String, java.lang.String, java.lang.String)
+	 */
+	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);
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see
+	 * org.maemo.esbox.maemosdk.core.sdk.IScratchboxSDK#addSbrshAccessList(java
+	 * .lang.String, java.lang.String, java.lang.String)
+	 */
+	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);
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see
+	 * org.maemo.esbox.maemosdk.core.sdk.IScratchboxSDK#mountTarget(java.lang
+	 * .String)
+	 */
+	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);
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see
+	 * org.maemo.esbox.maemosdk.core.sdk.IScratchboxSDK#unmountTarget(java.lang
+	 * .String)
+	 */
+	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);
+	}
+
+	/**
+	 * 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 (MachineUtils.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)
+			 * 
+			 * @seeorg.maemo.esbox.internal.core.command.ICommandAbstractor#
+			 * getFileSystemAccess()
+			 */
+			public IFileSystemAccess getFileSystemAccess() {
+				return commandAbstractor.getFileSystemAccess();
+			}
+
+		};
+	}
+
+}


Property changes on: trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/api/core/sdk/AbstractScratchboxSDK.java
___________________________________________________________________
Name: svn:mergeinfo
   + 

Copied: trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/api/core/sdk/AbstractScratchboxSDKTarget.java (from rev 873, branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/sdk/AbstractScratchboxSDKTarget.java)
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/api/core/sdk/AbstractScratchboxSDKTarget.java	                        (rev 0)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/api/core/sdk/AbstractScratchboxSDKTarget.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -0,0 +1,86 @@
+/*******************************************************************************
+ * 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:
+ *    Petr Baranov (Nokia) - refactoring ScratchboxFacade
+ *******************************************************************************/
+package org.maemo.esbox.internal.api.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.commands.ICommandAbstractor;
+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.IScratchboxSDK;
+import org.maemo.esbox.maemosdk.core.sdk.IScratchboxSDKTarget;
+
+/**
+ * @author baranov
+ * 
+ */
+public abstract class AbstractScratchboxSDKTarget extends BaseSDKTarget
+		implements IScratchboxSDKTarget {
+
+	/**
+	 * @param sdk
+	 * @param platform
+	 * @param architecture
+	 * @param name
+	 */
+	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
+		MachineUtils.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)
+			 * 
+			 * @seeorg.maemo.esbox.internal.core.command.ICommandAbstractor#
+			 * getFileSystemAccess()
+			 */
+			public IFileSystemAccess getFileSystemAccess() {
+				return AbstractScratchboxSDKTarget.this
+						.getTargetFileSystemAccess();
+			}
+		};
+	}
+	
+	/* (non-Javadoc)
+	 * @see org.maemo.esbox.maemosdk.core.sdk.IScratchboxSDKTarget#getSboxVersion()
+	 */
+	public int getSboxVersion() {
+		return ((IScratchboxSDK) getSDK()).getSboxVersion();
+	}
+}


Property changes on: trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/api/core/sdk/AbstractScratchboxSDKTarget.java
___________________________________________________________________
Name: svn:mergeinfo
   + 

Copied: trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/api/core/sdk/CacheUtils.java (from rev 873, branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/sdk/CacheUtils.java)
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/api/core/sdk/CacheUtils.java	                        (rev 0)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/api/core/sdk/CacheUtils.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -0,0 +1,87 @@
+/*******************************************************************************
+ * 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:
+ *    Petr Baranov (Nokia) - API and implementation from ScratchboxFacade
+ *******************************************************************************/
+package org.maemo.esbox.internal.api.core.sdk;
+
+import org.maemo.esbox.internal.maemosdk.core.scratchbox.PersistentCache;
+
+/**
+ * Singleton pattern. Use CacheUtils.getInstance() to access instance.
+ * 
+ * @author baranov
+ * 
+ */
+public class CacheUtils {
+
+	// cache
+	private boolean useCaching;
+	private PersistentCache cache;
+
+	private static final CacheUtils INSTANCE = new CacheUtils();
+
+	/**
+	 * 
+	 */
+	protected CacheUtils() {
+		useCaching = true; // !GeneralUtils.isJUnitRunning();
+		cache = new PersistentCache();
+		cache.load();
+	}
+
+	/**
+	 * @return instance
+	 */
+	public static synchronized CacheUtils getInstance() {
+		return INSTANCE;
+	}
+
+	/**
+	 * Clears cache.
+	 */
+	public synchronized void clearCachedData() {
+		if (useCaching) {
+			cache.clear();
+		}
+	}
+
+	/**
+	 * Saves cache.
+	 */
+	public synchronized void saveCachedData() {
+		if (useCaching) {
+			cache.save();
+		}
+	}
+
+	/**
+	 * Store the cached value for a key.
+	 * 
+	 * @param key
+	 * @param value
+	 */
+	public void setCachedValue(String key, Object value) {
+		if (useCaching)
+			cache.set(key, value);
+	}
+
+	/**
+	 * Get the cached value for a key (KEY_...), or <code>null</code> if not
+	 * registered
+	 * 
+	 * @param key
+	 * @return
+	 */
+	public Object getCachedValue(String key) {
+		if (useCaching)
+			return cache.get(key);
+		else
+			return null;
+	}
+}


Property changes on: trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/api/core/sdk/CacheUtils.java
___________________________________________________________________
Name: svn:mergeinfo
   + 

Copied: trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/api/core/sdk/MachineUtils.java (from rev 873, branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/sdk/MachineUtils.java)
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/api/core/sdk/MachineUtils.java	                        (rev 0)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/api/core/sdk/MachineUtils.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -0,0 +1,129 @@
+/*******************************************************************************
+ * 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:
+ *    Petr Baranov (Nokia) - API and implementation from ScratchboxFacade
+ *******************************************************************************/
+package org.maemo.esbox.internal.api.core.sdk;
+
+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.maemo.esbox.core.CorePreferenceManager;
+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.machine.MachineManager;
+import org.maemo.esbox.core.process.IProcessLauncherFactory;
+import org.maemo.esbox.internal.api.core.commands.ICommandAbstractor;
+import org.maemo.esbox.internal.api.core.sdk.UserAwarePreferenceProviderWrapper;
+import org.maemo.esbox.internal.maemosdk.core.Activator;
+
+/**
+ * @author baranov
+ * 
+ */
+public class MachineUtils {
+
+	/** 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)
+			 * 
+			 * @seeorg.maemo.esbox.internal.core.command.ICommandAbstractor#
+			 * getFileSystemAccess()
+			 */
+			public IFileSystemAccess getFileSystemAccess() {
+				return machine.getFileSystemAccess();
+			}
+		};
+	}
+
+	/**
+	 * @param machine
+	 * @throws ESboxException
+	 */
+	public 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;
+			}
+		}
+	}
+
+	/**
+	 * @param machineKey
+	 * @param machine
+	 */
+	public static void ensureCurrentMachine(String machineKey, IMachine machine) {
+		String current = (String) CacheUtils.getInstance().getCachedValue(
+				machineKey);
+		if (current != null) {
+			String machineURI = machine.getURI().toString();
+			if (!current.equals(machineURI)) {
+				// just zap
+				CacheUtils.getInstance().clearCachedData();
+			}
+			CacheUtils.getInstance().setCachedValue(machineKey, machineURI);
+		}
+	}
+
+	/**
+	 * @param machine
+	 * @param identifyingTool
+	 * @return
+	 */
+	public 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;
+	}
+}


Property changes on: trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/api/core/sdk/MachineUtils.java
___________________________________________________________________
Name: svn:mergeinfo
   + 

Copied: trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/api/core/sdk/MaemoUtils.java (from rev 873, branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/sdk/MaemoUtils.java)
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/api/core/sdk/MaemoUtils.java	                        (rev 0)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/api/core/sdk/MaemoUtils.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -0,0 +1,92 @@
+/*******************************************************************************
+ * 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:
+ *    Petr Baranov (Nokia) - API and implementation from ScratchboxFacade
+ *******************************************************************************/
+package org.maemo.esbox.internal.api.core.sdk;
+
+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.ISDKTarget;
+import org.maemo.esbox.internal.api.core.commands.ICommandAbstractor;
+import org.maemo.esbox.internal.maemosdk.core.command.scratchbox.MaemoCommand;
+
+/**
+ * @author baranov
+ * 
+ */
+public class MaemoUtils {
+
+	/**
+	 * 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);
+	}
+
+	/**
+	 * @param sdkTarget
+	 * @return
+	 * @throws ESboxException
+	 */
+	public static ICommandAbstractor getCommandAbstractor(
+			final ISDKTarget sdkTarget) throws ESboxException {
+		// ensure machine is alive
+		MachineUtils.acquireMachine(sdkTarget.getSDK().getMachine());
+
+		return new ICommandAbstractor() {
+
+			public String getPreferenceValue(String key) {
+				return sdkTarget.getPreferenceValue(key);
+			}
+
+			public IProcessLauncherFactory getProcessLauncherFactory() {
+				return sdkTarget.getProcessLauncherFactory();
+			}
+
+			public IFileSystemAccess getFileSystemAccess() {
+				return sdkTarget.getTargetFileSystemAccess();
+			}
+		};
+	}
+
+}


Property changes on: trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/api/core/sdk/MaemoUtils.java
___________________________________________________________________
Name: svn:mergeinfo
   + 

Modified: trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/Activator.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/Activator.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/Activator.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -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
  */
@@ -21,7 +27,7 @@
 	private static Activator plugin;
 
 	private IPreferenceStore preferenceStore;
-	
+
 	/**
 	 * The constructor
 	 */
@@ -30,7 +36,9 @@
 
 	/*
 	 * (non-Javadoc)
-	 * @see org.eclipse.core.runtime.Plugins#start(org.osgi.framework.BundleContext)
+	 * 
+	 * @see
+	 * org.eclipse.core.runtime.Plugins#start(org.osgi.framework.BundleContext)
 	 */
 	public void start(BundleContext context) throws Exception {
 		super.start(context);
@@ -39,7 +47,9 @@
 
 	/*
 	 * (non-Javadoc)
-	 * @see org.eclipse.core.runtime.Plugin#stop(org.osgi.framework.BundleContext)
+	 * 
+	 * @see
+	 * org.eclipse.core.runtime.Plugin#stop(org.osgi.framework.BundleContext)
 	 */
 	public void stop(BundleContext context) throws Exception {
 		plugin = null;
@@ -48,7 +58,7 @@
 
 	/**
 	 * Returns the shared instance
-	 *
+	 * 
 	 * @return the shared instance
 	 */
 	public static Activator getDefault() {
@@ -70,8 +80,7 @@
 	 * @param e
 	 * @return
 	 */
-	public static IStatus createStatus(int severity, String msg,
-			Throwable t) {
+	public static IStatus createStatus(int severity, String msg, Throwable t) {
 		return new Status(severity, PLUGIN_ID, msg, t);
 	}
 
@@ -83,7 +92,7 @@
 	public static IStatus createStatus(int severity, String string) {
 		return new Status(severity, PLUGIN_ID, string);
 	}
-	
+
 	/**
 	 * Return the error logger instance of this plug-in.
 	 * 
@@ -96,6 +105,7 @@
 			public String getPluginID() {
 				return PLUGIN_ID;
 			}
+
 			@Override
 			public Plugin getPlugin() {
 				return Activator.getDefault();
@@ -107,45 +117,47 @@
 	}
 
 	/**
-	 * Find a file relative to the plugin, either in a running
-	 * workspace or a standalone unit test (assumed to run relative
-	 * to a plugin)
+	 * Find a file relative to the plugin, either in a running workspace or a
+	 * standalone unit test (assumed to run relative to a plugin)
+	 * 
 	 * @param path
 	 */
-	public static InputStream getPluginRelativeInputStream(String path) throws IOException {
+	public static InputStream getPluginRelativeInputStream(String path)
+			throws IOException {
 		if (getDefault() != null) {
-			return FileLocator.openStream(getDefault().getBundle(), new Path(path), false);
+			return FileLocator.openStream(getDefault().getBundle(), new Path(
+					path), false);
 		} else {
 			return new FileInputStream("../" + path);
 		}
 	}
 
-    /**
-     * Returns the preference store for this UI plug-in.
-     * This preference store is used to hold persistent settings for this plug-in in
-     * the context of a workbench. Some of these settings will be user controlled, 
-     * whereas others may be internal setting that are never exposed to the user.
-     * <p>
-     * If an error occurs reading the preference store, an empty preference store is
-     * quietly created, initialized with defaults, and returned.
-     * </p>
-     * <p>
-     * <strong>NOTE:</strong> As of Eclipse 3.1 this method is
-     * no longer referring to the core runtime compatibility layer and so
-     * plug-ins relying on Plugin#initializeDefaultPreferences
-     * will have to access the compatibility layer themselves.
-     * </p>
-     *
-     * @return the preference store 
-     */
-    public IPreferenceStore getPreferenceStore() {
-        // Create the preference store lazily.
-        if (preferenceStore == null) {
-            preferenceStore = new ScopedPreferenceStore(new InstanceScope(),getBundle().getSymbolicName());
+	/**
+	 * Returns the preference store for this UI plug-in. This preference store
+	 * is used to hold persistent settings for this plug-in in the context of a
+	 * workbench. Some of these settings will be user controlled, whereas others
+	 * may be internal setting that are never exposed to the user.
+	 * <p>
+	 * If an error occurs reading the preference store, an empty preference
+	 * store is quietly created, initialized with defaults, and returned.
+	 * </p>
+	 * <p>
+	 * <strong>NOTE:</strong> As of Eclipse 3.1 this method is no longer
+	 * referring to the core runtime compatibility layer and so plug-ins relying
+	 * on Plugin#initializeDefaultPreferences will have to access the
+	 * compatibility layer themselves.
+	 * </p>
+	 * 
+	 * @return the preference store
+	 */
+	public IPreferenceStore getPreferenceStore() {
+		// Create the preference store lazily.
+		if (preferenceStore == null) {
+			preferenceStore = new ScopedPreferenceStore(new InstanceScope(),
+					getBundle().getSymbolicName());
 
-        }
-        return preferenceStore;
-    }
-	
+		}
+		return preferenceStore;
+	}
 
 }

Modified: trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/MaemoEnvironmentUtils.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/MaemoEnvironmentUtils.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/MaemoEnvironmentUtils.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -14,7 +14,6 @@
 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;
 
 /**

Copied: trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/OldStyleProjectProperties.java (from rev 873, trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/OldStyleProjectProperties.java)
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/OldStyleProjectProperties.java	                        (rev 0)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/OldStyleProjectProperties.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -0,0 +1,197 @@
+/*******************************************************************************
+ * 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 java.text.MessageFormat;
+import java.util.List;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.QualifiedName;
+import org.maemo.esbox.core.ESboxException;
+import org.maemo.esbox.core.execEnv.ExecutionEnvironmentFactory;
+import org.maemo.esbox.core.execEnv.IExecutionEnvironment;
+import org.maemo.esbox.core.execEnv.UnknownExecutionEnvironment;
+import org.maemo.esbox.core.sdk.ISDK;
+import org.maemo.esbox.core.sdk.ISDKTarget;
+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.project.core.IProjectProperties;
+
+/**
+ * This class retrieves the old-style C/C++ or Python project properties stored
+ * in workspace metadata.
+ * 
+ * @author eswartz
+ * 
+ */
+public class OldStyleProjectProperties implements IProjectProperties {
+	private static final String TARGET_NAME_ID = "org.indt.esbox.project.targetName";
+
+	private static final String SCRATCHBOX_VERSION_ID = "org.indt.esbox.project.scratchboxVersion";
+
+	private static final String EXECUTION_ENVIRONMENT_ID = "org.indt.esbox.project.execEnv";
+
+	static final QualifiedName targetNameProperty = new QualifiedName(
+			TARGET_NAME_ID, "Scratchbox Target");
+
+	static final QualifiedName scratchboxVersionProperty = new QualifiedName(
+			SCRATCHBOX_VERSION_ID, "Scratchbox Version");
+
+	static final QualifiedName executionEnvironmentProperty = new QualifiedName(
+			EXECUTION_ENVIRONMENT_ID, "Execution Environment");
+
+	private IProject project;
+
+	public OldStyleProjectProperties(IProject project) {
+		this.project = project;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.maemo.esbox.core.IPropertyAccess#read(java.lang.String)
+	 */
+	private String readProperty(QualifiedName property) {
+		try {
+			return project.getPersistentProperty(property);
+		} catch (CoreException e) {
+			Activator.getErrorLogger().logError(
+					"Could not read project property", e);
+			return null;
+		}
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see
+	 * org.maemo.esbox.project.core.IProjectProperties#getExecutionEnvironment()
+	 */
+	public IExecutionEnvironment getExecutionEnvironment() {
+		IExecutionEnvironment execEnv = null;
+		String execEnvId = readProperty(executionEnvironmentProperty);
+		if (execEnvId == null) {
+			// XXX: this is compatibility behavior
+			// execEnvId =
+			// "org.maemo.esbox.maemosdk.core.execution_environment.maemo";
+		}
+		execEnv = ExecutionEnvironmentFactory.getInstance()
+				.findExecutionEnvironment(execEnvId);
+		if (execEnv == null) {
+			execEnv = new UnknownExecutionEnvironment();
+		}
+		return execEnv;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see
+	 * org.maemo.esbox.project.core.IProjectProperties#getExecutionEnvironmentId
+	 * ()
+	 */
+	public String getExecutionEnvironmentId() {
+		return readProperty(executionEnvironmentProperty);
+	}
+
+	/**
+	 * Get the SDK target (SDK + target name) for the project's configured SDK
+	 * 
+	 * @return SDK target, never <code>null</code>
+	 * @throws ESboxException
+	 *             if no target known
+	 */
+	public ISDKTarget getSDKTarget() throws ESboxException {
+		if (!project.isOpen())
+			throw new ESboxException(MessageFormat.format(
+					"Project ''{0}'' is not open", project.getName()));
+
+		ISDK sdk = getSDK();
+		String targetName = getTargetName();
+
+		ISDKTarget target = sdk.findSDKTarget(targetName);
+		if (target == null) {
+			throw new ESboxException(MessageFormat.format(
+					"Project ''{0}'' references an unavailable target ''{1}''",
+					project.getName(), targetName));
+		}
+
+		return target;
+	}
+
+	/**
+	 * Get the SDK for the project
+	 * 
+	 * @return SDK, never <code>null</code>
+	 * @throws ESboxException
+	 *             if no SDK known
+	 */
+	public ISDK getSDK() throws ESboxException {
+		ISDK sdk = null;
+
+		String version = readProperty(scratchboxVersionProperty);
+		if (version == null) {
+			// old projects
+			version = "1";
+		}
+
+		List<IScratchboxSDK> sboxSDKs = ScratchboxSDKFacade.getInstance()
+				.getAllScratchboxSDKs();
+		for (IScratchboxSDK sboxSDK : sboxSDKs) {
+			if (version.equals(Integer.toString(sboxSDK.getSboxVersion()))) {
+				sdk = sboxSDK;
+				break;
+			}
+		}
+
+		if (sdk == null) {
+			throw new ESboxException(
+					MessageFormat
+							.format(
+									"Project ''{0}'' uses an unsupported scratchbox version {1}",
+									project.getName(), version));
+		}
+
+		return sdk;
+	}
+
+	public synchronized String getTargetName() {
+		return readProperty(targetNameProperty);
+	}
+
+	public synchronized String getSDKName() {
+		String sboxVersion = readProperty(scratchboxVersionProperty);
+	
+		if (sboxVersion == null)
+			return null;
+		
+		List<IScratchboxSDK> sboxSDKs;
+		try {
+			sboxSDKs = ScratchboxSDKFacade.getInstance().getAllScratchboxSDKs();
+		} catch (ScratchboxException e) {
+			return null;
+		}
+		for (IScratchboxSDK sboxSDK : sboxSDKs) {
+			if (sboxVersion.equals(Integer.toString(sboxSDK.getSboxVersion()))) {
+				return sboxSDK.getName();
+			}
+		}
+		return null;
+	}
+
+	// public synchronized String getScratchboxVersion(IProject project) {
+	// return readProperty(scratchboxVersionProperty);
+	// }
+
+}


Property changes on: trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/OldStyleProjectProperties.java
___________________________________________________________________
Name: svn:mergeinfo
   + 

Copied: trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/OldStyleWorkspaceProjectPropertiesProvider.java (from rev 873, trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/OldStyleWorkspaceProjectPropertiesProvider.java)
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/OldStyleWorkspaceProjectPropertiesProvider.java	                        (rev 0)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/OldStyleWorkspaceProjectPropertiesProvider.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -0,0 +1,63 @@
+/*******************************************************************************
+ * 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.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IProjectNature;
+import org.eclipse.core.runtime.CoreException;
+import org.maemo.esbox.project.core.IOldStyleProjectPropertiesProvider;
+import org.maemo.esbox.project.core.IProjectProperties;
+
+/**
+ * Implementation of oldStyleProjectPropertiesProvider to allow converting old
+ * projects to the current format.
+ * 
+ * @author eswartz
+ * 
+ */
+public class OldStyleWorkspaceProjectPropertiesProvider implements
+		IOldStyleProjectPropertiesProvider {
+
+	// NOTE: these nature IDs are stored here to avoid forcing this feature
+	// to depend on C/C++ or Python.
+	private static final String ESBOX_NATURE_ID = "org.indt.esbox.core.ESboxNature";
+	private static final String ESBOX_PYTHON_NATURE_ID = "org.indt.esbox.core.esboxPythonNature";
+
+	private boolean isNatureInProject(IProject _project, String id) {
+		if (_project != null && _project.isOpen()) {
+			try {
+				IProjectNature nature = _project.getNature(id);
+				if (nature != null) {
+					return true;
+				}
+			} catch (CoreException e) {
+				Activator.getErrorLogger().logError(
+						"Cannot detect project nature", e);
+			}
+		}
+		return false;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @seeorg.maemo.esbox.project.core.IOldStyleProjectPropertiesProvider#
+	 * createProjectProperties(org.eclipse.core.resources.IProject)
+	 */
+	public IProjectProperties createProjectProperties(IProject project) {
+		if (isNatureInProject(project, ESBOX_NATURE_ID)
+				|| isNatureInProject(project, ESBOX_PYTHON_NATURE_ID))
+			return new OldStyleProjectProperties(project);
+		return null;
+	}
+
+}


Property changes on: trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/OldStyleWorkspaceProjectPropertiesProvider.java
___________________________________________________________________
Name: svn:mergeinfo
   + 

Copied: trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/ScratchboxPackageManagerProvider.java (from rev 873, trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/ScratchboxPackageManagerProvider.java)
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/ScratchboxPackageManagerProvider.java	                        (rev 0)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/ScratchboxPackageManagerProvider.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -0,0 +1,62 @@
+/*******************************************************************************
+ * 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.process.IProcessLauncherFactory;
+import org.maemo.esbox.core.sdk.ISDKTarget;
+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;
+
+/**
+ * This implementation creates APT package managers for scratchbox targets.
+ * 
+ * @author eswartz
+ * 
+ */
+public class ScratchboxPackageManagerProvider implements
+		IPackageManagerProvider {
+
+	/**
+	 * 
+	 */
+	public ScratchboxPackageManagerProvider() {
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @seeorg.maemo.esbox.linux.packages.core.IPackageManagerProvider#
+	 * createPackageManager(org.maemo.esbox.core.sdk.ISDKTarget)
+	 */
+	public IPackageManager createPackageManager(ISDKTarget sdkTarget) {
+		if (!(sdkTarget instanceof IScratchboxSDKTarget))
+			return null;
+
+		// in sb2, apt commands must be run as root
+		IProcessLauncherFactory aptProcessLauncherFactory;
+		if (sdkTarget instanceof IScratchboxSDKTarget)
+			aptProcessLauncherFactory = ((IScratchboxSDKTarget) sdkTarget)
+					.getProcessLauncherFactoryForInstall();
+		else
+			aptProcessLauncherFactory = sdkTarget.getProcessLauncherFactory();
+
+		IProcessLauncherFactory pkgconfigProcessLauncherFactory = sdkTarget
+				.getProcessLauncherFactory();
+
+		IPackageManager manager = new AptPackageManager(sdkTarget,
+				aptProcessLauncherFactory, pkgconfigProcessLauncherFactory);
+		return manager;
+	}
+
+}


Property changes on: trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/ScratchboxPackageManagerProvider.java
___________________________________________________________________
Name: svn:mergeinfo
   + 

Copied: trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/ScratchboxPropertyTester.java (from rev 873, trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/ScratchboxPropertyTester.java)
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/ScratchboxPropertyTester.java	                        (rev 0)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/ScratchboxPropertyTester.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -0,0 +1,97 @@
+package org.maemo.esbox.internal.maemosdk.core;
+
+import org.eclipse.core.expressions.IPropertyTester;
+import org.eclipse.core.expressions.PropertyTester;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.IAdaptable;
+import org.maemo.esbox.core.ESboxException;
+import org.maemo.esbox.core.sdk.ISDKTarget;
+import org.maemo.esbox.maemosdk.core.sdk.IScratchboxSDKTarget;
+import org.maemo.esbox.project.core.ProjectManager;
+
+/**
+ * Test properties of ESbox resources for use in UI filtering and activation
+ * <p>
+ * <li>isRemoteTarget -- tell if the current build target can be a remote target
+ * (e.g. ARM)
+ * <li>isEmulatorTarget -- tell if the current build target can be an emulator
+ * target
+ * <li>isX86Target -- tell if the current build target is an x86 target
+ * <li>isARMELTarget -- tell if the current build target is an ARMEL target
+ * 
+ * @author eswartz
+ * 
+ */
+public class ScratchboxPropertyTester extends PropertyTester implements
+		IPropertyTester {
+
+	protected IProject getProject(Object receiver) {
+		IResource rsrc = null;
+		if (receiver instanceof IResource) {
+			rsrc = (IResource) receiver;
+		} else if (receiver instanceof IAdaptable) {
+			rsrc = (IResource) (((IAdaptable) receiver)
+					.getAdapter(IResource.class));
+		}
+		if (rsrc == null)
+			return null;
+		return rsrc.getProject();
+	}
+
+	protected ISDKTarget getSDKTarget(IProject project) {
+		try {
+			return ProjectManager.getInstance().getSDKTarget(project);
+		} catch (ESboxException e) {
+			return null;
+		}
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.core.expressions.IPropertyTester#test(java.lang.Object,
+	 * java.lang.String, java.lang.Object[], java.lang.Object)
+	 */
+	public boolean test(Object receiver, String property, Object[] args,
+			Object expectedValue) {
+
+		IProject project = getProject(receiver);
+		if (project != null) {
+			// TODO: Avoid actually reading the project metadata to get the
+			// target
+			// since, for the first invocation in a new workspace, this can make
+			// a submenu
+			// close as it's being opened if we need to put up a progress dialog
+			// to
+			// initialize the SDKs.
+			//
+			ISDKTarget sdkTarget = getSDKTarget(project);
+			if (sdkTarget != null) {
+				// 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;
+				}
+
+				if (property.equals("isRemoteTarget")) {
+					return isARM;
+				}
+				if (property.equals("isX86Target")) {
+					return isX86;
+				}
+				if (property.equals("isARMELTarget")) {
+					return isARM;
+				}
+			}
+		}
+
+		return false;
+	}
+
+}


Property changes on: trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/ScratchboxPropertyTester.java
___________________________________________________________________
Name: svn:mergeinfo
   + 

Modified: trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/adapters/MaemoDefaultExecutionEnvironmentAdapter.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/adapters/MaemoDefaultExecutionEnvironmentAdapter.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/adapters/MaemoDefaultExecutionEnvironmentAdapter.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -20,22 +20,28 @@
 
 /**
  * Implementation of default execution environment adapter
+ * 
  * @author eswartz
- *
+ * 
  */
-public class MaemoDefaultExecutionEnvironmentAdapter implements IDefaultExecutionEnvironmentAdapter {
+public class MaemoDefaultExecutionEnvironmentAdapter implements
+		IDefaultExecutionEnvironmentAdapter {
 	final ISDKTarget sdkTarget;
 
 	public MaemoDefaultExecutionEnvironmentAdapter(ISDKTarget sdkTarget) {
 		this.sdkTarget = sdkTarget;
 	}
 
-	/* (non-Javadoc)
-	 * @see org.maemo.esbox.core.adapters.IDefaultExecutionEnvironmentAdapter#getDefaultExecutionEnvironment(org.eclipse.core.resources.IProject)
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @seeorg.maemo.esbox.core.adapters.IDefaultExecutionEnvironmentAdapter#
+	 * getDefaultExecutionEnvironment(org.eclipse.core.resources.IProject)
 	 */
 	public IExecutionEnvironment getDefaultExecutionEnvironment(IProject project) {
 		// TODO: more intelligent check
-		return ExecutionEnvironmentFactory.getInstance().findExecutionEnvironment(MaemoExecutionEnvironment.ID);
+		return ExecutionEnvironmentFactory.getInstance()
+				.findExecutionEnvironment(MaemoExecutionEnvironment.ID);
 	}
 
 }

Modified: trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/adapters/MaemoDefaultExecutionEnvironmentFactory.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/adapters/MaemoDefaultExecutionEnvironmentFactory.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/adapters/MaemoDefaultExecutionEnvironmentFactory.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -17,13 +17,18 @@
 
 /**
  * This factory ties "default execution environment" support into an SDK target
+ * 
  * @author eswartz
- *
+ * 
  */
 public class MaemoDefaultExecutionEnvironmentFactory implements IAdapterFactory {
 
-	/* (non-Javadoc)
-	 * @see org.eclipse.core.runtime.IAdapterFactory#getAdapter(java.lang.Object, java.lang.Class)
+	/*
+	 * (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(IDefaultExecutionEnvironmentAdapter.class)) {
@@ -35,7 +40,9 @@
 		return null;
 	}
 
-	/* (non-Javadoc)
+	/*
+	 * (non-Javadoc)
+	 * 
 	 * @see org.eclipse.core.runtime.IAdapterFactory#getAdapterList()
 	 */
 	public Class[] getAdapterList() {

Modified: trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/adapters/MaemoGdbServerSupportAdapter.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/adapters/MaemoGdbServerSupportAdapter.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/adapters/MaemoGdbServerSupportAdapter.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -11,53 +11,55 @@
 
 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
- *
+ * 
  */
 public class MaemoGdbServerSupportAdapter implements IGdbServerSupportAdapter {
 
-	private final ISDKTarget sdkTarget;
+	private final IScratchboxSDKTarget sdkTarget;
 
-	public MaemoGdbServerSupportAdapter(ISDKTarget sdkTarget) {
+	public MaemoGdbServerSupportAdapter(IScratchboxSDKTarget sdkTarget) {
 		this.sdkTarget = sdkTarget;
 	}
 
 	public String getGDBServerCommandPattern(boolean isLocal) {
-		
+
 		if (!isLocal) {
 			// device uses standard gdbserver
-			return sdkTarget.getPreferenceValue(MaemoPreferenceConstants.SBOX_GDB_REMOTE);	
+			return sdkTarget
+					.getPreferenceValue(MaemoPreferenceConstants.SBOX_GDB_REMOTE);
 		}
-		
-		// emulator uses qemu-arm with varying arguments based on architecture and version
+
+		// emulator uses qemu-arm with varying arguments based on architecture
+		// and version
 		String architecture = IScratchboxSDKTarget.ARCHITECTURE_UNKNOWN;
-		
-		if (sdkTarget.getArchitecture().equals(IScratchboxSDKTarget.ARCHITECTURE_ARMEL)) {
+
+		if (sdkTarget.getArchitecture().equals(
+				IScratchboxSDKTarget.ARCHITECTURE_ARMEL)) {
 			architecture = IScratchboxSDKTarget.ARCHITECTURE_ARMEL;
-		}
-		else {
+		} else {
 			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(
-					"Cannot determine gdb server command pattern for ''{0}''", 
+					"Cannot determine gdb server command pattern for ''{0}''",
 					sdkTarget.getName());
-			Activator.getErrorLogger().logError( msg, e);
+			Activator.getErrorLogger().logError(msg, e);
 			return "<<unknown gdb server command pattern>>";
 		}
 	}

Modified: trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/adapters/MaemoGdbServerSupportAdapterFactory.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/adapters/MaemoGdbServerSupportAdapterFactory.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/adapters/MaemoGdbServerSupportAdapterFactory.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -12,28 +12,35 @@
 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.IGdbServerSupportAdapter;
+import org.maemo.esbox.maemosdk.core.sdk.IScratchboxSDKTarget;
 
 /**
  * @author eswartz
- *
+ * 
  */
 public class MaemoGdbServerSupportAdapterFactory implements IAdapterFactory {
 
-	/* (non-Javadoc)
-	 * @see org.eclipse.core.runtime.IAdapterFactory#getAdapter(java.lang.Object, java.lang.Class)
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @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;
 	}
 
-	/* (non-Javadoc)
+	/*
+	 * (non-Javadoc)
+	 * 
 	 * @see org.eclipse.core.runtime.IAdapterFactory#getAdapterList()
 	 */
 	public Class[] getAdapterList() {

Modified: trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/adapters/MaemoRunStandaloneAdapter.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/adapters/MaemoRunStandaloneAdapter.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/adapters/MaemoRunStandaloneAdapter.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -17,41 +17,51 @@
 
 /**
  * Implementation of "run standalone" support for maemo SDKs.
+ * 
  * @author eswartz
- *
+ * 
  */
 public class MaemoRunStandaloneAdapter implements IRunStandaloneAdapter {
 
-
 	/**
 	 * 
 	 */
 	public MaemoRunStandaloneAdapter(ISDKTarget sdkTarget) {
 	}
-	
-	/* (non-Javadoc)
+
+	/*
+	 * (non-Javadoc)
+	 * 
 	 * @see org.maemo.esbox.core.adapters.IRunStandaloneSupport#getDefault()
 	 */
 	public boolean getDefault() {
 		return true;
 	}
 
-	/* (non-Javadoc)
+	/*
+	 * (non-Javadoc)
+	 * 
 	 * @see org.maemo.esbox.core.adapters.IRunStandaloneSupport#getLabelText()
 	 */
 	public String getLabelText() {
 		return "Run with \"run-standalone.sh\" script";
 	}
 
-	/* (non-Javadoc)
+	/*
+	 * (non-Javadoc)
+	 * 
 	 * @see org.maemo.esbox.core.adapters.IRunStandaloneSupport#getTooltipText()
 	 */
 	public String getTooltipText() {
 		return "When enabled, the application is launched with the appropriate environment so that it will behave as if it were installed.";
 	}
 
-	/* (non-Javadoc)
-	 * @see org.maemo.esbox.core.adapters.IRunStandaloneSupport#updateLaunch(org.maemo.esbox.core.process.ProcessLauncherParameters, boolean)
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see
+	 * org.maemo.esbox.core.adapters.IRunStandaloneSupport#updateLaunch(org.
+	 * maemo.esbox.core.process.ProcessLauncherParameters, boolean)
 	 */
 	public void updateLaunch(ProcessLauncherParameters parameters,
 			boolean isRunStandalone) {

Modified: trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/adapters/MaemoRunStandaloneSupportAdapterFactory.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/adapters/MaemoRunStandaloneSupportAdapterFactory.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/adapters/MaemoRunStandaloneSupportAdapterFactory.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -17,19 +17,25 @@
 
 /**
  * This factory ties "run standalone" support into an SDK target
+ * 
  * @author eswartz
- *
+ * 
  */
 public class MaemoRunStandaloneSupportAdapterFactory implements IAdapterFactory {
 
-	/* (non-Javadoc)
-	 * @see org.eclipse.core.runtime.IAdapterFactory#getAdapter(java.lang.Object, java.lang.Class)
+	/*
+	 * (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(IRunStandaloneAdapter.class)) {
 			if (adaptableObject instanceof ISDKTarget) {
 				ISDKTarget sdkTarget = (ISDKTarget) adaptableObject;
-				if (sdkTarget.getPlatform().getName().toLowerCase().matches("gregale|bora|chinook|diablo|fremantle")) {
+				if (sdkTarget.getPlatform().getName().toLowerCase().matches(
+						"gregale|bora|chinook|diablo|fremantle")) {
 					return new MaemoRunStandaloneAdapter(sdkTarget);
 				}
 			}
@@ -37,7 +43,9 @@
 		return null;
 	}
 
-	/* (non-Javadoc)
+	/*
+	 * (non-Javadoc)
+	 * 
 	 * @see org.eclipse.core.runtime.IAdapterFactory#getAdapterList()
 	 */
 	public Class[] getAdapterList() {

Modified: trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/adapters/MaemoSbrshAutoconfigurationAdapter.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/adapters/MaemoSbrshAutoconfigurationAdapter.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/adapters/MaemoSbrshAutoconfigurationAdapter.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -18,44 +18,46 @@
 
 /**
  * Implementation of SBRSH autoconfiguration support for maemo SDKs.
+ * 
  * @author eswartz
- *
+ * 
  */
-public class MaemoSbrshAutoconfigurationAdapter implements ISbrshAutoconfigurationAdapter {
+public class MaemoSbrshAutoconfigurationAdapter implements
+		ISbrshAutoconfigurationAdapter {
 	private final ISDKTarget sdkTarget;
 
 	public MaemoSbrshAutoconfigurationAdapter(ISDKTarget sdkTarget) {
 		this.sdkTarget = sdkTarget;
 	}
 
-	/* (non-Javadoc)
-	 * @see org.maemo.esbox.device.core.adapters.ISbrshAutoconfigurationAdapter#getDefaultConfigurationTemplate()
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @seeorg.maemo.esbox.device.core.adapters.ISbrshAutoconfigurationAdapter#
+	 * getDefaultConfigurationTemplate()
 	 */
 	public String getDefaultConfigurationTemplate() {
-		String sbrshHeader = 
-			"AutoTarget  ${TARGET}:${TARGET_PORT} \n";
-		String rootstrapLine = 
-			"\t ssh 	${USER}@${HOST}:${ROOTSTRAP_PATH} 			/  					rw,nonempty,allow_other,port=${HOST_PORT}\n";
-		String stdMounts =
-			"\t ssh 	${USER}@${HOST}:${HOST_PROJECT_PATH}   	${TARGET_PROJECT_PATH}  	rw,nonempty,allow_other,port=${HOST_PORT}\n" +
-			"\t bind    /tmp                            /tmp \n" +
-	        "\t bind    /dev                            /dev \n" +
-	        "\t bind    /dev/pts                        /dev/pts \n" +
-	        "\t bind    /proc                           /proc \n" +
-	        "\t bind    /sys                            /sys \n" +
-	        "\t bind    /var                            /var \n"
-			;
-		
+		String sbrshHeader = "AutoTarget  ${TARGET}:${TARGET_PORT} \n";
+		String rootstrapLine = "\t ssh 	${USER}@${HOST}:${ROOTSTRAP_PATH} 			/  					rw,nonempty,allow_other,port=${HOST_PORT}\n";
+		String stdMounts = "\t ssh 	${USER}@${HOST}:${HOST_PROJECT_PATH}   	${TARGET_PROJECT_PATH}  	rw,nonempty,allow_other,port=${HOST_PORT}\n"
+				+ "\t bind    /tmp                            /tmp \n"
+				+ "\t bind    /dev                            /dev \n"
+				+ "\t bind    /dev/pts                        /dev/pts \n"
+				+ "\t bind    /proc                           /proc \n"
+				+ "\t bind    /sys                            /sys \n"
+				+ "\t bind    /var                            /var \n";
+
 		if (sdkTarget instanceof IScratchboxSDKTarget) {
 			ShellTemplateSubstitutor substitutor = new ShellTemplateSubstitutor();
-			substitutor.define("ROOTSTRAP_PATH", ((IScratchboxSDKTarget) sdkTarget).getRootstrapPath().toPortableString());
+			substitutor.define("ROOTSTRAP_PATH",
+					((IScratchboxSDKTarget) sdkTarget).getRootstrapPath()
+							.toPortableString());
 			rootstrapLine = substitutor.substitute(rootstrapLine);
 		} else {
 			rootstrapLine = "";
 		}
-		
+
 		return sbrshHeader + rootstrapLine + stdMounts;
 	}
-	
 
 }

Modified: trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/adapters/MaemoSbrshAutoconfigurationAdapterFactory.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/adapters/MaemoSbrshAutoconfigurationAdapterFactory.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/adapters/MaemoSbrshAutoconfigurationAdapterFactory.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -18,19 +18,26 @@
 
 /**
  * This factory ties "run standalone" support into an SDK target
+ * 
  * @author eswartz
- *
+ * 
  */
-public class MaemoSbrshAutoconfigurationAdapterFactory implements IAdapterFactory {
+public class MaemoSbrshAutoconfigurationAdapterFactory implements
+		IAdapterFactory {
 
-	/* (non-Javadoc)
-	 * @see org.eclipse.core.runtime.IAdapterFactory#getAdapter(java.lang.Object, java.lang.Class)
+	/*
+	 * (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(ISbrshAutoconfigurationAdapter.class)) {
 			if (adaptableObject instanceof ISDKTarget) {
 				ISDKTarget sdkTarget = (ISDKTarget) adaptableObject;
-				if (sdkTarget.getPlatform().getName().toLowerCase().matches("gregale|bora|chinook|diablo|fremantle")) {
+				if (sdkTarget.getPlatform().getName().toLowerCase().matches(
+						"gregale|bora|chinook|diablo|fremantle")) {
 					return new MaemoSbrshAutoconfigurationAdapter(sdkTarget);
 				}
 			}
@@ -38,7 +45,9 @@
 		return null;
 	}
 
-	/* (non-Javadoc)
+	/*
+	 * (non-Javadoc)
+	 * 
 	 * @see org.eclipse.core.runtime.IAdapterFactory#getAdapterList()
 	 */
 	public Class[] getAdapterList() {

Modified: trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/adapters/MaemoTargetEnvironmentModifierAdapter.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/adapters/MaemoTargetEnvironmentModifierAdapter.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/adapters/MaemoTargetEnvironmentModifierAdapter.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -58,3 +58,4 @@
 	}
 
 }
+

Modified: trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/ICommand.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/ICommand.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/ICommand.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -10,23 +10,24 @@
  *******************************************************************************/
 package org.maemo.esbox.internal.maemosdk.core.command;
 
-
 import org.maemo.esbox.core.ESboxException;
 
 import java.util.List;
 
 /**
  * ICommand type corresponds to a general command to be executed inside
- * Scratchbox. 
+ * Scratchbox.
  */
 public interface ICommand {
 
 	/**
 	 * Execute the command.
+	 * 
 	 * @param param
 	 *            the parameters used for the command.
 	 * @return the result of command.
-	 * @throws ESboxException TODO
+	 * @throws ESboxException
+	 *             TODO
 	 */
 	public Object performCommand(List<String> params) throws ESboxException;
 }

Deleted: trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/ICommandAbstractor.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/ICommandAbstractor.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/ICommandAbstractor.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -1,45 +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;
-
-import org.maemo.esbox.core.machine.IFileSystemAccess;
-import org.maemo.esbox.core.process.IProcessLauncherFactory;
-
-/**
- * This interface is used to abstract the way an ICommand is constructed
- * and launched, and the means by which it gets the values to substitute into
- * commands.  It may, for instance, either be run in the context of an ISDKTarget,
- * ISDK, or run natively.  Similarly, it may be controlled entirely by unit tests.  
- * 
- * @author eswartz
- *
- */
-public interface ICommandAbstractor {
-
-	/** 
-	 * Read a preference for the implicit category of the abstractor.
-	 * @param key the key to search
-	 * @return preference value or "" if undefined
-	 */
-	String getPreferenceValue(String key);
-
-	/**
-	 * Get the factory for creating process launchers to run programs in the context of the SDK.  
-	 * @return the process launcher factory, never <code>null</code>
-	 */
-	IProcessLauncherFactory getProcessLauncherFactory();
-	
-	/**
-	 * Get the file system access for the filesystem used by the command
-	 * @return IFilesystemAccess, never <code>null</code>
-	 */
-	IFileSystemAccess getFileSystemAccess();
-}
\ No newline at end of file

Deleted: trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/CreateMaemoRootstrapSb2Command.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/CreateMaemoRootstrapSb2Command.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/CreateMaemoRootstrapSb2Command.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -1,93 +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.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.scratchbox.ScratchboxException;
-
-import java.util.*;
-
-/**
- * Creates a new rootstrap for a target, if it does not exist.
- * This command wraps the callback to service:
- * <p>
- * maemo-rootstrap [--force] install &lt;target&gt;  
- * 
- */
-public class CreateMaemoRootstrapSb2Command extends MaemoRootstrapSb2Command {
-
-	private ISDK sdk;
-	private IProgressMonitor monitor;
-
-	public CreateMaemoRootstrapSb2Command(ISDK sdk, ICommandAbstractor commandAbstractor, IProgressMonitor monitor) {
-		super(commandAbstractor);
-		this.sdk = sdk;
-		this.monitor = monitor;
-	}
-
-	@Override
-	protected boolean checkParameters(List<String> param) {
-		return param.size() == 3;
-	}
-	
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see embedded.core.scratchbox.command.IScratchboxCommand#performCommand(java.lang.Object)
-	 */
-	public Boolean performCommand(List<String> param) throws ScratchboxException, ESboxException {
-		if (!this.checkParameters(param))
-			throw new ScratchboxInvalidParameterException(
-					"Invalid number of parameters");
-
-		String targetName = param.get(0);
-		String useHostToolsFlag = param.get(1);
-		String forceFlag = param.get(2);
-		
-		List<String> params = new ArrayList<String>();
-		if (useHostToolsFlag.equals(Boolean.TRUE.toString())) {
-			params.add(commandAbstractor.getPreferenceValue(
-					SB2PreferenceConstants.SB2_MAEMO_ROOTSTRAP_HOST_TOOLS_OPT));
-		}
-		if (forceFlag.equals(Boolean.TRUE.toString())) {
-			params.add(commandAbstractor.getPreferenceValue(
-					SB2PreferenceConstants.SB2_MAEMO_ROOTSTRAP_FORCE_OPT));
-		}
-		params.add(commandAbstractor.getPreferenceValue(
-				SB2PreferenceConstants.SB2_MAEMO_ROOTSTRAP_INSTALL_ACT));
-		params.add(targetName);
-		
-		IEnvironmentModifierBlock envBlock = commandAbstractor.getProcessLauncherFactory().defaultEnvironmentModifierBlock();
-		ProcessLauncherUtils.defineProxyVariables(envBlock);
-		
-		setMonitorAndConsole(
-				monitor,
-				CorePlugin.getDefault().getConsole(true, null, "Installing rootstrap " + targetName));
-		doPerformCommand(params, envBlock, 0);
-		
-		sdk.refresh();
-		
-		return true;
-	}
-
-	@Override
-	public int getParametersSize() {
-		return 1;
-	}
-
-}

Deleted: trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/CreateTargetCommand.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/CreateTargetCommand.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/CreateTargetCommand.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -1,114 +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.command.scratchbox;
-
-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 java.util.List;
-
-/**
- * Creates a new target, if it does not exist.
- * This command wraps the callback to service sb-conf setup [<TARGET>] 
- *                                                          [--compiler=<COMPILER>]
- *                                                          [--devkits=<LIST>]
- *                                                          [--cputransp=<METHOD>]
- *                                                          [--force] 
- * 
- */
-public class CreateTargetCommand extends ScratchboxCommand {
-
-	
-	private ISDK sdk;
-
-	public CreateTargetCommand(ISDK sdk, ICommandAbstractor commandAbstractor) {
-		super(commandAbstractor, 1);
-		this.sdk = sdk;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see embedded.core.scratchbox.command.IScratchboxCommand#performCommand(java.lang.Object)
-	 */
-	public Object performCommand(List<String> param) throws ESboxException {
-		if (!this.checkParameters(param))
-			throw new ScratchboxInvalidParameterException(
-					"Invalid number of parameters");
-
-		String targetName = param.get(0);
-		String compilerName = param.get(1);
-		String devkitsNames = param.get(2);
-		String cputranspName = param.get(3);
-
-		String setupTargetAction = commandAbstractor.getPreferenceValue(
-				SB1PreferenceConstants.SB1_SETUP_ACT);
-
-		String[] setupActionOptionsReplaced = this.replaceActions(targetName,
-				compilerName, devkitsNames, cputranspName);
-		String setupTargetCommand = this.replaceScratchboxConfigCommand(
-				setupTargetAction, setupActionOptionsReplaced);
-
-		Process process = createProcess(setupTargetCommand, null);
-
-		getInputFromProcessAndWait(process, false, 0);
-
-		sdk.refresh();
-		
-		return true;
-	}
-
-	/**
-	 * Replace the options of action SETUP. The options of SETUP action are
-	 * different from the other ones, so this method replaces the variables
-	 * properly.
-	 * 
-	 * @param targetName
-	 *            the name of the target.
-	 * 
-	 * @param compiler
-	 *            the compiler name of the target.
-	 * @param devkits
-	 *            the devkits of the target.
-	 * @param cputransp
-	 *            the cputransp method of the target.
-	 * @return an array of String with the options already modified with the
-	 *         options.
-	 */
-	protected String[] replaceActions(String targetName, String compiler,
-			String devkits, String cputransp) {
-		String[] setupActions = new String[4];
-		setupActions[0] = targetName;
-		setupActions[1] = commandAbstractor.getPreferenceValue(
-				SB1PreferenceConstants.SB1_SETUP_OPT_COMPILER);
-		setupActions[2] = commandAbstractor.getPreferenceValue(
-				SB1PreferenceConstants.SB1_SETUP_OPT_DEVKITS);
-		setupActions[3] = commandAbstractor.getPreferenceValue(
-				SB1PreferenceConstants.SB1_SETUP_OPT_CPUTRANSP);
-
-		setupActions[1] = setupActions[1].replaceAll("\\$\\{COMPILER\\}",
-				compiler);
-		setupActions[2] = setupActions[2].replaceAll("\\$\\{LIST\\}", devkits);
-		setupActions[3] = setupActions[3].replaceAll("\\$\\{METHOD\\}",
-				cputransp);
-
-		return setupActions;
-	}
-
-	@Override
-	public int getParametersSize() {
-		return 4;
-	}
-
-}

Deleted: trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/CreateTargetSb2Command.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/CreateTargetSb2Command.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/CreateTargetSb2Command.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -1,100 +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.maemo.esbox.core.*;
-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 java.util.List;
-
-/**
- * Creates a new target, if it does not exist.
- * This command wraps the callback to service:
- * <p>
- * sb2-init {flags} [targetname] [compiler]  
- * 
- */
-public class CreateTargetSb2Command extends ScratchboxCommand {
-
-	
-	private ISDK sdk;
-
-	public CreateTargetSb2Command(ISDK sdk, ICommandAbstractor commandAbstractor) {
-		super(commandAbstractor, 2);
-		this.sdk = sdk;
-	}
-
-	@Override
-	protected boolean checkParameters(List<String> param) {
-		return param.size() >= 3;
-	}
-	
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see embedded.core.scratchbox.command.IScratchboxCommand#performCommand(java.lang.Object)
-	 */
-	public Object performCommand(List<String> param) throws ESboxException {
-		if (!this.checkParameters(param))
-			throw new ScratchboxInvalidParameterException(
-					"Invalid number of parameters");
-
-		String targetName = param.get(0);
-		String compilerName = param.get(1);
-		String cpuTransp = param.get(2);
-		
-		// remaining arguments are flags
-		String pattern = commandAbstractor.getPreferenceValue(SB2PreferenceConstants.SB2_INIT_COMMAND);
-		
-		ShellTemplateSubstitutor substitutor = new ShellTemplateSubstitutor();
-		substitutor.define("TARGET", targetName);
-		substitutor.define("COMPILER", compilerName);
-
-		String options = "";
-		if (cpuTransp != null && cpuTransp.length() > 0) {
-			options += "-c " + cpuTransp;
-		}
-		substitutor.define("OPTIONS", options);
-
-		pattern = substitutor.substitute(pattern);
-		
-		List<String> cmdLine = CommandLineArguments.createFromCommandLine(pattern);
-		
-		IProcessLauncher processLauncher = ProcessLauncherCreator.createProcessLauncher(
-				commandAbstractor.getProcessLauncherFactory(), 
-				null,
-				cmdLine);
-
-		Process process = processLauncher.createProcess();
-		
-		processLauncher.redirectToConsole(true, null, "Installing scratchbox2 target " + targetName);
-
-		try {
-			process.waitFor();
-		} catch (InterruptedException e) {
-			Activator.getErrorLogger().logError("Target installation aborted", e);
-		}
-		
-		sdk.refresh();
-		
-		return true;
-	}
-
-	@Override
-	public int getParametersSize() {
-		return 3;
-	}
-
-}

Deleted: trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/GetCurrentTargetCommand.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/GetCurrentTargetCommand.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/GetCurrentTargetCommand.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -1,65 +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.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.scratchbox.ScratchboxException;
-import org.maemo.esbox.maemosdk.core.sdk.IScratchboxSDK;
-
-import java.util.List;
-
-/**
- * Get the current Scratchbox 1 target.
- * This command wraps the callback to service sb-conf current 
- */
-public class GetCurrentTargetCommand extends ScratchboxCommand {
-
-	private final IScratchboxSDK sdk;
-
-	public GetCurrentTargetCommand(ICommandAbstractor commandAbstractor, IScratchboxSDK sdk) {
-		super(commandAbstractor, 1);
-		this.sdk = sdk;
-	}
-
-	/*
-	 * (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");
-
-		if (sdk.getCachedCurrentTarget() != null)
-			return sdk.getCachedCurrentTarget();
-		
-		String currentTargetAction = commandAbstractor.getPreferenceValue(SB1PreferenceConstants.SB1_CURRENT_ACT);
-		String currentTargetCommand = this
-				.replaceScratchboxConfigCommand(currentTargetAction);
-
-		Process process = createProcess(currentTargetCommand, null);
-
-		String currentTarget = getInputFromProcessAndWait(process, true, 0);
-
-		sdk.setCachedCurrentTarget(currentTarget);
-		return currentTarget;
-	}
-
-	@Override
-	public int getParametersSize() {
-		return 0;
-	}
-
-}

Deleted: trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/GetCurrentTargetSb2Command.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/GetCurrentTargetSb2Command.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/GetCurrentTargetSb2Command.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -1,81 +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.command.scratchbox;
-
-import org.eclipse.core.filesystem.EFS;
-import org.eclipse.core.filesystem.IFileStore;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.Path;
-import org.maemo.esbox.core.*;
-import org.maemo.esbox.internal.maemosdk.core.command.ICommandAbstractor;
-import org.maemo.esbox.maemosdk.core.scratchbox.ScratchboxException;
-
-import java.io.*;
-import java.util.List;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-/**
- * Get the current Scratchgox 2 target.
- * There is no command to do this, so read $HOME/.scratchbox2/config
- */
-public class GetCurrentTargetSb2Command extends ScratchboxCommand {
-
-	public GetCurrentTargetSb2Command(ICommandAbstractor commandAbstractor) {
-		super(commandAbstractor, 2);
-	}
-
-	/*
-	 * (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");
-
-		IFileStore config = commandAbstractor.getFileSystemAccess().getFileStore(
-				new Path("home").append(commandAbstractor.getPreferenceValue(CorePreferenceConstants.USER))
-				.append(".scratchbox2")
-				.append("config"));
-
-		InputStream is = null;
-		try {
-			is = config.openInputStream(EFS.NONE, null);
-			BufferedReader reader = new BufferedReader(new InputStreamReader(is));
-			Pattern varPattern = Pattern.compile("\\s*DEFAULT_TARGET\\s*=\\s*(\\S+)\\s*");
-			String line;
-			while ((line = reader.readLine()) != null) {
-				Matcher matcher = varPattern.matcher(line.trim());
-				if (matcher.matches()) {
-					return matcher.group(1);
-				}
-			}
-			
-			return null;
-		} catch (IOException e) {
-			throw new ScratchboxException("Cannot read target from " + config + ": " + e.getMessage());
-		} catch (CoreException e) {
-			throw new ScratchboxException("Cannot read target from " + config + ": " + e.getMessage());
-		} finally {
-			Policy.close(is);
-		}
-
-	}
-
-	@Override
-	public int getParametersSize() {
-		return 0;
-	}
-
-}

Deleted: trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/GetGdbQemuCommandPatternCommand.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/GetGdbQemuCommandPatternCommand.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/GetGdbQemuCommandPatternCommand.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -1,137 +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.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 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: trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/GetMaemoRootstrapLocationCommand.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/GetMaemoRootstrapLocationCommand.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/GetMaemoRootstrapLocationCommand.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -1,81 +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.internal.maemosdk.core.command.ICommandAbstractor;
-import org.maemo.esbox.maemosdk.core.SB2PreferenceConstants;
-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);
-	}
-
-}

Deleted: trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/GetVersionScratchboxCommand.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/GetVersionScratchboxCommand.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/GetVersionScratchboxCommand.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -1,72 +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.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.scratchbox.ScratchboxException;
-
-import java.util.List;
-
-/**
- * Get the version of Scratchbox installed.
- * This command wraps the callback to service sb-conf version.
- * 
- */
-public class GetVersionScratchboxCommand extends ScratchboxCommand {
-
-	public GetVersionScratchboxCommand(ICommandAbstractor commandAbstractor, int version) {
-		super(commandAbstractor, version);
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see embedded.core.scratchbox.command.ScratchboxCommand#getParametersSize()
-	 */
-	public int getParametersSize() {
-		// TODO Auto-generated method stub
-		return 0;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see embedded.core.scratchbox.command.IScratchboxCommand#performCommand(java.util.List)
-	 */	
-	public String performCommand(List<String> params)
-			throws ScratchboxException, ESboxException {
-		if (!this.checkParameters(params))
-			throw new ScratchboxInvalidParameterException(
-					"Invalid number of parameters");
-
-		String sboxVersionAction;
-		if (sboxVersion == 1)
-			sboxVersionAction = commandAbstractor.getPreferenceValue(
-				SB1PreferenceConstants.SB1_VERSION_ACT);
-		else
-			sboxVersionAction = commandAbstractor.getPreferenceValue(
-					SB2PreferenceConstants.SB2_VERSION_ACT);
-			
-		String currentSboxVersionCommand = this
-				.replaceScratchboxConfigCommand(sboxVersionAction);
-
-		Process process = createProcess(currentSboxVersionCommand, null);
-
-		String currentVersion = getInputFromProcessAndWait(process, false, 0);
-
-		return currentVersion;
-	}
-
-}

Deleted: trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/KillallCommand.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/KillallCommand.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/KillallCommand.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -1,90 +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.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.scratchbox.ScratchboxException;
-
-import java.util.List;
-
-/**
- * Kill all Scratchbox sessions.
- * This command wraps the callback to service sb-conf killall [-signal=<SIGNAL>]
- * 
- */
-public class KillallCommand extends ScratchboxCommand {
-
-	public KillallCommand(ICommandAbstractor commandAbstractor) {
-		super(commandAbstractor, 1);
-	}
-
-	/*
-	 * (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 signalValue = "";
-		if (param.size() > 0)
-			signalValue = param.get(0);
-
-		String killallAction = commandAbstractor.getPreferenceValue(
-				SB1PreferenceConstants.SB1_KILLALL_ACT);
-		String signalOption = this.replaceSignal(signalValue);
-		String killallCommand = this.replaceScratchboxConfigCommand(
-				killallAction, new String[] { signalOption });
-		
-		Process process = createProcess(killallCommand, null);
-
-		getInputFromProcessAndWait(process, false, 0);
-
-		return true;
-	}
-
-	/**
-	 * Replace the value of SIGNAL option of killall action.
-	 * 
-	 * @param signalValue
-	 *            the value of the signal to be replaced.
-	 * @return the signal option of killall action replaced with the given
-	 *         signal value.
-	 */
-	private String replaceSignal(String signalValue) {
-		if (signalValue.equals(""))
-			return "";
-		String killallSignalOption = commandAbstractor.getPreferenceValue(
-				SB1PreferenceConstants.SB1_KILLALL_OPT_SIGNAL);
-
-		String signalReplaced = killallSignalOption.replaceAll(
-				"\\$\\{SIGNAL\\}", signalValue);
-
-		return signalReplaced;
-	}
-
-	@Override
-	public int getParametersSize() {
-		return 1;
-	}
-	
-	@Override
-	protected boolean checkParameters(List<String> param) {
-		// TODO Auto-generated method stub
-		return getParametersSize() <= 1;
-	}
-
-}

Deleted: trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/ListAvailableMaemoRootstrapsSb2Command.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/ListAvailableMaemoRootstrapsSb2Command.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/ListAvailableMaemoRootstrapsSb2Command.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -1,90 +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.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.scratchbox.MaemoRootstrap;
-import org.maemo.esbox.maemosdk.core.scratchbox.ScratchboxException;
-
-import java.util.*;
-
-/**
- * List the maemo rootstraps available for installation.
- */
-public class ListAvailableMaemoRootstrapsSb2Command extends MaemoRootstrapSb2Command {
-
-	private static final int LIST_TIMEOUT = 10000;
-
-	public ListAvailableMaemoRootstrapsSb2Command(ICommandAbstractor commandAbstractor) {
-		super(commandAbstractor);
-	}
-
-	@Override
-	protected boolean checkParameters(List<String> param) {
-		return param.size() == 0;
-	}
-	
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see embedded.core.scratchbox.command.IScratchboxCommand#performCommand(java.lang.Object)
-	 */	
-	public List<MaemoRootstrap> performCommand(List<String> param)
-			throws ScratchboxException, ESboxException {
-		if (!this.checkParameters(param))
-			throw new ScratchboxInvalidParameterException(
-					"Invalid number of parameters");
-		
-		String availableAction = commandAbstractor.getPreferenceValue(
-				SB2PreferenceConstants.SB2_MAEMO_ROOTSTRAP_AVAILABLE_ACT);
-		
-		// ensure the proxy is established
-		IEnvironmentModifierBlock proxyEnvBlock = commandAbstractor.getProcessLauncherFactory().defaultEnvironmentModifierBlock();
-		ProcessLauncherUtils.defineProxyVariables(proxyEnvBlock);
-		
-		List<String> available = doPerformCommand(
-				Collections.singletonList(availableAction), proxyEnvBlock, LIST_TIMEOUT);
-
-		// this output has a few header lines
-		List<MaemoRootstrap> targetsAvailable = new ArrayList<MaemoRootstrap>();
-		
-		boolean gotHeader = false;
-		for (String line : available) {
-			if (line.contains("Nickname,")) {
-				gotHeader = true;
-				continue;
-			}
-			if (line.trim().length() == 0) {
-				continue;
-			}
-			if (!gotHeader) {
-				continue;
-			}
-			
-			String[] tokens = line.split(",\\s*");
-			if (tokens.length == 3) {
-				targetsAvailable.add(new MaemoRootstrap(tokens[0], tokens[1], tokens[2]));
-			}
-				
-		}
-		return targetsAvailable;
-	}
-
-	@Override
-	public int getParametersSize() {
-		return 0;
-	}
-
-}

Deleted: trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/ListCompilersCommand.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/ListCompilersCommand.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/ListCompilersCommand.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -1,62 +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.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.scratchbox.ScratchboxException;
-
-import java.util.List;
-
-/**
- * List the installed compilers.
- * This command wraps the callback to service sb-conf list --compilers
- * 
- */
-public class ListCompilersCommand extends ScratchboxCommand {
-
-	public ListCompilersCommand(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 compilersOptions = commandAbstractor.getPreferenceValue(
-				SB1PreferenceConstants.SB1_LIST_OPT_COMPILERS);
-		String listCompilersCommand = this.replaceScratchboxConfigCommand(
-				listAction, new String[] { compilersOptions });
-		
-		Process process = createProcess(listCompilersCommand, null);
-
-		List<String> compilersAvailable = getLineInputFromProcessAndWait(process, true, 0);
-
-		return compilersAvailable;
-	}
-
-	@Override
-	public int getParametersSize() {
-		return 0;
-	}
-
-}

Deleted: trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/ListCompilersSb2Command.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/ListCompilersSb2Command.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/ListCompilersSb2Command.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -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.command.scratchbox;
-
-import org.eclipse.core.filesystem.EFS;
-import org.eclipse.core.filesystem.IFileStore;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.Path;
-import org.maemo.esbox.core.ESboxException;
-import org.maemo.esbox.internal.maemosdk.core.Activator;
-import org.maemo.esbox.internal.maemosdk.core.command.ICommandAbstractor;
-import org.maemo.esbox.maemosdk.core.scratchbox.ScratchboxException;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * List the installed compilers.
- * There's no known command for this, but we can look in specific places.
- * 
- */
-public class ListCompilersSb2Command extends ScratchboxCommand {
-
-	public ListCompilersSb2Command(ICommandAbstractor commandAbstractor) {
-		super(commandAbstractor, 2);
-	}
-
-	/*
-	 * (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");
-
-		List<String> compilersAvailable = new ArrayList<String>();
-		
-		try {
-			IFileStore baseToolDir = commandAbstractor.getFileSystemAccess().getFileStore(new Path("/opt/maemo/tools"));
-			IFileStore[] kids = baseToolDir.childStores(EFS.NONE, null);
-			for (IFileStore baseDir : kids) {
-				IFileStore dir = baseDir.getChild("bin"); 
-				if (dir.fetchInfo().isDirectory()) {
-					IFileStore[] files = dir.childStores(EFS.NONE, null);
-					for (IFileStore file : files) {
-						if (file.getName().endsWith("-gcc")) {
-							compilersAvailable.add(file.toURI().getPath());
-							break;
-						}
-					}
-				}
-			}
-		} catch (CoreException e) {
-			Activator.getErrorLogger().logError("Error scanning compilers", e);
-		}
-		return compilersAvailable;
-	}
-
-	@Override
-	public int getParametersSize() {
-		return 0;
-	}
-
-}

Deleted: trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/ListCputranspCommand.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/ListCputranspCommand.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/ListCputranspCommand.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -1,63 +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.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.scratchbox.ScratchboxException;
-
-import java.util.List;
-
-/**
- * List the installed cpu-transparency.
- * This command wraps the callback to service sb-conf list --cputransps
- * 
- */
-public class ListCputranspCommand extends ScratchboxCommand {
-
-	public ListCputranspCommand(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 cputranpOption = commandAbstractor.getPreferenceValue(
-				SB1PreferenceConstants.SB1_LIST_OPT_CPU);
-		String listCputranspsCommandString = this
-				.replaceScratchboxConfigCommand(listAction,
-						new String[] { cputranpOption });
-
-		Process process = createProcess(listCputranspsCommandString, null);
-
-		List<String> cputranspsAvailable = getLineInputFromProcessAndWait(process, true, 0);
-
-		return cputranspsAvailable;
-	}
-
-	@Override
-	public int getParametersSize() {
-		return 0;
-	}
-
-}

Deleted: trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/ListCputranspSb2Command.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/ListCputranspSb2Command.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/ListCputranspSb2Command.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -1,76 +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.Path;
-import org.maemo.esbox.core.ESboxException;
-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.*;
-
-/**
- * List the installed compilers.
- * There's no known command for this, but we can look in specific places.
- * 
- */
-public class ListCputranspSb2Command extends ScratchboxCommand {
-
-	public ListCputranspSb2Command(ICommandAbstractor commandAbstractor) {
-		super(commandAbstractor, 2);
-	}
-
-	/*
-	 * (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");
-
-		List<String> cputranspAvailable = new ArrayList<String>();
-		
-		Set<String> expected = new HashSet<String>();
-		expected.add("sb2-qemu-arm");
-		expected.add("sbrsh");
-		
-		Properties env = ProcessLauncherUtils.getSynthesizedEnvironment(commandAbstractor.getProcessLauncherFactory());
-		String pathenv = env.getProperty("PATH");
-		if (pathenv == null) {
-			pathenv = "/usr/bin:/bin";	// XXX
-		}
-		if (pathenv != null) {
-			String[] paths = pathenv.split(":");
-			for (String exp : expected) {
-				for (String path : paths) {
-					IFileStore bin = commandAbstractor.getFileSystemAccess().getFileStore(new Path(path).append(exp));
-					if (bin.fetchInfo().exists()) {
-						cputranspAvailable.add(bin.toURI().getPath());
-						break;
-					}
-				}
-			}
-		}
-
-		return cputranspAvailable;
-	}
-
-	@Override
-	public int getParametersSize() {
-		return 0;
-	}
-
-}

Deleted: trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/ListDevkitsCommand.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/ListDevkitsCommand.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/ListDevkitsCommand.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -1,62 +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.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.scratchbox.ScratchboxException;
-
-import java.util.List;
-
-/**
- * List the installed devkits.
- * This command wraps the callback to service sb-conf list --devkits
- * 
- */
-public class ListDevkitsCommand extends ScratchboxCommand {
-
-	public ListDevkitsCommand(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 devkitsOption = commandAbstractor.getPreferenceValue(
-				SB1PreferenceConstants.SB1_LIST_OPT_DEVKITS);
-		String listDevkitsCommandString = this.replaceScratchboxConfigCommand(
-				listAction, new String[] { devkitsOption });
-
-		Process process = createProcess(listDevkitsCommandString, null);
-
-		List<String> devkitsAvailable = getLineInputFromProcessAndWait(process, true, 0);
-
-		return devkitsAvailable;
-	}
-
-	@Override
-	public int getParametersSize() {
-		return 0;
-	}
-
-}

Deleted: trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/ListInstalledMaemoRootstrapsSb2Command.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/ListInstalledMaemoRootstrapsSb2Command.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/ListInstalledMaemoRootstrapsSb2Command.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -1,60 +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.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.scratchbox.ScratchboxException;
-
-import java.util.Collections;
-import java.util.List;
-
-/**
- * List the maemo rootstraps installed
- */
-public class ListInstalledMaemoRootstrapsSb2Command extends MaemoRootstrapSb2Command {
-
-	public ListInstalledMaemoRootstrapsSb2Command(ICommandAbstractor commandAbstractor) {
-		super(commandAbstractor);
-	}
-
-	@Override
-	protected boolean checkParameters(List<String> param) {
-		return param.size() == 0;
-	}
-	
-	/*
-	 * (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 availableAction = commandAbstractor.getPreferenceValue(
-				SB2PreferenceConstants.SB2_MAEMO_ROOTSTRAP_LIST_ACT);
-		
-		List<String> installed = doPerformCommand(
-				Collections.singletonList(availableAction), null, 0);
-		
-		return installed;
-	}
-
-	@Override
-	public int getParametersSize() {
-		return 0;
-	}
-
-}

Deleted: trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/ListSessionsCommand.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/ListSessionsCommand.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/ListSessionsCommand.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -1,79 +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.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.scratchbox.ScratchboxException;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * 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;
-	}
-
-}

Deleted: trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/ListTargetsCommand.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/ListTargetsCommand.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/ListTargetsCommand.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -1,72 +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.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.scratchbox.ScratchboxException;
-
-import java.util.List;
-
-/**
- * List the installed targets.
- * This command wraps the callback to service (sb1) sb-conf list --targets
- * or sb2-config -l (sb2)
- * 
- */
-public class ListTargetsCommand extends ScratchboxCommand {
-
-	public ListTargetsCommand(ICommandAbstractor commandAbstractor, int sboxVersion) {
-		super(commandAbstractor, sboxVersion);
-	}
-
-	/*
-	 * (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;
-		String targetsOption;
-		if (sboxVersion == 1) {
-			listAction = commandAbstractor.getPreferenceValue(
-					SB1PreferenceConstants.SB1_LIST_ACT);
-			targetsOption = commandAbstractor.getPreferenceValue(
-					SB1PreferenceConstants.SB1_LIST_OPT_TARGETS);
-		} else {
-			listAction = commandAbstractor.getPreferenceValue(
-					SB2PreferenceConstants.SB2_LIST_ACT);
-			targetsOption = "";
-		}
-		String listTargetsCommandString = this.replaceScratchboxConfigCommand(
-				listAction, new String[] { targetsOption });
-
-		Process process = createProcess(listTargetsCommandString, null);
-
-		List<String> targetsAvailable = getLineInputFromProcessAndWait(process, true, 0);
-
-		return targetsAvailable;
-	}
-
-	@Override
-	public int getParametersSize() {
-		return 0;
-	}
-
-}

Modified: trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/MaemoCommand.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/MaemoCommand.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/MaemoCommand.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -18,10 +18,11 @@
 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.internal.api.core.commands.ICommandAbstractor;
+import org.maemo.esbox.internal.maemosdk.core.*;
 import org.maemo.esbox.maemosdk.core.MaemoPreferenceConstants;
+import org.maemo.esbox.maemosdk.core.command.ScratchboxCommand;
+import org.maemo.esbox.maemosdk.core.command.ScratchboxInvalidParameterException;
 import org.maemo.esbox.maemosdk.core.scratchbox.ScratchboxException;
 
 import java.util.*;
@@ -33,31 +34,33 @@
 
 	private ISDKTarget sdkTarget;
 
-	public MaemoCommand(ICommandAbstractor commandAbstractor, ISDKTarget sdkTarget) {
-		super(commandAbstractor, 1);
+	public MaemoCommand(ICommandAbstractor commandAbstractor,
+			ISDKTarget sdkTarget) {
+		super(commandAbstractor);
 		this.sdkTarget = sdkTarget;
 	}
 
 	/*
 	 * (non-Javadoc)
 	 * 
-	 * @see org.maemo.esbox.internal.core.command.scratchbox.ScratchboxCommand#getParametersSize()
+	 * @seeorg.maemo.esbox.internal.core.command.scratchbox.ScratchboxCommand#
+	 * getParametersSize()
 	 */
 	@Override
 	public int getParametersSize() {
 		return 1;
 	}
-	
 	/*
 	 * (non-Javadoc)
 	 * 
-	 * @see org.maemo.esbox.internal.core.command.ICommand#performCommand(java.util.List)
+	 * @see
+	 * org.maemo.esbox.internal.core.command.ICommand#performCommand(java.util
+	 * .List)
 	 */
 	public Object performCommand(List<String> params) throws ESboxException {
 		if (!this.checkParameters(params))
 			throw new ScratchboxInvalidParameterException(
 					"Invalid number of parameters");
-		
 		String maemoCommand = commandAbstractor.getPreferenceValue(
 				MaemoPreferenceConstants.MAEMO_COMMAND);
 		maemoCommand = this.replaceActions(maemoCommand,params.get(0));
@@ -71,11 +74,11 @@
 				Collections.singletonList(maemoCommand), envBlock);
 
 		Process process = processLauncher.createProcess();
-		
+
 		// spit the consumed output to the console
-		MessageConsole console = CorePlugin.getDefault().getConsole(
-				true, sdkTarget, "Running Maemo command (" + params.get(0) + ")");
-		
+		MessageConsole console = CorePlugin.getDefault().getConsole(true,
+				sdkTarget, "Running Maemo command (" + params.get(0) + ")");
+
 		console.addPatternMatchListener(new IPatternMatchListener() {
 
 			public int getCompilerFlags() {
@@ -97,30 +100,31 @@
 			}
 
 			public void matchFound(PatternMatchEvent event) {
-				TextConsole console = (TextConsole)event.getSource();
+				TextConsole console = (TextConsole) event.getSource();
 				String content;
 				try {
-					content = console.getDocument().get(event.getOffset(), event.getLength());
+					content = console.getDocument().get(event.getOffset(),
+							event.getLength());
 				} catch (BadLocationException e) {
 					content = console.getDocument().get();
 				}
 				ErrorLogger errorLogger = Activator.getErrorLogger();
-				errorLogger.logAndShowError("Error launching maemo", 
+				errorLogger.logAndShowError("Error launching maemo",
 						new ESboxException(content));
 			}
-			
+
 		});
-		
+
 		// emit everything else to the console
 		processLauncher.redirectToConsole(console);
-		
+
 		// wait for it to finish
 		try {
 			process.waitFor();
 		} catch (InterruptedException e) {
-			
+
 		}
-		
+
 		return true;
 	}
 
@@ -128,9 +132,9 @@
 		if (sdkTarget == null) {
 			throw new ScratchboxException("No SDK target specified");
 		}
-		
+
 		List<String> params = getParamList(MaemoPreferenceConstants.MAEMO_START_ACTION);
-				
+
 		Object result = performCommand(params);
 		return result;
 	}
@@ -139,19 +143,20 @@
 		if (sdkTarget == null) {
 			throw new ScratchboxException("No SDK target specified");
 		}
-		
+
 		List<String> params = getParamList(MaemoPreferenceConstants.MAEMO_STOP_ACTION);
-		
+
 		Object result = performCommand(params);
-		
+
 		return result;
 	}
 
-	public Object restartMaemoCommand(ISDKTarget sdkTarget) throws ESboxException {
+	public Object restartMaemoCommand(ISDKTarget sdkTarget)
+			throws ESboxException {
 		if (sdkTarget == null) {
 			throw new ScratchboxException("No SDK target specified");
 		}
-		
+
 		List<String> params = getParamList(MaemoPreferenceConstants.MAEMO_RESTART_ACTION);
 		return performCommand(params);
 	}
@@ -161,7 +166,7 @@
 		params.add(commandAbstractor.getPreferenceValue(key));
 		return params;
 	}
-	
+
 	private String replaceActions(String command, String action) {
 		return command.replaceAll("\\$\\{ACTIONS\\}", action);
 	}

Deleted: trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/MaemoRootstrapSb2Command.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/MaemoRootstrapSb2Command.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/MaemoRootstrapSb2Command.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -1,83 +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.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.scratchbox.ScratchboxException;
-
-import java.util.*;
-
-/**
- * Base class for maemo rootstrap command.  
- */
-public abstract class MaemoRootstrapSb2Command extends ScratchboxCommand {
-
-	public MaemoRootstrapSb2Command(ICommandAbstractor commandAbstractor) {
-		super(commandAbstractor, 2);
-	}
-
-	@Override
-	protected boolean checkParameters(List<String> param) {
-		return true;
-	}
-	
-	/** 
-	 * Override if stderr output is allowed.
-	 * @return false
-	 */
-	protected boolean allowErrors() {
-		return false;
-		
-	}
-	
-	/**
-	 * 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 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, IEnvironmentModifierBlock envBlock, long timeout)
-			throws ESboxException {
-		String rootstrapCommand = commandAbstractor.getPreferenceValue(
-					SB2PreferenceConstants.SB2_MAEMO_ROOTSTRAP_COMMAND);
-
-		String options = CommandLineArguments.toCommandLine(params);
-			
-		ShellTemplateSubstitutor substitutor = new ShellTemplateSubstitutor();
-		substitutor.define("OPTIONS", options);
-		
-		rootstrapCommand = substitutor.substitute(rootstrapCommand);
-		
-		if (console == null) {
-			Process process = createProcess(rootstrapCommand, envBlock);
-			List<String> results = getLineInputFromProcessAndWait(process, allowErrors(), timeout);
-			return results;
-		} else {
-			runAndWaitForProcess("Running " + rootstrapCommand, rootstrapCommand, envBlock, timeout);
-			return Collections.EMPTY_LIST;
-		}
-	}
-
-	@Override
-	public int getParametersSize() {
-		return 0;
-	}
-
-}

Deleted: trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/RemoveMaemoRootstrapSb2Command.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/RemoveMaemoRootstrapSb2Command.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/RemoveMaemoRootstrapSb2Command.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -1,85 +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.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.scratchbox.ScratchboxException;
-
-import java.util.*;
-
-/**
- * Remove a maemo rootstrap.  Parameters are target name and force boolean flag.
- */
-public class RemoveMaemoRootstrapSb2Command extends MaemoRootstrapSb2Command {
-
-	private final IProgressMonitor monitor;
-
-	public RemoveMaemoRootstrapSb2Command(ICommandAbstractor commandAbstractor, IProgressMonitor monitor) {
-		super(commandAbstractor);
-		this.monitor = monitor;
-	}
-
-	@Override
-	protected boolean checkParameters(List<String> param) {
-		return param.size() == 2;
-	}
-	
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see embedded.core.scratchbox.command.IScratchboxCommand#performCommand(java.lang.Object)
-	 */	
-	public Boolean performCommand(List<String> param)
-			throws ScratchboxException, ESboxException {
-		if (!this.checkParameters(param))
-			throw new ScratchboxInvalidParameterException(
-					"Invalid number of parameters");
-		
-		String targetName = param.get(0);
-		String forceFlag = param.get(1);
-		
-		String action = commandAbstractor.getPreferenceValue(
-				SB2PreferenceConstants.SB2_MAEMO_ROOTSTRAP_REMOVE_ACT);
-		
-		List<String> commands = new ArrayList<String>();
-		
-		if (forceFlag.equals(Boolean.TRUE.toString())) {
-			String force = commandAbstractor.getPreferenceValue(
-					SB2PreferenceConstants.SB2_MAEMO_ROOTSTRAP_FORCE_OPT);
-			commands.add(force);
-		}
-		commands.add(action);
-		commands.add(targetName);
-		
-		IEnvironmentModifierBlock envBlock = commandAbstractor.getProcessLauncherFactory().defaultEnvironmentModifierBlock();
-		ProcessLauncherUtils.defineProxyVariables(envBlock);
-		
-		setMonitorAndConsole(
-				monitor,
-				CorePlugin.getDefault().getConsole(true, null, "Removing rootstrap " + targetName));
-
-		doPerformCommand(commands, envBlock, 0);
-		
-		return Boolean.TRUE;
-	}
-
-	@Override
-	public int getParametersSize() {
-		return 0;
-	}
-
-}

Deleted: trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/RemoveTargetCommand.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/RemoveTargetCommand.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/RemoveTargetCommand.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -1,90 +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.command.scratchbox;
-
-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.scratchbox.ScratchboxException;
-
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * Remove a Scratchbox target.
- * This command wraps the callback to service sb-conf remove [<TARGET>]
- * 
- */
-public class RemoveTargetCommand extends ScratchboxCommand {
-
-	private ISDK sdk;
-
-	public RemoveTargetCommand(ISDK sdk, ICommandAbstractor commandAbstractor) {
-		super(commandAbstractor, 1);
-		this.sdk = 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.");
-
-		String removeTargetAction = commandAbstractor.getPreferenceValue(
-				SB1PreferenceConstants.SB1_REMOVE_ACT);
-		String forceRemoveTargetOption = commandAbstractor.getPreferenceValue(
-				SB1PreferenceConstants.SB1_REMOVE_OPT_FORCE);
-		String removeTargetCommand = this.replaceScratchboxConfigCommand(
-				removeTargetAction, new String[] { targetToRemove,
-						forceRemoveTargetOption });
-
-		Process process = createProcess(removeTargetCommand, null);
-
-		getInputFromProcessAndWait(process, true, 0);
-
-		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;
-	}
-
-}

Deleted: trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/RemoveTargetSb2Command.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/RemoveTargetSb2Command.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/RemoveTargetSb2Command.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -1,95 +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.internal.maemosdk.core.command.ICommandAbstractor;
-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;
-	}
-
-}

Deleted: trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/ResetTargetCommand.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/ResetTargetCommand.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/ResetTargetCommand.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -1,60 +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.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.scratchbox.ScratchboxException;
-
-import java.util.List;
-
-/**
- * Reset a Scratchbox target.
- * This command wraps the callback to service sb-conf reset [<TARGET>]
- * 
- */
-public class ResetTargetCommand extends ScratchboxCommand {
-
-	public ResetTargetCommand(ICommandAbstractor commandAbstractor) {
-		super(commandAbstractor, 1);
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see embedded.core.scratchbox.command.IScratchboxCommand#performCommand(java.util.List)
-	 */	
-	public Object performCommand(List<String> params)
-			throws ScratchboxException, ESboxException {
-		if (!this.checkParameters(params))
-			throw new ScratchboxInvalidParameterException(
-					"Invalid number of parameters");
-
-		String resetTargetAction = commandAbstractor.getPreferenceValue(
-				SB1PreferenceConstants.SB1_RESET_ACT);
-		String resetTargetCommand = this.replaceScratchboxConfigCommand(
-				resetTargetAction, new String[] {});
-
-		Process process = createProcess(resetTargetCommand, null);
-
-		getInputFromProcessAndWait(process, false, 0);
-
-		return true;
-	}
-
-	@Override
-	public int getParametersSize() {
-		return 0;
-	}
-
-}

Deleted: trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/RootstrapCommand.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/RootstrapCommand.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/RootstrapCommand.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -1,59 +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.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.scratchbox.ScratchboxException;
-
-import java.util.List;
-
-/** 
- * This command wraps the callback to service sb-conf rootstrap [<TARGET>] <FILE>|<URL>  
- */
-public class RootstrapCommand extends ScratchboxCommand {
-
-	public RootstrapCommand(ICommandAbstractor commandAbstractor) {
-		super(commandAbstractor, 1);
-	}
-
-	/*
-	 * (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 fileOrURL = param.get(0);
-
-		String rootstrapAction = commandAbstractor.getPreferenceValue(
-				SB1PreferenceConstants.SB1_ROOTSTRAP_ACT);
-		String rootstrapCommand = this.replaceScratchboxConfigCommand(
-				rootstrapAction, new String[] { fileOrURL });
-
-		Process process = createProcess(rootstrapCommand, null);
-
-		getInputFromProcessAndWait(process, false, 0);
-
-		return true;
-	}
-
-	@Override
-	public int getParametersSize() {
-		return 1;
-	}
-
-}

Deleted: trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/ScratchboxCommand.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/ScratchboxCommand.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/ScratchboxCommand.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -1,578 +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.command.scratchbox;
-
-import org.eclipse.core.runtime.*;
-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;
-import org.maemo.esbox.internal.maemosdk.core.command.ICommandAbstractor;
-import org.maemo.esbox.maemosdk.core.*;
-import org.maemo.esbox.maemosdk.core.scratchbox.ScratchboxException;
-
-import java.io.*;
-import java.security.InvalidParameterException;
-import java.util.*;
-
-/**
- * Implements some common methods for Scratchbox commands.
- * <p>
- * <b>NOTE:</b> this base class should only be used for basic scratchbox utility
- * command launching. It is not recommended to use this class's
- * string-substitution method to create general command lines, since this
- * ignores details like shell escaping and quoting, which should be
- * constructed with the List<String> class and alternate IProcessLauncherFactory
- * methods.
- */
-public abstract class ScratchboxCommand implements ICommand {
-
-	/**
-	 * 
-	 */
-	private static final IStatus CANCEL_STATUS = Policy.getCancelStatus(Activator.getDefault());
-
-	public static final String ERROR_TOKEN = "ERROR:"; //$NON-NLS-1$
-	
-	public static final String WARNING_TOKEN = "sb-conf:"; //$NON-NLS-1$
-
-	protected ICommandAbstractor commandAbstractor;
-
-	protected int sboxVersion;
-
-	protected MessageConsole console;
-
-	private IProgressMonitor monitor;
-	
-	public ScratchboxCommand(ICommandAbstractor commandAbstractor, int sboxVersion) {
-		this.commandAbstractor = commandAbstractor;
-		this.sboxVersion = sboxVersion;
-	}
-	
-	/**
-	 * Replace the actions and options of the Scratchbox configure command. This
-	 * is an utility method to be used by all the subclasses of
-	 * IScratchboxCommand.
-	 * 
-	 * @param sboxCommand
-	 *            The Scratchbox command.
-	 * @param action
-	 *            The action to be replace.
-	 * @return The result command with the replacement of action made.
-	 */
-	public String replaceScratchboxConfigCommand(String action) {
-		return this.replaceScratchboxConfigCommand(action, null);
-	}
-
-	/**
-	 * Replace the actions and options of the Scratchbox configure command. This
-	 * is an utility method to be used by all the subclasses of
-	 * IScratchboxCommand.
-	 * 
-	 * @param action
-	 *            The action to be replace.
-	 * @param options
-	 *            The options to be replace. If the value of options is null, it
-	 *            is supposed to not consider any option.
-	 * @return The result command with all the replacements (actions and
-	 *         options) made.
-	 * 
-	 * @throws InvalidParameterException
-	 *             if parameters action or command is null.
-	 */
-	public String replaceScratchboxConfigCommand(String action, String[] options)
-			throws InvalidParameterException {
-		String sboxCommand;
-		
-		if (sboxVersion == 1)
-			sboxCommand = commandAbstractor.getPreferenceValue(
-				SB1PreferenceConstants.SB1_SBOX_COMMAND);
-		else
-			sboxCommand = commandAbstractor.getPreferenceValue(
-					SB2PreferenceConstants.SB2_CONFIG_COMMAND);
-
-		return replaceScratchboxCommand(sboxCommand, action, options);
-	}
-
-	/**
-	 * Replace the actions and options of the sbrsh configure command.
-	 * 
-	 * @param action
-	 *            The action to be replace.
-	 * @return The result command with the replacement of action made.
-	 */
-	public String replaceScratchboxSbrshConfigCommand(String action) {
-		return this.replaceScratchboxSbrshConfigCommand(action, null);
-	}
-
-	/**
-	 * Replace the actions and options of the sbrsh configure command.
-	 * 
-	 * @param action
-	 *            The action to be replace.
-	 * @param options
-	 *            The options to be replace. If the value of options is null, it
-	 *            is supposed to not consider any option.
-	 * @return The result command with all the replacements (actions and
-	 *         options) made.
-	 * 
-	 * @throws InvalidParameterException
-	 *             if parameters action or command is null.
-	 */
-	public String replaceScratchboxSbrshConfigCommand(String action,
-			String[] options) throws InvalidParameterException {
-		String sbrshConfigCommand = commandAbstractor.getPreferenceValue(
-				MaemoPreferenceConstants.SBRSH_CONFIG_COMMAND);
-
-		return replaceScratchboxCommand(sbrshConfigCommand, action, options);
-	}
-
-	/**
-	 * Replace the actions and options of a given Scratchbox command.
-	 * 
-	 * @param command
-	 *            The command with actions and options to be replaced.
-	 * @param action
-	 *            The action to be replaced.
-	 * @param options
-	 *            The options to be replace. If the value of options is null, it
-	 *            is supposed to not consider any option.
-	 * @return The result command with all the replacements (actions and
-	 *         options) made.
-	 * @throws InvalidParameterException
-	 *             if parameters action or command is null.
-	 */
-	protected String replaceScratchboxCommand(String command, String action,
-			String[] options) throws InvalidParameterException {
-		if (command == null || action == null)
-			throw new InvalidParameterException("The parameters cannot be null");
-
-		String resultCommand;
-		String optionsToReplace = "";
-		String separator = "";
-
-		if (options != null) {
-			for (int i = 0; i < options.length; i++) {
-				optionsToReplace += separator + options[i];
-				separator = " ";
-			}
-		}
-
-		ShellTemplateSubstitutor substitutor = new ShellTemplateSubstitutor();
-		substitutor.define("ACTIONS", action);
-		substitutor.define("OPTIONS", optionsToReplace);
-
-		resultCommand = substitutor.substitute(command);
-
-		return resultCommand;
-	}
-
-	/**
-	 * For long-running process, provide a progress monitor and
-	 * the  console to which to report results of an executing command.
-	 * If not set, or set to <code>null</code>, there will be no console output.
-	 * @param monitor
-	 * @param console
-	 */
-	protected void setMonitorAndConsole(IProgressMonitor monitor, MessageConsole console) {
-		this.monitor = monitor;
-		this.console = console;
-	}
-
-
-	/**
-	 * Create a process from the given process launch handler factory and 
-	 * the given command line.
-	 * @param launcherFactory the factory for creating IProcessLauncherFactory
-	 * @param commandLine the command line string
-	 * @throws ScratchboxException failure to launch process
-	 */
-	public Process createProcess(List<String> cmdLine) throws ESboxException {
-		IProcessLauncher processLauncher = ProcessLauncherCreator.createProcessLauncher(
-				commandAbstractor.getProcessLauncherFactory(), 
-				null,
-				cmdLine);
-		Process process = processLauncher.createProcess();
-		if (console != null) {
-			new PrintStream(console.newMessageStream()).println(CommandLineArguments.toCommandLine(cmdLine));
-			processLauncher.redirectToConsole(console);
-		}
-		return process;
-	}
-
-	/**
-	 * Create a process from the given process launch handler factory and 
-	 * the given command line.
-	 * @param launcherFactory the factory for creating IProcessLauncherFactory
-	 * @param commandLine the command line string
-	 * @throws ScratchboxException failure to launch process
-	 */
-	public Process createProcess(String commandline) throws ESboxException {
-		return createProcess(commandline, null);
-	}
-
-	/**
-	 * Create a process from the given process launch handler factory and 
-	 * the given command line.
-	 * @param commandLine the command line string
-	 * @param envBlock prperties
-	 * @throws ScratchboxException failure to launch process
-	 */
-	public Process createProcess(String commandline, IEnvironmentModifierBlock envBlock) throws ESboxException {
-		List<String> cmdLine = CommandLineArguments.createFromCommandLine(commandline);
-		IProcessLauncher processLauncher = ProcessLauncherCreator.createProcessLauncher(
-				commandAbstractor.getProcessLauncherFactory(), 
-				null,
-				cmdLine,
-				envBlock);
-		Process process = processLauncher.createProcess();
-		if (console != null) {
-			new PrintStream(console.newMessageStream()).println(commandline);
-			processLauncher.redirectToConsole(console);
-		}
-		return process;
-	}
-	
-	/**
-	 * Eat the stdout and stderr results from the process and wait for it 
-	 * to finish.  Optionally check whether stderr is empty.
-	 * <p>
-	 * This is done here instead of in the commands because CDT's Spawner will
-	 * destroy the streams when #waitFor() is called, while other Process
-	 * implementations don't do this, and we don't want a dependency on the
-	 * ordering repeated in the command implementations.
-	 * @return stdout results, as a string
-	 */
-	protected String getInputFromProcessAndWait(Process process, boolean allowError) throws ScratchboxException {
-		return getInputFromProcessAndWait(process, allowError, 0);
-	}
-
-	protected IStatus runAndWaitForProcess(String jobName, final String commandline,
-			IEnvironmentModifierBlock envBlock, long timeout) throws ESboxException {
-		final IProcessLauncher processLauncher = ProcessLauncherCreator.createProcessLauncher(
-				commandAbstractor.getProcessLauncherFactory(), 
-				null,
-				CommandLineArguments.createFromCommandLine(commandline),
-				envBlock);
-		processLauncher.usePTY(true);
-		
-		final Process process = processLauncher.createProcess();
-		new PrintStream(console.newMessageStream()).println(commandline);
-		
-		Job job = new Job(jobName) {
-			
-			@Override
-			protected IStatus run(IProgressMonitor monitor) {
-				monitor.beginTask("", 2);
-				monitor.subTask("Running " + commandline);
-				try {
-					processLauncher.redirectToConsole(console);
-					try {
-						process.waitFor();
-						monitor.worked(1);
-						int exit = process.exitValue();
-						if (exit != 0) {
-							return Activator.createErrorStatus("Process failed with exit value " + exit, null);
-						}
-					} catch (InterruptedException e) {
-						return CANCEL_STATUS;
-					}
-				} finally {
-					monitor.done();
-				}
-				return Status.OK_STATUS;
-			}
-		};
-		job.schedule();
-		try {
-			long deadline = System.currentTimeMillis() + timeout;
-			while (job.getResult() == null) {
-				Thread.sleep(500);
-				if (monitor.isCanceled() || (timeout != 0 && System.currentTimeMillis() >= deadline)) {
-					process.destroy();
-					job.cancel();
-					return CANCEL_STATUS;
-				}
-			}
-			return job.getResult();
-		} catch (InterruptedException e) {
-			return CANCEL_STATUS;
-		}
-	}
-
-	/**
-	 * Wait for the process to finish with a certain timeout.
-	 * @param timeout if not zero, timeout in milliseconds before throwing exception
-	 * @return exit code
-	 */
-	protected int waitForProcess(final Process process, final long timeout) throws ScratchboxException {
-		final Exception[] excs = { null };
-		Runnable runnable = new Runnable() {
-
-			public void run() {
-				try {
-					process.waitFor();
-				} catch (InterruptedException e) {
-					excs[0] = e;
-				}
-			}
-			
-		};
-		
-		if (timeout == 0) {
-			runnable.run();
-		} else {
-			Thread thread = new Thread(runnable);
-			thread.start();
-			try {
-				thread.join(timeout);
-				if (thread.isAlive()) {
-					thread.interrupt();
-					excs[0] = new InterruptedException();
-				}
-			} catch (InterruptedException e) {
-				excs[0] = e;
-			}
-		}
-		
-		if (excs[0] instanceof InterruptedException) {
-			throw new ScratchboxException("Command interrupted after " + timeout + " milliseconds");
-		} else if (excs[0] instanceof ScratchboxException) {
-			throw (ScratchboxException) excs[0];
-		} else if (excs[0] != null) {
-			throw new ScratchboxException(excs[0]);
-		}
-		
-		return process.exitValue();
-	}
-	
-	/**
-	 * Eat the stdout and stderr results from the process and wait for it 
-	 * to finish.  Optionally check whether stderr is empty.
-	 * <p>
-	 * This is done here instead of in the commands because CDT's Spawner will
-	 * destroy the streams when #waitFor() is called, while other Process
-	 * implementations don't do this, and we don't want a dependency on the
-	 * ordering repeated in the command implementations.
-	 * @param timeout if not zero, timeout in milliseconds before throwing exception
-	 * @return stdout results, as a string
-	 */
-	protected String getInputFromProcessAndWait(final Process process, final boolean allowError, final long timeout) throws ScratchboxException {
-		final String[] inputs = { null };
-		final Exception[] excs = { null };
-		Runnable runnable = new Runnable() {
-
-			public void run() {
-				try {
-					inputs[0] = getInputFromProcess(process);
-	
-					if (!allowError) {
-						String error = getErrorInputFromProcess(process);
-						if (error.length() > 0) {
-							excs[0] = new ScratchboxInvalidOperationException(error);
-							return;
-						}
-					}
-				} catch (IOException e) {
-					excs[0] = e;
-					return;
-				} catch (ScratchboxException e) {
-					excs[0] = e;
-					return;
-				}
-				
-				try {
-					process.waitFor();
-				} catch (InterruptedException e) {
-					excs[0] = e;
-				}
-			}
-			
-		};
-		
-		if (timeout == 0) {
-			runnable.run();
-		} else {
-			Thread thread = new Thread(runnable);
-			thread.start();
-			try {
-				thread.join(timeout);
-				if (thread.isAlive()) {
-					thread.interrupt();
-					process.destroy();
-					excs[0] = new InterruptedException();
-				}
-			} catch (InterruptedException e) {
-				excs[0] = e;
-			}
-		}
-		
-		if (excs[0] instanceof InterruptedException) {
-			throw new ScratchboxException("Command interrupted after " + timeout + " milliseconds");
-		} else if (excs[0] instanceof ScratchboxException) {
-			throw (ScratchboxException) excs[0];
-		} else if (excs[0] != null) {
-			throw new ScratchboxException(excs[0]);
-		}
-
-		return inputs[0];
-	}
-	
-	/**
-	 * Eat the stdout and stderr results from the process and wait for it 
-	 * to finish.  Return a 
-	 * <p>
-	 * This is done here instead of in the commands because CDT's Spawner will
-	 * destroy the streams when #waitFor() is called, while other Process
-	 * implementations don't do this, and we don't want a dependency on the
-	 * ordering repeated in the command implementations.
-	 * @return stdout results, as an array of lines
-	 */
-	protected List<String> getLineInputFromProcessAndWait(Process process, boolean allowError) throws ScratchboxException {
-		return getLineInputFromProcessAndWait(process, allowError, 0);
-	}
-
-	/**
-	 * Eat the stdout and stderr results from the process and wait for it 
-	 * to finish.  Return a 
-	 * <p>
-	 * This is done here instead of in the commands because CDT's Spawner will
-	 * destroy the streams when #waitFor() is called, while other Process
-	 * implementations don't do this, and we don't want a dependency on the
-	 * ordering repeated in the command implementations.
-	 * @param timeout if non-zero, timeout in milliseconds
-	 * @return stdout results, as an array of lines
-	 */
-	protected List<String> getLineInputFromProcessAndWait(Process process, boolean allowError, long timeout) throws ScratchboxException {
-		String input = getInputFromProcessAndWait(process, allowError, timeout);
-		return processLines(input);
-	}
-
-	/**
-	 * Return the input stream of the process as a string. All lines generated
-	 * by the process are concatenated.
-	 * 
-	 * @param process
-	 *            the process.
-	 * @return the input stream of the process.
-	 * @throws IOException
-	 *             if any I/O problem occurrs.
-	 */
-	private String getInputFromProcess(Process process) throws IOException, ScratchboxException {
-		return getInputStream(process.getInputStream());
-	}
-
-	/**
-	 * Return the error input stream of the process as a string. All lines
-	 * generated by the process are concatenated.
-	 * 
-	 * @param process
-	 *            the process.
-	 * @return the input stream of the process.
-	 * @throws IOException
-	 *             if any I/O problem occurrs.
-	 * @throws ScratchboxException 
-	 */
-	private String getErrorInputFromProcess(Process process) throws IOException, ScratchboxException {
-		return getInputStream(process.getErrorStream());
-	}
-
-	/**
-	 * Return an input stream as a string. All lines generated by the process
-	 * are concatenated.
-	 * 
-	 * @param processInputStream
-	 *            the input stream to be read.
-	 * @return the input stream of the process.
-	 * @throws IOException
-	 *             if any I/O problem occurrs.
-	 * @throws ScratchboxException 
-	 */
-	private String getInputStream(InputStream processInputStream)
-			throws IOException, ScratchboxException {
-		BufferedReader in = new BufferedReader(new InputStreamReader(
-				processInputStream));
-
-		String line;
-		String result = "";
-		String separator = "";
-
-		while ((line = in.readLine()) != null) {
-			checkError(line,ERROR_TOKEN);
-			checkError(line,WARNING_TOKEN);
-			result += separator + line;
-			separator = System.getProperty("line.separator");
-		}
-
-		return result;
-	}
-	
-	private void checkError(String inputString, String errorPattern) throws ScratchboxException {
-		if (inputString.startsWith(errorPattern)) {
-			int index = inputString.indexOf(errorPattern);
-			throw new ScratchboxException(inputString.substring(index + errorPattern.length()));
-		}
-	}
-
-	/**
-	 * Get a string with a set of lines an return a list with the lines
-	 * separated.
-	 * 
-	 * @param stringWithLines
-	 *            a string with lines.
-	 * @return a list with the lines separated.
-	 */
-	private List<String> processLines(String stringWithLines) {
-		List<String> lines = new ArrayList<String>();
-		final String FILE_SEPARATOR = System.getProperty("line.separator");
-
-		StringTokenizer tokens = new StringTokenizer(stringWithLines,
-				FILE_SEPARATOR);
-		while (tokens.hasMoreElements()) {
-			lines.add(tokens.nextToken());
-		}
-
-		return lines;
-	}
-
-	/**
-	 * Return the correct size of performCommand parameters list.
-	 * 
-	 * @return the correct size of performCommand parameters list.
-	 */
-	public abstract int getParametersSize();
-
-	/**
-	 * Verify if the parameter list has the correct size.
-	 * 
-	 * @param param
-	 *            the list of parameters to be verified.
-	 * @return true, if the list contains the correct number of parameters;
-	 *         false, otherwise.
-	 */
-	protected boolean checkParameters(List<String> param) {
-		return getParametersSize() == param.size();
-	}
-
-
-	protected String catenateLines(List<String> lines) {
-		StringBuilder builder = new StringBuilder();
-		for (String line : lines) {
-			builder.append(line);
-			builder.append('\n');
-		}
-		return builder.toString();
-	}
-}

Modified: trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/ScratchboxInvalidOperationException.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/ScratchboxInvalidOperationException.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/ScratchboxInvalidOperationException.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -15,7 +15,7 @@
 /**
  * This exception is thrown whenever the user try to remove the current
  * Scratchbox target.
- *  
+ * 
  */
 public class ScratchboxInvalidOperationException extends ScratchboxException {
 

Deleted: trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/ScratchboxInvalidParameterException.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/ScratchboxInvalidParameterException.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/ScratchboxInvalidParameterException.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -1,34 +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:
- *    Raul Herbster (UFCG) - initial API and implementation
- *******************************************************************************/
-package org.maemo.esbox.internal.maemosdk.core.command.scratchbox;
-
-import org.maemo.esbox.maemosdk.core.scratchbox.ScratchboxException;
-
-/**
- * This exception is thrown whenever an invalid parameter is passed to a command. 
- */
-public class ScratchboxInvalidParameterException extends ScratchboxException {
-
-	/**
-	 * Serial version number of exception.
-	 */
-	private static final long serialVersionUID = 1L;
-
-	/**
-	 * Constructor.
-	 * 
-	 * @param message
-	 *            the message associated with the exception.
-	 */
-	public ScratchboxInvalidParameterException(String message) {
-		super(message);
-	}
-}

Deleted: trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/SelectTargetCommand.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/SelectTargetCommand.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/SelectTargetCommand.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -1,67 +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.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.scratchbox.ScratchboxException;
-import org.maemo.esbox.maemosdk.core.sdk.IScratchboxSDK;
-
-import java.util.List;
-
-/**
- * Select a Scratchbox target.
- * This command wraps the callback to service sb-conf select [<TARGET>]
- * 
- */
-public class SelectTargetCommand extends ScratchboxCommand {
-
-	private final IScratchboxSDK sdk;
-
-	public SelectTargetCommand(ICommandAbstractor commandAbstractor, IScratchboxSDK sdk) {
-		super(commandAbstractor, 1);
-		this.sdk = 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 targetToSelect = param.get(0);
-
-		String selectTargetAction = commandAbstractor.getPreferenceValue(
-				SB1PreferenceConstants.SB1_SELECT_ACT);
-		String selectTargetCommand = this.replaceScratchboxConfigCommand(
-				selectTargetAction, new String[] { targetToSelect });
-
-		Process process = createProcess(selectTargetCommand, null);
-
-		getInputFromProcessAndWait(process, false, 0);
-
-		sdk.setCachedCurrentTarget(targetToSelect);
-		
-		return true;
-	}
-
-	@Override
-	public int getParametersSize() {
-		return 1;
-	}
-
-}

Deleted: trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/ShowPathMappingSb2Command.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/ShowPathMappingSb2Command.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/ShowPathMappingSb2Command.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -1,90 +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.IPath;
-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.scratchbox.ScratchboxException;
-
-import java.io.ByteArrayOutputStream;
-import java.util.*;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-/**
- * Invoke 'sb2-show path' on a list of paths and return the mappings, or <code>null</code>
- * for unmapped entries
- * @author eswartz
- *
- */
-public class ShowPathMappingSb2Command extends ScratchboxCommand {
-	public ShowPathMappingSb2Command(ICommandAbstractor commandAbstractor) {
-		super(commandAbstractor, 2);
-	}
-
-	@Override
-	protected boolean checkParameters(List<String> param) {
-		return true;
-	}
-	
-	public Map<IPath, IPath> performCommand(List<String> params)
-			throws ScratchboxException, ESboxException {
-		List<String> cmdLine = CommandLineArguments.createFromVarArgs(
-				commandAbstractor.getPreferenceValue(SB2PreferenceConstants.SB2_SB2_SHOW_COMMAND),
-				commandAbstractor.getPreferenceValue(SB2PreferenceConstants.SB2_SB2_SHOW_PATH_ACTION));
-		cmdLine.addAll(params);
-		
-		IProcessLauncher launcher = ProcessLauncherCreator.createProcessLauncher(
-				commandAbstractor.getProcessLauncherFactory(),
-				null, cmdLine);
-		
-		/*Process process =*/ launcher.createProcess();
-		
-		ByteArrayOutputStream out = new ByteArrayOutputStream();
-		ByteArrayOutputStream err = new ByteArrayOutputStream();
-		launcher.waitAndRead(out, err);
-		
-		if (err.size() != 0)
-			throw new ScratchboxException("Cannot resolve scratchbox2 path mappings:\n"+ err);
-		
-		String resolveInfo = out.toString().trim();
-		String[] lines = resolveInfo.split("\r\n|\r|\n");
-		
-		Map<IPath, IPath> result = new HashMap<IPath, IPath>(lines.length);
-		
-		Pattern sb2ShowPattern = Pattern.compile(
-				commandAbstractor.getPreferenceValue(SB2PreferenceConstants.SB2_SB2_SHOW_PATH_OUTPUT_PATTERN));
-
-		for (String line : lines) {
-			Matcher matcher = sb2ShowPattern.matcher(line);
-			if (matcher.matches()) {
-				String toPath = matcher.group(2);
-				// workaround buggy output
-				if (toPath.startsWith("//"))
-					toPath = toPath.substring(1);
-				result.put(new Path(matcher.group(1)), new Path(toPath));
-			}
-		}
-		
-		return result;
-	}
-
-	@Override
-	public int getParametersSize() {
-		return 0;
-	}
-	
-}

Deleted: trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/ShowTargetCommand.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/ShowTargetCommand.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/ShowTargetCommand.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -1,97 +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.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.scratchbox.ScratchboxException;
-import org.maemo.esbox.maemosdk.core.scratchbox.ScratchboxTarget;
-
-import java.util.*;
-
-/**
- * Show the settings of a Scratchbox target.
- * This command wraps the callback to service sb-conf show [<TARGET>]
- * 
- */
-public class ShowTargetCommand extends ScratchboxCommand {
-
-	public ShowTargetCommand(ICommandAbstractor commandAbstractor) {
-		super(commandAbstractor, 1);
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.maemo.esbox.core.internal.command.ICommand#performCommand(java.util.List)
-	 */	
-	public ScratchboxTarget performCommand(List<String> params)
-			throws ScratchboxException, ESboxException {
-		if (!this.checkParameters(params))
-			throw new ScratchboxInvalidParameterException(
-					"Invalid number of parameters");
-
-		String listAction = commandAbstractor.getPreferenceValue(
-				SB1PreferenceConstants.SB1_SHOW_ACT);
-		String showTargetCommandString = this.replaceScratchboxConfigCommand(
-				listAction, new String[] { params.get(0) });
-
-		Process process = createProcess(showTargetCommandString, null);
-
-		ScratchboxTarget target = null;
-		List<String> targetInfo = getLineInputFromProcessAndWait(process, false, 0);
-		target = createTarget(params.get(0), targetInfo);
-
-		return target;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.maemo.esbox.core.scratchbox.internal.command.ScratchboxCommand#getParametersSize()
-	 */
-	@Override
-	public int getParametersSize() {
-		// TODO Auto-generated method stub
-		return 1;
-	}
-
-	private ScratchboxTarget createTarget(String targetName,
-			List<String> targetInfo) {
-		ScratchboxTarget target = new ScratchboxTarget();
-
-		target.setName(targetName);
-
-		String compilerField = targetInfo.get(0);
-		String compiler = compilerField.substring(
-				compilerField.indexOf(":") + 1).trim();
-		target.setCompiler(compiler);
-
-		String devkitsField = targetInfo.get(1);
-		devkitsField = devkitsField.substring(devkitsField.indexOf(":") + 1);
-		StringTokenizer tokens = new StringTokenizer(devkitsField);
-		List<String> devkits = new ArrayList<String>();
-		while (tokens.hasMoreTokens()) {
-			devkits.add(tokens.nextToken());
-		}
-		target.setDevkits(devkits);
-
-		String cputranspField = targetInfo.get(2);
-		String cpuTransp = cputranspField.substring(
-				cputranspField.indexOf(":") + 1).trim();
-		target.setCputransp(cpuTransp);
-
-		return target;
-	}
-
-}

Modified: trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/SimpleCommand.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/SimpleCommand.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/SimpleCommand.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -14,7 +14,9 @@
 import org.maemo.esbox.core.*;
 import org.maemo.esbox.core.process.IProcessLauncher;
 import org.maemo.esbox.core.process.ProcessLauncherCreator;
-import org.maemo.esbox.internal.maemosdk.core.command.ICommandAbstractor;
+import org.maemo.esbox.internal.api.core.commands.ICommandAbstractor;
+import org.maemo.esbox.maemosdk.core.command.ScratchboxCommand;
+import org.maemo.esbox.maemosdk.core.command.ScratchboxInvalidParameterException;
 import org.maemo.esbox.maemosdk.core.scratchbox.ScratchboxException;
 
 import java.util.List;
@@ -26,33 +28,39 @@
 public class SimpleCommand extends ScratchboxCommand {
 
 	public SimpleCommand(ICommandAbstractor commandAbstractor) {
-		super(commandAbstractor, 1);
+		super(commandAbstractor);
 	}
 
 	/*
 	 * (non-Javadoc)
 	 * 
-	 * @see org.maemo.esbox.core.internal.command.ICommand#performCommand(java.util.List)
+	 * @see
+	 * org.maemo.esbox.core.internal.command.ICommand#performCommand(java.util
+	 * .List)
 	 */
 	public List<String> performCommand(List<String> params)
 			throws ScratchboxException, ESboxException {
 
 		if (params.size() == 0)
-			throw new ScratchboxInvalidParameterException("empty parameter list");
-		
-		IProcessLauncher processLauncher = ProcessLauncherCreator.createProcessLauncher(commandAbstractor.getProcessLauncherFactory(), null,
-				params);
+			throw new ScratchboxInvalidParameterException(
+					"empty parameter list");
+
+		IProcessLauncher processLauncher = ProcessLauncherCreator
+				.createProcessLauncher(commandAbstractor
+						.getProcessLauncherFactory(), null, params);
 		Process process = processLauncher.createProcess();
-		
-		List<String> commandResult = getLineInputFromProcessAndWait(process, true, 0);
 
+		List<String> commandResult = getLineInputFromProcessAndWait(process,
+				true, 0);
+
 		return commandResult;
 	}
 
 	/*
 	 * (non-Javadoc)
 	 * 
-	 * @see org.maemo.esbox.core.scratchbox.internal.command.ScratchboxCommand#getParametersSize()
+	 * @seeorg.maemo.esbox.core.scratchbox.internal.command.ScratchboxCommand#
+	 * getParametersSize()
 	 */
 	@Override
 	public int getParametersSize() {

Modified: trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/sbrsh/AddSbrshCommand.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/sbrsh/AddSbrshCommand.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/sbrsh/AddSbrshCommand.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -12,28 +12,30 @@
 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.internal.api.core.commands.ICommandAbstractor;
 import org.maemo.esbox.maemosdk.core.MaemoPreferenceConstants;
+import org.maemo.esbox.maemosdk.core.command.ScratchboxCommand;
+import org.maemo.esbox.maemosdk.core.command.ScratchboxInvalidParameterException;
 import org.maemo.esbox.maemosdk.core.scratchbox.ScratchboxException;
 
 import java.util.List;
 
 /**
- * This command wraps the callback to service sbrsh-conf add <TARGET-HOSTNAME> [[<USERNAME>@]<IP-ADDRESS>]
- *  
+ * This command wraps the callback to service sbrsh-conf add <TARGET-HOSTNAME>
+ * [[<USERNAME>@]<IP-ADDRESS>]
+ * 
  */
 public class AddSbrshCommand extends ScratchboxCommand {
 
 	public AddSbrshCommand(ICommandAbstractor commandAbstractor) {
-		super(commandAbstractor, 1);
+		super(commandAbstractor);
 	}
 
 	/*
 	 * (non-Javadoc)
 	 * 
-	 * @see embedded.core.scratchbox.command.ScratchboxCommand#getParametersSize()
+	 * @see
+	 * embedded.core.scratchbox.command.ScratchboxCommand#getParametersSize()
 	 */
 	@Override
 	public int getParametersSize() {
@@ -44,8 +46,10 @@
 	/*
 	 * (non-Javadoc)
 	 * 
-	 * @see embedded.core.scratchbox.command.IScratchboxCommand#performCommand(java.util.List)
-	 */	
+	 * @see
+	 * embedded.core.scratchbox.command.IScratchboxCommand#performCommand(java
+	 * .util.List)
+	 */
 	public Object performCommand(List<String> params)
 			throws ScratchboxException, ESboxException {
 		if (!this.checkParameters(params))
@@ -58,8 +62,8 @@
 
 		String localHostName = username + "@" + ipAddress;
 
-		String addAction = commandAbstractor.getPreferenceValue(
-				MaemoPreferenceConstants.ADD_ACT);
+		String addAction = commandAbstractor
+				.getPreferenceValue(MaemoPreferenceConstants.ADD_ACT);
 		String addCommand = this.replaceScratchboxSbrshConfigCommand(addAction,
 				new String[] { targetDeviceAddr, localHostName });
 

Modified: trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/sbrsh/ConfigureSbrshCommand.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/sbrsh/ConfigureSbrshCommand.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/sbrsh/ConfigureSbrshCommand.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -12,29 +12,30 @@
 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.internal.api.core.commands.ICommandAbstractor;
 import org.maemo.esbox.maemosdk.core.MaemoPreferenceConstants;
+import org.maemo.esbox.maemosdk.core.command.ScratchboxCommand;
+import org.maemo.esbox.maemosdk.core.command.ScratchboxInvalidParameterException;
 import org.maemo.esbox.maemosdk.core.scratchbox.ScratchboxException;
 
 import java.util.List;
 
 /**
- * This command wraps the callback to service sbrsh-conf configure [<TARGET-NAME>]
- * <TARGET-HOSTNAME>[:<TARGET-PORT>]
+ * This command wraps the callback to service sbrsh-conf configure
+ * [<TARGET-NAME>] <TARGET-HOSTNAME>[:<TARGET-PORT>]
  * 
  */
 public class ConfigureSbrshCommand extends ScratchboxCommand {
 
 	public ConfigureSbrshCommand(ICommandAbstractor commandAbstractor) {
-		super(commandAbstractor, 1);
+		super(commandAbstractor);
 	}
 
 	/*
 	 * (non-Javadoc)
 	 * 
-	 * @see embedded.core.scratchbox.command.ScratchboxCommand#getParametersSize()
+	 * @see
+	 * embedded.core.scratchbox.command.ScratchboxCommand#getParametersSize()
 	 */
 	@Override
 	public int getParametersSize() {
@@ -45,8 +46,10 @@
 	/*
 	 * (non-Javadoc)
 	 * 
-	 * @see embedded.core.scratchbox.command.IScratchboxCommand#performCommand(java.util.List)
-	 */	
+	 * @see
+	 * embedded.core.scratchbox.command.IScratchboxCommand#performCommand(java
+	 * .util.List)
+	 */
 	public Object performCommand(List<String> params)
 			throws ScratchboxException, ESboxException {
 		if (!this.checkParameters(params))
@@ -57,8 +60,8 @@
 		String targetHostname = params.get(1);
 		String nfsServerAddr = params.get(2);
 
-		String configureAction = commandAbstractor.getPreferenceValue(
-				MaemoPreferenceConstants.CONFIGURE_ACT);
+		String configureAction = commandAbstractor
+				.getPreferenceValue(MaemoPreferenceConstants.CONFIGURE_ACT);
 		String nfsOption = this.replaceAction(nfsServerAddr);
 
 		String configureCommand = this.replaceScratchboxSbrshConfigCommand(
@@ -78,8 +81,8 @@
 	 * @return
 	 */
 	protected String replaceAction(String nfsServerAddr) {
-		String nfsOption = commandAbstractor.getPreferenceValue(
-				MaemoPreferenceConstants.NFS_SERVER_HOSTNAME);
+		String nfsOption = commandAbstractor
+				.getPreferenceValue(MaemoPreferenceConstants.NFS_SERVER_HOSTNAME);
 		nfsOption = nfsOption.replaceAll("\\$\\{HOSTNAME\\}", nfsServerAddr);
 
 		return nfsOption;

Modified: trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/sbrsh/MountTargetSbrshCommand.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/sbrsh/MountTargetSbrshCommand.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/sbrsh/MountTargetSbrshCommand.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -12,28 +12,29 @@
 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.internal.api.core.commands.ICommandAbstractor;
 import org.maemo.esbox.maemosdk.core.MaemoPreferenceConstants;
+import org.maemo.esbox.maemosdk.core.command.ScratchboxCommand;
+import org.maemo.esbox.maemosdk.core.command.ScratchboxInvalidParameterException;
 import org.maemo.esbox.maemosdk.core.scratchbox.ScratchboxException;
 
 import java.util.List;
 
 /**
  * This command wraps the callback to service sbrsh-conf mount [<TARGET-NAME>]
- *  
+ * 
  */
 public class MountTargetSbrshCommand extends ScratchboxCommand {
 
 	public MountTargetSbrshCommand(ICommandAbstractor commandAbstractor) {
-		super(commandAbstractor, 1);
+		super(commandAbstractor);
 	}
 
 	/*
 	 * (non-Javadoc)
 	 * 
-	 * @see embedded.core.scratchbox.command.ScratchboxCommand#getParametersSize()
+	 * @see
+	 * embedded.core.scratchbox.command.ScratchboxCommand#getParametersSize()
 	 */
 	@Override
 	public int getParametersSize() {
@@ -44,8 +45,10 @@
 	/*
 	 * (non-Javadoc)
 	 * 
-	 * @see embedded.core.scratchbox.command.IScratchboxCommand#performCommand(java.util.List)
-	 */	
+	 * @see
+	 * embedded.core.scratchbox.command.IScratchboxCommand#performCommand(java
+	 * .util.List)
+	 */
 	public Object performCommand(List<String> params)
 			throws ScratchboxException, ESboxException {
 		if (!this.checkParameters(params))
@@ -54,8 +57,8 @@
 
 		String targetName = params.get(0);
 
-		String mountAction = commandAbstractor.getPreferenceValue(
-				MaemoPreferenceConstants.MOUNT_ACT);
+		String mountAction = commandAbstractor
+				.getPreferenceValue(MaemoPreferenceConstants.MOUNT_ACT);
 		String mountCommand = this.replaceScratchboxSbrshConfigCommand(
 				mountAction, new String[] { targetName });
 

Modified: trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/sbrsh/UnmountTargetSbrshCommand.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/sbrsh/UnmountTargetSbrshCommand.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/command/scratchbox/sbrsh/UnmountTargetSbrshCommand.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -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.internal.api.core.commands.ICommandAbstractor;
 import org.maemo.esbox.maemosdk.core.MaemoPreferenceConstants;
+import org.maemo.esbox.maemosdk.core.command.ScratchboxCommand;
+import org.maemo.esbox.maemosdk.core.command.ScratchboxInvalidParameterException;
 import org.maemo.esbox.maemosdk.core.scratchbox.ScratchboxException;
 
 import java.util.List;
@@ -27,13 +27,14 @@
 public class UnmountTargetSbrshCommand extends ScratchboxCommand {
 
 	public UnmountTargetSbrshCommand(ICommandAbstractor commandAbstractor) {
-		super(commandAbstractor, 1);
+		super(commandAbstractor);
 	}
 
 	/*
 	 * (non-Javadoc)
 	 * 
-	 * @see embedded.core.scratchbox.command.ScratchboxCommand#getParametersSize()
+	 * @see
+	 * embedded.core.scratchbox.command.ScratchboxCommand#getParametersSize()
 	 */
 	@Override
 	public int getParametersSize() {
@@ -44,8 +45,10 @@
 	/*
 	 * (non-Javadoc)
 	 * 
-	 * @see embedded.core.scratchbox.command.IScratchboxCommand#performCommand(java.util.List)
-	 */	
+	 * @see
+	 * embedded.core.scratchbox.command.IScratchboxCommand#performCommand(java
+	 * .util.List)
+	 */
 	public Object performCommand(List<String> params)
 			throws ScratchboxException, ESboxException {
 		if (!this.checkParameters(params))
@@ -54,8 +57,8 @@
 
 		String targetName = params.get(0);
 
-		String unmountAction = commandAbstractor.getPreferenceValue(
-				MaemoPreferenceConstants.UNMOUNT_ACT);
+		String unmountAction = commandAbstractor
+				.getPreferenceValue(MaemoPreferenceConstants.UNMOUNT_ACT);
 		String unmountCommand = this.replaceScratchboxSbrshConfigCommand(
 				unmountAction, new String[] { targetName });
 

Copied: trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/scratchbox/MaemoLauncher.java (from rev 873, trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/scratchbox/MaemoLauncher.java)
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/scratchbox/MaemoLauncher.java	                        (rev 0)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/scratchbox/MaemoLauncher.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -0,0 +1,155 @@
+/*******************************************************************************
+ * 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:
+ *    Raul Herbster (UFCG) - initial implementation
+ *    Ed Swartz (Nokia) - adaptation
+ *******************************************************************************/
+
+package org.maemo.esbox.internal.maemosdk.core.scratchbox;
+
+import java.io.IOException;
+import java.util.List;
+
+import org.maemo.esbox.core.ESboxException;
+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.internal.api.core.sdk.MaemoUtils;
+import org.maemo.esbox.maemosdk.core.scratchbox.ScratchboxException;
+
+/**
+ * This class maintains knowledge about whether maemo is running in a target and
+ * controls access to starting, stopping, and querying status.
+ * 
+ * @author eswartz
+ * 
+ */
+public class MaemoLauncher {
+
+	private static final String MAEMO_LAUNCHER_APP = "maemo-launcher";
+	private static MaemoLauncher instance;
+
+	public synchronized static MaemoLauncher getInstance() {
+		if (instance == null) {
+			instance = new MaemoLauncher();
+		}
+		return instance;
+	}
+
+	/**
+	 * Test whether maemo is running. We look for 'maemo-launcher' in the
+	 * process list.
+	 * 
+	 * @param sdkTarget
+	 * @return true if maemo process found
+	 * @throws ESboxException
+	 *             if query is impossible
+	 */
+	private boolean testMaemoLauncher(ISDKTarget sdkTarget)
+			throws ESboxException {
+		List<IProcess> runningProcesses = getMaemoLaunchers(sdkTarget.getSDK()
+				.getMachine());
+		return runningProcesses.size() > 0;
+	}
+
+	private List<IProcess> getMaemoLaunchers(IMachine machine) {
+		// includes scratchbox call that launched maemo-launcher
+		List<IProcess> runningProcesses = machine.getProcessLister()
+				.getProcesses(
+						new ProcessFilterCmdLineRegexp(".*/"
+								+ MAEMO_LAUNCHER_APP + "\\s+.*"));
+		return runningProcesses;
+	}
+
+	/**
+	 * Test whether maemo is started by testing the existence of the
+	 * maemo-launcher daemon
+	 * 
+	 * @param sdkTarget
+	 * @return flag
+	 */
+	public boolean isMaemoRunning(ISDKTarget sdkTarget) throws ESboxException {
+		return testMaemoLauncher(sdkTarget);
+	}
+
+	/**
+	 * Start maemo if it's not running.
+	 * 
+	 * @param sdkTarget
+	 * @throws ESboxException
+	 *             if already running or cannot be started
+	 */
+	public void startMaemo(ISDKTarget sdkTarget) throws ESboxException {
+		if (isMaemoRunning(sdkTarget))
+			throw new ScratchboxException("Maemo is already running");
+
+		MaemoUtils.startMaemoCommand(sdkTarget);
+	}
+
+	/**
+	 * Stop maemo if it's running
+	 * 
+	 * @param sdkTarget
+	 * @throws ESboxException
+	 *             if not running or cannot be stopped
+	 */
+	public void stopMaemo(ISDKTarget sdkTarget) throws ESboxException {
+		// always try... may be half-initialized
+		// if (!isMaemoRunning(sdkTarget))
+		// throw new
+		// ScratchboxException("Maemo is not running, or failed to launch.");
+
+		MaemoUtils.stopMaemoCommand(sdkTarget);
+	}
+
+	/**
+	 * Restart maemo
+	 * 
+	 * @param sdkTarget
+	 * @throws ESboxException
+	 *             if cannot be restarted
+	 */
+	public void restartMaemo(ISDKTarget sdkTarget) throws ESboxException {
+		MaemoUtils.restartMaemoCommand(sdkTarget);
+	}
+
+	/**
+	 * Kill maemo by forcibly killing instances of the launcher left behind
+	 * 
+	 * @param sdkTarget
+	 * @throws ESboxException
+	 */
+	public void killMaemo(ISDKTarget sdkTarget) throws ESboxException {
+		List<IProcess> pids = getMaemoLaunchers(sdkTarget.getSDK().getMachine());
+		if (pids.size() == 0)
+			return;
+
+		try {
+			for (IProcess process : pids) {
+				process.terminate();
+			}
+		} catch (IOException e) {
+
+		}
+
+		// try again
+		pids = getMaemoLaunchers(sdkTarget.getSDK().getMachine());
+		if (pids.size() == 0)
+			return;
+
+		try {
+			for (IProcess process : pids) {
+				process.kill();
+			}
+		} catch (IOException e) {
+			throw new ESboxException("Could not kill " + MAEMO_LAUNCHER_APP, e);
+		}
+
+	}
+}


Property changes on: trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/scratchbox/MaemoLauncher.java
___________________________________________________________________
Name: svn:mergeinfo
   + 

Copied: trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/scratchbox/PersistentCache.java (from rev 873, trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/scratchbox/PersistentCache.java)
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/scratchbox/PersistentCache.java	                        (rev 0)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/scratchbox/PersistentCache.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -0,0 +1,146 @@
+/*******************************************************************************
+ * 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.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;
+
+/**
+ * This object stores (key, value) pairs for cached data which is expensive to
+ * compute. The keys are unique strings. Values are serializable objects. The
+ * cache is loaded and stored with the plugin.
+ * 
+ * @author eswartz
+ * 
+ */
+public class PersistentCache {
+
+	/**
+	 * Default filename, under workspace metadata for this plugin's state, where
+	 * the cache is stored.
+	 */
+	private static final String SCRATCHBOX_CACHE_FILE = "scratchbox_cache.dat";
+
+	/**
+	 * The environment variable which, if defined, overrides the file above. It
+	 * should be a full filesystem path.
+	 */
+	private static final String SCRATCHBOX_CACHE_ENV = "SCRATCHBOX_CACHE";
+
+	private Map<String, Object> data;
+
+	public PersistentCache() {
+		data = new HashMap<String, Object>();
+	}
+
+	/**
+	 * Try to load the cache from plugin state.
+	 */
+	public void load() {
+		File state = getCacheFile();
+		if (state == null)
+			return;
+		try {
+			ObjectInputStream ois = new ObjectInputStream(new FileInputStream(
+					state));
+			try {
+				data = (Map<String, Object>) ois.readObject();
+			} catch (ClassNotFoundException e) {
+				Activator.getErrorLogger().logError("Cannot unserialize data",
+						e);
+			} finally {
+				Policy.close(ois);
+			}
+		} catch (IOException e) {
+			// ignore
+		}
+	}
+
+	/**
+	 * @return
+	 */
+	private File getCacheFile() {
+		// check for argument passed to unit test
+		String sboxCache = System.getenv(SCRATCHBOX_CACHE_ENV);
+		if (sboxCache != null && sboxCache.length() > 0) {
+			return new File(sboxCache);
+		}
+		if (Activator.getDefault() == null)
+			return null;
+		IPath stateLocation = Activator.getDefault().getStateLocation();
+		File state = stateLocation.append(SCRATCHBOX_CACHE_FILE).toFile();
+		return state;
+	}
+
+	/**
+	 * Save the cache to plugin state.
+	 */
+	public void save() {
+		File state = getCacheFile();
+		if (state == null)
+			return;
+		ObjectOutputStream oos;
+		try {
+			oos = new ObjectOutputStream(new FileOutputStream(state));
+		} catch (IOException e1) {
+			Activator.getErrorLogger().logError("Cannot write cache data", e1);
+			return;
+		}
+		try {
+			oos.writeObject(data);
+		} catch (IOException e) {
+			Activator.getErrorLogger().logError("Cannot serialize cache data",
+					e);
+		} finally {
+			Policy.close(oos);
+		}
+	}
+
+	/**
+	 * Delete the entries in the cache.
+	 */
+	public synchronized void clear() {
+		data.clear();
+	}
+
+	/**
+	 * Get a value from the cache.
+	 * 
+	 * @param key
+	 *            KEY_xxx
+	 * @return
+	 */
+	public synchronized Object get(String key) {
+		return data.get(key);
+	}
+
+	/**
+	 * Store a value in the cache
+	 * 
+	 * @param key
+	 *            KEY_xxx
+	 * @param value
+	 */
+	public synchronized void set(String key, Object value) {
+		data.put(key, value);
+	}
+}


Property changes on: trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/scratchbox/PersistentCache.java
___________________________________________________________________
Name: svn:mergeinfo
   + 

Copied: trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/scratchbox/XLauncher.java (from rev 873, trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/scratchbox/XLauncher.java)
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/scratchbox/XLauncher.java	                        (rev 0)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/scratchbox/XLauncher.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -0,0 +1,305 @@
+/*******************************************************************************
+ * 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:
+ *    Raul Herbster (UFCG) - initial implementation
+ *    Ed Swartz (Nokia) - adaptation
+ *******************************************************************************/
+
+package org.maemo.esbox.internal.maemosdk.core.scratchbox;
+
+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.IEnvironmentModifierBlock;
+import org.maemo.esbox.core.machine.IMachine;
+import org.maemo.esbox.core.machine.MachineRegistry;
+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 org.maemo.esbox.maemosdk.core.scratchbox.ESboxScriptLauncher;
+import org.maemo.esbox.maemosdk.core.scratchbox.ScratchboxException;
+
+/**
+ * This class maintains knowledge about whether the X server is running in the
+ * host, and controls access to starting, stopping, and querying status.
+ * 
+ * @author eswartz
+ * 
+ */
+public class XLauncher {
+
+	private static XLauncher instance;
+
+	private Job launchingXJob;
+
+	public synchronized static XLauncher getInstance() {
+		if (instance == null) {
+			instance = new XLauncher();
+		}
+		return instance;
+	}
+
+	/**
+	 * Test a connection to the X server denoted by 'display'. This performs an
+	 * immediate check and is ignorant if a launch is in progress.
+	 * 
+	 * @param display
+	 *            the DISPLAY value, e.g. ":2" or ":0.0" or "myhost:0"
+	 * @return true if connection succeeded
+	 * @throws ESboxException
+	 *             if query is impossible
+	 */
+	private boolean testXConnection(String display) throws ESboxException {
+		String[] parts = display.split(":");
+		if (parts.length != 2)
+			throw new ESboxException(
+					MessageFormat
+							.format(
+									"DISPLAY variable ''{0}'' does not have expected syntax [host]:<number>[.<number>]",
+									display));
+		String host = parts[0];
+		if (host.equals("unix")) {
+			Activator
+					.getErrorLogger()
+					.logError(
+							MessageFormat
+									.format(
+											"Support for testing X connection over UNIX domain sockets is not implemented; assuming success (DISPLAY=''{0}'')",
+											display), null);
+			return true;
+		}
+
+		if (host.length() == 0) {
+			host = null;
+		}
+
+		String[] displayParts = parts[1].split("\\.");
+		int displayNumber = 0;
+		try {
+			displayNumber = Integer.parseInt(displayParts[0]);
+		} catch (NumberFormatException e) {
+			throw new ESboxException(
+					MessageFormat
+							.format(
+									"DISPLAY variable ''{0}'' does not have expected syntax [host]:<number>[.<number>]",
+									display));
+		}
+
+		try {
+			/* Socket socket = */new Socket(host, 6000 + displayNumber);
+			return true;
+		} catch (Exception e) {
+			return false;
+		}
+	}
+
+	/**
+	 * Test whether the X server is started by testing a connection to the
+	 * server.
+	 * 
+	 * @param prefProvider
+	 * @return
+	 */
+	public boolean isXServerStarted(IPreferenceProvider prefProvider)
+			throws ESboxException {
+		return testXConnection(getDisplayValue(prefProvider));
+	}
+
+	/** Be nice and start X if needed before starting/restarting maemo */
+	public void startXIfNeeded(IPreferenceProvider prefProvider)
+			throws ESboxException {
+		waitForXLaunch();
+		if (!isXServerStarted(prefProvider)) {
+			startX(prefProvider);
+			waitForXLaunch();
+		}
+	}
+
+	/**
+	 * Wait forever for the X launching job (if any) to complete. This returns
+	 * only when the job is complete. It does not reflect a successful launch of
+	 * the server.
+	 */
+	private void waitForXLaunch() {
+		while (true) {
+			synchronized (this) {
+				if (launchingXJob == null) {
+					return;
+				}
+				if (launchingXJob != null) {
+					if (launchingXJob.getResult() != null) {
+						return;
+					}
+				}
+			}
+
+			try {
+				Thread.sleep(500);
+			} catch (InterruptedException e) {
+				return;
+			}
+		}
+	}
+
+	public void startX(final IPreferenceProvider prefProvider)
+			throws ESboxException {
+		waitForXLaunch();
+
+		if (isXServerStarted(prefProvider))
+			throw new ScratchboxException("X Server is already running");
+
+		String viewer = getDisplayXServerCommand(prefProvider);
+		final String display = getDisplayValue(prefProvider);
+
+		List<String> cmdLine = CommandLineArguments
+				.createFromCommandLine(viewer);
+
+		if (cmdLine.size() > 0) {
+
+			IMachine localMachine = MachineRegistry.getInstance()
+					.getLocalMachine();
+			if (localMachine == null)
+				throw new ESboxException("Cannot find local machine");
+
+			IProcessLauncherFactory factory = localMachine.getProcessLauncherFactory();
+			IEnvironmentModifierBlock envBlock = null;
+			
+			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,
+					envBlock);
+			
+			final Process process = processLauncher.createProcess();
+
+			final MessageConsole console = processLauncher.redirectToConsole(
+					true, null, "Starting X Server");
+
+			synchronized (this) {
+				launchingXJob = new Job("Waiting for X Server") {
+
+					@Override
+					protected IStatus run(IProgressMonitor monitor) {
+						while (true) {
+							try {
+								if (testXConnection(display))
+									break;
+							} catch (ESboxException e) {
+								return Activator.createErrorStatus(
+										"Failed to check X connection", e);
+							}
+
+							try {
+								Thread.sleep(500);
+							} catch (InterruptedException e) {
+								return Policy.getCancelStatus(Activator
+										.getDefault());
+							}
+
+							try {
+								// see if the process terminated yet
+								int exit = process.exitValue();
+
+								console.newMessageStream().println(
+										"Process exited with code 0x"
+												+ Integer.toHexString(exit));
+
+								// report failure outside this job else we can
+								// get stuck here
+								// if someone queries the job status from the UI
+								// thread
+								Display.getDefault().asyncExec(new Runnable() {
+
+									public void run() {
+										Activator
+												.getErrorLogger()
+												.logAndShowError(
+														"X server did not launch; check the Console.",
+														null);
+									}
+
+								});
+								break;
+							} catch (IllegalThreadStateException e) {
+								// not finished, good
+							}
+						}
+						synchronized (XLauncher.this) {
+							launchingXJob = null;
+						}
+						return Status.OK_STATUS;
+					}
+				};
+				launchingXJob.schedule();
+			}
+		} else {
+			Activator.getErrorLogger().logAndShowError(
+					"No X server configured in ESbox preferences", null);
+		}
+
+	}
+
+	public void stopX(IPreferenceProvider prefProvider) throws ESboxException {
+		waitForXLaunch();
+
+		if (!isXServerStarted(prefProvider))
+			throw new ScratchboxException(
+					"X Server was not started. Start X Server first");
+
+		String server = getDisplayXServerCommand(prefProvider);
+
+		List<String> cmdLine = CommandLineArguments
+				.createFromCommandLine(server);
+
+		// find server to kill
+		if (cmdLine.size() > 0) {
+			IMachine localMachine = MachineRegistry.getInstance()
+					.getLocalMachine();
+			if (localMachine == null)
+				throw new ESboxException("Cannot find local machine");
+
+			ESboxScriptLauncher.getInstance().killProcess(localMachine,
+					cmdLine.get(0), "X Server");
+		}
+	}
+
+	private String getDisplayXServerCommand(IPreferenceProvider prefProvider) {
+		String command = prefProvider
+				.getPreferenceValue(MaemoPreferenceConstants.DISPLAY_X_COMMAND);
+
+		command = command.replaceAll("\\$\\{DISPLAY\\}",
+				getDisplayValue(prefProvider));
+		return command;
+	}
+	
+	private String getDisplayValue(IPreferenceProvider prefProvider) {
+		String value = prefProvider.getPreferenceValue(MaemoPreferenceConstants.X_DISPLAY);
+		if (value.length() > 0)
+			return value;
+		else
+			return System.getenv("DISPLAY"); // get from system
+	}
+}


Property changes on: trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/scratchbox/XLauncher.java
___________________________________________________________________
Name: svn:mergeinfo
   + 

Modified: trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/sdk/BaseScratchboxSDKTarget.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/sdk/BaseScratchboxSDKTarget.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/sdk/BaseScratchboxSDKTarget.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -12,23 +12,30 @@
 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;
 
 /**
  * Common base for (maemo) scratchbox SDK targets
+ * 
  * @author eswartz
- *
+ * 
  */
-public abstract class BaseScratchboxSDKTarget extends BaseSDKTarget implements IScratchboxSDKTarget {
+public abstract class BaseScratchboxSDKTarget extends BaseSDKTarget implements
+		IScratchboxSDKTarget {
 
 	public BaseScratchboxSDKTarget(ISDK sdk, ISDKPlatform platform,
 			String architecture, String target) {
 		super(sdk, platform, architecture, target);
-		
-		Platform.getAdapterManager().registerAdapters(new MaemoRunStandaloneSupportAdapterFactory(), ISDKTarget.class);
+
+		Platform.getAdapterManager()
+				.registerAdapters(
+						new MaemoRunStandaloneSupportAdapterFactory(),
+						ISDKTarget.class);
 	}
 
 }

Modified: trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/sdk/IScratchboxSDKPlatformArchitectureProvider.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/sdk/IScratchboxSDKPlatformArchitectureProvider.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/sdk/IScratchboxSDKPlatformArchitectureProvider.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -14,23 +14,28 @@
 
 /**
  * Helper interface to identify the platform and architecture
+ * 
  * @author eswartz
- *
+ * 
  */
 public interface IScratchboxSDKPlatformArchitectureProvider {
-	/** 
-	 * Identify the platform for the target 
-	 *
-	 * @param sdk the SDK
-	 * @param target the target name
+	/**
+	 * Identify the platform for the target
+	 * 
+	 * @param sdk
+	 *            the SDK
+	 * @param target
+	 *            the target name
 	 */
 	ISDKPlatform getPlatform(String target);
-	
-	/** 
-	 * Identify the architecture for the target 
-	 *
-	 * @param sdk the SDK
-	 * @param target the target name
+
+	/**
+	 * Identify the architecture for the target
+	 * 
+	 * @param sdk
+	 *            the SDK
+	 * @param target
+	 *            the target name
 	 */
 	String getArchitecture(String target);
 }

Deleted: trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/sdk/Scratchbox1EnvironmentProvider.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/sdk/Scratchbox1EnvironmentProvider.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/sdk/Scratchbox1EnvironmentProvider.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -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.maemo.esbox.core.ESboxException;
-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.IStandardEnvironmentProvider;
-import org.maemo.esbox.internal.maemosdk.core.Activator;
-
-import java.util.*;
-
-/**
- * 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);
-	}
-
-}

Deleted: trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/sdk/Scratchbox1FileSystemMapping.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/sdk/Scratchbox1FileSystemMapping.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/sdk/Scratchbox1FileSystemMapping.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -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: trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/sdk/Scratchbox1ProcessLauncher.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/sdk/Scratchbox1ProcessLauncher.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/sdk/Scratchbox1ProcessLauncher.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -1,207 +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.*;
-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.env.*;
-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 {
-
-	/**
-	 * 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());
-	}
-	
-
-}

Deleted: trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/sdk/Scratchbox1ProcessLauncherFactory.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/sdk/Scratchbox1ProcessLauncherFactory.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/sdk/Scratchbox1ProcessLauncherFactory.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -1,53 +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.env.IEnvironmentModifierBlock;
-import org.maemo.esbox.core.process.*;
-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 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); 
-	}
-}

Deleted: trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/sdk/Scratchbox1SDK.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/sdk/Scratchbox1SDK.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/sdk/Scratchbox1SDK.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -1,102 +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.*;
-
-/**
- * SDK for a Scratchbox 1.x environment
- * @author eswartz
- *
- */
-public class Scratchbox1SDK extends ScratchboxSDK implements IScratchbox1SDK {
-
-	private IPath sdkRoot;
-	private final IScratchboxSDKPlatformArchitectureProvider platformArchitectureProvider;
-	
-	/**
-	 * @param version
-	 * @param name
-	 */
-	public Scratchbox1SDK(
-			IMachine machine,
-			IScratchboxSDKPlatformArchitectureProvider platformArchitectureProvider,
-			String version, 
-			IPreferenceProvider prefProvider) {
-		super(machine, version, NAME, prefProvider);
-		this.sdkRoot = null;
-		this.platformArchitectureProvider = platformArchitectureProvider;
-	}
-
-	public void refresh() {
-		// populate targets
-		super.refresh();
-		try {
-			List<String> targetNames = getTargets();
-			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> getTargets() throws ESboxException {
-		return ScratchboxFacade.getInstance().getTargets(this); 
-	}
-}

Deleted: trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/sdk/Scratchbox1SDKTarget.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/sdk/Scratchbox1SDKTarget.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/sdk/Scratchbox1SDKTarget.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -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.sdk;
-
-import org.eclipse.core.runtime.IPath;
-import org.maemo.esbox.core.CorePreferenceConstants;
-import org.maemo.esbox.core.machine.IVirtualMachine;
-import org.maemo.esbox.core.process.EnvironmentModifierUtils;
-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 getProcessLauncherFactory(false);
-	}
-
-	/**
-	 * @param b
-	 * @return
-	 */
-	private IProcessLauncherFactory getProcessLauncherFactory(boolean runAsRoot) {
-		Scratchbox1ProcessLauncherFactory launcherFactory = new Scratchbox1ProcessLauncherFactory(this, runAsRoot);
-		return launcherFactory; 
-	}
-
-	/* (non-Javadoc)
-	 * @see org.maemo.esbox.core.scratchbox.sdk.IScratchboxSDKTarget#getProcessLauncherFactoryForInstall()
-	 */
-	public IProcessLauncherFactory getProcessLauncherFactoryForInstall() {
-		return getProcessLauncherFactory(true);
-	}
-	
-
-	public IPath getRootstrapPath() {
-		// Rootstrap path is just the TargetRoot like this:
-		//     /scratchbox/users/maemo/targets/CHINOOK_ARMEL
-		return  getSDKTargetRoot();
-	}
-}

Deleted: trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/sdk/Scratchbox2EnvironmentProvider.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/sdk/Scratchbox2EnvironmentProvider.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/sdk/Scratchbox2EnvironmentProvider.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -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.maemo.esbox.core.ESboxException;
-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.IStandardEnvironmentProvider;
-import org.maemo.esbox.internal.maemosdk.core.Activator;
-import org.maemo.esbox.maemosdk.core.SB2PreferenceConstants;
-
-import java.util.*;
-
-/**
- * @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;
-	}
-
-}

Deleted: trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/sdk/Scratchbox2FileSystemMapping.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/sdk/Scratchbox2FileSystemMapping.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/sdk/Scratchbox2FileSystemMapping.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -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: trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/sdk/Scratchbox2ProcessLauncher.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/sdk/Scratchbox2ProcessLauncher.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/sdk/Scratchbox2ProcessLauncher.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -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.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());
-	}
-}

Deleted: trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/sdk/Scratchbox2ProcessLauncherFactory.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/sdk/Scratchbox2ProcessLauncherFactory.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/sdk/Scratchbox2ProcessLauncherFactory.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -1,66 +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.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); 
-	}
-
-}

Deleted: trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/sdk/Scratchbox2SDK.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/sdk/Scratchbox2SDK.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/sdk/Scratchbox2SDK.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -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.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, prefProvider);
-		this.platformArchitectureProvider = platformArchitectureProvider;
-	}
-
-	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> getTargets() 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: trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/sdk/Scratchbox2SDKTarget.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/sdk/Scratchbox2SDKTarget.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/sdk/Scratchbox2SDKTarget.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -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: trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/sdk/ScratchboxSDK.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/sdk/ScratchboxSDK.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/internal/maemosdk/core/sdk/ScratchboxSDK.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -10,17 +10,23 @@
  *******************************************************************************/
 package org.maemo.esbox.internal.maemosdk.core.sdk;
 
-import org.eclipse.core.runtime.Assert;
+import java.util.List;
+
+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.commands.ICommandAbstractor;
 import org.maemo.esbox.internal.api.core.sdk.BaseSDK;
 import org.maemo.esbox.maemosdk.core.sdk.IScratchboxSDK;
+import org.maemo.esbox.maemosdk.core.sdk.IScratchboxSDKTarget;
 
 /**
  * SDK for a Scratchbox environment
+ * 
  * @author eswartz
- *
+ * 
  */
 public abstract class ScratchboxSDK extends BaseSDK implements IScratchboxSDK {
 
@@ -34,15 +40,21 @@
 	}
 
 
-	/* (non-Javadoc)
+	/*
+	 * (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()
+
+	/*
+	 * (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
@@ -50,16 +62,93 @@
 			return null;
 		return cachedCurrentTarget;
 	}
-	
-	/* (non-Javadoc)
-	 * @see org.maemo.esbox.core.scratchbox.sdk.IScratchboxSDK#setCachedCurrentTarget(java.lang.String)
+
+	/*
+	 * (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) {
-		Assert.isNotNull(prefProvider);
 		return prefProvider.getPreferenceValue(key);
 	}
+
+	public boolean addSbrshAccessList(String targetDeviceAddr, String username,
+			String ipAddr) throws ESboxException {
+		// TODO Auto-generated method stub
+		return false;
+	}
+
+	public boolean configureSbrsh(String targetName, String targetDeviceAddr,
+			String nfsServerAddr) throws ESboxException {
+		// TODO Auto-generated method stub
+		return false;
+	}
+
+	public boolean createTarget(String targetName, String compiler,
+			String devkits, String cputransp) throws ESboxException {
+		// TODO Auto-generated method stub
+		return false;
+	}
+
+	public ICommandAbstractor getCommandAbstractor() throws ESboxException {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	public List<String> getCompilers() throws ESboxException {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	public List<String> getCputransp() throws ESboxException {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	public String getCurrentSboxVersion(IMachine machine) throws ESboxException {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	public IScratchboxSDKTarget getCurrentSDKTarget() throws ESboxException {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	public String getCurrentTarget() throws ESboxException {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	public List<String> getTargets() throws ESboxException {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	public boolean mountTarget(String targetName) throws ESboxException {
+		// TODO Auto-generated method stub
+		return false;
+	}
+
+	public boolean removeTarget(String targetName) throws ESboxException {
+		// TODO Auto-generated method stub
+		return false;
+	}
+
+	public boolean unmountTarget(String targetName) throws ESboxException {
+		// TODO Auto-generated method stub
+		return false;
+	}
+
+	public IPath getSDKRoot() {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
 }

Deleted: trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/MaemoPreferenceConstants.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/MaemoPreferenceConstants.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/MaemoPreferenceConstants.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -1,60 +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;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.maemo.esbox.internal.maemosdk.core.Activator;
-
-/**
- * This class encapsulates the keys for preference constants defined by the Maemo plugins.
- * @author eswartz
- *
- */
-public class MaemoPreferenceConstants {
-	public static final int VERSION_MAJOR = 17;
-	public static final int VERSION_MINOR = 0;
-	
-	/** Get the preference store that contains these preferences */
-	public static IPreferenceStore getPreferenceStore() {
-		return Activator.getDefault().getPreferenceStore();
-	}
-	
-	/* sbrsh */
-	public static final String ADD_ACT = "ADD_ACT";
-	//public static final String CHOOSE_TARGET_COMMAND = "CHOOSE_TARGET_COMMAND";
-	public static final String CONFIGURE_ACT = "CONFIGURE_ACT";
-	public static final String MOUNT_ACT = "MOUNT_ACT";
-	public static final String NFS_SERVER_HOSTNAME = "NFS_SERVER_HOSTNAME";
-	public static final String SBRSH_CONFIG_COMMAND = "SBRSH_CONFIG_COMMAND";
-	public static final String UNMOUNT_ACT = "UNMOUNT_ACT";
-
-	/* X/Maemo actions */
-	public static final String DISPLAY_X_COMMAND = "DISPLAY_X_COMMAND";
-	public static final String GAZPACHO_COMMAND = "GAZPACHO_COMMAND";
-	public static final String MAEMO_COMMAND = "MAEMO_COMMAND";
-	public static final String MAEMO_START_ACTION = "MAEMO_START_ACTION";
-	public static final String MAEMO_STOP_ACTION = "MAEMO_STOP_ACTION";
-	public static final String MAEMO_RESTART_ACTION = "MAEMO_RESTART_ACTION";
-	public static final String SBOX_GDB_REMOTE = "SBOX_GDB_REMOTE";
-	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";
-
-}

Added: trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/MaemoPreferenceConstants.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/MaemoPreferenceConstants.java	                        (rev 0)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/MaemoPreferenceConstants.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -0,0 +1,56 @@
+/*******************************************************************************
+ * 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;
+
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.maemo.esbox.internal.maemosdk.core.Activator;
+
+/**
+ * This class encapsulates the keys for preference constants defined by the
+ * Maemo plugins.
+ * 
+ * @author eswartz
+ * 
+ */
+public class MaemoPreferenceConstants {
+	public static final int VERSION_MAJOR = 17;
+	public static final int VERSION_MINOR = 0;
+
+	/** Get the preference store that contains these preferences */
+	public static IPreferenceStore getPreferenceStore() {
+		return Activator.getDefault().getPreferenceStore();
+	}
+
+	/* sbrsh */
+	public static final String ADD_ACT = "ADD_ACT";
+	// public static final String CHOOSE_TARGET_COMMAND =
+	// "CHOOSE_TARGET_COMMAND";
+	public static final String CONFIGURE_ACT = "CONFIGURE_ACT";
+	public static final String MOUNT_ACT = "MOUNT_ACT";
+	public static final String NFS_SERVER_HOSTNAME = "NFS_SERVER_HOSTNAME";
+	public static final String SBRSH_CONFIG_COMMAND = "SBRSH_CONFIG_COMMAND";
+	public static final String UNMOUNT_ACT = "UNMOUNT_ACT";
+
+	/* X/Maemo actions */
+	public static final String DISPLAY_X_COMMAND = "DISPLAY_X_COMMAND";
+	public static final String GAZPACHO_COMMAND = "GAZPACHO_COMMAND";
+	public static final String MAEMO_COMMAND = "MAEMO_COMMAND";
+	public static final String MAEMO_START_ACTION = "MAEMO_START_ACTION";
+	public static final String MAEMO_STOP_ACTION = "MAEMO_STOP_ACTION";
+	public static final String MAEMO_RESTART_ACTION = "MAEMO_RESTART_ACTION";
+	public static final String SBOX_GDB_REMOTE = "SBOX_GDB_REMOTE";
+	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";
+}


Property changes on: trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/MaemoPreferenceConstants.java
___________________________________________________________________
Name: svn:mergeinfo
   + 

Deleted: trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/MaemoPreferenceMigrator.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/MaemoPreferenceMigrator.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/MaemoPreferenceMigrator.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -1,53 +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;
-
-import org.maemo.esbox.core.HostUtils;
-import org.maemo.esbox.core.IPreferenceMigrator;
-import org.maemo.esbox.internal.api.core.OldESboxPreferenceMigrator;
-
-import java.util.Properties;
-
-/**
- * To migrate preferences, we use the 1.4 -> newer conversion and also pick
- * an OS-specific initial value for the X server command.
- * @author eswartz
- *
- */
-public class MaemoPreferenceMigrator extends OldESboxPreferenceMigrator
-		implements IPreferenceMigrator {
-
-	/* (non-Javadoc)
-	 * @see org.maemo.esbox.internal.api.core.OldESboxPreferenceMigrator#adjustDefaultSettings(java.util.Properties)
-	 */
-	@Override
-	public void adjustDefaultSettings(Properties newPropertyDefaults) {
-		super.adjustDefaultSettings(newPropertyDefaults);
-		// adjust any environment-dependent defaults
-		String hostEnvKey;
-		if (HostUtils.isWindows())
-			hostEnvKey = MaemoPreferenceConstants.DISPLAY_X_COMMAND_WIN32;
-		else
-			hostEnvKey = MaemoPreferenceConstants.DISPLAY_X_COMMAND_UNIX;
-		newPropertyDefaults.put(MaemoPreferenceConstants.DISPLAY_X_COMMAND, 
-				newPropertyDefaults.getProperty(hostEnvKey));
-		
-		if (HostUtils.isWindows())
-			hostEnvKey = MaemoPreferenceConstants.X_PATH_WIN32;
-		else
-			hostEnvKey = MaemoPreferenceConstants.X_PATH_UNIX;
-		newPropertyDefaults.put(MaemoPreferenceConstants.X_PATH, 
-				newPropertyDefaults.getProperty(hostEnvKey));
-		
-	}
-	
-}

Modified: trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/MaemoSDKEngine.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/MaemoSDKEngine.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/MaemoSDKEngine.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -22,25 +22,27 @@
  * Engine to manipulate information about Maemo SDK.
  */
 public class MaemoSDKEngine {
-	
-	public static String MAEMOSDK_EXTENSION_ID = Activator.PLUGIN_ID + ".maemo_sdk";
+
+	public static String MAEMOSDK_EXTENSION_ID = Activator.PLUGIN_ID
+			+ ".maemo_sdk";
 	public static String MAEMOSDK_VERSION = "version";
 	public static String MAEMOSDK_NAME = "name";
 	private static MaemoSDKEngine singleton = null;
-	
+
 	/* singleton instance */
 	private List<MaemoSDKInfo> maemoSDKSList;
-	
+
 	/**
 	 * Private constructor.
 	 */
 	private MaemoSDKEngine() {
-		maemoSDKSList = new ArrayList<MaemoSDKInfo>();		
+		maemoSDKSList = new ArrayList<MaemoSDKInfo>();
 		initializeMaemoSDKList();
 	}
 
 	/**
 	 * Return the singleton instance of this engine.
+	 * 
 	 * @return the singleton instance of this engine.
 	 */
 	public static synchronized MaemoSDKEngine getInstance() {
@@ -50,33 +52,37 @@
 	}
 
 	/**
-	 * Initialize the list of defined Maemo SDKs. Such SDKs are described
-	 * by plug-ins extension point org.maemo.esbox.ui.maemo_sdk
+	 * Initialize the list of defined Maemo SDKs. Such SDKs are described by
+	 * plug-ins extension point org.maemo.esbox.ui.maemo_sdk
 	 */
 	private void initializeMaemoSDKList() {
 		String maemoSDKVersion = null;
 		String maemoSDKName = null;
-				
-		IExtension[] extensions = Platform.getExtensionRegistry().getExtensionPoint(MAEMOSDK_EXTENSION_ID).getExtensions();
-		for(int i=0; i<extensions.length; i++) {
+
+		IExtension[] extensions = Platform.getExtensionRegistry()
+				.getExtensionPoint(MAEMOSDK_EXTENSION_ID).getExtensions();
+		for (int i = 0; i < extensions.length; i++) {
 			IExtension extension = extensions[i];
-			IConfigurationElement[] configElements = extension.getConfigurationElements();
-			for(int j=0; j<configElements.length; j++) {
+			IConfigurationElement[] configElements = extension
+					.getConfigurationElements();
+			for (int j = 0; j < configElements.length; j++) {
 				IConfigurationElement config = configElements[j];
 				maemoSDKVersion = config.getAttribute(MAEMOSDK_VERSION);
 				maemoSDKName = config.getAttribute(MAEMOSDK_NAME);
-				
-				maemoSDKSList.add(new MaemoSDKInfo(maemoSDKVersion,maemoSDKName));			
+
+				maemoSDKSList.add(new MaemoSDKInfo(maemoSDKVersion,
+						maemoSDKName));
 			}
-		}		
+		}
 	}
-	
+
 	/**
 	 * Return the list of subscribed Maemo SDKs.
+	 * 
 	 * @return the list of subscribed Maemo SDKs.
 	 */
 	public List<MaemoSDKInfo> getMaemoSDKS() {
 		return maemoSDKSList;
 	}
-	
+
 }

Modified: trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/MaemoSDKInfo.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/MaemoSDKInfo.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/MaemoSDKInfo.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -10,7 +10,6 @@
  *******************************************************************************/
 package org.maemo.esbox.maemosdk.core;
 
-
 /**
  * Class that contains information about an Maemo SDK.
  */
@@ -18,11 +17,14 @@
 
 	private String version;
 	private String name;
-	
+
 	/**
 	 * Constructor.
-	 * @param version the version of Maemo.
-	 * @param name the name of SDK version.
+	 * 
+	 * @param version
+	 *            the version of Maemo.
+	 * @param name
+	 *            the name of SDK version.
 	 */
 	public MaemoSDKInfo(String version, String name) {
 		this.version = version;
@@ -31,6 +33,7 @@
 
 	/**
 	 * Return the version of Maemo SDK.
+	 * 
 	 * @return the version of Maemo SDK.
 	 */
 	public String getVersion() {
@@ -39,6 +42,7 @@
 
 	/**
 	 * The name of Maemo SDK.
+	 * 
 	 * @return the name of Maemo SDK.
 	 */
 	public String getName() {
@@ -69,10 +73,10 @@
 			return false;
 		return true;
 	}
-	
+
 	@Override
-	public String toString() {	
+	public String toString() {
 		return getVersion() + " (" + getName() + ")";
 	}
-	
+
 }

Deleted: trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/OldStyleProjectProperties.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/OldStyleProjectProperties.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/OldStyleProjectProperties.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -1,160 +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;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.QualifiedName;
-import org.maemo.esbox.core.*;
-import org.maemo.esbox.core.execEnv.*;
-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.*;
-import org.maemo.esbox.project.core.IProjectProperties;
-
-import java.text.MessageFormat;
-
-/**
- * This class retrieves the old-style C/C++ or Python project properties stored in workspace metadata.
- * @author eswartz
- *
- */
-public class OldStyleProjectProperties implements
-		IProjectProperties {
-	private static final String TARGET_NAME_ID = "org.indt.esbox.project.targetName";
-	
-	private static final String SCRATCHBOX_VERSION_ID = "org.indt.esbox.project.scratchboxVersion";
-	
-	private static final String EXECUTION_ENVIRONMENT_ID = "org.indt.esbox.project.execEnv";
-	
-	static final QualifiedName targetNameProperty = new QualifiedName(TARGET_NAME_ID,"Scratchbox Target");
-	
-	static final QualifiedName scratchboxVersionProperty = new QualifiedName(SCRATCHBOX_VERSION_ID,"Scratchbox Version");
-	
-	static final QualifiedName executionEnvironmentProperty = new QualifiedName(EXECUTION_ENVIRONMENT_ID,"Execution Environment");
-	
-	private IProject project;
-
-	public OldStyleProjectProperties(IProject project) {
-		this.project = project;
-	}
-	
-	/* (non-Javadoc)
-	 * @see org.maemo.esbox.core.IPropertyAccess#read(java.lang.String)
-	 */
-	private String readProperty(QualifiedName property) {
-		try {
-			return project.getPersistentProperty(property);
-		} catch (CoreException e) {
-			Activator.getErrorLogger().logError("Could not read project property", e);
-			return null;
-		}
-	}
-	
-	/* (non-Javadoc)
-	 * @see org.maemo.esbox.project.core.IProjectProperties#getExecutionEnvironment()
-	 */
-	public IExecutionEnvironment getExecutionEnvironment() {
-		IExecutionEnvironment execEnv = null;
-		String execEnvId = readProperty(executionEnvironmentProperty);
-		if (execEnvId == null) {
-			// XXX: this is compatibility behavior
-			//execEnvId = "org.maemo.esbox.maemosdk.core.execution_environment.maemo";
-		}
-		execEnv = ExecutionEnvironmentFactory.getInstance().findExecutionEnvironment(execEnvId);
-		if (execEnv == null) {
-			execEnv = new UnknownExecutionEnvironment();
-		}
-		return execEnv;
-	}
-
-	/* (non-Javadoc)
-	 * @see org.maemo.esbox.project.core.IProjectProperties#getExecutionEnvironmentId()
-	 */
-	public String getExecutionEnvironmentId() {
-		return readProperty(executionEnvironmentProperty);
-	}
-
-	/**
-	 * Get the SDK target (SDK + target name) for the project's configured SDK
-	 * @return SDK target, never <code>null</code>
-	 * @throws ESboxException if no target known
-	 */
-	public ISDKTarget getSDKTarget() throws ESboxException {
-		if (!project.isOpen())
-			throw new ESboxException(
-					MessageFormat.format("Project ''{0}'' is not open",
-							project.getName()));
-		
-		ISDK sdk = getSDK();
-		String targetName = getTargetName();
-
-		ISDKTarget target = sdk.findSDKTarget(targetName);
-		if (target == null) {
-			throw new ESboxException(
-					MessageFormat.format("Project ''{0}'' references an unavailable target ''{1}''",
-							project.getName(),
-							targetName));
-		}
-		
-		return target;
-	}
-
-	/**
-	 * Get the SDK for the project
-	 * @return SDK, never <code>null</code>
-	 * @throws ESboxException if no SDK known
-	 */
-	public ISDK getSDK() throws ESboxException {
-		ISDK sdk = null;
-		
-		String version = getScratchboxVersion(project);
-		if (version == null) {
-			// old projects
-			version = "1";
-		}
-		if (version.equals("1")) {
-			sdk = ScratchboxSDKFacade.getInstance().getScratchbox1SDK();
-		} else if (version.equals("2")) {
-			sdk = ScratchboxSDKFacade.getInstance().getScratchbox2SDK();
-		}
-		if (sdk == null) {
-			throw new ESboxException(
-					MessageFormat.format("Project ''{0}'' uses an unsupported scratchbox version {1}",
-							project.getName(),
-							version));
-		}
-
-		return sdk;
-	}		
-	
-	public synchronized String getTargetName() {
-		return readProperty(targetNameProperty);
-	}
-	
-	public synchronized String getSDKName() {
-		String sboxVersion = readProperty(scratchboxVersionProperty);
-		if (sboxVersion == null)
-			return null;
-		if (sboxVersion.equals("1"))
-			return IScratchbox1SDK.NAME;
-		if (sboxVersion.equals("2"))
-			return IScratchbox2SDK.NAME;
-		return null;
-	}
-
-	public synchronized String getScratchboxVersion(IProject project) {
-		return readProperty(scratchboxVersionProperty);
-	}
-
-}

Deleted: trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/OldStyleWorkspaceProjectPropertiesProvider.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/OldStyleWorkspaceProjectPropertiesProvider.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/OldStyleWorkspaceProjectPropertiesProvider.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -1,57 +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;
-
-import org.eclipse.core.resources.IProject;
-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.*;
-
-/**
- * Implementation of oldStyleProjectPropertiesProvider to allow converting
- * old projects to the current format.
- * @author eswartz
- *
- */
-public class OldStyleWorkspaceProjectPropertiesProvider implements
-		IOldStyleProjectPropertiesProvider {
-
-	// NOTE: these nature IDs are stored here to avoid forcing this feature
-	// to depend on C/C++ or Python.
-	private static final String ESBOX_NATURE_ID = "org.indt.esbox.core.ESboxNature";
-	private static final String ESBOX_PYTHON_NATURE_ID = "org.indt.esbox.core.esboxPythonNature";
-
-	private boolean isNatureInProject(IProject _project, String id) {
-		if(_project != null && _project.isOpen()){
-			try {	        	
-				IProjectNature nature = _project.getNature(id);	            
-				if(nature != null) {
-					return true;
-				}
-			} catch (CoreException e) {
-				Activator.getErrorLogger().logError("Cannot detect project nature", e);
-			}
-		}	   
-		return false;		
-	}
-	/* (non-Javadoc)
-	 * @see org.maemo.esbox.project.core.IOldStyleProjectPropertiesProvider#createProjectProperties(org.eclipse.core.resources.IProject)
-	 */
-	public IProjectProperties createProjectProperties(IProject project) {
-		if (isNatureInProject(project, ESBOX_NATURE_ID)
-				|| isNatureInProject(project, ESBOX_PYTHON_NATURE_ID))
-			return new OldStyleProjectProperties(project);
-		return null;
-	}
-
-}

Deleted: trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/SB1PreferenceConstants.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/SB1PreferenceConstants.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/SB1PreferenceConstants.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -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.maemosdk.core;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.maemo.esbox.internal.maemosdk.core.Activator;
-
-/**
- * This class encapsulates the keys for preference constants defined by Scratchbox 1.
- * @author eswartz
- *
- */
-public class SB1PreferenceConstants {
-	public static final int VERSION_MAJOR = 17;
-	public static final int VERSION_MINOR = 0;
-	
-	/** Get the preference store that contains these preferences */
-	public static IPreferenceStore getPreferenceStore() {
-		return Activator.getDefault().getPreferenceStore();
-	}
-	
-
-	/* SB1 configuration options */
-	
-	public static final String RUN_SCRIPT_LOC = "RUN_SCRIPT_LOC";
-
-	public static final String SB1_GDB_REMOTE_QEMU = "SB1_GDB_REMOTE_QEMU";
-	public static final String SB1_CURRENT_ACT = "SB1_CURRENT_ACT";
-	public static final String SB1_SBOX_COMMAND = "SB1_SBOX_COMMAND";
-	public static final String SB1_REMOVE_ACT = "SB1_REMOVE_ACT";
-	public static final String SB1_REMOVE_OPT_FORCE = "SB1_REMOVE_OPT_FORCE";
-	public static final String SB1_RESET_ACT = "SB1_RESET_ACT";
-	public static final String SB1_ROOTSTRAP_ACT = "SB1_ROOTSTRAP_ACT";
-	public static final String SB1_ROOTSTRAP_OPT_FORCE = "SB1_ROOTSTRAP_OPT_FORCE";
-	public static final String SB1_INSTALL_ACT = "SB1_INSTALL_ACT";
-	public static final String SB1_INSTALL_OPT_CLIB = "SB1_INSTALL_OPT_CLIB";
-	public static final String SB1_INSTALL_OPT_DEVKITS = "SB1_INSTALL_OPT_DEVKITS";
-	public static final String SB1_INSTALL_OPT_ETC = "SB1_INSTALL_OPT_ETC";
-	public static final String SB1_INSTALL_OPT_FAKE = "SB1_INSTALL_OPT_FAKE";
-	public static final String SB1_INSTALL_OPT_GDB = "SB1_INSTALL_OPT_GDB";
-	public static final String SB1_INSTALL_OPT_STRACE = "SB1_INSTALL_OPT_STRACE";
-	public static final String SB1_KILLALL_ACT = "SB1_KILLALL_ACT";
-	public static final String SB1_KILLALL_OPT_SIGNAL = "SB1_KILLALL_OPT_SIGNAL";
-	public static final String SB1_LIST_ACT = "SB1_LIST_ACT";
-	public static final String SB1_LIST_OPT_COMPILERS = "SB1_LIST_OPT_COMPILERS";
-	public static final String SB1_LIST_OPT_CPU = "SB1_LIST_OPT_CPU";
-	public static final String SB1_LIST_OPT_DEVKITS = "SB1_LIST_OPT_DEVKITS";
-	public static final String SB1_LIST_OPT_SESSIONS = "SB1_LIST_OPT_SESSIONS";
-	public static final String SB1_LIST_OPT_TARGETS = "SB1_LIST_OPT_TARGETS";
-	public static final String SB1_LOGIN_COMMAND = "SB1_LOGIN_COMMAND";
-	public static final String SB1_SBOX_SANDBOX = "SB1_SBOX_SANDBOX";
-	public static final String SB1_SELECT_ACT = "SB1_SELECT_ACT";
-	public static final String SB1_SETUP_ACT = "SB1_SETUP_ACT";
-	public static final String SB1_SETUP_OPT_COMPILER = "SB1_SETUP_OPT_COMPILER";
-	public static final String SB1_SETUP_OPT_CPUTRANSP = "SB1_SETUP_OPT_CPUTRANSP";
-	public static final String SB1_SETUP_OPT_DEVKITS = "SB1_SETUP_OPT_DEVKITS";
-	public static final String SB1_SETUP_OPT_FORCE = "SB1_SETUP_OPT_FORCE";
-	public static final String SB1_SHOW_ACT = "SB1_SHOW_ACT";
-	public static final String SB1_SHOW_OPT_COMP_ARCH = "SB1_SHOW_OPT_COMP_ARCH";
-	public static final String SB1_SHOW_OPT_COMP_CLIB = "SB1_SHOW_OPT_COMP_CLIB";
-	public static final String SB1_SHOW_OPT_COMP_SUBARCH = "SB1_SHOW_OPT_COMP_SUBARCH";
-	public static final String SB1_SHOW_OPT_COMPILERS = "SB1_SHOW_OPT_COMPILERS";
-	public static final String SB1_SHOW_OPT_CPU = "SB1_SHOW_OPT_CPU";
-	public static final String SB1_SHOW_OPT_DEVKITS = "SB1_SHOW_OPT_DEVKITS";
-	public static final String SB1_VERSION_ACT = "SB1_VERSION_ACT";
-}

Deleted: trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/SB2PreferenceConstants.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/SB2PreferenceConstants.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/SB2PreferenceConstants.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -1,55 +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;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.maemo.esbox.internal.maemosdk.core.Activator;
-
-/**
- * This class encapsulates the keys for preference constants defined by Scratchbox 2.
- * @author eswartz
- *
- */
-public class SB2PreferenceConstants {
-	public static final int VERSION_MAJOR = 17;
-	public static final int VERSION_MINOR = 0;
-	
-	/** Get the preference store that contains these preferences */
-	public static IPreferenceStore getPreferenceStore() {
-		return Activator.getDefault().getPreferenceStore();
-	}
-	
-
-	/* SB2 configuration options */
-	public static final String SB2_GDB_REMOTE_QEMU = "SB2_GDB_REMOTE_QEMU";
-	public static final String SB2_CONFIG_COMMAND = "SB2_CONFIG_COMMAND";
-	public static final String SB2_EXEC_COMMAND = "SB2_EXEC_COMMAND";
-	public static final String SB2_INIT_COMMAND = "SB2_INIT_COMMAND";
-	public static final String SB2_VERSION_ACT = "SB2_VERSION_ACT";
-	public static final String SB2_LIST_ACT = "SB2_LIST_ACT";
-	public static final String SB2_MAPPING_MODE = "SB2_MAPPING_MODE";
-	public static final String SB2_INSTALL_MAPPING_MODE = "SB2_INSTALL_MAPPING_MODE";
-	public static final String SB2_LOG_LEVEL = "SB2_LOG_LEVEL";
-	public static final String SB2_INIT_OPT_COMPILER = "SB2_INIT_OPT_COMPILER";
-	public static final String SB2_MAEMO_ROOTSTRAP_COMMAND = "SB2_MAEMO_ROOTSTRAP_COMMAND";
-	public static final String SB2_MAEMO_ROOTSTRAP_AVAILABLE_ACT = "SB2_MAEMO_ROOTSTRAP_AVAILABLE_ACT";
-	public static final String SB2_MAEMO_ROOTSTRAP_LIST_ACT = "SB2_MAEMO_ROOTSTRAP_LIST_ACT";
-	public static final String SB2_MAEMO_ROOTSTRAP_INSTALL_ACT = "SB2_MAEMO_ROOTSTRAP_INSTALL_ACT";
-	public static final String SB2_MAEMO_ROOTSTRAP_FORCE_OPT = "SB2_MAEMO_ROOTSTRAP_FORCE_OPT";
-	public static final String SB2_MAEMO_ROOTSTRAP_HOST_TOOLS_OPT = "SB2_MAEMO_ROOTSTRAP_HOST_TOOLS_OPT";
-	public static final String SB2_MAEMO_ROOTSTRAP_REMOVE_ACT = "SB2_MAEMO_ROOTSTRAP_REMOVE_ACT";
-	public static final String SB2_SB2_SHOW_COMMAND = "SB2_SB2_SHOW_COMMAND";
-	public static final String SB2_SB2_SHOW_PATH_ACTION = "SB2_SB2_SHOW_PATH_ACTION";
-	public static final String SB2_SB2_SHOW_PATH_OUTPUT_PATTERN = "SB2_SB2_SHOW_PATH_OUTPUT_PATTERN";
-	public static final String SB2_MAEMO_ROOTSTRAP_PATH_ACT = "SB2_MAEMO_ROOTSTRAP_PATH_ACT";
-	
-}

Deleted: trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/ScratchboxPackageManagerProvider.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/ScratchboxPackageManagerProvider.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/ScratchboxPackageManagerProvider.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -1,57 +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;
-
-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.aptpkgconfig.AptPackageManager;
-import org.maemo.esbox.maemosdk.core.sdk.IScratchboxSDKTarget;
-
-/**
- * This implementation creates APT package managers for scratchbox targets.
- * @author eswartz
- *
- */
-public class ScratchboxPackageManagerProvider implements
-		IPackageManagerProvider {
-
-	/**
-	 * 
-	 */
-	public ScratchboxPackageManagerProvider() {
-	}
-
-	/* (non-Javadoc)
-	 * @see org.maemo.esbox.linux.packages.core.IPackageManagerProvider#createPackageManager(org.maemo.esbox.core.sdk.ISDKTarget)
-	 */
-	public IPackageManager createPackageManager(ISDKTarget sdkTarget) {
-		if (!(sdkTarget instanceof IScratchboxSDKTarget))
-			return null;
-
-		// in sb2, apt commands must be run as root
-		IProcessLauncherFactory aptProcessLauncherFactory;
-		if (sdkTarget instanceof IScratchboxSDKTarget)
-			aptProcessLauncherFactory = ((IScratchboxSDKTarget) sdkTarget).getProcessLauncherFactoryForInstall();
-		else
-			aptProcessLauncherFactory = sdkTarget.getProcessLauncherFactory();
-			
-		IProcessLauncherFactory pkgconfigProcessLauncherFactory = 
-			sdkTarget.getProcessLauncherFactory();
-		
-		IPackageManager manager = new AptPackageManager(sdkTarget,
-				aptProcessLauncherFactory,
-				pkgconfigProcessLauncherFactory);
-		return manager;
-	}
-
-}

Deleted: trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/ScratchboxPropertyTester.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/ScratchboxPropertyTester.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/ScratchboxPropertyTester.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -1,89 +0,0 @@
-package org.maemo.esbox.maemosdk.core;
-
-import org.eclipse.core.expressions.IPropertyTester;
-import org.eclipse.core.expressions.PropertyTester;
-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.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;
-
-/**
- * Test properties of ESbox resources for use in UI filtering and activation
- * <p>
- * <li>isRemoteTarget -- tell if the current build target can be a remote target (e.g. ARM)
- * <li>isEmulatorTarget -- tell if the current build target can be an emulator target
- * <li>isX86Target -- tell if the current build target is an x86 target
- * <li>isARMELTarget -- tell if the current build target is an ARMEL target
- *
- * @author eswartz
- *
- */
-public class ScratchboxPropertyTester extends PropertyTester implements
-		IPropertyTester {
-
-	protected IProject getProject(Object receiver) {
-		IResource rsrc = null;
-		if (receiver instanceof IResource) {
-			rsrc = (IResource) receiver;
-		} else if (receiver instanceof IAdaptable) {
-			rsrc = (IResource) (((IAdaptable) receiver).getAdapter(IResource.class)); 
-		}
-		if (rsrc == null)
-			return null;
-		return rsrc.getProject();
-	}
-	
-	protected ISDKTarget getSDKTarget(IProject project) {
-		try {
-			return ProjectManager.getInstance().getSDKTarget(project);
-		} catch (ESboxException e) {
-			return null;
-		}
-	}
-
-	
-	/* (non-Javadoc)
-	 * @see org.eclipse.core.expressions.IPropertyTester#test(java.lang.Object, java.lang.String, java.lang.Object[], java.lang.Object)
-	 */
-	public boolean test(Object receiver, String property, Object[] args,
-			Object expectedValue) {
-		
-		IProject project = getProject(receiver);
-		if (project != null) {
-			// TODO: Avoid actually reading the project metadata to get the target
-			// since, for the first invocation in a new workspace, this can make a submenu
-			// close as it's being opened if we need to put up a progress dialog to
-			// initialize the SDKs.
-			//
-			ISDKTarget sdkTarget = getSDKTarget(project);
-			if (sdkTarget != null) {
-				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;
-				}
-				
-				if (property.equals("isRemoteTarget")) {
-					return isARM;
-				}
-				if (property.equals("isX86Target")) {
-					return isX86;
-				}
-				if (property.equals("isARMELTarget")) {
-					return isARM;
-				}
-			}
-		}
-		
-		
-		return false;
-	}
-
-}

Copied: trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/command (from rev 873, branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/command)

Deleted: trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/command/AbstractSDKCommand.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/command/AbstractSDKCommand.java	2008-10-15 06:30:08 UTC (rev 873)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/command/AbstractSDKCommand.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -1,59 +0,0 @@
-package org.maemo.esbox.maemosdk.core.command;
-
-import java.security.InvalidParameterException;
-
-import org.maemo.esbox.internal.api.commands.ICommandAbstractor;
-
-public abstract class AbstractSDKCommand extends ScratchboxCommand {
-
-	public AbstractSDKCommand(ICommandAbstractor commandAbstractor) {
-		super(commandAbstractor);
-		// TODO Auto-generated constructor stub
-	}
-
-	/**
-	 * Replace the actions and options of the Scratchbox configure command. This
-	 * is an utility method to be used by all the subclasses of
-	 * IScratchboxCommand.
-	 * 
-	 * @param sboxCommand
-	 *            The Scratchbox command.
-	 * @param action
-	 *            The action to be replace.
-	 * @return The result command with the replacement of action made.
-	 */
-	public String replaceScratchboxConfigCommand(String action) {
-		return this.replaceScratchboxConfigCommand(action, null);
-	}
-
-	/**
-	 * Replace the actions and options of the Scratchbox configure command. This
-	 * is an utility method to be used by all the subclasses of
-	 * IScratchboxCommand.
-	 * 
-	 * @param action
-	 *            The action to be replace.
-	 * @param options
-	 *            The options to be replace. If the value of options is null, it
-	 *            is supposed to not consider any option.
-	 * @return The result command with all the replacements (actions and
-	 *         options) made.
-	 * 
-	 * @throws InvalidParameterException
-	 *             if parameters action or command is null.
-	 */
-	public abstract String replaceScratchboxConfigCommand(String action,
-			String[] options) throws InvalidParameterException;
-	// {
-	// String sboxCommand;
-	//		
-	// if (sboxVersion == 1)
-	// sboxCommand = commandAbstractor.getPreferenceValue(
-	// SB1PreferenceConstants.SB1_SBOX_COMMAND);
-	// else
-	// sboxCommand = commandAbstractor.getPreferenceValue(
-	// SB2PreferenceConstants.SB2_CONFIG_COMMAND);
-	//
-	// return replaceScratchboxCommand(sboxCommand, action, options);
-	// }
-}

Copied: trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/command/AbstractSDKCommand.java (from rev 873, branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/command/AbstractSDKCommand.java)
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/command/AbstractSDKCommand.java	                        (rev 0)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/command/AbstractSDKCommand.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -0,0 +1,59 @@
+package org.maemo.esbox.maemosdk.core.command;
+
+import java.security.InvalidParameterException;
+
+import org.maemo.esbox.internal.api.core.commands.ICommandAbstractor;
+
+public abstract class AbstractSDKCommand extends ScratchboxCommand {
+
+	public AbstractSDKCommand(ICommandAbstractor commandAbstractor) {
+		super(commandAbstractor);
+		// TODO Auto-generated constructor stub
+	}
+
+	/**
+	 * Replace the actions and options of the Scratchbox configure command. This
+	 * is an utility method to be used by all the subclasses of
+	 * IScratchboxCommand.
+	 * 
+	 * @param sboxCommand
+	 *            The Scratchbox command.
+	 * @param action
+	 *            The action to be replace.
+	 * @return The result command with the replacement of action made.
+	 */
+	public String replaceScratchboxConfigCommand(String action) {
+		return this.replaceScratchboxConfigCommand(action, null);
+	}
+
+	/**
+	 * Replace the actions and options of the Scratchbox configure command. This
+	 * is an utility method to be used by all the subclasses of
+	 * IScratchboxCommand.
+	 * 
+	 * @param action
+	 *            The action to be replace.
+	 * @param options
+	 *            The options to be replace. If the value of options is null, it
+	 *            is supposed to not consider any option.
+	 * @return The result command with all the replacements (actions and
+	 *         options) made.
+	 * 
+	 * @throws InvalidParameterException
+	 *             if parameters action or command is null.
+	 */
+	public abstract String replaceScratchboxConfigCommand(String action,
+			String[] options) throws InvalidParameterException;
+	// {
+	// String sboxCommand;
+	//		
+	// if (sboxVersion == 1)
+	// sboxCommand = commandAbstractor.getPreferenceValue(
+	// SB1PreferenceConstants.SB1_SBOX_COMMAND);
+	// else
+	// sboxCommand = commandAbstractor.getPreferenceValue(
+	// SB2PreferenceConstants.SB2_CONFIG_COMMAND);
+	//
+	// return replaceScratchboxCommand(sboxCommand, action, options);
+	// }
+}

Deleted: trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/command/ScratchboxCommand.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/command/ScratchboxCommand.java	2008-10-15 06:30:08 UTC (rev 873)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/command/ScratchboxCommand.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -1,575 +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.command;
-
-import org.eclipse.core.runtime.*;
-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.api.commands.ICommandAbstractor;
-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.ScratchboxInvalidOperationException;
-import org.maemo.esbox.maemosdk.core.*;
-import org.maemo.esbox.maemosdk.core.scratchbox.ScratchboxException;
-
-import java.io.*;
-import java.security.InvalidParameterException;
-import java.util.*;
-
-/**
- * Implements some common methods for Scratchbox commands.
- * <p>
- * <b>NOTE:</b> this base class should only be used for basic scratchbox utility
- * command launching. It is not recommended to use this class's
- * string-substitution method to create general command lines, since this
- * ignores details like shell escaping and quoting, which should be constructed
- * with the List<String> class and alternate IProcessLauncherFactory methods.
- */
-public abstract class ScratchboxCommand implements ICommand {
-
-	/**
-	 * 
-	 */
-	private static final IStatus CANCEL_STATUS = Policy
-			.getCancelStatus(Activator.getDefault());
-
-	public static final String ERROR_TOKEN = "ERROR:"; //$NON-NLS-1$
-
-	public static final String WARNING_TOKEN = "sb-conf:"; //$NON-NLS-1$
-
-	protected ICommandAbstractor commandAbstractor;
-
-	// protected int sboxVersion;
-
-	protected MessageConsole console;
-
-	private IProgressMonitor monitor;
-
-	public ScratchboxCommand(ICommandAbstractor commandAbstractor/*
-																 * , int
-																 * sboxVersion
-																 */) {
-		this.commandAbstractor = commandAbstractor;
-		// this.sboxVersion = sboxVersion;
-	}
-
-	/**
-	 * Replace the actions and options of the sbrsh configure command.
-	 * 
-	 * @param action
-	 *            The action to be replace.
-	 * @return The result command with the replacement of action made.
-	 */
-	public String replaceScratchboxSbrshConfigCommand(String action) {
-		return this.replaceScratchboxSbrshConfigCommand(action, null);
-	}
-
-	/**
-	 * Replace the actions and options of the sbrsh configure command.
-	 * 
-	 * @param action
-	 *            The action to be replace.
-	 * @param options
-	 *            The options to be replace. If the value of options is null, it
-	 *            is supposed to not consider any option.
-	 * @return The result command with all the replacements (actions and
-	 *         options) made.
-	 * 
-	 * @throws InvalidParameterException
-	 *             if parameters action or command is null.
-	 */
-	public String replaceScratchboxSbrshConfigCommand(String action,
-			String[] options) throws InvalidParameterException {
-		String sbrshConfigCommand = commandAbstractor
-				.getPreferenceValue(MaemoPreferenceConstants.SBRSH_CONFIG_COMMAND);
-
-		return replaceScratchboxCommand(sbrshConfigCommand, action, options);
-	}
-
-	/**
-	 * Replace the actions and options of a given Scratchbox command.
-	 * 
-	 * @param command
-	 *            The command with actions and options to be replaced.
-	 * @param action
-	 *            The action to be replaced.
-	 * @param options
-	 *            The options to be replace. If the value of options is null, it
-	 *            is supposed to not consider any option.
-	 * @return The result command with all the replacements (actions and
-	 *         options) made.
-	 * @throws InvalidParameterException
-	 *             if parameters action or command is null.
-	 */
-	protected String replaceScratchboxCommand(String command, String action,
-			String[] options) throws InvalidParameterException {
-		if (command == null || action == null)
-			throw new InvalidParameterException("The parameters cannot be null");
-
-		String resultCommand;
-		String optionsToReplace = "";
-		String separator = "";
-
-		if (options != null) {
-			for (int i = 0; i < options.length; i++) {
-				optionsToReplace += separator + options[i];
-				separator = " ";
-			}
-		}
-
-		ShellTemplateSubstitutor substitutor = new ShellTemplateSubstitutor();
-		substitutor.define("ACTIONS", action);
-		substitutor.define("OPTIONS", optionsToReplace);
-
-		resultCommand = substitutor.substitute(command);
-
-		return resultCommand;
-	}
-
-	/**
-	 * For long-running process, provide a progress monitor and the console to
-	 * which to report results of an executing command. If not set, or set to
-	 * <code>null</code>, there will be no console output.
-	 * 
-	 * @param monitor
-	 * @param console
-	 */
-	protected void setMonitorAndConsole(IProgressMonitor monitor,
-			MessageConsole console) {
-		this.monitor = monitor;
-		this.console = console;
-	}
-
-	/**
-	 * Create a process from the given process launch handler factory and the
-	 * given command line.
-	 * 
-	 * @param launcherFactory
-	 *            the factory for creating IProcessLauncherFactory
-	 * @param commandLine
-	 *            the command line string
-	 * @throws ScratchboxException
-	 *             failure to launch process
-	 */
-	public Process createProcess(List<String> cmdLine) throws ESboxException {
-		IProcessLauncher processLauncher = ProcessLauncherCreator
-				.createProcessLauncher(commandAbstractor
-						.getProcessLauncherFactory(), null, cmdLine);
-		Process process = processLauncher.createProcess();
-		if (console != null) {
-			new PrintStream(console.newMessageStream())
-					.println(CommandLineArguments.toCommandLine(cmdLine));
-			processLauncher.redirectToConsole(console);
-		}
-		return process;
-	}
-
-	/**
-	 * Create a process from the given process launch handler factory and the
-	 * given command line.
-	 * 
-	 * @param launcherFactory
-	 *            the factory for creating IProcessLauncherFactory
-	 * @param commandLine
-	 *            the command line string
-	 * @throws ScratchboxException
-	 *             failure to launch process
-	 */
-	public Process createProcess(String commandline) throws ESboxException {
-		return createProcess(commandline, null);
-	}
-
-	/**
-	 * Create a process from the given process launch handler factory and the
-	 * given command line.
-	 * 
-	 * @param commandLine
-	 *            the command line string
-	 * @param envBlock
-	 *            prperties
-	 * @throws ScratchboxException
-	 *             failure to launch process
-	 */
-	public Process createProcess(String commandline,
-			IEnvironmentModifierBlock envBlock) throws ESboxException {
-		List<String> cmdLine = CommandLineArguments
-				.createFromCommandLine(commandline);
-		IProcessLauncher processLauncher = ProcessLauncherCreator
-				.createProcessLauncher(commandAbstractor
-						.getProcessLauncherFactory(), null, cmdLine, envBlock);
-		Process process = processLauncher.createProcess();
-		if (console != null) {
-			new PrintStream(console.newMessageStream()).println(commandline);
-			processLauncher.redirectToConsole(console);
-		}
-		return process;
-	}
-
-	/**
-	 * Eat the stdout and stderr results from the process and wait for it to
-	 * finish. Optionally check whether stderr is empty.
-	 * <p>
-	 * This is done here instead of in the commands because CDT's Spawner will
-	 * destroy the streams when #waitFor() is called, while other Process
-	 * implementations don't do this, and we don't want a dependency on the
-	 * ordering repeated in the command implementations.
-	 * 
-	 * @return stdout results, as a string
-	 */
-	protected String getInputFromProcessAndWait(Process process,
-			boolean allowError) throws ScratchboxException {
-		return getInputFromProcessAndWait(process, allowError, 0);
-	}
-
-	protected IStatus runAndWaitForProcess(String jobName,
-			final String commandline, IEnvironmentModifierBlock envBlock,
-			long timeout) throws ESboxException {
-		final IProcessLauncher processLauncher = ProcessLauncherCreator
-				.createProcessLauncher(
-						commandAbstractor.getProcessLauncherFactory(),
-						null,
-						CommandLineArguments.createFromCommandLine(commandline),
-						envBlock);
-		processLauncher.usePTY(true);
-
-		final Process process = processLauncher.createProcess();
-		new PrintStream(console.newMessageStream()).println(commandline);
-
-		Job job = new Job(jobName) {
-
-			@Override
-			protected IStatus run(IProgressMonitor monitor) {
-				monitor.beginTask("", 2);
-				monitor.subTask("Running " + commandline);
-				try {
-					processLauncher.redirectToConsole(console);
-					try {
-						process.waitFor();
-						monitor.worked(1);
-						int exit = process.exitValue();
-						if (exit != 0) {
-							return Activator.createErrorStatus(
-									"Process failed with exit value " + exit,
-									null);
-						}
-					} catch (InterruptedException e) {
-						return CANCEL_STATUS;
-					}
-				} finally {
-					monitor.done();
-				}
-				return Status.OK_STATUS;
-			}
-		};
-		job.schedule();
-		try {
-			long deadline = System.currentTimeMillis() + timeout;
-			while (job.getResult() == null) {
-				Thread.sleep(500);
-				if (monitor.isCanceled()
-						|| (timeout != 0 && System.currentTimeMillis() >= deadline)) {
-					process.destroy();
-					job.cancel();
-					return CANCEL_STATUS;
-				}
-			}
-			return job.getResult();
-		} catch (InterruptedException e) {
-			return CANCEL_STATUS;
-		}
-	}
-
-	/**
-	 * Wait for the process to finish with a certain timeout.
-	 * 
-	 * @param timeout
-	 *            if not zero, timeout in milliseconds before throwing exception
-	 * @return exit code
-	 */
-	protected int waitForProcess(final Process process, final long timeout)
-			throws ScratchboxException {
-		final Exception[] excs = { null };
-		Runnable runnable = new Runnable() {
-
-			public void run() {
-				try {
-					process.waitFor();
-				} catch (InterruptedException e) {
-					excs[0] = e;
-				}
-			}
-
-		};
-
-		if (timeout == 0) {
-			runnable.run();
-		} else {
-			Thread thread = new Thread(runnable);
-			thread.start();
-			try {
-				thread.join(timeout);
-				if (thread.isAlive()) {
-					thread.interrupt();
-					excs[0] = new InterruptedException();
-				}
-			} catch (InterruptedException e) {
-				excs[0] = e;
-			}
-		}
-
-		if (excs[0] instanceof InterruptedException) {
-			throw new ScratchboxException("Command interrupted after "
-					+ timeout + " milliseconds");
-		} else if (excs[0] instanceof ScratchboxException) {
-			throw (ScratchboxException) excs[0];
-		} else if (excs[0] != null) {
-			throw new ScratchboxException(excs[0]);
-		}
-
-		return process.exitValue();
-	}
-
-	/**
-	 * Eat the stdout and stderr results from the process and wait for it to
-	 * finish. Optionally check whether stderr is empty.
-	 * <p>
-	 * This is done here instead of in the commands because CDT's Spawner will
-	 * destroy the streams when #waitFor() is called, while other Process
-	 * implementations don't do this, and we don't want a dependency on the
-	 * ordering repeated in the command implementations.
-	 * 
-	 * @param timeout
-	 *            if not zero, timeout in milliseconds before throwing exception
-	 * @return stdout results, as a string
-	 */
-	protected String getInputFromProcessAndWait(final Process process,
-			final boolean allowError, final long timeout)
-			throws ScratchboxException {
-		final String[] inputs = { null };
-		final Exception[] excs = { null };
-		Runnable runnable = new Runnable() {
-
-			public void run() {
-				try {
-					inputs[0] = getInputFromProcess(process);
-
-					if (!allowError) {
-						String error = getErrorInputFromProcess(process);
-						if (error.length() > 0) {
-							excs[0] = new ScratchboxInvalidOperationException(
-									error);
-							return;
-						}
-					}
-				} catch (IOException e) {
-					excs[0] = e;
-					return;
-				} catch (ScratchboxException e) {
-					excs[0] = e;
-					return;
-				}
-
-				try {
-					process.waitFor();
-				} catch (InterruptedException e) {
-					excs[0] = e;
-				}
-			}
-
-		};
-
-		if (timeout == 0) {
-			runnable.run();
-		} else {
-			Thread thread = new Thread(runnable);
-			thread.start();
-			try {
-				thread.join(timeout);
-				if (thread.isAlive()) {
-					thread.interrupt();
-					process.destroy();
-					excs[0] = new InterruptedException();
-				}
-			} catch (InterruptedException e) {
-				excs[0] = e;
-			}
-		}
-
-		if (excs[0] instanceof InterruptedException) {
-			throw new ScratchboxException("Command interrupted after "
-					+ timeout + " milliseconds");
-		} else if (excs[0] instanceof ScratchboxException) {
-			throw (ScratchboxException) excs[0];
-		} else if (excs[0] != null) {
-			throw new ScratchboxException(excs[0]);
-		}
-
-		return inputs[0];
-	}
-
-	/**
-	 * Eat the stdout and stderr results from the process and wait for it to
-	 * finish. Return a
-	 * <p>
-	 * This is done here instead of in the commands because CDT's Spawner will
-	 * destroy the streams when #waitFor() is called, while other Process
-	 * implementations don't do this, and we don't want a dependency on the
-	 * ordering repeated in the command implementations.
-	 * 
-	 * @return stdout results, as an array of lines
-	 */
-	protected List<String> getLineInputFromProcessAndWait(Process process,
-			boolean allowError) throws ScratchboxException {
-		return getLineInputFromProcessAndWait(process, allowError, 0);
-	}
-
-	/**
-	 * Eat the stdout and stderr results from the process and wait for it to
-	 * finish. Return a
-	 * <p>
-	 * This is done here instead of in the commands because CDT's Spawner will
-	 * destroy the streams when #waitFor() is called, while other Process
-	 * implementations don't do this, and we don't want a dependency on the
-	 * ordering repeated in the command implementations.
-	 * 
-	 * @param timeout
-	 *            if non-zero, timeout in milliseconds
-	 * @return stdout results, as an array of lines
-	 */
-	protected List<String> getLineInputFromProcessAndWait(Process process,
-			boolean allowError, long timeout) throws ScratchboxException {
-		String input = getInputFromProcessAndWait(process, allowError, timeout);
-		return processLines(input);
-	}
-
-	/**
-	 * Return the input stream of the process as a string. All lines generated
-	 * by the process are concatenated.
-	 * 
-	 * @param process
-	 *            the process.
-	 * @return the input stream of the process.
-	 * @throws IOException
-	 *             if any I/O problem occurrs.
-	 */
-	private String getInputFromProcess(Process process) throws IOException,
-			ScratchboxException {
-		return getInputStream(process.getInputStream());
-	}
-
-	/**
-	 * Return the error input stream of the process as a string. All lines
-	 * generated by the process are concatenated.
-	 * 
-	 * @param process
-	 *            the process.
-	 * @return the input stream of the process.
-	 * @throws IOException
-	 *             if any I/O problem occurrs.
-	 * @throws ScratchboxException
-	 */
-	private String getErrorInputFromProcess(Process process)
-			throws IOException, ScratchboxException {
-		return getInputStream(process.getErrorStream());
-	}
-
-	/**
-	 * Return an input stream as a string. All lines generated by the process
-	 * are concatenated.
-	 * 
-	 * @param processInputStream
-	 *            the input stream to be read.
-	 * @return the input stream of the process.
-	 * @throws IOException
-	 *             if any I/O problem occurrs.
-	 * @throws ScratchboxException
-	 */
-	private String getInputStream(InputStream processInputStream)
-			throws IOException, ScratchboxException {
-		BufferedReader in = new BufferedReader(new InputStreamReader(
-				processInputStream));
-
-		String line;
-		String result = "";
-		String separator = "";
-
-		while ((line = in.readLine()) != null) {
-			checkError(line, ERROR_TOKEN);
-			checkError(line, WARNING_TOKEN);
-			result += separator + line;
-			separator = System.getProperty("line.separator");
-		}
-
-		return result;
-	}
-
-	private void checkError(String inputString, String errorPattern)
-			throws ScratchboxException {
-		if (inputString.startsWith(errorPattern)) {
-			int index = inputString.indexOf(errorPattern);
-			throw new ScratchboxException(inputString.substring(index
-					+ errorPattern.length()));
-		}
-	}
-
-	/**
-	 * Get a string with a set of lines an return a list with the lines
-	 * separated.
-	 * 
-	 * @param stringWithLines
-	 *            a string with lines.
-	 * @return a list with the lines separated.
-	 */
-	private List<String> processLines(String stringWithLines) {
-		List<String> lines = new ArrayList<String>();
-		final String FILE_SEPARATOR = System.getProperty("line.separator");
-
-		StringTokenizer tokens = new StringTokenizer(stringWithLines,
-				FILE_SEPARATOR);
-		while (tokens.hasMoreElements()) {
-			lines.add(tokens.nextToken());
-		}
-
-		return lines;
-	}
-
-	/**
-	 * Return the correct size of performCommand parameters list.
-	 * 
-	 * @return the correct size of performCommand parameters list.
-	 */
-	public abstract int getParametersSize();
-
-	/**
-	 * Verify if the parameter list has the correct size.
-	 * 
-	 * @param param
-	 *            the list of parameters to be verified.
-	 * @return true, if the list contains the correct number of parameters;
-	 *         false, otherwise.
-	 */
-	protected boolean checkParameters(List<String> param) {
-		return getParametersSize() == param.size();
-	}
-
-	protected String catenateLines(List<String> lines) {
-		StringBuilder builder = new StringBuilder();
-		for (String line : lines) {
-			builder.append(line);
-			builder.append('\n');
-		}
-		return builder.toString();
-	}
-}

Copied: trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/command/ScratchboxCommand.java (from rev 873, branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/command/ScratchboxCommand.java)
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/command/ScratchboxCommand.java	                        (rev 0)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/command/ScratchboxCommand.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -0,0 +1,575 @@
+/*******************************************************************************
+ * 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.command;
+
+import org.eclipse.core.runtime.*;
+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.api.core.commands.ICommandAbstractor;
+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.ScratchboxInvalidOperationException;
+import org.maemo.esbox.maemosdk.core.MaemoPreferenceConstants;
+import org.maemo.esbox.maemosdk.core.scratchbox.ScratchboxException;
+
+import java.io.*;
+import java.security.InvalidParameterException;
+import java.util.*;
+
+/**
+ * Implements some common methods for Scratchbox commands.
+ * <p>
+ * <b>NOTE:</b> this base class should only be used for basic scratchbox utility
+ * command launching. It is not recommended to use this class's
+ * string-substitution method to create general command lines, since this
+ * ignores details like shell escaping and quoting, which should be constructed
+ * with the List<String> class and alternate IProcessLauncherFactory methods.
+ */
+public abstract class ScratchboxCommand implements ICommand {
+
+	/**
+	 * 
+	 */
+	private static final IStatus CANCEL_STATUS = Policy
+			.getCancelStatus(Activator.getDefault());
+
+	public static final String ERROR_TOKEN = "ERROR:"; //$NON-NLS-1$
+
+	public static final String WARNING_TOKEN = "sb-conf:"; //$NON-NLS-1$
+
+	protected ICommandAbstractor commandAbstractor;
+
+	// protected int sboxVersion;
+
+	protected MessageConsole console;
+
+	private IProgressMonitor monitor;
+
+	public ScratchboxCommand(ICommandAbstractor commandAbstractor/*
+																 * , int
+																 * sboxVersion
+																 */) {
+		this.commandAbstractor = commandAbstractor;
+		// this.sboxVersion = sboxVersion;
+	}
+
+	/**
+	 * Replace the actions and options of the sbrsh configure command.
+	 * 
+	 * @param action
+	 *            The action to be replace.
+	 * @return The result command with the replacement of action made.
+	 */
+	public String replaceScratchboxSbrshConfigCommand(String action) {
+		return this.replaceScratchboxSbrshConfigCommand(action, null);
+	}
+
+	/**
+	 * Replace the actions and options of the sbrsh configure command.
+	 * 
+	 * @param action
+	 *            The action to be replace.
+	 * @param options
+	 *            The options to be replace. If the value of options is null, it
+	 *            is supposed to not consider any option.
+	 * @return The result command with all the replacements (actions and
+	 *         options) made.
+	 * 
+	 * @throws InvalidParameterException
+	 *             if parameters action or command is null.
+	 */
+	public String replaceScratchboxSbrshConfigCommand(String action,
+			String[] options) throws InvalidParameterException {
+		String sbrshConfigCommand = commandAbstractor
+				.getPreferenceValue(MaemoPreferenceConstants.SBRSH_CONFIG_COMMAND);
+
+		return replaceScratchboxCommand(sbrshConfigCommand, action, options);
+	}
+
+	/**
+	 * Replace the actions and options of a given Scratchbox command.
+	 * 
+	 * @param command
+	 *            The command with actions and options to be replaced.
+	 * @param action
+	 *            The action to be replaced.
+	 * @param options
+	 *            The options to be replace. If the value of options is null, it
+	 *            is supposed to not consider any option.
+	 * @return The result command with all the replacements (actions and
+	 *         options) made.
+	 * @throws InvalidParameterException
+	 *             if parameters action or command is null.
+	 */
+	protected String replaceScratchboxCommand(String command, String action,
+			String[] options) throws InvalidParameterException {
+		if (command == null || action == null)
+			throw new InvalidParameterException("The parameters cannot be null");
+
+		String resultCommand;
+		String optionsToReplace = "";
+		String separator = "";
+
+		if (options != null) {
+			for (int i = 0; i < options.length; i++) {
+				optionsToReplace += separator + options[i];
+				separator = " ";
+			}
+		}
+
+		ShellTemplateSubstitutor substitutor = new ShellTemplateSubstitutor();
+		substitutor.define("ACTIONS", action);
+		substitutor.define("OPTIONS", optionsToReplace);
+
+		resultCommand = substitutor.substitute(command);
+
+		return resultCommand;
+	}
+
+	/**
+	 * For long-running process, provide a progress monitor and the console to
+	 * which to report results of an executing command. If not set, or set to
+	 * <code>null</code>, there will be no console output.
+	 * 
+	 * @param monitor
+	 * @param console
+	 */
+	protected void setMonitorAndConsole(IProgressMonitor monitor,
+			MessageConsole console) {
+		this.monitor = monitor;
+		this.console = console;
+	}
+
+	/**
+	 * Create a process from the given process launch handler factory and the
+	 * given command line.
+	 * 
+	 * @param launcherFactory
+	 *            the factory for creating IProcessLauncherFactory
+	 * @param commandLine
+	 *            the command line string
+	 * @throws ScratchboxException
+	 *             failure to launch process
+	 */
+	public Process createProcess(List<String> cmdLine) throws ESboxException {
+		IProcessLauncher processLauncher = ProcessLauncherCreator
+				.createProcessLauncher(commandAbstractor
+						.getProcessLauncherFactory(), null, cmdLine);
+		Process process = processLauncher.createProcess();
+		if (console != null) {
+			new PrintStream(console.newMessageStream())
+					.println(CommandLineArguments.toCommandLine(cmdLine));
+			processLauncher.redirectToConsole(console);
+		}
+		return process;
+	}
+
+	/**
+	 * Create a process from the given process launch handler factory and the
+	 * given command line.
+	 * 
+	 * @param launcherFactory
+	 *            the factory for creating IProcessLauncherFactory
+	 * @param commandLine
+	 *            the command line string
+	 * @throws ScratchboxException
+	 *             failure to launch process
+	 */
+	public Process createProcess(String commandline) throws ESboxException {
+		return createProcess(commandline, null);
+	}
+
+	/**
+	 * Create a process from the given process launch handler factory and the
+	 * given command line.
+	 * 
+	 * @param commandLine
+	 *            the command line string
+	 * @param envBlock
+	 *            prperties
+	 * @throws ScratchboxException
+	 *             failure to launch process
+	 */
+	public Process createProcess(String commandline,
+			IEnvironmentModifierBlock envBlock) throws ESboxException {
+		List<String> cmdLine = CommandLineArguments
+				.createFromCommandLine(commandline);
+		IProcessLauncher processLauncher = ProcessLauncherCreator
+				.createProcessLauncher(commandAbstractor
+						.getProcessLauncherFactory(), null, cmdLine, envBlock);
+		Process process = processLauncher.createProcess();
+		if (console != null) {
+			new PrintStream(console.newMessageStream()).println(commandline);
+			processLauncher.redirectToConsole(console);
+		}
+		return process;
+	}
+
+	/**
+	 * Eat the stdout and stderr results from the process and wait for it to
+	 * finish. Optionally check whether stderr is empty.
+	 * <p>
+	 * This is done here instead of in the commands because CDT's Spawner will
+	 * destroy the streams when #waitFor() is called, while other Process
+	 * implementations don't do this, and we don't want a dependency on the
+	 * ordering repeated in the command implementations.
+	 * 
+	 * @return stdout results, as a string
+	 */
+	protected String getInputFromProcessAndWait(Process process,
+			boolean allowError) throws ScratchboxException {
+		return getInputFromProcessAndWait(process, allowError, 0);
+	}
+
+	protected IStatus runAndWaitForProcess(String jobName,
+			final String commandline, IEnvironmentModifierBlock envBlock,
+			long timeout) throws ESboxException {
+		final IProcessLauncher processLauncher = ProcessLauncherCreator
+				.createProcessLauncher(
+						commandAbstractor.getProcessLauncherFactory(),
+						null,
+						CommandLineArguments.createFromCommandLine(commandline),
+						envBlock);
+		processLauncher.usePTY(true);
+
+		final Process process = processLauncher.createProcess();
+		new PrintStream(console.newMessageStream()).println(commandline);
+
+		Job job = new Job(jobName) {
+
+			@Override
+			protected IStatus run(IProgressMonitor monitor) {
+				monitor.beginTask("", 2);
+				monitor.subTask("Running " + commandline);
+				try {
+					processLauncher.redirectToConsole(console);
+					try {
+						process.waitFor();
+						monitor.worked(1);
+						int exit = process.exitValue();
+						if (exit != 0) {
+							return Activator.createErrorStatus(
+									"Process failed with exit value " + exit,
+									null);
+						}
+					} catch (InterruptedException e) {
+						return CANCEL_STATUS;
+					}
+				} finally {
+					monitor.done();
+				}
+				return Status.OK_STATUS;
+			}
+		};
+		job.schedule();
+		try {
+			long deadline = System.currentTimeMillis() + timeout;
+			while (job.getResult() == null) {
+				Thread.sleep(500);
+				if (monitor.isCanceled()
+						|| (timeout != 0 && System.currentTimeMillis() >= deadline)) {
+					process.destroy();
+					job.cancel();
+					return CANCEL_STATUS;
+				}
+			}
+			return job.getResult();
+		} catch (InterruptedException e) {
+			return CANCEL_STATUS;
+		}
+	}
+
+	/**
+	 * Wait for the process to finish with a certain timeout.
+	 * 
+	 * @param timeout
+	 *            if not zero, timeout in milliseconds before throwing exception
+	 * @return exit code
+	 */
+	protected int waitForProcess(final Process process, final long timeout)
+			throws ScratchboxException {
+		final Exception[] excs = { null };
+		Runnable runnable = new Runnable() {
+
+			public void run() {
+				try {
+					process.waitFor();
+				} catch (InterruptedException e) {
+					excs[0] = e;
+				}
+			}
+
+		};
+
+		if (timeout == 0) {
+			runnable.run();
+		} else {
+			Thread thread = new Thread(runnable);
+			thread.start();
+			try {
+				thread.join(timeout);
+				if (thread.isAlive()) {
+					thread.interrupt();
+					excs[0] = new InterruptedException();
+				}
+			} catch (InterruptedException e) {
+				excs[0] = e;
+			}
+		}
+
+		if (excs[0] instanceof InterruptedException) {
+			throw new ScratchboxException("Command interrupted after "
+					+ timeout + " milliseconds");
+		} else if (excs[0] instanceof ScratchboxException) {
+			throw (ScratchboxException) excs[0];
+		} else if (excs[0] != null) {
+			throw new ScratchboxException(excs[0]);
+		}
+
+		return process.exitValue();
+	}
+
+	/**
+	 * Eat the stdout and stderr results from the process and wait for it to
+	 * finish. Optionally check whether stderr is empty.
+	 * <p>
+	 * This is done here instead of in the commands because CDT's Spawner will
+	 * destroy the streams when #waitFor() is called, while other Process
+	 * implementations don't do this, and we don't want a dependency on the
+	 * ordering repeated in the command implementations.
+	 * 
+	 * @param timeout
+	 *            if not zero, timeout in milliseconds before throwing exception
+	 * @return stdout results, as a string
+	 */
+	protected String getInputFromProcessAndWait(final Process process,
+			final boolean allowError, final long timeout)
+			throws ScratchboxException {
+		final String[] inputs = { null };
+		final Exception[] excs = { null };
+		Runnable runnable = new Runnable() {
+
+			public void run() {
+				try {
+					inputs[0] = getInputFromProcess(process);
+
+					if (!allowError) {
+						String error = getErrorInputFromProcess(process);
+						if (error.length() > 0) {
+							excs[0] = new ScratchboxInvalidOperationException(
+									error);
+							return;
+						}
+					}
+				} catch (IOException e) {
+					excs[0] = e;
+					return;
+				} catch (ScratchboxException e) {
+					excs[0] = e;
+					return;
+				}
+
+				try {
+					process.waitFor();
+				} catch (InterruptedException e) {
+					excs[0] = e;
+				}
+			}
+
+		};
+
+		if (timeout == 0) {
+			runnable.run();
+		} else {
+			Thread thread = new Thread(runnable);
+			thread.start();
+			try {
+				thread.join(timeout);
+				if (thread.isAlive()) {
+					thread.interrupt();
+					process.destroy();
+					excs[0] = new InterruptedException();
+				}
+			} catch (InterruptedException e) {
+				excs[0] = e;
+			}
+		}
+
+		if (excs[0] instanceof InterruptedException) {
+			throw new ScratchboxException("Command interrupted after "
+					+ timeout + " milliseconds");
+		} else if (excs[0] instanceof ScratchboxException) {
+			throw (ScratchboxException) excs[0];
+		} else if (excs[0] != null) {
+			throw new ScratchboxException(excs[0]);
+		}
+
+		return inputs[0];
+	}
+
+	/**
+	 * Eat the stdout and stderr results from the process and wait for it to
+	 * finish. Return a
+	 * <p>
+	 * This is done here instead of in the commands because CDT's Spawner will
+	 * destroy the streams when #waitFor() is called, while other Process
+	 * implementations don't do this, and we don't want a dependency on the
+	 * ordering repeated in the command implementations.
+	 * 
+	 * @return stdout results, as an array of lines
+	 */
+	protected List<String> getLineInputFromProcessAndWait(Process process,
+			boolean allowError) throws ScratchboxException {
+		return getLineInputFromProcessAndWait(process, allowError, 0);
+	}
+
+	/**
+	 * Eat the stdout and stderr results from the process and wait for it to
+	 * finish. Return a
+	 * <p>
+	 * This is done here instead of in the commands because CDT's Spawner will
+	 * destroy the streams when #waitFor() is called, while other Process
+	 * implementations don't do this, and we don't want a dependency on the
+	 * ordering repeated in the command implementations.
+	 * 
+	 * @param timeout
+	 *            if non-zero, timeout in milliseconds
+	 * @return stdout results, as an array of lines
+	 */
+	protected List<String> getLineInputFromProcessAndWait(Process process,
+			boolean allowError, long timeout) throws ScratchboxException {
+		String input = getInputFromProcessAndWait(process, allowError, timeout);
+		return processLines(input);
+	}
+
+	/**
+	 * Return the input stream of the process as a string. All lines generated
+	 * by the process are concatenated.
+	 * 
+	 * @param process
+	 *            the process.
+	 * @return the input stream of the process.
+	 * @throws IOException
+	 *             if any I/O problem occurrs.
+	 */
+	private String getInputFromProcess(Process process) throws IOException,
+			ScratchboxException {
+		return getInputStream(process.getInputStream());
+	}
+
+	/**
+	 * Return the error input stream of the process as a string. All lines
+	 * generated by the process are concatenated.
+	 * 
+	 * @param process
+	 *            the process.
+	 * @return the input stream of the process.
+	 * @throws IOException
+	 *             if any I/O problem occurrs.
+	 * @throws ScratchboxException
+	 */
+	private String getErrorInputFromProcess(Process process)
+			throws IOException, ScratchboxException {
+		return getInputStream(process.getErrorStream());
+	}
+
+	/**
+	 * Return an input stream as a string. All lines generated by the process
+	 * are concatenated.
+	 * 
+	 * @param processInputStream
+	 *            the input stream to be read.
+	 * @return the input stream of the process.
+	 * @throws IOException
+	 *             if any I/O problem occurrs.
+	 * @throws ScratchboxException
+	 */
+	private String getInputStream(InputStream processInputStream)
+			throws IOException, ScratchboxException {
+		BufferedReader in = new BufferedReader(new InputStreamReader(
+				processInputStream));
+
+		String line;
+		String result = "";
+		String separator = "";
+
+		while ((line = in.readLine()) != null) {
+			checkError(line, ERROR_TOKEN);
+			checkError(line, WARNING_TOKEN);
+			result += separator + line;
+			separator = System.getProperty("line.separator");
+		}
+
+		return result;
+	}
+
+	private void checkError(String inputString, String errorPattern)
+			throws ScratchboxException {
+		if (inputString.startsWith(errorPattern)) {
+			int index = inputString.indexOf(errorPattern);
+			throw new ScratchboxException(inputString.substring(index
+					+ errorPattern.length()));
+		}
+	}
+
+	/**
+	 * Get a string with a set of lines an return a list with the lines
+	 * separated.
+	 * 
+	 * @param stringWithLines
+	 *            a string with lines.
+	 * @return a list with the lines separated.
+	 */
+	private List<String> processLines(String stringWithLines) {
+		List<String> lines = new ArrayList<String>();
+		final String FILE_SEPARATOR = System.getProperty("line.separator");
+
+		StringTokenizer tokens = new StringTokenizer(stringWithLines,
+				FILE_SEPARATOR);
+		while (tokens.hasMoreElements()) {
+			lines.add(tokens.nextToken());
+		}
+
+		return lines;
+	}
+
+	/**
+	 * Return the correct size of performCommand parameters list.
+	 * 
+	 * @return the correct size of performCommand parameters list.
+	 */
+	public abstract int getParametersSize();
+
+	/**
+	 * Verify if the parameter list has the correct size.
+	 * 
+	 * @param param
+	 *            the list of parameters to be verified.
+	 * @return true, if the list contains the correct number of parameters;
+	 *         false, otherwise.
+	 */
+	protected boolean checkParameters(List<String> param) {
+		return getParametersSize() == param.size();
+	}
+
+	protected String catenateLines(List<String> lines) {
+		StringBuilder builder = new StringBuilder();
+		for (String line : lines) {
+			builder.append(line);
+			builder.append('\n');
+		}
+		return builder.toString();
+	}
+}

Deleted: trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/command/ScratchboxInvalidParameterException.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/command/ScratchboxInvalidParameterException.java	2008-10-15 06:30:08 UTC (rev 873)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/command/ScratchboxInvalidParameterException.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -1,35 +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:
- *    Raul Herbster (UFCG) - initial API and implementation
- *******************************************************************************/
-package org.maemo.esbox.maemosdk.core.command;
-
-import org.maemo.esbox.maemosdk.core.scratchbox.ScratchboxException;
-
-/**
- * This exception is thrown whenever an invalid parameter is passed to a
- * command.
- */
-public class ScratchboxInvalidParameterException extends ScratchboxException {
-
-	/**
-	 * Serial version number of exception.
-	 */
-	private static final long serialVersionUID = 1L;
-
-	/**
-	 * Constructor.
-	 * 
-	 * @param message
-	 *            the message associated with the exception.
-	 */
-	public ScratchboxInvalidParameterException(String message) {
-		super(message);
-	}
-}

Copied: trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/command/ScratchboxInvalidParameterException.java (from rev 873, branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/command/ScratchboxInvalidParameterException.java)
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/command/ScratchboxInvalidParameterException.java	                        (rev 0)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/command/ScratchboxInvalidParameterException.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -0,0 +1,35 @@
+/*******************************************************************************
+ * 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:
+ *    Raul Herbster (UFCG) - initial API and implementation
+ *******************************************************************************/
+package org.maemo.esbox.maemosdk.core.command;
+
+import org.maemo.esbox.maemosdk.core.scratchbox.ScratchboxException;
+
+/**
+ * This exception is thrown whenever an invalid parameter is passed to a
+ * command.
+ */
+public class ScratchboxInvalidParameterException extends ScratchboxException {
+
+	/**
+	 * Serial version number of exception.
+	 */
+	private static final long serialVersionUID = 1L;
+
+	/**
+	 * Constructor.
+	 * 
+	 * @param message
+	 *            the message associated with the exception.
+	 */
+	public ScratchboxInvalidParameterException(String message) {
+		super(message);
+	}
+}

Modified: trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/execEnv/BaseScratchboxExecutionEnvironment.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/execEnv/BaseScratchboxExecutionEnvironment.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/execEnv/BaseScratchboxExecutionEnvironment.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -16,11 +16,13 @@
 
 /**
  * @author eswartz
- *
+ * 
  */
-public abstract class BaseScratchboxExecutionEnvironment extends BaseExecutionEnvironment {
+public abstract class BaseScratchboxExecutionEnvironment extends
+		BaseExecutionEnvironment {
 	/** Base id for scratchbox execution environment ids */
-	public static final String SB_EXEC_ENV_BASE = Activator.PLUGIN_ID + ".execution_environment";
+	public static final String SB_EXEC_ENV_BASE = Activator.PLUGIN_ID
+			+ ".execution_environment";
 
 	public BaseScratchboxExecutionEnvironment(String id, String name) {
 		super(id, name);

Modified: trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/execEnv/GTKExecutionEnvironment.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/execEnv/GTKExecutionEnvironment.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/execEnv/GTKExecutionEnvironment.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -11,15 +11,16 @@
 
 package org.maemo.esbox.maemosdk.core.execEnv;
 
-
 /**
  * Environment for GTK applications in X11
+ * 
  * @author eswartz
- *
+ * 
  */
 public class GTKExecutionEnvironment extends X11ExecutionEnvironment {
 	@SuppressWarnings("hiding")
-	public static final String ID = SB_EXEC_ENV_BASE + ".gtk"; 
+	public static final String ID = SB_EXEC_ENV_BASE + ".gtk";
+
 	public GTKExecutionEnvironment() {
 		super(ID, "GTK");
 	}

Modified: trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/execEnv/MaemoExecutionEnvironment.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/execEnv/MaemoExecutionEnvironment.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/execEnv/MaemoExecutionEnvironment.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -15,22 +15,22 @@
 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;
 import org.maemo.esbox.project.core.ProjectManager;
 
 /**
- * Environment for Maemo applications 
+ * Environment for Maemo applications
+ * 
  * @author eswartz
- *
+ * 
  */
 public class MaemoExecutionEnvironment extends X11ExecutionEnvironment {
 	@SuppressWarnings("hiding")
 	public static final String ID = SB_EXEC_ENV_BASE + ".maemo";
 
-
 	public MaemoExecutionEnvironment() {
 		super(ID, "Maemo");
 	}
@@ -38,8 +38,7 @@
 	public MaemoExecutionEnvironment(String id, String name) {
 		super(id, name);
 	}
-	
-	
+
 	@Override
 	public void establishEnvironment(Shell shell, IProject project)
 			throws CoreException {
@@ -48,13 +47,15 @@
 		try {
 			sdkTarget = ProjectManager.getInstance().getSDKTarget(project);
 			if (!ESboxScriptLauncher.getInstance().isMaemoStarted(sdkTarget)) {
-				if (MessageDialog.openQuestion(shell, "Launch Maemo?",
-				"Maemo is not running.  Would you like to launch it now?")) {
+				if (MessageDialog
+						.openQuestion(shell, "Launch Maemo?",
+								"Maemo is not running.  Would you like to launch it now?")) {
 					ESboxScriptLauncher.getInstance().startMaemo(sdkTarget);
 				}
-			}		
+			}
 		} catch (ESboxException e) {
-			Activator.getErrorLogger().logAndShowError("Error querying Maemo status", e);
+			Activator.getErrorLogger().logAndShowError(
+					"Error querying Maemo status", e);
 			// don't fail the launch
 		}
 	}

Modified: trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/execEnv/X11ExecutionEnvironment.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/execEnv/X11ExecutionEnvironment.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/execEnv/X11ExecutionEnvironment.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -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;
@@ -23,8 +23,9 @@
 
 /**
  * Environment for X11-based programs
+ * 
  * @author eswartz
- *
+ * 
  */
 public class X11ExecutionEnvironment extends BaseScratchboxExecutionEnvironment {
 
@@ -36,33 +37,36 @@
 	public X11ExecutionEnvironment() {
 		super(ID, "X11");
 	}
-	
+
 	public X11ExecutionEnvironment(String id, String name) {
 		super(id, name);
 	}
-	
+
 	@Override
 	public void establishEnvironment(Shell shell, IProject project)
 			throws CoreException {
 		super.establishEnvironment(shell, project);
-		
+
 		ISDKTarget sdkTarget;
 		try {
 			sdkTarget = ProjectManager.getInstance().getSDKTarget(project);
 		} catch (ESboxException e1) {
-			throw new CoreException(Activator.createErrorStatus("Not an ESbox project: " + project, e1));
+			throw new CoreException(Activator.createErrorStatus(
+					"Not an ESbox project: " + project, e1));
 		}
-		
+
 		try {
 			if (!ESboxScriptLauncher.getInstance().isXServerStarted(sdkTarget)) {
-				
-				if (MessageDialog.openQuestion(shell, "Launch X Server?",
-						"The X server is not running.  Would you like to launch it now?")) {
+
+				if (MessageDialog
+						.openQuestion(shell, "Launch X Server?",
+								"The X server is not running.  Would you like to launch it now?")) {
 					ESboxScriptLauncher.getInstance().startX();
 				}
 			}
 		} catch (ESboxException e) {
-			Activator.getErrorLogger().logAndShowError("Error querying X status", e);
+			Activator.getErrorLogger().logAndShowError(
+					"Error querying X status", e);
 			// don't fail the launch
 		}
 	}

Modified: trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/platform/PlatformEngine.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/platform/PlatformEngine.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/platform/PlatformEngine.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -23,15 +23,16 @@
  */
 public class PlatformEngine {
 
-	public static String PLATFORMS_EXTENSION_ID = Activator.PLUGIN_ID + ".platform";
+	public static String PLATFORMS_EXTENSION_ID = Activator.PLUGIN_ID
+			+ ".platform";
 	public static String PLATFORM_ID = "id";
 	public static String PLATFORM_NAME = "name";
-	
+
 	/* singleton instance */
 	private static PlatformEngine singleton = null;
-	
+
 	private List<PlatformInfo> platformList;
-	
+
 	/**
 	 * Private constructor.
 	 */
@@ -39,9 +40,10 @@
 		platformList = new ArrayList<PlatformInfo>();
 		initializePlatformInfoList();
 	}
-	
+
 	/**
 	 * Return the singleton instance of this engine.
+	 * 
 	 * @return the singleton instance of this engine.
 	 */
 	public static synchronized PlatformEngine getInstance() {
@@ -49,35 +51,38 @@
 			singleton = new PlatformEngine();
 		return singleton;
 	}
-	
+
 	/**
 	 * Return the list of subscribed platforms supported by Maemo.
+	 * 
 	 * @return the list of subscribed platforms supported by Maemo.
 	 */
-	public List<PlatformInfo> getPlatforms() {		
+	public List<PlatformInfo> getPlatforms() {
 		return platformList;
 	}
-	
+
 	/**
-	 * Initialize the list of defined Maemo SDKs. Such SDKs are described
-	 * by plug-ins extension point org.maemo.esbox.ui.platform
+	 * Initialize the list of defined Maemo SDKs. Such SDKs are described by
+	 * plug-ins extension point org.maemo.esbox.ui.platform
 	 **/
 	private void initializePlatformInfoList() {
 		String platformId = null;
 		String platformName = null;
-				
-		IExtension[] extensions = Platform.getExtensionRegistry().getExtensionPoint(PLATFORMS_EXTENSION_ID).getExtensions();
-		for(int i=0; i<extensions.length; i++) {
+
+		IExtension[] extensions = Platform.getExtensionRegistry()
+				.getExtensionPoint(PLATFORMS_EXTENSION_ID).getExtensions();
+		for (int i = 0; i < extensions.length; i++) {
 			IExtension extension = extensions[i];
-			IConfigurationElement[] configElements = extension.getConfigurationElements();
-			for(int j=0; j<configElements.length; j++) {
+			IConfigurationElement[] configElements = extension
+					.getConfigurationElements();
+			for (int j = 0; j < configElements.length; j++) {
 				IConfigurationElement config = configElements[j];
 				platformId = config.getAttribute(PLATFORM_ID);
 				platformName = config.getAttribute(PLATFORM_NAME);
-				
-				platformList.add(new PlatformInfo(platformId,platformName));			
+
+				platformList.add(new PlatformInfo(platformId, platformName));
 			}
 		}
 	}
-	
+
 }

Modified: trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/platform/PlatformInfo.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/platform/PlatformInfo.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/platform/PlatformInfo.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -10,20 +10,22 @@
  *******************************************************************************/
 package org.maemo.esbox.maemosdk.core.platform;
 
-
 /**
  * Contains information about platforms supported by Maemo.
  */
 public class PlatformInfo {
 
 	private String id;
-	
+
 	private String name;
 
 	/**
 	 * Constructor
-	 * @param id the id of platform.
-	 * @param name the name of platform.
+	 * 
+	 * @param id
+	 *            the id of platform.
+	 * @param name
+	 *            the name of platform.
 	 */
 	public PlatformInfo(String id, String name) {
 		this.id = id;
@@ -32,6 +34,7 @@
 
 	/**
 	 * Return the id of platform.
+	 * 
 	 * @return the id of platform.
 	 */
 	public String getId() {
@@ -40,12 +43,13 @@
 
 	/**
 	 * Return the name of platform.
+	 * 
 	 * @return the name of platoform.
 	 */
 	public String getName() {
 		return name;
 	}
-	
+
 	@Override
 	public int hashCode() {
 		final int prime = 31;
@@ -70,11 +74,10 @@
 			return false;
 		return true;
 	}
-	
+
 	@Override
-	public String toString() {	
+	public String toString() {
 		return getName();
 	}
 
-	
 }

Modified: trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/scratchbox/ESboxScriptLauncher.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/scratchbox/ESboxScriptLauncher.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/scratchbox/ESboxScriptLauncher.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -12,74 +12,109 @@
 
 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.internal.maemosdk.core.scratchbox.MaemoLauncher;
+import org.maemo.esbox.internal.maemosdk.core.scratchbox.XLauncher;
 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 -
- * Scratchbox preferences.
- * @author kosola
- * modified by Raul Fernandes Herbster
- * modified by eswartz
+ * Class handle all methods that needs some graphical environment. It invokes
+ * graphical thing that are ordered in window - preferences - Scratchbox
+ * preferences.
+ * 
+ * @author kosola modified by Raul Fernandes Herbster modified by eswartz
  */
 public class ESboxScriptLauncher {
 
-	private static ESboxScriptLauncher singleton = null;	
-	
+	private static ESboxScriptLauncher singleton = null;
+
 	/**
 	 * Constructor
 	 */
 	private ESboxScriptLauncher() {
 	}
-	
+
 	public static synchronized ESboxScriptLauncher getInstance() {
 		if (singleton == null)
 			singleton = new ESboxScriptLauncher();
-		return singleton;			
+		return singleton;
 	}
 
 	/**
 	 * Method that start X-environment for Scratchbox
-	 * @throws ScratchboxException 
+	 * 
+	 * @throws ScratchboxException
 	 */
-	public void startX() throws ESboxException  {
+	public void startX() throws ESboxException {
 
-		XLauncher.getInstance().startX(CorePreferenceManager.getInstance().getPreferenceProvider());
+		XLauncher.getInstance().startX(
+				CorePreferenceManager.getInstance().getPreferenceProvider());
 	}
 
 	/**
 	 * Method that stop X-environment for Scratchbox
-	 * @throws ScratchboxException 
+	 * 
+	 * @throws ScratchboxException
 	 */
 	public void stopX(ISDKTarget sdkTarget) throws ESboxException {
 
-		if (sdkTarget != null && MaemoLauncher.getInstance().isMaemoRunning(sdkTarget))
+		if (sdkTarget != null
+				&& MaemoLauncher.getInstance().isMaemoRunning(sdkTarget))
 			throw new ESboxException("Maemo is still running. Stop Maemo first");
 
-		XLauncher.getInstance().stopX(CorePreferenceManager.getInstance().getPreferenceProvider());
+		XLauncher.getInstance().stopX(
+				CorePreferenceManager.getInstance().getPreferenceProvider());
 	}
 
 	/**
 	 * Kill all instances of a given process
-	 * @param processName executable name
-	 * @param processLabel the user-visible name for the process
+	 * 
+	 * @param processName
+	 *            executable name
+	 * @param processLabel
+	 *            the user-visible name for the process
 	 * @throws ScratchboxException
 	 */
-	public void killProcess(IMachine machine, String processName, String processLabel) throws ESboxException {
+	public void killProcess(IMachine machine, String processName,
+			String processLabel) throws ESboxException {
 
-		List<IProcess> processes = machine.getProcessLister().getProcesses(new ProcessFilterCmdLineRegexp(".*" + processName + ".*"));
+		List<IProcess> processes = machine.getProcessLister().getProcesses(
+				new ProcessFilterCmdLineRegexp(".*" + processName + ".*"));
 		for (IProcess process : processes) {
 			try {
 				process.terminate();
@@ -91,26 +126,33 @@
 
 	/**
 	 * Method that run command autogen.sh for the project
+	 * 
 	 * @param project
-	 * @throws ESboxException 
+	 * @throws ESboxException
 	 */
 	public void runAutogen(IProject project) throws ESboxException {
 		runAutogen(project, null, null);
 	}
 
 	/**
-	 * Method that runs command autogen.sh and waits if a progress monitor
-	 * is supplied.
+	 * Method that runs command autogen.sh and waits if a progress monitor is
+	 * supplied.
 	 * 
 	 * @param project
-	 * @param monitor if null, do not wait; else wait and report progress through the monitor
-	 * @param path if <code>null</code> use the project path, else override to run autogen elsewhere
+	 * @param monitor
+	 *            if null, do not wait; else wait and report progress through
+	 *            the monitor
+	 * @param path
+	 *            if <code>null</code> use the project path, else override to
+	 *            run autogen elsewhere
 	 * @return exit code, if monitor is not null
 	 */
-	public int runAutogen(IProject project, IProgressMonitor monitor, IPath path) throws ESboxException {
+	public int runAutogen(IProject project, IProgressMonitor monitor, IPath path)
+			throws ESboxException {
 		ensureBuildMachine(project, null);
-		return runScript(path != null ? path : project.getLocation(), 
-				"./autogen.sh", "Running automake script (autogen.sh) [" + project.getName() + "]",
+		return runScript(path != null ? path : project.getLocation(),
+				"./autogen.sh", "Running automake script (autogen.sh) ["
+						+ project.getName() + "]",
 				"Error running script autogen.sh", monitor, project);
 	}
 
@@ -118,59 +160,74 @@
 	 * run ./configure for the project
 	 * 
 	 * @param project
-	 * @throws ESboxException 
+	 * @throws ESboxException
 	 */
 	public void runConfigure(IProject project) throws ESboxException {
 		runConfigure(project, null, null);
 	}
 
 	/**
-	 * Method that run command ./configure and wait if a progress monitor
-	 * is supplied.
+	 * Method that run command ./configure and wait if a progress monitor is
+	 * supplied.
 	 * 
 	 * @param project
-	 * @param monitor if null, do not wait; else wait and report progress through the monitor
-	 * @param path if <code>null</code>, use the project location, else override the directory
+	 * @param monitor
+	 *            if null, do not wait; else wait and report progress through
+	 *            the monitor
+	 * @param path
+	 *            if <code>null</code>, use the project location, else override
+	 *            the directory
 	 * @return exit code, if monitor is not null
-	 * @throws ESboxException 
+	 * @throws ESboxException
 	 */
-	public int runConfigure(IProject project, IProgressMonitor monitor, IPath path) throws ESboxException {
+	public int runConfigure(IProject project, IProgressMonitor monitor,
+			IPath path) throws ESboxException {
 		ensureBuildMachine(project, null);
-		return runScript(path != null ? path : project.getLocation(), 
-				"./configure", "Running automake script (configure) [" + project.getName() + "]",
+		return runScript(path != null ? path : project.getLocation(),
+				"./configure", "Running automake script (configure) ["
+						+ project.getName() + "]",
 				"Error running script configure", monitor, project);
 	}
 
 	/**
-	 * This method ensures that a Makefile exists in the project, by running autogen or configure
-	 * as needed.  It also rebuilds Makefiles if configure has changed, or rebuilds configure
-	 * if configure.ac or autogen.sh has changed.
+	 * This method ensures that a Makefile exists in the project, by running
+	 * autogen or configure as needed. It also rebuilds Makefiles if configure
+	 * has changed, or rebuilds configure if configure.ac or autogen.sh has
+	 * changed.
 	 * 
 	 * @param project
-	 * @param monitor if null, do not wait; else wait and report progress through the monitor
-	 * @param path if <code>null</code> use the project path, else override to run scripts elsewhere
-	 * @param makefileName the name of the makefile to look for, or <code>null</code> for "Makefile"
+	 * @param monitor
+	 *            if null, do not wait; else wait and report progress through
+	 *            the monitor
+	 * @param path
+	 *            if <code>null</code> use the project path, else override to
+	 *            run scripts elsewhere
+	 * @param makefileName
+	 *            the name of the makefile to look for, or <code>null</code> for
+	 *            "Makefile"
 	 */
-	public void runEstablishAutoMakefiles(IProject project, IProgressMonitor monitor, IPath path,
-			String makefileName) throws ESboxException {
-		
+	public void runEstablishAutoMakefiles(IProject project,
+			IProgressMonitor monitor, IPath path, String makefileName)
+			throws ESboxException {
+
 		if (monitor == null)
 			monitor = new NullProgressMonitor();
-		
+
 		monitor.beginTask("", 3);
-		
+
 		// make sure machine is available
 		ensureBuildMachine(project, new SubProgressMonitor(monitor, 1));
-		
+
 		if (path == null)
 			path = project.getLocation();
-		
+
 		if (makefileName == null)
 			makefileName = "Makefile";
-		
+
 		boolean triedToAutomake = false;
-		
-		// XXX: the project is assumed to be visible to the remote machine, so we don't translate or use IFileStore here
+
+		// XXX: the project is assumed to be visible to the remote machine, so
+		// we don't translate or use IFileStore here
 		File autogen_sh = path.append("autogen.sh").toFile();
 		File configure_ac = path.append("configure.ac").toFile();
 		File configure = path.append("configure").toFile();
@@ -179,53 +236,61 @@
 
 		boolean runAutogen = false;
 
-		if (autogen_sh.exists() && 
-				((configure.exists() && autogen_sh.lastModified() > configure.lastModified())
-				|| (makefile.exists() && autogen_sh.lastModified() > makefile.lastModified()))) {
-			// timestamps out of date (note: depend on last-generated files, not the _ac or _am
+		if (autogen_sh.exists()
+				&& ((configure.exists() && autogen_sh.lastModified() > configure
+						.lastModified()) || (makefile.exists() && autogen_sh
+						.lastModified() > makefile.lastModified()))) {
+			// timestamps out of date (note: depend on last-generated files, not
+			// the _ac or _am
 			// ones, since autogen doesn't modify the _ac or _am files)
 			runAutogen = true;
-		} else if (configure_ac.exists() && configure.exists() && configure_ac.lastModified() > configure.lastModified()) {
+		} else if (configure_ac.exists() && configure.exists()
+				&& configure_ac.lastModified() > configure.lastModified()) {
 			// timestamps out of date
 			runAutogen = true;
 		} else if (configure_ac.exists() && !configure.exists()) {
 			// configure must be created
 			runAutogen = true;
 		}
-		
+
 		boolean failedAutogen = false;
 		if (runAutogen) {
-			IProgressMonitor subMonitor = monitor != null ? 
-					new SubProgressMonitor(monitor, 1) : new NullProgressMonitor();
-					
+			IProgressMonitor subMonitor = monitor != null ? new SubProgressMonitor(
+					monitor, 1)
+					: new NullProgressMonitor();
+
 			// see if autogen.sh exists
 			if (autogen_sh.exists()) {
 				if (runAutogen(project, subMonitor, path) != 0) {
 					failedAutogen = true;
 				}
 				triedToAutomake = true;
-			} else if (configure_ac.exists()){
+			} else if (configure_ac.exists()) {
 				// run autoconf
-				if (runScript(path, "autoconf", "Running autoconf [" + project.getName() + "]",
+				if (runScript(path, "autoconf", "Running autoconf ["
+						+ project.getName() + "]",
 						"Error autoconfiguring project", subMonitor, project) != 0) {
 					failedAutogen = true;
 				}
 				triedToAutomake = true;
 			} else {
-				// um... either the logic is wrong or the user deleted the file in between
+				// um... either the logic is wrong or the user deleted the file
+				// in between
 			}
 		} else {
 			if (monitor != null)
 				monitor.worked(1);
 		}
-			
+
 		boolean runConfigure = false;
-		
+
 		if (!failedAutogen) {
-			if (configure.exists() && makefile.exists() && configure.lastModified() > makefile.lastModified()) {
+			if (configure.exists() && makefile.exists()
+					&& configure.lastModified() > makefile.lastModified()) {
 				// timestamps out of date
 				runConfigure = true;
-			} else if (makefile_am.exists() && makefile.exists() && makefile_am.lastModified() > makefile.lastModified()) {
+			} else if (makefile_am.exists() && makefile.exists()
+					&& makefile_am.lastModified() > makefile.lastModified()) {
 				// timestamps out of date
 				runConfigure = true;
 			} else if (configure.exists() && !makefile.exists()) {
@@ -233,14 +298,15 @@
 				runConfigure = true;
 			}
 		}
-		
+
 		boolean failedConfigure = false;
-		
+
 		if (runConfigure) {
 			// run configure
-			IProgressMonitor subMonitor = monitor != null ? 
-					new SubProgressMonitor(monitor, 1) : new NullProgressMonitor();
-					
+			IProgressMonitor subMonitor = monitor != null ? new SubProgressMonitor(
+					monitor, 1)
+					: new NullProgressMonitor();
+
 			// configure exists, so run it
 			if (runConfigure(project, subMonitor, path) != 0) {
 				failedConfigure = true;
@@ -250,45 +316,46 @@
 			if (monitor != null)
 				monitor.worked(1);
 		}
-		
-	
+
 		// final check
 		if (failedConfigure || failedAutogen) {
 			String message = "Autogen or configure ran with errors.\nCheck the Console for autotools messages.";
 			throw new ESboxException(message);
-			
+
 		} else if (!makefile.exists()) {
-			String message = "Cannot find or create " + makefileName + " in project '" + project.getName() + "'.\n";
+			String message = "Cannot find or create " + makefileName
+					+ " in project '" + project.getName() + "'.\n";
 			if (triedToAutomake)
 				message += "\nCheck the Console for autotools messages.";
 			throw new ESboxException(message);
 		}
-		
+
 		monitor.done();
-		
+
 	}
 
 	/**
-	 * This doesn't invoke any code, but deletes any generated automake files
-	 * so that they will be re-run in the future.
+	 * This doesn't invoke any code, but deletes any generated automake files so
+	 * that they will be re-run in the future.
+	 * 
 	 * @param project
 	 */
 	public void resetAutomakeState(IProject project, String makefileName) {
 		if (makefileName == null)
 			makefileName = "Makefile";
-		
+
 		// make sure the outside build state hasn't changed in the meantime
 		try {
 			project.refreshLocal(IProject.DEPTH_ONE, new NullProgressMonitor());
 		} catch (CoreException e1) {
 			Activator.getErrorLogger().logError("Error refreshing project", e1);
 		}
-		
+
 		// see if generated files exist
 		IFile configure_ac = project.getFile("configure.ac");
 		IFile configure = project.getFile("configure");
 		IFile makefile = project.getFile(makefileName);
-		
+
 		if (configure_ac.exists()) {
 			try {
 				// it is an automake project
@@ -297,16 +364,19 @@
 				if (makefile.exists())
 					makefile.delete(true, new NullProgressMonitor());
 			} catch (CoreException e) {
-				Activator.getErrorLogger().logError("Error deleting generated automake files", e);
+				Activator.getErrorLogger().logError(
+						"Error deleting generated automake files", e);
 			}
 		} else {
-			// hmm... touch the Makefile.  This isn't nice for SCM but it's all we can do besides
+			// hmm... touch the Makefile. This isn't nice for SCM but it's all
+			// we can do besides
 			// deleting the executable, which is no nicer.
 			if (makefile.exists()) {
 				try {
 					makefile.touch(new NullProgressMonitor());
 				} catch (CoreException e) {
-					Activator.getErrorLogger().logError("Error touching Makefile", e);
+					Activator.getErrorLogger().logError(
+							"Error touching Makefile", e);
 				}
 			}
 		}
@@ -314,62 +384,67 @@
 
 	/**
 	 * Validate that the project appears to be an autotools or Makefile project.
+	 * 
 	 * @param project
 	 * @return true if some key files were found.
 	 */
 	public boolean validateAutomakeState(IProject project, String makefileName) {
 		if (makefileName == null)
 			makefileName = "Makefile";
-		
+
 		// see if generated files exist
 		IFile autogen_sh = project.getFile("autogen.sh");
 		IFile configure_ac = project.getFile("configure.ac");
 		IFile configure = project.getFile("configure");
 		IFile makefile = project.getFile(makefileName);
-		
-		return autogen_sh.exists() || makefile.exists() || configure.exists() || configure_ac.exists();
+
+		return autogen_sh.exists() || makefile.exists() || configure.exists()
+				|| configure_ac.exists();
 	}
-	
+
 	/**
-	 * Run 'scriptname' in 'path' location with 'wait' for 'project'.
-	 * Once complete, refreshes the project.
+	 * Run 'scriptname' in 'path' location with 'wait' for 'project'. Once
+	 * complete, refreshes the project.
+	 * 
 	 * @param path
-	 * @param scriptname the script, with "./" if needed
+	 * @param scriptname
+	 *            the script, with "./" if needed
 	 * @param comment
 	 * @param errormessage
-	 * @param monitor if not null, wait for progress to finish
+	 * @param monitor
+	 *            if not null, wait for progress to finish
 	 * @param project
 	 * @return exit code (if monitor is not null)
 	 */
 	private int runScript(IPath path, String scriptname, final String comment,
-			String errormessage, IProgressMonitor monitor, final IProject project) throws ESboxException {
+			String errormessage, IProgressMonitor monitor,
+			final IProject project) throws ESboxException {
 		verifyFiles(new IPath[] { path.append(scriptname) });
-		
+
 		IPath wd = path;
 
-		final ISDKTarget sdkTarget = ProjectManager.getInstance().getSDKTarget(project);
+		final ISDKTarget sdkTarget = ProjectManager.getInstance().getSDKTarget(
+				project);
 		IPath wdInScratchbox = sdkTarget.convertHostToTargetPath(wd);
-		
-		IProcessLauncherFactory launcherFactory = sdkTarget.getProcessLauncherFactory(); 
 
-		final IProcessLauncher processLauncher = ProcessLauncherCreator.createProcessLauncher(
-				launcherFactory, wdInScratchbox,
-				scriptname);
-		
+		IProcessLauncherFactory launcherFactory = sdkTarget
+				.getProcessLauncherFactory();
+
+		final IProcessLauncher processLauncher = ProcessLauncherCreator
+				.createProcessLauncher(launcherFactory, wdInScratchbox,
+						scriptname);
+
 		final Process process = processLauncher.createProcess();
 
-		final MessageConsole console = CorePlugin.getDefault().getConsole(
-				true,
-				sdkTarget,
-				comment);
-		
-		
+		final MessageConsole console = CorePlugin.getDefault().getConsole(true,
+				sdkTarget, comment);
+
 		if (monitor == null) {
 			WorkspaceJob job = new WorkspaceJob(comment) {
-				
+
 				@Override
 				public IStatus runInWorkspace(IProgressMonitor monitor)
-				throws CoreException {
+						throws CoreException {
 					monitor.beginTask("", 2);
 					monitor.subTask(comment);
 					try {
@@ -378,14 +453,15 @@
 							while (true) {
 								if (monitor.isCanceled()) {
 									process.destroy();
-									return Policy.getCancelStatus(Activator.getDefault());
+									return Policy.getCancelStatus(Activator
+											.getDefault());
 								}
 								try {
 									Thread.sleep(500);
 								} catch (InterruptedException e) {
 									// ignore
 								}
-								
+
 								try {
 									process.exitValue();
 									break;
@@ -396,7 +472,8 @@
 							}
 						} finally {
 							try {
-								project.refreshLocal(IResource.DEPTH_INFINITE, new SubProgressMonitor(monitor, 1));
+								project.refreshLocal(IResource.DEPTH_INFINITE,
+										new SubProgressMonitor(monitor, 1));
 							} catch (CoreException e) {
 								return e.getStatus();
 							}
@@ -406,7 +483,7 @@
 					}
 					return Status.OK_STATUS;
 				}
-				
+
 			};
 			job.setRule(project);
 			job.schedule();
@@ -420,19 +497,18 @@
 					monitor.subTask(comment);
 					try {
 						OutputStream out = console.newOutputStream();
-						exits[0] = processLauncher.waitAndRead(out, out, new SubProgressMonitor(monitor, 1));
-						project.refreshLocal(IResource.DEPTH_INFINITE, new SubProgressMonitor(monitor, 1));
+						exits[0] = processLauncher.waitAndRead(out, out,
+								new SubProgressMonitor(monitor, 1));
+						project.refreshLocal(IResource.DEPTH_INFINITE,
+								new SubProgressMonitor(monitor, 1));
 					} finally {
 						monitor.done();
 					}
 				}
-				
+
 			};
 			try {
-				ResourcesPlugin.getWorkspace().run(
-						runnable,
-						project,
-						0,
+				ResourcesPlugin.getWorkspace().run(runnable, project, 0,
 						monitor);
 			} catch (OperationCanceledException e) {
 				// ignore
@@ -444,64 +520,78 @@
 	}
 
 	/**
-	 * Create a job which will build a debian package in the project's directory.  Waits for completion.
+	 * Create a job which will build a debian package in the project's
+	 * directory. Waits for completion.
+	 * 
 	 * @return IStatus status of build
 	 */
-	public void createDebianPackage(final IProject project, IProgressMonitor monitor) throws ESboxException {
+	public void createDebianPackage(final IProject project,
+			IProgressMonitor monitor) throws ESboxException {
 		monitor.beginTask("", IProgressMonitor.UNKNOWN);
 		monitor.subTask("Creating package");
-		
+
 		IPath path = project.getLocation();
 
 		verifyFiles(new IPath[] { path.append("debian"),
-				path.append("debian/changelog"),
-				path.append("debian/control"),
+				path.append("debian/changelog"), path.append("debian/control"),
 				path.append("debian/rules") });
 
 		ISDKTarget target = ProjectManager.getInstance().getSDKTarget(project);
-		
-		IProcessLauncherFactory launcherFactory = target.getProcessLauncherFactory(); 
 
+		IProcessLauncherFactory launcherFactory = target
+				.getProcessLauncherFactory();
+
 		String cmd = "dpkg-buildpackage -rfakeroot -d";
 
 		// launch command inside Scratchbox
-		final IProcessLauncher processLauncher = ProcessLauncherCreator.createProcessLauncher(
-				launcherFactory, target.convertHostToTargetPath(path),
-				CommandLineArguments.createFromCommandLine(cmd));
+		final IProcessLauncher processLauncher = ProcessLauncherCreator
+				.createProcessLauncher(launcherFactory, target
+						.convertHostToTargetPath(path), CommandLineArguments
+						.createFromCommandLine(cmd));
 
 		Process sbp = processLauncher.createProcess();
-		
-		processLauncher.redirectToConsole(true, null, "Making Debian package [" + project.getName() + "]");
-		
+
+		processLauncher.redirectToConsole(true, null, "Making Debian package ["
+				+ project.getName() + "]");
+
 		monitor.worked(1);
-		
+
 		int exit;
 		try {
 			exit = waitForProcess(sbp, monitor);
 			if (exit != 0) {
-				throw new ESboxException("Package creation failed; see Console (exit code " + exit + ")");
+				throw new ESboxException(
+						"Package creation failed; see Console (exit code "
+								+ exit + ")");
 			}
 			try {
-				project.refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
+				project.refreshLocal(IResource.DEPTH_INFINITE,
+						new NullProgressMonitor());
 			} catch (CoreException e) {
 				throw new ESboxException(e);
 			}
 		} catch (InterruptedException e1) {
 			throw new ESboxException("Package creation interrupted");
 		}
-		
+
 		monitor.done();
 
 	}
-	
-	/** 
-	 * Wait for a running process to complete, allowing user to cancel (which kills the process)
-	 * @param process the process
-	 * @param monitor a progress monitor
+
+	/**
+	 * Wait for a running process to complete, allowing user to cancel (which
+	 * kills the process)
+	 * 
+	 * @param process
+	 *            the process
+	 * @param monitor
+	 *            a progress monitor
 	 * @return exit code
-	 * @throws InterruptedException if process is canceled
+	 * @throws InterruptedException
+	 *             if process is canceled
 	 */
-	public int waitForProcess(Process process, IProgressMonitor monitor) throws InterruptedException {
+	public int waitForProcess(Process process, IProgressMonitor monitor)
+			throws InterruptedException {
 		while (true) {
 			// wait a while to avoid polling
 			try {
@@ -509,20 +599,20 @@
 			} catch (InterruptedException e) {
 				throw e;
 			}
-			
+
 			try {
 				// see if the process terminated yet
 				return process.exitValue();
 			} catch (IllegalThreadStateException e) {
 				// thrown by #exitValue() when not finished, good
 			}
-			
+
 			// see if user canceled
 			if (monitor.isCanceled()) {
 				process.destroy();
 				throw new InterruptedException();
 			}
-		}	
+		}
 	}
 
 	private void verifyFiles(IPath[] files) throws ESboxException {
@@ -535,6 +625,7 @@
 
 	/**
 	 * Build a Debian package in the background.
+	 * 
 	 * @param project
 	 */
 	public void runCreateDebianPackage(final IProject project) {
@@ -546,11 +637,12 @@
 				try {
 					createDebianPackage(project, monitor);
 				} catch (ESboxException e) {
-					return Activator.createErrorStatus("Failed to create Debian package", e);
+					return Activator.createErrorStatus(
+							"Failed to create Debian package", e);
 				}
 				return Status.OK_STATUS;
 			}
-			
+
 		};
 		job.schedule();
 	}
@@ -561,7 +653,7 @@
 				return false;
 		} catch (ESboxException e1) {
 		}
-		
+
 		try {
 			return MaemoLauncher.getInstance().isMaemoRunning(sdkTarget);
 		} catch (ESboxException e) {
@@ -570,47 +662,51 @@
 		}
 	}
 
-	public boolean isXServerStarted(IPreferenceProvider prefProvider) throws ESboxException {
+	public boolean isXServerStarted(IPreferenceProvider prefProvider)
+			throws ESboxException {
 		return XLauncher.getInstance().isXServerStarted(prefProvider);
 	}
 
-	/** Get the name of the script that launches processes in a standalone manner.
+	/**
+	 * Get the name of the script that launches processes in a standalone
+	 * manner.
+	 * 
 	 * @param sdkTarget
 	 * @return script name, never <code>null</code>
 	 */
 	/*
-	public String getStandaloneScriptName(ISDKTarget sdkTarget) {
-		return "run-standalone.sh";
-	}
-	*/
+	 * public String getStandaloneScriptName(ISDKTarget sdkTarget) { return
+	 * "run-standalone.sh"; }
+	 */
 
 	/**
 	 * Tell if the target supports a "run-standalone" script.
+	 * 
 	 * @param sdkTarget
-	 * @return 
+	 * @return
 	 */
 	/*
-	public boolean hasRunStandaloneScript(ISDKTarget sdkTarget) {
-		// XXX: do this better
-		if (sdkTarget == null)
-			return true;
-		return sdkTarget.getPlatform().getName().toLowerCase().matches("gregale|bora|chinook|diablo");
-	}
-	*/
-	
+	 * public boolean hasRunStandaloneScript(ISDKTarget sdkTarget) { // XXX: do
+	 * this better if (sdkTarget == null) return true; return
+	 * sdkTarget.getPlatform
+	 * ().getName().toLowerCase().matches("gregale|bora|chinook|diablo"); }
+	 */
+
 	/** Stop Maemo if it is running. */
 	public void stopMaemo(ISDKTarget sdkTarget) throws ESboxException {
 		// maemo processes can still be running...
-		//if (!isXServerStarted(sdkTarget))
-		//	throw new ScratchboxException("Cannot stop Maemo. Start X Server first");
+		// if (!isXServerStarted(sdkTarget))
+		// throw new
+		// ScratchboxException("Cannot stop Maemo. Start X Server first");
 
 		MaemoLauncher.getInstance().stopMaemo(sdkTarget);
 	}
 
-	/** 
+	/**
 	 * Start X and Maemo if it is not running.
 	 * <p>
-	 * This kills maemo if X is not running, since maemo may be left hanging is X is killed. 
+	 * This kills maemo if X is not running, since maemo may be left hanging is
+	 * X is killed.
 	 */
 	public void startMaemo(ISDKTarget sdkTarget) throws ESboxException {
 		if (!XLauncher.getInstance().isXServerStarted(sdkTarget)) {
@@ -622,10 +718,11 @@
 		}
 	}
 
-	/** 
-	 * Restart X and Maemo if it is running. 
+	/**
+	 * Restart X and Maemo if it is running.
 	 * <p>
-	 * This kills maemo if X is not running, since maemo may be left hanging is X is killed. 
+	 * This kills maemo if X is not running, since maemo may be left hanging is
+	 * X is killed.
 	 */
 	public void restartMaemo(ISDKTarget sdkTarget) throws ESboxException {
 		if (!XLauncher.getInstance().isXServerStarted(sdkTarget)) {
@@ -638,29 +735,31 @@
 		}
 	}
 
-	/** Kill maemo.  Does not kill X. 
+	/**
+	 * Kill maemo. Does not kill X.
 	 */
 	public void killMaemo(ISDKTarget target) throws ESboxException {
 		MaemoLauncher.getInstance().killMaemo(target);
 	}
 
-
 	/**
-	 * Make sure the build machine associated with the project is alive.
-	 * This must be called from the UI thread or some other top-level caller,
-	 * since it can deadlock.
+	 * Make sure the build machine associated with the project is alive. This
+	 * must be called from the UI thread or some other top-level caller, since
+	 * it can deadlock.
+	 * 
 	 * @param project
 	 * @param monitor
 	 */
-	public void ensureBuildMachine(IProject project,
-			IProgressMonitor monitor) throws ESboxException {
+	public void ensureBuildMachine(IProject project, IProgressMonitor monitor)
+			throws ESboxException {
 		if (monitor == null)
 			monitor = new NullProgressMonitor();
 		ISDK sdk = ProjectManager.getInstance().getSDK(project);
 		if (sdk == null)
 			throw new ESboxException("Invalid SDK for project: " + project);
 		IMachine machine = sdk.getMachine();
-		IStatus status = MachineManager.getInstance().acquireMachine(machine, monitor);
+		IStatus status = MachineManager.getInstance().acquireMachine(machine,
+				monitor);
 		if (!status.isOK())
 			throw new ESboxException(status.getMessage(), status.getException());
 	}

Deleted: trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/scratchbox/MaemoLauncher.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/scratchbox/MaemoLauncher.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/scratchbox/MaemoLauncher.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -1,134 +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:
- *    Raul Herbster (UFCG) - initial implementation
- *    Ed Swartz (Nokia) - adaptation
- *******************************************************************************/
-
-package org.maemo.esbox.maemosdk.core.scratchbox;
-
-import org.maemo.esbox.core.ESboxException;
-import org.maemo.esbox.core.machine.*;
-import org.maemo.esbox.core.sdk.ISDKTarget;
-
-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.
- * @author eswartz
- *
- */
-public class MaemoLauncher {
-
-	private static final String MAEMO_LAUNCHER_APP = "maemo-launcher";
-	private static MaemoLauncher instance;
-
-	public synchronized static MaemoLauncher getInstance() {
-		if (instance == null) {
-			instance = new MaemoLauncher();
-		}
-		return instance;
-	}
-	
-	/**
-	 * Test whether maemo is running.  We look for 'maemo-launcher' in the process list.
-	 * @param sdkTarget 
-	 * @return true if maemo process found 
-	 * @throws ESboxException if query is impossible
-	 */
-	private boolean testMaemoLauncher(ISDKTarget sdkTarget) throws ESboxException {
-		List<IProcess> runningProcesses = getMaemoLaunchers(sdkTarget.getSDK().getMachine());
-		return runningProcesses.size() > 0;
-	}
-
-	private List<IProcess> getMaemoLaunchers(IMachine machine) {
-		// includes scratchbox call that launched maemo-launcher
-		List<IProcess> runningProcesses = 
-			machine.getProcessLister().getProcesses(new ProcessFilterCmdLineRegexp(
-					".*/"+MAEMO_LAUNCHER_APP+"\\s+.*"));
-		return runningProcesses;
-	}
-	
-	/**
-	 * Test whether maemo is started by testing the existence of the maemo-launcher daemon
-	 * @param sdkTarget
-	 * @return flag
-	 */
-	public boolean isMaemoRunning(ISDKTarget sdkTarget) throws ESboxException {
-		return testMaemoLauncher(sdkTarget);
-	}
-
-	/**
-	 * Start maemo if it's not running.
-	 * @param sdkTarget
-	 * @throws ESboxException if already running or cannot be started
-	 */
-	public void startMaemo(ISDKTarget sdkTarget) throws ESboxException {
-		if (isMaemoRunning(sdkTarget))
-			throw new ScratchboxException("Maemo is already running");
-
-		ScratchboxFacade.getInstance().startMaemoCommand(sdkTarget);
-	}
-
-	/**
-	 * Stop maemo if it's running
-	 * @param sdkTarget
-	 * @throws ESboxException if not running or cannot be stopped
-	 */
-	public void stopMaemo(ISDKTarget sdkTarget) throws ESboxException {
-		// always try... may be half-initialized
-		//if (!isMaemoRunning(sdkTarget))
-		//	throw new ScratchboxException("Maemo is not running, or failed to launch.");
-
-		ScratchboxFacade.getInstance().stopMaemoCommand(sdkTarget);
-	}
-	
-	/**
-	 * Restart maemo
-	 * @param sdkTarget
-	 * @throws ESboxException if cannot be restarted
-	 */
-	public void restartMaemo(ISDKTarget sdkTarget) throws ESboxException {
-		ScratchboxFacade.getInstance().restartMaemoCommand(sdkTarget);
-	}
-
-	/**
-	 * Kill maemo by forcibly killing instances of the launcher left behind
-	 * @param sdkTarget
-	 * @throws ESboxException
-	 */
-	public void killMaemo(ISDKTarget sdkTarget) throws ESboxException {
-		List<IProcess> pids = getMaemoLaunchers(sdkTarget.getSDK().getMachine());
-		if (pids.size() == 0)
-			return;
-		
-		try {
-			for (IProcess process : pids) {
-				process.terminate();
-			}
-		} catch (IOException e) {
-			
-		}
-		
-		// try again
-		pids = getMaemoLaunchers(sdkTarget.getSDK().getMachine());
-		if (pids.size() == 0)
-			return;
-		
-		try {
-			for (IProcess process : pids) {
-				process.kill();
-			}
-		} catch (IOException e) {
-			throw new ESboxException("Could not kill " + MAEMO_LAUNCHER_APP, e);
-		}
-
-	}
-}

Modified: trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/scratchbox/MaemoRootstrap.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/scratchbox/MaemoRootstrap.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/scratchbox/MaemoRootstrap.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -13,8 +13,9 @@
 
 /**
  * The data associated with a maemo SDK+ rootstrap
+ * 
  * @author eswartz
- *
+ * 
  */
 public class MaemoRootstrap {
 	private final String name;
@@ -25,17 +26,17 @@
 		this.name = name;
 		this.architecture = architecture;
 		this.description = description;
-		
+
 	}
-	
+
 	public String getName() {
 		return name;
 	}
-	
+
 	public String getArchitecture() {
 		return architecture;
 	}
-	
+
 	public String getDescription() {
 		return description;
 	}
@@ -78,6 +79,5 @@
 			return false;
 		return true;
 	}
-	
-	
+
 }

Deleted: trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/scratchbox/PersistentCache.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/scratchbox/PersistentCache.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/scratchbox/PersistentCache.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -1,133 +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.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. 
- * The cache is loaded and stored with the plugin.
- * @author eswartz
- *
- */
-public class PersistentCache {
-
-	/**
-	 * Default filename, under workspace metadata for this plugin's state, where
-	 * the cache is stored.
-	 */
-	private static final String SCRATCHBOX_CACHE_FILE = "scratchbox_cache.dat";
-
-	/**
-	 * The environment variable which, if defined, overrides the file above.
-	 * It should be a full filesystem path.
-	 */
-	private static final String SCRATCHBOX_CACHE_ENV = "SCRATCHBOX_CACHE";
-	
-	private Map<String, Object> data;
-	
-	public PersistentCache() {
-		data = new HashMap<String, Object>();
-	}
-	
-	/**
-	 * Try to load the cache from plugin state.
-	 */
-	public void load() {
-		File state = getCacheFile();
-		if (state == null)
-			return;
-		try {
-			ObjectInputStream ois = new ObjectInputStream(new FileInputStream(state));
-			try {
-				data = (Map<String, Object>) ois.readObject();
-			} catch (ClassNotFoundException e) {
-				Activator.getErrorLogger().logError("Cannot unserialize data", e);
-			} finally {
-				Policy.close(ois);
-			}
-		} catch (IOException e) {
-			// ignore
-		}
-	}
-	
-	/**
-	 * @return
-	 */
-	private File getCacheFile() {
-		// check for argument passed to unit test
-		String sboxCache = System.getenv(SCRATCHBOX_CACHE_ENV);
-		if (sboxCache != null && sboxCache.length() > 0) {
-			return new File(sboxCache);
-		}
-		if (Activator.getDefault() == null)
-			return null;
-		IPath stateLocation = Activator.getDefault().getStateLocation();
-		File state = stateLocation.append(SCRATCHBOX_CACHE_FILE).toFile();
-		return state;
-	}
-
-	/**
-	 * Save the cache to plugin state.
-	 */
-	public void save() {
-		File state = getCacheFile();
-		if (state == null)
-			return;
-		ObjectOutputStream oos;
-		try {
-			oos = new ObjectOutputStream(new FileOutputStream(state));
-		} catch (IOException e1) {
-			Activator.getErrorLogger().logError("Cannot write cache data", e1);
-			return;
-		}
-		try {
-			oos.writeObject(data);
-		} catch (IOException e) {
-			Activator.getErrorLogger().logError("Cannot serialize cache data", e);
-		} finally {
-			Policy.close(oos);
-		}
-	}
-
-	/**
-	 * Delete the entries in the cache.
-	 */
-	public synchronized void clear() {
-		data.clear();
-	}
-
-	/**
-	 * Get a value from the cache.
-	 * @param key KEY_xxx
-	 * @return
-	 */
-	public synchronized Object get(String key) {
-		return data.get(key);
-	}
-
-	/**
-	 * Store a value in the cache
-	 * @param key KEY_xxx
-	 * @param value
-	 */
-	public synchronized void set(String key, Object value) {
-		data.put(key, value);
-	}
-}

Modified: trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/scratchbox/ScratchboxException.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/scratchbox/ScratchboxException.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/scratchbox/ScratchboxException.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -14,7 +14,7 @@
 import org.maemo.esbox.core.ESboxException;
 
 /**
- * General exception generated by communication API. 
+ * General exception generated by communication API.
  */
 public class ScratchboxException extends ESboxException {
 
@@ -25,12 +25,14 @@
 
 	/**
 	 * Constructor.
-	 * @param message the message of the exception.
+	 * 
+	 * @param message
+	 *            the message of the exception.
 	 */
 	public ScratchboxException(String message) {
 		super(message);
 	}
-	
+
 	public ScratchboxException(Throwable cause) {
 		super(cause);
 	}

Deleted: trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/scratchbox/ScratchboxFacade.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/scratchbox/ScratchboxFacade.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/scratchbox/ScratchboxFacade.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -1,1110 +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.filesystem.IFileInfo;
-import org.eclipse.core.runtime.*;
-import org.maemo.esbox.core.*;
-import org.maemo.esbox.core.env.*;
-import org.maemo.esbox.core.machine.*;
-import org.maemo.esbox.core.process.*;
-import org.maemo.esbox.core.sdk.*;
-import org.maemo.esbox.internal.api.core.machine.HostUnixMachine;
-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.ICommandAbstractor;
-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.sdk.*;
-
-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 ScratchboxFacade {
-
-	private static ScratchboxFacade singleton = null;
-
-	private 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;
-			}
-		}
-	}
-
-	private 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;
-	}
-
-	/**
-	 * 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 
-	 * 
-	 */
-	private 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();
-			}
-			
-		};
-	}
-	
-	/**
-	 * Get a command abstractor that updates the PATH if sb1 tools are not on the path.
-	 * @param commandAbstractor
-	 * @param machine
-	 * @return 
-	 */
-	private 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");
-	}
-	/**
-	 * Get a command abstractor that updates the PATH if sb2 tools are not on the path.
-	 * @param commandAbstractor
-	 * @param machine
-	 * @return
-	 */
-	private ICommandAbstractor getSb2WrappedAbstractor(ICommandAbstractor commandAbstractor,
-			IMachine machine) {
-		// XXX: the default path should be provided some other way
-		return wrapCommandAbstractorForSDK(
-				commandAbstractor,
-				machine, 
-				"sb2",
-				"/usr/bin");
-	}
-
-	/** 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 for their host machine. 
-	 * 
-	 * Some sb1 configurations place binaries only in /scratchbox/tools/bin, making it
-	 * invisible to the default PATH.  A scratchbox SDK will detect this.
-	 */
-	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) {
-			return getSb1WrappedAbstractor(commandAbstractor, sdk.getMachine());
-		} else if (sdk instanceof IScratchbox2SDK) { 
-			return getSb2WrappedAbstractor(commandAbstractor, sdk.getMachine());
-		}
-		
-		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 = getSb1WrappedAbstractor(commandAbstractor, machine);
-		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); 
-		commandAbstractor = getSb2WrappedAbstractor(commandAbstractor, 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 {
-		if (sdk instanceof IScratchbox1SDK)
-			return 1;
-		else if (sdk instanceof IScratchbox2SDK)
-			return 2;
-		else
-			throwBadESboxException(sdk);
-		return 0;
-	}
-
-	/**
-	 * 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(IScratchbox2SDKTarget 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);
-	}
-
-}

Modified: trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/scratchbox/ScratchboxTarget.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/scratchbox/ScratchboxTarget.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/scratchbox/ScratchboxTarget.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -13,8 +13,8 @@
 import java.util.List;
 
 /**
- * Representation of Scratchbox target. It contains the name, compiler,
- * devkits and CPU-transparency of a target.
+ * Representation of Scratchbox target. It contains the name, compiler, devkits
+ * and CPU-transparency of a target.
  */
 public class ScratchboxTarget implements Comparable<Object> {
 
@@ -88,6 +88,7 @@
 
 	/*
 	 * (non-Javadoc)
+	 * 
 	 * @see java.lang.Comparable#compareTo(java.lang.Object)
 	 */
 	public int compareTo(Object o) {

Deleted: trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/scratchbox/ScratchboxTargetSwitcher.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/scratchbox/ScratchboxTargetSwitcher.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/scratchbox/ScratchboxTargetSwitcher.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -1,158 +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 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 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 IScratchbox1SDKTarget)) {
-			return;
-		}
-		
-		IScratchbox1SDK sdk = ((IScratchbox1SDK) 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);
-		}
-	}
-}

Deleted: trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/scratchbox/XLauncher.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/scratchbox/XLauncher.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/scratchbox/XLauncher.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -1,263 +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:
- *    Raul Herbster (UFCG) - initial implementation
- *    Ed Swartz (Nokia) - adaptation
- *******************************************************************************/
-
-package org.maemo.esbox.maemosdk.core.scratchbox;
-
-import org.eclipse.core.runtime.*;
-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.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.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;
-
-/**
- * This class maintains knowledge about whether the X server is running in
- * the host, and controls access to starting, stopping, and querying status.
- * @author eswartz
- *
- */
-public class XLauncher {
-
-	private static XLauncher instance;
-	
-	private Job launchingXJob;
-
-	public synchronized static XLauncher getInstance() {
-		if (instance == null) {
-			instance = new XLauncher();
-		}
-		return instance;
-	}
-	
-	/**
-	 * Test a connection to the X server denoted by 'display'.  This performs 
-	 * an immediate check and is ignorant if a launch is in progress.
-	 * @param display the DISPLAY value, e.g. ":2" or ":0.0" or "myhost:0"
-	 * @return true if connection succeeded 
-	 * @throws ESboxException if query is impossible
-	 */
-	private boolean testXConnection(String display) throws ESboxException {
-		String[] parts = display.split(":");
-		if (parts.length != 2)
-			throw new ESboxException(
-					MessageFormat.format("DISPLAY variable ''{0}'' does not have expected syntax [host]:<number>[.<number>]",
-							display));
-		String host = parts[0];
-		if (host.equals("unix")) {
-			Activator.getErrorLogger().logError(
-					MessageFormat.format("Support for testing X connection over UNIX domain sockets is not implemented; assuming success (DISPLAY=''{0}'')",
-							display), null);
-			return true;
-		}
-		
-		if (host.length() == 0) {
-			host = null;
-		}
-		
-		String[] displayParts = parts[1].split("\\.");
-		int displayNumber = 0;
-		try {
-			displayNumber = Integer.parseInt(displayParts[0]);
-		} catch (NumberFormatException e) {
-			throw new ESboxException(
-					MessageFormat.format("DISPLAY variable ''{0}'' does not have expected syntax [host]:<number>[.<number>]",
-							display));
-		}
-		
-		try {
-			/*Socket socket =*/ new Socket(host, 6000 + displayNumber);
-			return true;
-		} catch (Exception e) {
-			return false;
-		}
-	}
-	
-	/**
-	 * Test whether the X server is started by testing a connection to the server.
-	 * @param prefProvider
-	 * @return
-	 */
-	public boolean isXServerStarted(IPreferenceProvider prefProvider) throws ESboxException {
-		return testXConnection(getDisplayValue(prefProvider));
-	}
-
-	/** Be nice and start X if needed before starting/restarting maemo */
-	public void startXIfNeeded(IPreferenceProvider prefProvider) throws ESboxException {
-		waitForXLaunch();
-		if (!isXServerStarted(prefProvider)) {
-			startX(prefProvider);
-			waitForXLaunch();
-		}
-	}
-
-	/**
-	 * Wait forever for the X launching job (if any) to complete.
-	 * This returns only when the job is complete.  It does not
-	 * reflect a successful launch of the server.
-	 */
-	private void waitForXLaunch() {
-		while (true) {
-			synchronized (this) {
-				if (launchingXJob == null) {
-					return;
-				}
-				if (launchingXJob != null) {
-					if (launchingXJob.getResult() != null) {
-						return;
-					}
-				}
-			}
-			
-			try {
-				Thread.sleep(500);
-			} catch (InterruptedException e) {
-				return;
-			}
-		}
-	}
-
-	public void startX(final IPreferenceProvider prefProvider) throws ESboxException {
-		waitForXLaunch();
-		
-		if (isXServerStarted(prefProvider))
-			throw new ScratchboxException("X Server is already running");
-
-		String viewer = getDisplayXServerCommand(prefProvider);	
-		final String display = getDisplayValue(prefProvider);
-		
-		List<String> cmdLine = CommandLineArguments.createFromCommandLine(viewer);
-		
-		if (cmdLine.size() > 0) {
-
-			IMachine localMachine = MachineRegistry.getInstance().getLocalMachine();
-			if (localMachine == null)
-				throw new ESboxException("Cannot find local machine");
-			
-			IProcessLauncherFactory factory = localMachine.getProcessLauncherFactory();
-
-			IEnvironmentModifierBlock envBlock = null;
-			
-			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,
-					envBlock);
-			
-			final Process process = processLauncher.createProcess();
-			
-			final MessageConsole console = processLauncher.redirectToConsole(true, null, "Starting X Server");
-			
-			synchronized(this) {
-				launchingXJob = new Job("Waiting for X Server") {
-	
-					@Override
-					protected IStatus run(IProgressMonitor monitor) {
-						while (true) {
-							try {
-								if (testXConnection(display))
-									break;
-							} catch (ESboxException e) {
-								return Activator.createErrorStatus("Failed to check X connection", e);
-							}
-							
-							try {
-								Thread.sleep(500);
-							} catch (InterruptedException e) {
-								return Policy.getCancelStatus(Activator.getDefault());
-							}
-							
-							try {
-								// see if the process terminated yet
-								int exit = process.exitValue();
-								
-								console.newMessageStream().println("Process exited with code 0x" + Integer.toHexString(exit));
-								
-								// report failure outside this job else we can get stuck here
-								// if someone queries the job status from the UI thread
-								Display.getDefault().asyncExec(new Runnable() {
-
-									public void run() {
-										Activator.getErrorLogger().logAndShowError("X server did not launch; check the Console.", null);
-									}
-									
-								});
-								break;
-							} catch (IllegalThreadStateException e) {
-								// not finished, good
-							}
-						}	
-						synchronized (XLauncher.this) {
-							launchingXJob = null;
-						}
-						return Status.OK_STATUS;
-					}
-				};
-				launchingXJob.schedule();
-			}
-		} else {
-			Activator.getErrorLogger().logAndShowError("No X server configured in ESbox preferences", null);
-		}
-		
-	}
-
-	public void stopX(IPreferenceProvider prefProvider) throws ESboxException {
-		waitForXLaunch();
-		
-		if (!isXServerStarted(prefProvider))
-			throw new ScratchboxException("X Server was not started. Start X Server first");
-		
-		String server = getDisplayXServerCommand(prefProvider);
-		
-		List<String> cmdLine = CommandLineArguments.createFromCommandLine(server);
-
-		// find server to kill
-		if (cmdLine.size() > 0) {
-			IMachine localMachine = MachineRegistry.getInstance().getLocalMachine();
-			if (localMachine == null)
-				throw new ESboxException("Cannot find local machine");
-
-			ESboxScriptLauncher.getInstance().killProcess(localMachine, cmdLine.get(0), "X Server");
-		}
-	}
-	
-
-	private String getDisplayXServerCommand(IPreferenceProvider prefProvider) {
-		String command = prefProvider.getPreferenceValue(
-				MaemoPreferenceConstants.DISPLAY_X_COMMAND);
-
-		command = command.replaceAll("\\$\\{DISPLAY\\}", getDisplayValue(prefProvider));
-		return command;
-	}
-	
-	private String getDisplayValue(IPreferenceProvider prefProvider) {
-		String value = prefProvider.getPreferenceValue(MaemoPreferenceConstants.X_DISPLAY);
-		if (value.length() > 0)
-			return value;
-		else
-			return System.getenv("DISPLAY"); // get from system
-	}
-}

Deleted: trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/sdk/IScratchbox1SDK.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/sdk/IScratchbox1SDK.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/sdk/IScratchbox1SDK.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -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: trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/sdk/IScratchbox1SDKTarget.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/sdk/IScratchbox1SDKTarget.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/sdk/IScratchbox1SDKTarget.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -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: trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/sdk/IScratchbox2SDK.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/sdk/IScratchbox2SDK.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/sdk/IScratchbox2SDK.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -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: trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/sdk/IScratchbox2SDKTarget.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/sdk/IScratchbox2SDKTarget.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/sdk/IScratchbox2SDKTarget.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -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: trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/sdk/IScratchboxSDK.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/sdk/IScratchboxSDK.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/sdk/IScratchboxSDK.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -7,27 +7,179 @@
  *
  * Contributors:
  *    Ed Swartz (Nokia) - initial API and implementation
+ *    Petr Baranov - refactoring ScratchboxFacade
  *******************************************************************************/
 package org.maemo.esbox.maemosdk.core.sdk;
 
+import java.util.List;
+
+import org.maemo.esbox.core.ESboxException;
 import org.maemo.esbox.core.sdk.ISDK;
 
 /**
  * This interface provides scratchbox-specific functionality to an ISDK
- * @author eswartz
- *
+ * 
+ * @author baranov
+ * 
  */
 public interface IScratchboxSDK extends ISDK {
-	/** 
-	 * If appropriate, get the cached value of the current scratchbox target.
-	 *  
+	/**
+	 * If appropriate, get the cached value of the scratchbox target.
+	 * 
 	 * @return cached name, or <code>null</code>
 	 */
 	String getCachedCurrentTarget();
 
 	/**
 	 * Set the last detected current scratchbox target.
+	 * 
 	 * @param currentTarget
 	 */
 	void setCachedCurrentTarget(String currentTarget);
+
+	/**
+	 * Return the list of available compilers in Scratchbox.
+	 * 
+	 * @return a list with the available compilers in Scratchbox.
+	 * @throws ESboxException
+	 *             if some problem related to Scratchbox communication occurs.
+	 */
+	public List<String> getCompilers() throws ESboxException;
+
+	/**
+	 * Return the list of available cputransp method at Scratchbox.
+	 * 
+	 * 
+	 * @return a list with the available cputransp method at Scratchbox.
+	 * @throws ESboxException
+	 *             if some problem related to Scratchbox communication occurs.
+	 */
+	public List<String> getCputransp() throws ESboxException;
+
+	/**
+	 * 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 List<String> getTargets() throws ESboxException;
+
+	/**
+	 * Return the current target name of the Scratchbox.
+	 * 
+	 * 
+	 * @return the current target of the Scratchbox.
+	 * @throws ESboxException
+	 *             if some problem related to Scratchbox communication occurs.
+	 */
+	public String getCurrentTarget() throws ESboxException;
+
+	/**
+	 * Return the current target of the Scratchbox.
+	 * 
+	 * @return the current target of Scratchbox.
+	 * @throws ESboxException
+	 *             if some problem related to Scratchbox communication occurs.
+	 */
+	public IScratchboxSDKTarget getCurrentSDKTarget() throws ESboxException;
+
+	/**
+	 * Create a new target for Scratchbox. An target must have a name, and the
+	 * compiler, devkits and cputransp must be available in Scratchbox.
+	 * 
+	 * @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 boolean createTarget(String targetName, String compiler,
+			String devkits, String cputransp) throws ESboxException;
+
+	/**
+	 * Remove a target from the Scratchbox. A target with the given name must
+	 * exist.
+	 * 
+	 * @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 boolean removeTarget(String targetName) throws ESboxException;
+
+	/**
+	 * Configure sbrsh settings of an certain target.
+	 * 
+	 * @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 boolean configureSbrsh(String targetName, String targetDeviceAddr,
+			String nfsServerAddr) throws ESboxException;
+
+	/**
+	 * Add the target to an access list. Such list contains all targets that can
+	 * be access the remote device.
+	 * 
+	 * @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 boolean addSbrshAccessList(String targetDeviceAddr, String username,
+			String ipAddr) throws ESboxException;
+
+	/**
+	 * 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 boolean mountTarget(String targetName) throws ESboxException;
+
+	/**
+	 * 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 boolean unmountTarget(String targetName) throws ESboxException;
+
+	/**
+	 * @return version number of the Scratchbox
+	 */
+	public int getSboxVersion();
 }

Modified: trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/sdk/IScratchboxSDKTarget.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/sdk/IScratchboxSDKTarget.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/sdk/IScratchboxSDKTarget.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -7,20 +7,24 @@
  *
  * Contributors:
  *    Ed Swartz (Nokia) - initial API and implementation
+ *    Petr Baranov - refactoring ScratchboxFacade
  *******************************************************************************/
 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;
 
 /**
  * This interface provides scratchbox-specific functionality to an ISDKTarget.
  * <p>
- * This provides a means to differentiate build and install commands, which require different
- * styles of root acquisition and also different mapping modes in scratchbox 2.
+ * This provides a means to differentiate build and install commands, which
+ * require different styles of root acquisition and also different mapping modes
+ * in scratchbox.
+ * 
  * @author eswartz
- *
+ * 
  */
 public interface IScratchboxSDKTarget extends ISDKTarget {
 	public static String ARCHITECTURE_X86 = "X86";
@@ -29,14 +33,30 @@
 
 	/**
 	 * Get the rootstrap root directory.
-	 * @return IPath where rootstrap is installed, or <code>null</code> if unknown
+	 * 
+	 * @return IPath where rootstrap is installed, or <code>null</code> if
+	 *         unknown
 	 */
 	IPath getRootstrapPath();
-	
-	/** Create a process launcher factory for running install (apt/dpkg/etc) commands. 
-	 * The default {@link #getProcessLauncherFactory()} provides launchers for build commands. 
+
+	/**
+	 * Create a process launcher factory for running install (apt/dpkg/etc)
+	 * commands. The default {@link #getProcessLauncherFactory()} provides
+	 * launchers for build commands.
 	 */
 	IProcessLauncherFactory getProcessLauncherFactoryForInstall();
-	
 
+	/**
+	 * Get the pattern to launch QEMU with gdbserver support for the given SDK target.
+	 * @param architecture
+	 * @return a command template
+	 * @throws ESboxException
+	 */
+	String getGdbQemuCommandPattern(String architecture) throws ESboxException;
+
+	/**
+	 * Get the version of scratchbox this represents.
+	 * @return 1 or 2
+	 */
+	int getSboxVersion();
 }

Modified: trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/sdk/ScratchboxSDKFacade.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/sdk/ScratchboxSDKFacade.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.core/src/org/maemo/esbox/maemosdk/core/sdk/ScratchboxSDKFacade.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -7,91 +7,96 @@
  *
  * Contributors:
  *    Ed Swartz (Nokia) - initial API and implementation
+ *    Petr Baranov (Nokia)
  *******************************************************************************/
 package org.maemo.esbox.maemosdk.core.sdk;
 
+import java.util.ArrayList;
 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;
 
 /**
- * This facade provides access to IScratchbox[1|2]SDK instances
- * gathered at startup. 
+ * This facade provides access to IScratchbox[1|2]SDK instances gathered at
+ * startup.
  * 
  * @author eswartz
- *
+ * 
  */
 public class ScratchboxSDKFacade {
 	private static ScratchboxSDKFacade instance;
-	
+	private List<IScratchboxSDK> scratchboxSDKs = null;
+
 	public static synchronized ScratchboxSDKFacade getInstance() {
 		if (instance == null) {
 			instance = new ScratchboxSDKFacade();
 		}
 		return instance;
 	}
-	
-	private ScratchboxSDKFacade() { }
-	
-	/** 
-	 * Get the (first) scratchbox 1 installation on the system. 
+
+	private ScratchboxSDKFacade() {
+	}
+
+	/**
+	 * Get the (first) scratchbox 1 installation on the system.
+	 * 
 	 * @return {@link IScratchbox1SDK}, never <code>null</code>
-	 * @throws ScratchboxException if no scratchbox 1 SDK available
+	 * @throws ScratchboxException
+	 *             if no scratchbox 1 SDK available
 	 * */
-	public IScratchbox1SDK getScratchbox1SDK() throws ScratchboxException {
-		List<ISDK> sdks = SDKFactory.getInstance().getSDKs();
-		for (ISDK sdk : sdks) {
-			if (sdk instanceof IScratchbox1SDK) {
-				return (IScratchbox1SDK) sdk;
+	public List<IScratchboxSDK> getAllScratchboxSDKs()
+			throws ScratchboxException {
+		if (scratchboxSDKs == null) {
+			List<ISDK> sdks = SDKFactory.getInstance().getSDKs();
+			scratchboxSDKs = new ArrayList<IScratchboxSDK>();
+			for (ISDK sdk : sdks) {
+				if (sdk instanceof IScratchboxSDK) {
+					scratchboxSDKs.add((IScratchboxSDK) sdk);
+				}
 			}
 		}
-		throw new ScratchboxException("No scratchbox 1 SDKs installed");
+		if (scratchboxSDKs.isEmpty())
+			throw new ScratchboxException("No scratchbox SDKs installed");
+		return scratchboxSDKs;
 	}
 
-	/** 
-	 * Get the (first) scratchbox 2 installation on the system. 
-	 * @return {@link IScratchbox1SDK}, never <code>null</code>
-	 * @throws ScratchboxException if no scratchbox 2 SDK available
-	 * */
-	public IScratchbox2SDK getScratchbox2SDK() throws ScratchboxException {
-		List<ISDK> sdks = SDKFactory.getInstance().getSDKs();
-		for (ISDK sdk : sdks) {
-			if (sdk instanceof IScratchbox2SDK) {
-				return (IScratchbox2SDK) sdk;
-			}
+	public <SboxSDK extends IScratchboxSDK> List<SboxSDK> getScratchboxSDK(
+			Class<SboxSDK> klass) throws ScratchboxException {
+		List<IScratchboxSDK> allSBoxSDKs = getAllScratchboxSDKs();
+		List<SboxSDK> result = new ArrayList<SboxSDK>();
+		for (IScratchboxSDK sdk : allSBoxSDKs) {
+			if (klass.isInstance(sdk))
+				result.add((SboxSDK) sdk);
 		}
-		throw new ScratchboxException("No scratchbox 2 SDKs installed");
+		if (result.isEmpty())
+			throw new ScratchboxException("No " + klass.getName()
+					+ " installed");
+		return result;
 	}
 
 	/**
 	 * Get all scratchbox targets
+	 * 
 	 * @return array of IScratchboxSDKTarget, never <code>null</code>
 	 */
 	public IScratchboxSDKTarget[] getScratchboxSDKTargets() {
-		ISDKTarget[] sb1Targets = new ISDKTarget[0];
-		ISDKTarget[] sb2Targets = new ISDKTarget[0];
+		List<IScratchboxSDK> sboxSDKs = null;
+		List<IScratchboxSDKTarget> sdkTargets = new ArrayList<IScratchboxSDKTarget>();
 		try {
-			sb1Targets = getScratchbox1SDK().getSDKTargets();
+			sboxSDKs = getAllScratchboxSDKs();
 		} catch (ScratchboxException e) {
-			
+
 		}
-		try {
-			sb2Targets = getScratchbox2SDK().getSDKTargets();
-		} catch (ScratchboxException e) {
-			
+		for (IScratchboxSDK sboxSDK : sboxSDKs) {
+			ISDKTarget[] targets = sboxSDK.getSDKTargets();
+			for (ISDKTarget target : targets)
+				if (target instanceof IScratchboxSDKTarget)
+					sdkTargets.add((IScratchboxSDKTarget) target);
 		}
-		
-		IScratchboxSDKTarget[] sdkTargets = new IScratchboxSDKTarget[
-             sb1Targets.length + sb2Targets.length];
-		int idx = 0;
-		for (ISDKTarget sdkTarget : sb1Targets) {
-			sdkTargets[idx++] = (IScratchboxSDKTarget) sdkTarget;
-		}
-		for (ISDKTarget sdkTarget : sb2Targets) {
-			sdkTargets[idx++] = (IScratchboxSDKTarget) sdkTarget;
-		}
-		
-		return sdkTargets;
+
+		return sdkTargets.toArray(new IScratchboxSDKTarget[sdkTargets.size()]);
 	}
 }

Copied: trunk/maemosdk/org.maemo.esbox.maemosdk.sb1 (from rev 873, branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sb1)

Deleted: trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/.classpath
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sb1/.classpath	2008-10-15 06:30:08 UTC (rev 873)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/.classpath	2008-10-15 19:30:29 UTC (rev 877)
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
-	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
-	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
-	<classpathentry kind="src" path="src"/>
-	<classpathentry kind="output" path="bin"/>
-</classpath>

Copied: trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/.classpath (from rev 873, branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sb1/.classpath)
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/.classpath	                        (rev 0)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/.classpath	2008-10-15 19:30:29 UTC (rev 877)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+	<classpathentry kind="src" path="src"/>
+	<classpathentry kind="output" path="bin"/>
+</classpath>

Deleted: trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/.project
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sb1/.project	2008-10-15 06:30:08 UTC (rev 873)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/.project	2008-10-15 19:30:29 UTC (rev 877)
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-	<name>org.maemo.esbox.maemosdk.sb1</name>
-	<comment></comment>
-	<projects>
-	</projects>
-	<buildSpec>
-		<buildCommand>
-			<name>org.eclipse.jdt.core.javabuilder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-		<buildCommand>
-			<name>org.eclipse.pde.ManifestBuilder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-		<buildCommand>
-			<name>org.eclipse.pde.SchemaBuilder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-	</buildSpec>
-	<natures>
-		<nature>org.eclipse.pde.PluginNature</nature>
-		<nature>org.eclipse.jdt.core.javanature</nature>
-	</natures>
-</projectDescription>

Copied: trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/.project (from rev 873, branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sb1/.project)
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/.project	                        (rev 0)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/.project	2008-10-15 19:30:29 UTC (rev 877)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>org.maemo.esbox.maemosdk.sb1</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.pde.ManifestBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.pde.SchemaBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.pde.PluginNature</nature>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+	</natures>
+</projectDescription>

Copied: trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/.settings (from rev 873, branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sb1/.settings)

Copied: trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/META-INF (from rev 873, branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sb1/META-INF)

Deleted: trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/META-INF/MANIFEST.MF
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sb1/META-INF/MANIFEST.MF	2008-10-15 06:30:08 UTC (rev 873)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/META-INF/MANIFEST.MF	2008-10-15 19:30:29 UTC (rev 877)
@@ -1,20 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: scratchbox 1 support
-Bundle-SymbolicName: org.maemo.esbox.maemosdk.sb1;singleton:=true
-Bundle-Version: 1.5.0.qualifier
-Bundle-Activator: org.maemo.esbox.maemosdk.sb1.internal.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.maemo.esbox.maemosdk.ui;bundle-version="1.5.0"
-Bundle-ActivationPolicy: lazy
-Bundle-RequiredExecutionEnvironment: JavaSE-1.6
-Bundle-Vendor: INdT / Nokia
-Export-Package: org.maemo.esbox.maemosdk.sb1.command;x-friends:="org.maemo.esbox.maemosdk.tests",
- org.maemo.esbox.maemosdk.sb1.core;x-friends:="org.maemo.esbox.maemosdk.tests",
- org.maemo.esbox.maemosdk.sb1.launcher;x-friends:="org.maemo.esbox.maemosdk.tests",
- org.maemo.esbox.maemosdk.sb1.provider;x-friends:="org.maemo.esbox.maemosdk.tests",
- org.maemo.esbox.maemosdk.sb1.ui.adapters;x-friends:="org.maemo.esbox.maemosdk.tests",
- org.maemo.esbox.maemosdk.sb1.ui.preferences;x-friends:="org.maemo.esbox.maemosdk.tests",
- org.maemo.esbox.maemosdk.sb1.ui.wizard;x-friends:="org.maemo.esbox.maemosdk.tests"

Copied: trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/META-INF/MANIFEST.MF (from rev 873, branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sb1/META-INF/MANIFEST.MF)
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/META-INF/MANIFEST.MF	                        (rev 0)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/META-INF/MANIFEST.MF	2008-10-15 19:30:29 UTC (rev 877)
@@ -0,0 +1,21 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: ESbox Scratchbox 1 Support
+Bundle-SymbolicName: org.maemo.esbox.maemosdk.sb1;singleton:=true
+Bundle-Version: 1.5.0.qualifier
+Bundle-Activator: org.maemo.esbox.internal.maemosdk.sb1.Activator
+Require-Bundle: org.eclipse.core.runtime,
+ org.maemo.esbox.maemosdk.core;bundle-version="1.5.0";visibility:=reexport,
+ org.eclipse.ui.ide,
+ org.maemo.esbox.maemosdk.ui;bundle-version="1.5.0"
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-Vendor: INdT / Nokia
+Export-Package: org.maemo.esbox.internal.maemosdk.sb1.command;x-friends:="org.maemo.esbox.maemosdk.tests",
+ org.maemo.esbox.internal.maemosdk.sb1.core;x-friends:="org.maemo.esbox.maemosdk.tests",
+ org.maemo.esbox.internal.maemosdk.sb1.launcher,
+ org.maemo.esbox.internal.maemosdk.sb1.provider,
+ org.maemo.esbox.internal.maemosdk.sb1.ui.adapters,
+ org.maemo.esbox.internal.maemosdk.sb1.ui.preferences,
+ org.maemo.esbox.internal.maemosdk.sb1.ui.wizard,
+ org.maemo.esbox.maemosdk.sb1.sdk

Deleted: trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/build.properties
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sb1/build.properties	2008-10-15 06:30:08 UTC (rev 873)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/build.properties	2008-10-15 19:30:29 UTC (rev 877)
@@ -1,6 +0,0 @@
-source.. = src/
-output.. = bin/
-bin.includes = META-INF/,\
-               .,\
-               plugin.xml,\
-               conf/

Copied: trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/build.properties (from rev 873, branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sb1/build.properties)
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/build.properties	                        (rev 0)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/build.properties	2008-10-15 19:30:29 UTC (rev 877)
@@ -0,0 +1,6 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+               .,\
+               plugin.xml,\
+               conf/

Copied: trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/conf (from rev 873, branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sb1/conf)

Deleted: trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/conf/run.sh
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sb1/conf/run.sh	2008-10-15 06:30:08 UTC (rev 873)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/conf/run.sh	2008-10-15 19:30:29 UTC (rev 877)
@@ -1,43 +0,0 @@
-#!/bin/sh
-
-#/*******************************************************************************
-# * Copyright (c) 2007-2008 INdT, (c) 2008 Nokia.
-# * 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 (raul at embedded.ufcg.edu.br) (UFCG) - initial API and implementation
-# *    Ed Swartz (Nokia) - additions and changes
-# *******************************************************************************/
-
-__version=0.5
-__release=1.2
-__location=$1
-__export_list=$2
-shift
-shift
-__command="$@"
-
-if [ ! -d $__location ] ; then
-        echo "E: Directory $__location not found"
-        exit 1
-fi
-
-cd $__location
-
-# 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
-

Copied: trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/conf/run.sh (from rev 873, branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sb1/conf/run.sh)
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/conf/run.sh	                        (rev 0)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/conf/run.sh	2008-10-15 19:30:29 UTC (rev 877)
@@ -0,0 +1,43 @@
+#!/bin/sh
+
+#/*******************************************************************************
+# * Copyright (c) 2007-2008 INdT, (c) 2008 Nokia.
+# * 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 (raul at embedded.ufcg.edu.br) (UFCG) - initial API and implementation
+# *    Ed Swartz (Nokia) - additions and changes
+# *******************************************************************************/
+
+__version=0.5
+__release=1.2
+__location=$1
+__export_list=$2
+shift
+shift
+__command="$@"
+
+if [ ! -d $__location ] ; then
+        echo "E: Directory $__location not found"
+        exit 1
+fi
+
+cd $__location
+
+# 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
+

Deleted: trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/conf/sb1_prefs.xml
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sb1/conf/sb1_prefs.xml	2008-10-15 06:30:08 UTC (rev 873)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/conf/sb1_prefs.xml	2008-10-15 19:30:29 UTC (rev 877)
@@ -1,77 +0,0 @@
-<?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 1 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="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>
-
-	<!-- this uses ${QEMU} because the default qemu-arm is an often misconfigured softlink: see GetGdbQemuCommandPatternCommand -->
-	<entry key="SB1_GDB_REMOTE_QEMU">${QEMU} -g ${PORT}</entry>
-	
-	<!-- actions of command sb-conf  -->	
-	
-	<entry key="SB1_VERSION_ACT">version</entry>
-	<entry key="SB1_SETUP_ACT">setup</entry>
-	<entry key="SB1_INSTALL_ACT">install</entry>	
-	<entry key="SB1_ROOTSTRAP_ACT">rootstrap</entry>
-	<entry key="SB1_SELECT_ACT">select</entry>
-	<entry key="SB1_RESET_ACT">reset</entry>
-	<entry key="SB1_KILLALL_ACT">killall</entry>
-	<entry key="SB1_REMOVE_ACT">remove</entry>
-	<entry key="SB1_SHOW_ACT">show</entry>
-	<entry key="SB1_LIST_ACT">list</entry>
-	<entry key="SB1_CURRENT_ACT">current</entry>
-	
-	<!-- options for action rootstrap -->
-	<entry key="SB1_ROOTSTRAP_OPT_FORCE">--force</entry>
-	<entry key="SB1_SETUP_ACT">setup</entry>
-	
-	<!-- options for action remove -->
-	<entry key="SB1_REMOVE_OPT_FORCE">--force</entry>
-	
-	<!-- options for action setup -->
-	<entry key="SB1_SETUP_OPT_COMPILER">--compiler=${COMPILER}</entry>
-	<entry key="SB1_SETUP_OPT_DEVKITS">--devkits=${LIST}</entry>
-	<entry key="SB1_SETUP_OPT_CPUTRANSP">--cputransp=${METHOD}</entry>
-	<entry key="SB1_SETUP_OPT_FORCE">--force</entry>
-	
-	<!-- options for action killall -->
-	<entry key="SB1_KILLALL_OPT_SIGNAL">signal=${SIGNAL}</entry>	
-	
-	<!-- options for action install -->
-	<entry key="SB1_INSTALL_OPT_CLIB">--clibrary</entry>
-	<entry key="SB1_INSTALL_OPT_ETC">--etc</entry>
-	<entry key="SB1_INSTALL_OPT_DEVKITS">--devkits</entry>
-	<entry key="SB1_INSTALL_OPT_FAKE">--fakeroot</entry>
-	<entry key="SB1_INSTALL_OPT_GDB">--gdb</entry>
-	<entry key="SB1_INSTALL_OPT_STRACE">--strace</entry>	
-	
-	<!-- options for action show -->
-	<entry key="SB1_SHOW_OPT_COMPILERS">--compilers</entry>
-	<entry key="SB1_SHOW_OPT_DEVKITS">--devkits</entry>
-	<entry key="SB1_SHOW_OPT_CPU">--cputransp</entry>
-	<entry key="SB1_SHOW_OPT_COMP_ARCH">--compiler-arch</entry>
-	<entry key="SB1_SHOW_OPT_COMP_SUBARCH">--compiler-subarch</entry>
-	<entry key="SB1_SHOW_OPT_COMP_CLIB">--compiler-clib</entry>
-	
-	<!-- options for action list -->
-	<entry key="SB1_LIST_OPT_COMPILERS">--compilers</entry>
-	<entry key="SB1_LIST_OPT_DEVKITS">--devkits</entry>
-	<entry key="SB1_LIST_OPT_CPU">--cputransps</entry>
-	<entry key="SB1_LIST_OPT_TARGETS">--targets</entry>
-	<entry key="SB1_LIST_OPT_SESSIONS">--sessions</entry>
-	
-	<!-- setting such as Scratchbox location and user name -->
-	<entry key="SB1_SBOX_SANDBOX">/scratchbox/users/${USER}</entry>
-	
-</properties>

Copied: trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/conf/sb1_prefs.xml (from rev 873, branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sb1/conf/sb1_prefs.xml)
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/conf/sb1_prefs.xml	                        (rev 0)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/conf/sb1_prefs.xml	2008-10-15 19:30:29 UTC (rev 877)
@@ -0,0 +1,77 @@
+<?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 1 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="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>
+
+	<!-- this uses ${QEMU} because the default qemu-arm is an often misconfigured softlink: see GetGdbQemuCommandPatternCommand -->
+	<entry key="SB1_GDB_REMOTE_QEMU">${QEMU} -g ${PORT}</entry>
+	
+	<!-- actions of command sb-conf  -->	
+	
+	<entry key="SB1_VERSION_ACT">version</entry>
+	<entry key="SB1_SETUP_ACT">setup</entry>
+	<entry key="SB1_INSTALL_ACT">install</entry>	
+	<entry key="SB1_ROOTSTRAP_ACT">rootstrap</entry>
+	<entry key="SB1_SELECT_ACT">select</entry>
+	<entry key="SB1_RESET_ACT">reset</entry>
+	<entry key="SB1_KILLALL_ACT">killall</entry>
+	<entry key="SB1_REMOVE_ACT">remove</entry>
+	<entry key="SB1_SHOW_ACT">show</entry>
+	<entry key="SB1_LIST_ACT">list</entry>
+	<entry key="SB1_CURRENT_ACT">current</entry>
+	
+	<!-- options for action rootstrap -->
+	<entry key="SB1_ROOTSTRAP_OPT_FORCE">--force</entry>
+	<entry key="SB1_SETUP_ACT">setup</entry>
+	
+	<!-- options for action remove -->
+	<entry key="SB1_REMOVE_OPT_FORCE">--force</entry>
+	
+	<!-- options for action setup -->
+	<entry key="SB1_SETUP_OPT_COMPILER">--compiler=${COMPILER}</entry>
+	<entry key="SB1_SETUP_OPT_DEVKITS">--devkits=${LIST}</entry>
+	<entry key="SB1_SETUP_OPT_CPUTRANSP">--cputransp=${METHOD}</entry>
+	<entry key="SB1_SETUP_OPT_FORCE">--force</entry>
+	
+	<!-- options for action killall -->
+	<entry key="SB1_KILLALL_OPT_SIGNAL">signal=${SIGNAL}</entry>	
+	
+	<!-- options for action install -->
+	<entry key="SB1_INSTALL_OPT_CLIB">--clibrary</entry>
+	<entry key="SB1_INSTALL_OPT_ETC">--etc</entry>
+	<entry key="SB1_INSTALL_OPT_DEVKITS">--devkits</entry>
+	<entry key="SB1_INSTALL_OPT_FAKE">--fakeroot</entry>
+	<entry key="SB1_INSTALL_OPT_GDB">--gdb</entry>
+	<entry key="SB1_INSTALL_OPT_STRACE">--strace</entry>	
+	
+	<!-- options for action show -->
+	<entry key="SB1_SHOW_OPT_COMPILERS">--compilers</entry>
+	<entry key="SB1_SHOW_OPT_DEVKITS">--devkits</entry>
+	<entry key="SB1_SHOW_OPT_CPU">--cputransp</entry>
+	<entry key="SB1_SHOW_OPT_COMP_ARCH">--compiler-arch</entry>
+	<entry key="SB1_SHOW_OPT_COMP_SUBARCH">--compiler-subarch</entry>
+	<entry key="SB1_SHOW_OPT_COMP_CLIB">--compiler-clib</entry>
+	
+	<!-- options for action list -->
+	<entry key="SB1_LIST_OPT_COMPILERS">--compilers</entry>
+	<entry key="SB1_LIST_OPT_DEVKITS">--devkits</entry>
+	<entry key="SB1_LIST_OPT_CPU">--cputransps</entry>
+	<entry key="SB1_LIST_OPT_TARGETS">--targets</entry>
+	<entry key="SB1_LIST_OPT_SESSIONS">--sessions</entry>
+	
+	<!-- setting such as Scratchbox location and user name -->
+	<entry key="SB1_SBOX_SANDBOX">/scratchbox/users/${USER}</entry>
+	
+</properties>

Deleted: trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/plugin.xml
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sb1/plugin.xml	2008-10-15 06:30:08 UTC (rev 873)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/plugin.xml	2008-10-15 19:30:29 UTC (rev 877)
@@ -1,40 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.2"?>
-<plugin>
-   <extension
-         point="org.maemo.esbox.core.sdk_provider">
-      <sdk_provider
-            class="org.maemo.esbox.maemosdk.sb1.provider.Scratchbox1SDKProvider">
-      </sdk_provider>
-   </extension>
-   <extension
-         point="org.eclipse.ui.preferencePages">
-      <page
-            category="org.maemo.esbox.ui.esboxPreferencePage"
-            class="org.maemo.esbox.maemosdk.sb1.ui.preferences.Scratchbox1PreferencesPage"
-            id="org.maemo.esbox.maemosdk.sdk1.esboxPreferencePage"
-            name="Scratchbox 1">
-      </page>
-   </extension>
-   <extension
-         point="org.eclipse.core.runtime.adapters">
-      <factory
-            adaptableType="org.maemo.esbox.maemosdk.sb1.core.IScratchbox1SDK"
-            class="org.maemo.esbox.maemosdk.sb1.ui.adapters.MaemoSDKInstallTargetAdapterFactory">
-         <adapter
-               type="org.maemo.esbox.core.adapters.ISDKManageTargetAdapter">
-         </adapter>
-      </factory>
-   </extension>
-   <extension
-         point="org.maemo.esbox.core.preference_set_provider">
-      <preferenceSetProvider
-            defaultsXMLFile="conf/sb1_prefs.xml"
-            preferenceConstantsClass="org.maemo.esbox.maemosdk.sb1.core.SB1PreferenceConstants"
-            preferenceMigratorClass="org.maemo.esbox.internal.api.core.OldESboxPreferenceMigrator"
-            preferenceStoreBundle="org.maemo.esbox.maemosdk.sdk1"
-            version="17">
-      </preferenceSetProvider>
-   </extension>
-
-</plugin>

Copied: trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/plugin.xml (from rev 873, branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sb1/plugin.xml)
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/plugin.xml	                        (rev 0)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/plugin.xml	2008-10-15 19:30:29 UTC (rev 877)
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.2"?>
+<plugin>
+   <extension
+         point="org.maemo.esbox.core.sdk_provider">
+      <sdk_provider
+            class="org.maemo.esbox.internal.maemosdk.sb1.provider.Scratchbox1SDKProvider">
+      </sdk_provider>
+   </extension>
+   <extension
+         point="org.eclipse.ui.preferencePages">
+      <page
+            category="org.maemo.esbox.ui.esboxPreferencePage"
+            class="org.maemo.esbox.internal.maemosdk.sb1.ui.preferences.Scratchbox1PreferencesPage"
+            id="org.maemo.esbox.maemosdk.sdk1.esboxPreferencePage"
+            name="Scratchbox 1">
+      </page>
+   </extension>
+   <extension
+         point="org.eclipse.core.runtime.adapters">
+      <factory
+            adaptableType="org.maemo.esbox.maemosdk.sb1.sdk.IScratchbox1SDK"
+            class="org.maemo.esbox.internal.maemosdk.sb1.ui.adapters.MaemoSDKInstallTargetAdapterFactory">
+         <adapter
+               type="org.maemo.esbox.core.adapters.ISDKManageTargetAdapter">
+         </adapter>
+      </factory>
+   </extension>
+   <extension
+         point="org.maemo.esbox.core.preference_set_provider">
+      <preferenceSetProvider
+            defaultsXMLFile="conf/sb1_prefs.xml"
+            preferenceConstantsClass="org.maemo.esbox.internal.maemosdk.sb1.core.SB1PreferenceConstants"
+            preferenceMigratorClass="org.maemo.esbox.internal.api.core.OldESboxPreferenceMigrator"
+            preferenceStoreBundle="org.maemo.esbox.maemosdk.sdk1"
+            version="17">
+      </preferenceSetProvider>
+   </extension>
+
+</plugin>

Copied: trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src (from rev 873, branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sb1/src)

Copied: trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org (from rev 873, branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org)

Copied: trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo (from rev 873, branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo)

Copied: trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox (from rev 873, branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox)

Copied: trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/Activator.java (from rev 873, branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/maemosdk/sb1/internal/Activator.java)
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/Activator.java	                        (rev 0)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/Activator.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -0,0 +1,146 @@
+package org.maemo.esbox.internal.maemosdk.sb1;
+
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+
+import org.eclipse.core.runtime.FileLocator;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Plugin;
+import org.eclipse.core.runtime.preferences.InstanceScope;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.eclipse.ui.preferences.ScopedPreferenceStore;
+import org.maemo.esbox.core.ErrorLogger;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class Activator extends Plugin {
+
+	// The plug-in ID
+	public static final String PLUGIN_ID = "org.maemo.esbox.maemosdk.sdk1";
+
+	// The shared instance
+	private static Activator plugin;
+
+	private IPreferenceStore preferenceStore;
+
+	/**
+	 * The constructor
+	 */
+	public Activator() {
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see
+	 * org.eclipse.core.runtime.Plugins#start(org.osgi.framework.BundleContext)
+	 */
+	public void start(BundleContext context) throws Exception {
+		super.start(context);
+		plugin = this;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see
+	 * org.eclipse.core.runtime.Plugin#stop(org.osgi.framework.BundleContext)
+	 */
+	public void stop(BundleContext context) throws Exception {
+		plugin = null;
+		super.stop(context);
+	}
+
+	/**
+	 * Returns the shared instance
+	 * 
+	 * @return the shared instance
+	 */
+	public static Activator getDefault() {
+		return plugin;
+	}
+
+	/**
+	 * Return the error logger instance of this plug-in.
+	 * 
+	 * @return the error logger instance of this plug-in.
+	 */
+	public static ErrorLogger getErrorLogger() {
+		class CoreErrorLogger extends ErrorLogger {
+
+			@Override
+			public String getPluginID() {
+				return PLUGIN_ID;
+			}
+
+			@Override
+			public Plugin getPlugin() {
+				return Activator.getDefault();
+			}
+
+		}
+
+		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);
+	}
+
+	/**
+	 * Find a file relative to the plugin, either in a running workspace or a
+	 * standalone unit test (assumed to run relative to a plugin)
+	 * 
+	 * @param path
+	 */
+	public static InputStream getPluginRelativeInputStream(String path)
+			throws IOException {
+		if (getDefault() != null) {
+			return FileLocator.openStream(getDefault().getBundle(), new Path(
+					path), false);
+		} else {
+			return new FileInputStream("../" + path);
+		}
+	}
+
+	/**
+	 * Returns the preference store for this UI plug-in. This preference store
+	 * is used to hold persistent settings for this plug-in in the context of a
+	 * workbench. Some of these settings will be user controlled, whereas others
+	 * may be internal setting that are never exposed to the user.
+	 * <p>
+	 * If an error occurs reading the preference store, an empty preference
+	 * store is quietly created, initialized with defaults, and returned.
+	 * </p>
+	 * <p>
+	 * <strong>NOTE:</strong> As of Eclipse 3.1 this method is no longer
+	 * referring to the core runtime compatibility layer and so plug-ins relying
+	 * on Plugin#initializeDefaultPreferences will have to access the
+	 * compatibility layer themselves.
+	 * </p>
+	 * 
+	 * @return the preference store
+	 */
+	public IPreferenceStore getPreferenceStore() {
+		// Create the preference store lazily.
+		if (preferenceStore == null) {
+			preferenceStore = new ScopedPreferenceStore(new InstanceScope(),
+					getBundle().getSymbolicName());
+
+		}
+		return preferenceStore;
+	}
+}


Property changes on: trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/Activator.java
___________________________________________________________________
Name: svn:mergeinfo
   + 

Copied: trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/command/AbstractSB1Command.java (from rev 873, branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/maemosdk/sb1/command/AbstractSB1Command.java)
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/command/AbstractSB1Command.java	                        (rev 0)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/command/AbstractSB1Command.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -0,0 +1,49 @@
+/*******************************************************************************
+ * 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:
+ *    Petr Baranov (Nokia) - initial API and implementation
+ *******************************************************************************/
+package org.maemo.esbox.internal.maemosdk.sb1.command;
+
+import java.security.InvalidParameterException;
+
+import org.maemo.esbox.internal.api.core.commands.ICommandAbstractor;
+import org.maemo.esbox.internal.maemosdk.sb1.core.SB1PreferenceConstants;
+import org.maemo.esbox.maemosdk.core.command.AbstractSDKCommand;
+
+/**
+ * @author baranov
+ * 
+ */
+public abstract class AbstractSB1Command extends AbstractSDKCommand {
+
+	/**
+	 * @param commandAbstractor
+	 */
+	public AbstractSB1Command(ICommandAbstractor commandAbstractor) {
+		super(commandAbstractor);
+		// TODO Auto-generated constructor stub
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @seeorg.maemo.esbox.maemosdk.core.command.AbstractSDKCommand#
+	 * replaceScratchboxConfigCommand(java.lang.String, java.lang.String[])
+	 */
+	public String replaceScratchboxConfigCommand(String action, String[] options)
+			throws InvalidParameterException {
+		String sboxCommand;
+
+		sboxCommand = commandAbstractor
+				.getPreferenceValue(SB1PreferenceConstants.SB1_SBOX_COMMAND);
+
+		return replaceScratchboxCommand(sboxCommand, action, options);
+	}
+
+}


Property changes on: trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/command/AbstractSB1Command.java
___________________________________________________________________
Name: svn:mergeinfo
   + 

Copied: trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/command/CreateTargetCommand.java (from rev 873, branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/maemosdk/sb1/command/CreateTargetCommand.java)
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/command/CreateTargetCommand.java	                        (rev 0)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/command/CreateTargetCommand.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -0,0 +1,121 @@
+/*******************************************************************************
+ * 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)
+ *    Petr Baranov (Nokia)
+ *******************************************************************************/
+package org.maemo.esbox.internal.maemosdk.sb1.command;
+
+import java.util.List;
+
+import org.maemo.esbox.core.ESboxException;
+import org.maemo.esbox.internal.api.core.commands.ICommandAbstractor;
+import org.maemo.esbox.internal.maemosdk.sb1.core.SB1PreferenceConstants;
+import org.maemo.esbox.maemosdk.core.command.ScratchboxInvalidParameterException;
+import org.maemo.esbox.maemosdk.sb1.sdk.IScratchbox1SDK;
+
+/**
+ * Creates a new target, if it does not exist. This command wraps the callback
+ * to service sb-conf setup [<TARGET>] [--compiler=<COMPILER>]
+ * [--devkits=<LIST>] [--cputransp=<METHOD>] [--force]
+ * 
+ */
+public class CreateTargetCommand extends AbstractSB1Command {
+
+	private IScratchbox1SDK sdk;
+
+	public CreateTargetCommand(IScratchbox1SDK sdk,
+			ICommandAbstractor commandAbstractor) {
+		super(commandAbstractor);
+		this.sdk = sdk;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see
+	 * embedded.core.scratchbox.command.IScratchboxCommand#performCommand(java
+	 * .lang.Object)
+	 */
+	public Object performCommand(List<String> param) throws ESboxException {
+		if (!this.checkParameters(param))
+			throw new ScratchboxInvalidParameterException(
+					"Invalid number of parameters");
+
+		String targetName = param.get(0);
+		String compilerName = param.get(1);
+		String devkitsNames = param.get(2);
+		String cputranspName = param.get(3);
+
+		String setupTargetAction = commandAbstractor
+				.getPreferenceValue(SB1PreferenceConstants.SB1_SETUP_ACT);
+
+		String[] setupActionOptionsReplaced = this.replaceActions(targetName,
+				compilerName, devkitsNames, cputranspName);
+		String setupTargetCommand = this.replaceScratchboxConfigCommand(
+				setupTargetAction, setupActionOptionsReplaced);
+
+		Process process = createProcess(setupTargetCommand, null);
+
+		getInputFromProcessAndWait(process, false, 0);
+
+		sdk.refresh();
+
+		return true;
+	}
+
+	/**
+	 * Replace the options of action SETUP. The options of SETUP action are
+	 * different from the other ones, so this method replaces the variables
+	 * properly.
+	 * 
+	 * @param targetName
+	 *            the name of the target.
+	 * 
+	 * @param compiler
+	 *            the compiler name of the target.
+	 * @param devkits
+	 *            the devkits of the target.
+	 * @param cputransp
+	 *            the cputransp method of the target.
+	 * @return an array of String with the options already modified with the
+	 *         options.
+	 */
+	protected String[] replaceActions(String targetName, String compiler,
+			String devkits, String cputransp) {
+		String[] setupActions = new String[4];
+		setupActions[0] = targetName;
+		setupActions[1] = commandAbstractor
+				.getPreferenceValue(SB1PreferenceConstants.SB1_SETUP_OPT_COMPILER);
+		setupActions[2] = commandAbstractor
+				.getPreferenceValue(SB1PreferenceConstants.SB1_SETUP_OPT_DEVKITS);
+		setupActions[3] = commandAbstractor
+				.getPreferenceValue(SB1PreferenceConstants.SB1_SETUP_OPT_CPUTRANSP);
+
+		setupActions[1] = setupActions[1].replaceAll("\\$\\{COMPILER\\}",
+				compiler);
+		setupActions[2] = setupActions[2].replaceAll("\\$\\{LIST\\}", devkits);
+		setupActions[3] = setupActions[3].replaceAll("\\$\\{METHOD\\}",
+				cputransp);
+
+		return setupActions;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see
+	 * org.maemo.esbox.maemosdk.core.command.ScratchboxCommand#getParametersSize
+	 * ()
+	 */
+	public int getParametersSize() {
+		return 4;
+	}
+
+}


Property changes on: trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/command/CreateTargetCommand.java
___________________________________________________________________
Name: svn:mergeinfo
   + 

Copied: trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/command/GetCurrentTargetCommand.java (from rev 873, branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/maemosdk/sb1/command/GetCurrentTargetCommand.java)
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/command/GetCurrentTargetCommand.java	                        (rev 0)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/command/GetCurrentTargetCommand.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -0,0 +1,72 @@
+/*******************************************************************************
+ * 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)
+ *    Petr Baranov (Nokia)
+ *******************************************************************************/
+package org.maemo.esbox.internal.maemosdk.sb1.command;
+
+import java.util.List;
+
+import org.maemo.esbox.core.ESboxException;
+import org.maemo.esbox.internal.api.core.commands.ICommandAbstractor;
+import org.maemo.esbox.internal.maemosdk.sb1.core.SB1PreferenceConstants;
+import org.maemo.esbox.maemosdk.core.command.ScratchboxInvalidParameterException;
+import org.maemo.esbox.maemosdk.core.scratchbox.ScratchboxException;
+import org.maemo.esbox.maemosdk.sb1.sdk.IScratchbox1SDK;
+
+/**
+ * Get the current Scratchbox 1 target. This command wraps the callback to
+ * service sb-conf current
+ */
+public class GetCurrentTargetCommand extends AbstractSB1Command {
+
+	private final IScratchbox1SDK sdk;
+
+	public GetCurrentTargetCommand(ICommandAbstractor commandAbstractor,
+			IScratchbox1SDK sdk) {
+		super(commandAbstractor);
+		this.sdk = sdk;
+	}
+
+	/*
+	 * (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");
+
+		if (sdk.getCachedCurrentTarget() != null)
+			return sdk.getCachedCurrentTarget();
+
+		String currentTargetAction = commandAbstractor
+				.getPreferenceValue(SB1PreferenceConstants.SB1_CURRENT_ACT);
+		String currentTargetCommand = this
+				.replaceScratchboxConfigCommand(currentTargetAction);
+
+		Process process = createProcess(currentTargetCommand, null);
+
+		String currentTarget = getInputFromProcessAndWait(process, true, 0);
+
+		sdk.setCachedCurrentTarget(currentTarget);
+		return currentTarget;
+	}
+
+	@Override
+	public int getParametersSize() {
+		return 0;
+	}
+
+}


Property changes on: trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/command/GetCurrentTargetCommand.java
___________________________________________________________________
Name: svn:mergeinfo
   + 

Copied: trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/command/GetGdbQemuCommandPatternCommand.java (from rev 873, branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/maemosdk/sb1/command/GetGdbQemuCommandPatternCommand.java)
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/command/GetGdbQemuCommandPatternCommand.java	                        (rev 0)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/command/GetGdbQemuCommandPatternCommand.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -0,0 +1,151 @@
+/*******************************************************************************
+ * 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
+ *    Petr Baranov (Nokia)
+ *******************************************************************************/
+package org.maemo.esbox.internal.maemosdk.sb1.command;
+
+import java.util.List;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import org.eclipse.core.runtime.IStatus;
+import org.maemo.esbox.core.ESboxException;
+import org.maemo.esbox.internal.api.core.commands.ICommandAbstractor;
+import org.maemo.esbox.internal.maemosdk.sb1.Activator;
+import org.maemo.esbox.internal.maemosdk.sb1.core.SB1PreferenceConstants;
+import org.maemo.esbox.maemosdk.core.MaemoPreferenceConstants;
+import org.maemo.esbox.maemosdk.core.command.ScratchboxInvalidParameterException;
+import org.maemo.esbox.maemosdk.core.scratchbox.ScratchboxException;
+import org.maemo.esbox.maemosdk.core.sdk.IScratchboxSDKTarget;
+import org.osgi.framework.Version;
+
+/**
+ * Get the command pattern for launching qemu with the debugger
+ * 
+ * @author eswartz
+ * 
+ */
+public class GetGdbQemuCommandPatternCommand extends AbstractSB1Command {
+
+	private IScratchboxSDKTarget sdkTarget;
+
+	public GetGdbQemuCommandPatternCommand(IScratchboxSDKTarget sdkTarget,
+			ICommandAbstractor commandAbstractor) {
+		super(commandAbstractor);
+		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)) {
+			// 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;
+	}
+
+	/**
+	 * 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;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see
+	 * org.maemo.esbox.maemosdk.core.command.ScratchboxCommand#getParametersSize
+	 * ()
+	 */
+	public int getParametersSize() {
+		return 1;
+	}
+}


Property changes on: trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/command/GetGdbQemuCommandPatternCommand.java
___________________________________________________________________
Name: svn:mergeinfo
   + 

Copied: trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/command/GetVersionScratchboxCommand.java (from rev 873, branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/maemosdk/sb1/command/GetVersionScratchboxCommand.java)
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/command/GetVersionScratchboxCommand.java	                        (rev 0)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/command/GetVersionScratchboxCommand.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -0,0 +1,71 @@
+/*******************************************************************************
+ * 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)
+ *    Petr Baranov (Nokia)
+ *******************************************************************************/
+package org.maemo.esbox.internal.maemosdk.sb1.command;
+
+import java.util.List;
+
+import org.maemo.esbox.core.ESboxException;
+import org.maemo.esbox.internal.api.core.commands.ICommandAbstractor;
+import org.maemo.esbox.internal.maemosdk.sb1.core.SB1PreferenceConstants;
+import org.maemo.esbox.maemosdk.core.command.ScratchboxInvalidParameterException;
+import org.maemo.esbox.maemosdk.core.scratchbox.ScratchboxException;
+
+/**
+ * Get the version of Scratchbox installed. This command wraps the callback to
+ * service sb-conf version.
+ * 
+ */
+public class GetVersionScratchboxCommand extends AbstractSB1Command {
+
+	public GetVersionScratchboxCommand(ICommandAbstractor commandAbstractor) {
+		super(commandAbstractor);
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see
+	 * embedded.core.scratchbox.command.ScratchboxCommand#getParametersSize()
+	 */
+	public int getParametersSize() {
+		// TODO Auto-generated method stub
+		return 0;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see
+	 * embedded.core.scratchbox.command.IScratchboxCommand#performCommand(java
+	 * .util.List)
+	 */
+	public String performCommand(List<String> params)
+			throws ScratchboxException, ESboxException {
+		if (!this.checkParameters(params))
+			throw new ScratchboxInvalidParameterException(
+					"Invalid number of parameters");
+
+		String sboxVersionAction;
+		sboxVersionAction = commandAbstractor
+				.getPreferenceValue(SB1PreferenceConstants.SB1_VERSION_ACT);
+		String currentSboxVersionCommand = this
+				.replaceScratchboxConfigCommand(sboxVersionAction);
+
+		Process process = createProcess(currentSboxVersionCommand, null);
+
+		String currentVersion = getInputFromProcessAndWait(process, false, 0);
+
+		return currentVersion;
+	}
+
+}


Property changes on: trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/command/GetVersionScratchboxCommand.java
___________________________________________________________________
Name: svn:mergeinfo
   + 

Copied: trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/command/KillallCommand.java (from rev 873, branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/maemosdk/sb1/command/KillallCommand.java)
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/command/KillallCommand.java	                        (rev 0)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/command/KillallCommand.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -0,0 +1,106 @@
+/*******************************************************************************
+ * 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.sb1.command;
+
+import java.util.List;
+
+import org.maemo.esbox.core.ESboxException;
+import org.maemo.esbox.internal.api.core.commands.ICommandAbstractor;
+import org.maemo.esbox.internal.maemosdk.sb1.core.SB1PreferenceConstants;
+import org.maemo.esbox.maemosdk.core.command.ScratchboxInvalidParameterException;
+import org.maemo.esbox.maemosdk.core.scratchbox.ScratchboxException;
+
+/**
+ * Kill all Scratchbox sessions. This command wraps the callback to service
+ * sb-conf killall [-signal=<SIGNAL>]
+ * 
+ */
+public class KillallCommand extends AbstractSB1Command {
+
+	public KillallCommand(ICommandAbstractor commandAbstractor) {
+		super(commandAbstractor);
+	}
+
+	/*
+	 * (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 signalValue = "";
+		if (param.size() > 0)
+			signalValue = param.get(0);
+
+		String killallAction = commandAbstractor
+				.getPreferenceValue(SB1PreferenceConstants.SB1_KILLALL_ACT);
+		String signalOption = this.replaceSignal(signalValue);
+		String killallCommand = this.replaceScratchboxConfigCommand(
+				killallAction, new String[] { signalOption });
+
+		Process process = createProcess(killallCommand, null);
+
+		getInputFromProcessAndWait(process, false, 0);
+
+		return true;
+	}
+
+	/**
+	 * Replace the value of SIGNAL option of killall action.
+	 * 
+	 * @param signalValue
+	 *            the value of the signal to be replaced.
+	 * @return the signal option of killall action replaced with the given
+	 *         signal value.
+	 */
+	private String replaceSignal(String signalValue) {
+		if (signalValue.equals(""))
+			return "";
+		String killallSignalOption = commandAbstractor
+				.getPreferenceValue(SB1PreferenceConstants.SB1_KILLALL_OPT_SIGNAL);
+
+		String signalReplaced = killallSignalOption.replaceAll(
+				"\\$\\{SIGNAL\\}", signalValue);
+
+		return signalReplaced;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see
+	 * org.maemo.esbox.maemosdk.core.command.ScratchboxCommand#getParametersSize
+	 * ()
+	 */
+	public int getParametersSize() {
+		return 1;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see
+	 * org.maemo.esbox.maemosdk.core.command.ScratchboxCommand#checkParameters
+	 * (java.util.List)
+	 */
+	protected boolean checkParameters(List<String> param) {
+		// TODO Auto-generated method stub
+		return getParametersSize() <= 1;
+	}
+
+}


Property changes on: trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/command/KillallCommand.java
___________________________________________________________________
Name: svn:mergeinfo
   + 

Copied: trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/command/ListCompilersCommand.java (from rev 873, branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/maemosdk/sb1/command/ListCompilersCommand.java)
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/command/ListCompilersCommand.java	                        (rev 0)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/command/ListCompilersCommand.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -0,0 +1,73 @@
+/*******************************************************************************
+ * 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)
+ *    Petr Baranov (Nokia)
+ *******************************************************************************/
+package org.maemo.esbox.internal.maemosdk.sb1.command;
+
+import java.util.List;
+
+import org.maemo.esbox.core.ESboxException;
+import org.maemo.esbox.internal.api.core.commands.ICommandAbstractor;
+import org.maemo.esbox.internal.maemosdk.sb1.core.SB1PreferenceConstants;
+import org.maemo.esbox.maemosdk.core.command.ScratchboxInvalidParameterException;
+import org.maemo.esbox.maemosdk.core.scratchbox.ScratchboxException;
+
+/**
+ * List the installed compilers. This command wraps the callback to service
+ * sb-conf list --compilers
+ * 
+ */
+public class ListCompilersCommand extends AbstractSB1Command {
+
+	public ListCompilersCommand(ICommandAbstractor commandAbstractor) {
+		super(commandAbstractor);
+	}
+
+	/*
+	 * (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 compilersOptions = commandAbstractor
+				.getPreferenceValue(SB1PreferenceConstants.SB1_LIST_OPT_COMPILERS);
+		String listCompilersCommand = this.replaceScratchboxConfigCommand(
+				listAction, new String[] { compilersOptions });
+
+		Process process = createProcess(listCompilersCommand, null);
+
+		List<String> compilersAvailable = getLineInputFromProcessAndWait(
+				process, true, 0);
+
+		return compilersAvailable;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see
+	 * org.maemo.esbox.maemosdk.core.command.ScratchboxCommand#getParametersSize
+	 * ()
+	 */
+	public int getParametersSize() {
+		return 0;
+	}
+
+}


Property changes on: trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/command/ListCompilersCommand.java
___________________________________________________________________
Name: svn:mergeinfo
   + 

Copied: trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/command/ListCputranspCommand.java (from rev 873, branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/maemosdk/sb1/command/ListCputranspCommand.java)
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/command/ListCputranspCommand.java	                        (rev 0)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/command/ListCputranspCommand.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -0,0 +1,68 @@
+/*******************************************************************************
+ * 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)
+ *    Petr Baranov (Nokia)
+ *******************************************************************************/
+package org.maemo.esbox.internal.maemosdk.sb1.command;
+
+import java.util.List;
+
+import org.maemo.esbox.core.ESboxException;
+import org.maemo.esbox.internal.api.core.commands.ICommandAbstractor;
+import org.maemo.esbox.internal.maemosdk.sb1.core.SB1PreferenceConstants;
+import org.maemo.esbox.maemosdk.core.command.ScratchboxInvalidParameterException;
+import org.maemo.esbox.maemosdk.core.scratchbox.ScratchboxException;
+
+/**
+ * List the installed cpu-transparency. This command wraps the callback to
+ * service sb-conf list --cputransps
+ * 
+ */
+public class ListCputranspCommand extends AbstractSB1Command {
+
+	public ListCputranspCommand(ICommandAbstractor commandAbstractor) {
+		super(commandAbstractor);
+	}
+
+	/*
+	 * (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 cputranpOption = commandAbstractor
+				.getPreferenceValue(SB1PreferenceConstants.SB1_LIST_OPT_CPU);
+		String listCputranspsCommandString = this
+				.replaceScratchboxConfigCommand(listAction,
+						new String[] { cputranpOption });
+
+		Process process = createProcess(listCputranspsCommandString, null);
+
+		List<String> cputranspsAvailable = getLineInputFromProcessAndWait(
+				process, true, 0);
+
+		return cputranspsAvailable;
+	}
+
+	@Override
+	public int getParametersSize() {
+		return 0;
+	}
+
+}


Property changes on: trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/command/ListCputranspCommand.java
___________________________________________________________________
Name: svn:mergeinfo
   + 

Copied: trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/command/ListDevkitsCommand.java (from rev 873, branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/maemosdk/sb1/command/ListDevkitsCommand.java)
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/command/ListDevkitsCommand.java	                        (rev 0)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/command/ListDevkitsCommand.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -0,0 +1,67 @@
+/*******************************************************************************
+ * 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)
+ *    Petr Baranov (Nokia)
+ *******************************************************************************/
+package org.maemo.esbox.internal.maemosdk.sb1.command;
+
+import java.util.List;
+
+import org.maemo.esbox.core.ESboxException;
+import org.maemo.esbox.internal.api.core.commands.ICommandAbstractor;
+import org.maemo.esbox.internal.maemosdk.sb1.core.SB1PreferenceConstants;
+import org.maemo.esbox.maemosdk.core.command.ScratchboxInvalidParameterException;
+import org.maemo.esbox.maemosdk.core.scratchbox.ScratchboxException;
+
+/**
+ * List the installed devkits. This command wraps the callback to service
+ * sb-conf list --devkits
+ * 
+ */
+public class ListDevkitsCommand extends AbstractSB1Command {
+
+	public ListDevkitsCommand(ICommandAbstractor commandAbstractor) {
+		super(commandAbstractor);
+	}
+
+	/*
+	 * (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 devkitsOption = commandAbstractor
+				.getPreferenceValue(SB1PreferenceConstants.SB1_LIST_OPT_DEVKITS);
+		String listDevkitsCommandString = this.replaceScratchboxConfigCommand(
+				listAction, new String[] { devkitsOption });
+
+		Process process = createProcess(listDevkitsCommandString, null);
+
+		List<String> devkitsAvailable = getLineInputFromProcessAndWait(process,
+				true, 0);
+
+		return devkitsAvailable;
+	}
+
+	@Override
+	public int getParametersSize() {
+		return 0;
+	}
+
+}


Property changes on: trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/command/ListDevkitsCommand.java
___________________________________________________________________
Name: svn:mergeinfo
   + 

Copied: trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/command/ListSessionsCommand.java (from rev 873, branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/maemosdk/sb1/command/ListSessionsCommand.java)
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/command/ListSessionsCommand.java	                        (rev 0)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/command/ListSessionsCommand.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -0,0 +1,82 @@
+/*******************************************************************************
+ * 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)
+ *    Petr Baranov (Nokia)
+ *******************************************************************************/
+package org.maemo.esbox.internal.maemosdk.sb1.command;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.maemo.esbox.core.ESboxException;
+import org.maemo.esbox.internal.api.core.commands.ICommandAbstractor;
+import org.maemo.esbox.internal.maemosdk.sb1.core.SB1PreferenceConstants;
+import org.maemo.esbox.maemosdk.core.command.ScratchboxInvalidParameterException;
+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 AbstractSB1Command {
+
+	public ListSessionsCommand(ICommandAbstractor commandAbstractor) {
+		super(commandAbstractor);
+	}
+
+	/*
+	 * (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;
+	}
+
+	public int getParametersSize() {
+		return 0;
+	}
+
+}


Property changes on: trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/command/ListSessionsCommand.java
___________________________________________________________________
Name: svn:mergeinfo
   + 

Copied: trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/command/ListTargetsCommand.java (from rev 873, branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/maemosdk/sb1/command/ListTargetsCommand.java)
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/command/ListTargetsCommand.java	                        (rev 0)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/command/ListTargetsCommand.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -0,0 +1,69 @@
+/*******************************************************************************
+ * 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)
+ *    Petr Baranov (Nokia)
+ *******************************************************************************/
+package org.maemo.esbox.internal.maemosdk.sb1.command;
+
+import java.util.List;
+
+import org.maemo.esbox.core.ESboxException;
+import org.maemo.esbox.internal.api.core.commands.ICommandAbstractor;
+import org.maemo.esbox.internal.maemosdk.sb1.core.SB1PreferenceConstants;
+import org.maemo.esbox.maemosdk.core.command.ScratchboxInvalidParameterException;
+import org.maemo.esbox.maemosdk.core.scratchbox.ScratchboxException;
+
+/**
+ * List the installed targets. This command wraps the callback to service (sb1)
+ * sb-conf list --targets or sb2-config -l (sb2)
+ * 
+ */
+public class ListTargetsCommand extends AbstractSB1Command {
+
+	public ListTargetsCommand(ICommandAbstractor commandAbstractor) {
+		super(commandAbstractor);
+	}
+
+	/*
+	 * (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;
+		String targetsOption;
+		listAction = commandAbstractor
+				.getPreferenceValue(SB1PreferenceConstants.SB1_LIST_ACT);
+		targetsOption = commandAbstractor
+				.getPreferenceValue(SB1PreferenceConstants.SB1_LIST_OPT_TARGETS);
+		String listTargetsCommandString = this.replaceScratchboxConfigCommand(
+				listAction, new String[] { targetsOption });
+
+		Process process = createProcess(listTargetsCommandString, null);
+
+		List<String> targetsAvailable = getLineInputFromProcessAndWait(process,
+				true, 0);
+
+		return targetsAvailable;
+	}
+
+	@Override
+	public int getParametersSize() {
+		return 0;
+	}
+
+}


Property changes on: trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/command/ListTargetsCommand.java
___________________________________________________________________
Name: svn:mergeinfo
   + 

Copied: trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/command/RemoveTargetCommand.java (from rev 873, branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/maemosdk/sb1/command/RemoveTargetCommand.java)
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/command/RemoveTargetCommand.java	                        (rev 0)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/command/RemoveTargetCommand.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -0,0 +1,95 @@
+/*******************************************************************************
+ * 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)
+ *    Petr Baranov (Nokia)
+ *******************************************************************************/
+package org.maemo.esbox.internal.maemosdk.sb1.command;
+
+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.api.core.commands.ICommandAbstractor;
+import org.maemo.esbox.internal.maemosdk.sb1.core.SB1PreferenceConstants;
+import org.maemo.esbox.maemosdk.core.command.ScratchboxInvalidParameterException;
+import org.maemo.esbox.maemosdk.core.scratchbox.ScratchboxException;
+
+/**
+ * Remove a Scratchbox target. This command wraps the callback to service
+ * sb-conf remove [<TARGET>]
+ * 
+ */
+public class RemoveTargetCommand extends AbstractSB1Command {
+
+	private ISDK sdk;
+
+	public RemoveTargetCommand(ISDK sdk, ICommandAbstractor commandAbstractor) {
+		super(commandAbstractor);
+		this.sdk = 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.");
+
+		String removeTargetAction = commandAbstractor
+				.getPreferenceValue(SB1PreferenceConstants.SB1_REMOVE_ACT);
+		String forceRemoveTargetOption = commandAbstractor
+				.getPreferenceValue(SB1PreferenceConstants.SB1_REMOVE_OPT_FORCE);
+		String removeTargetCommand = this.replaceScratchboxConfigCommand(
+				removeTargetAction, new String[] { targetToRemove,
+						forceRemoveTargetOption });
+
+		Process process = createProcess(removeTargetCommand, null);
+
+		getInputFromProcessAndWait(process, true, 0);
+
+		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).performCommand(new ArrayList<String>());
+		return targetsAvailable.contains(targetToRemove);
+	}
+
+	@Override
+	public int getParametersSize() {
+		return 1;
+	}
+
+}


Property changes on: trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/command/RemoveTargetCommand.java
___________________________________________________________________
Name: svn:mergeinfo
   + 

Copied: trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/command/ResetTargetCommand.java (from rev 873, branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/maemosdk/sb1/command/ResetTargetCommand.java)
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/command/ResetTargetCommand.java	                        (rev 0)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/command/ResetTargetCommand.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -0,0 +1,64 @@
+/*******************************************************************************
+ * 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)
+ *    Petr Baranov (Nokia)
+ *******************************************************************************/
+package org.maemo.esbox.internal.maemosdk.sb1.command;
+
+import java.util.List;
+
+import org.maemo.esbox.core.ESboxException;
+import org.maemo.esbox.internal.api.core.commands.ICommandAbstractor;
+import org.maemo.esbox.internal.maemosdk.sb1.core.SB1PreferenceConstants;
+import org.maemo.esbox.maemosdk.core.command.ScratchboxInvalidParameterException;
+import org.maemo.esbox.maemosdk.core.scratchbox.ScratchboxException;
+
+/**
+ * Reset a Scratchbox target. This command wraps the callback to service sb-conf
+ * reset [<TARGET>]
+ * 
+ */
+public class ResetTargetCommand extends AbstractSB1Command {
+
+	public ResetTargetCommand(ICommandAbstractor commandAbstractor) {
+		super(commandAbstractor);
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see
+	 * embedded.core.scratchbox.command.IScratchboxCommand#performCommand(java
+	 * .util.List)
+	 */
+	public Object performCommand(List<String> params)
+			throws ScratchboxException, ESboxException {
+		if (!this.checkParameters(params))
+			throw new ScratchboxInvalidParameterException(
+					"Invalid number of parameters");
+
+		String resetTargetAction = commandAbstractor
+				.getPreferenceValue(SB1PreferenceConstants.SB1_RESET_ACT);
+		String resetTargetCommand = this.replaceScratchboxConfigCommand(
+				resetTargetAction, new String[] {});
+
+		Process process = createProcess(resetTargetCommand, null);
+
+		getInputFromProcessAndWait(process, false, 0);
+
+		return true;
+	}
+
+	@Override
+	public int getParametersSize() {
+		return 0;
+	}
+
+}


Property changes on: trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/command/ResetTargetCommand.java
___________________________________________________________________
Name: svn:mergeinfo
   + 

Copied: trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/command/RootstrapCommand.java (from rev 873, branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/maemosdk/sb1/command/RootstrapCommand.java)
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/command/RootstrapCommand.java	                        (rev 0)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/command/RootstrapCommand.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -0,0 +1,65 @@
+/*******************************************************************************
+ * 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)
+ *    Petr Baranov (Nokia)
+ *******************************************************************************/
+package org.maemo.esbox.internal.maemosdk.sb1.command;
+
+import java.util.List;
+
+import org.maemo.esbox.core.ESboxException;
+import org.maemo.esbox.internal.api.core.commands.ICommandAbstractor;
+import org.maemo.esbox.internal.maemosdk.sb1.core.SB1PreferenceConstants;
+import org.maemo.esbox.maemosdk.core.command.ScratchboxInvalidParameterException;
+import org.maemo.esbox.maemosdk.core.scratchbox.ScratchboxException;
+
+/**
+ * This command wraps the callback to service sb-conf rootstrap [<TARGET>]
+ * <FILE>|<URL>
+ */
+public class RootstrapCommand extends AbstractSB1Command {
+
+	public RootstrapCommand(ICommandAbstractor commandAbstractor) {
+		super(commandAbstractor);
+	}
+
+	/*
+	 * (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 fileOrURL = param.get(0);
+
+		String rootstrapAction = commandAbstractor
+				.getPreferenceValue(SB1PreferenceConstants.SB1_ROOTSTRAP_ACT);
+		String rootstrapCommand = this.replaceScratchboxConfigCommand(
+				rootstrapAction, new String[] { fileOrURL });
+
+		Process process = createProcess(rootstrapCommand, null);
+
+		getInputFromProcessAndWait(process, false, 0);
+
+		return true;
+	}
+
+	@Override
+	public int getParametersSize() {
+		return 1;
+	}
+
+}


Property changes on: trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/command/RootstrapCommand.java
___________________________________________________________________
Name: svn:mergeinfo
   + 

Copied: trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/command/SelectTargetCommand.java (from rev 873, branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/maemosdk/sb1/command/SelectTargetCommand.java)
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/command/SelectTargetCommand.java	                        (rev 0)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/command/SelectTargetCommand.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -0,0 +1,73 @@
+/*******************************************************************************
+ * 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)
+ *    Petr Baranov (Nokia)
+ *******************************************************************************/
+package org.maemo.esbox.internal.maemosdk.sb1.command;
+
+import java.util.List;
+
+import org.maemo.esbox.core.ESboxException;
+import org.maemo.esbox.internal.api.core.commands.ICommandAbstractor;
+import org.maemo.esbox.internal.maemosdk.sb1.core.SB1PreferenceConstants;
+import org.maemo.esbox.maemosdk.core.command.ScratchboxInvalidParameterException;
+import org.maemo.esbox.maemosdk.core.scratchbox.ScratchboxException;
+import org.maemo.esbox.maemosdk.core.sdk.IScratchboxSDK;
+
+/**
+ * Select a Scratchbox target. This command wraps the callback to service
+ * sb-conf select [<TARGET>]
+ * 
+ */
+public class SelectTargetCommand extends AbstractSB1Command {
+
+	private final IScratchboxSDK sdk;
+
+	public SelectTargetCommand(ICommandAbstractor commandAbstractor,
+			IScratchboxSDK sdk) {
+		super(commandAbstractor);
+		this.sdk = 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 targetToSelect = param.get(0);
+
+		String selectTargetAction = commandAbstractor
+				.getPreferenceValue(SB1PreferenceConstants.SB1_SELECT_ACT);
+		String selectTargetCommand = this.replaceScratchboxConfigCommand(
+				selectTargetAction, new String[] { targetToSelect });
+
+		Process process = createProcess(selectTargetCommand, null);
+
+		getInputFromProcessAndWait(process, false, 0);
+
+		sdk.setCachedCurrentTarget(targetToSelect);
+
+		return true;
+	}
+
+	@Override
+	public int getParametersSize() {
+		return 1;
+	}
+
+}


Property changes on: trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/command/SelectTargetCommand.java
___________________________________________________________________
Name: svn:mergeinfo
   + 

Copied: trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/command/ShowTargetCommand.java (from rev 873, branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/maemosdk/sb1/command/ShowTargetCommand.java)
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/command/ShowTargetCommand.java	                        (rev 0)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/command/ShowTargetCommand.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -0,0 +1,105 @@
+/*******************************************************************************
+ * 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)
+ *    Petr Baranov (Nokia)
+ *******************************************************************************/
+package org.maemo.esbox.internal.maemosdk.sb1.command;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.StringTokenizer;
+
+import org.maemo.esbox.core.ESboxException;
+import org.maemo.esbox.internal.api.core.commands.ICommandAbstractor;
+import org.maemo.esbox.internal.maemosdk.sb1.core.SB1PreferenceConstants;
+import org.maemo.esbox.maemosdk.core.command.ScratchboxInvalidParameterException;
+import org.maemo.esbox.maemosdk.core.scratchbox.ScratchboxException;
+import org.maemo.esbox.maemosdk.core.scratchbox.ScratchboxTarget;
+
+/**
+ * Show the settings of a Scratchbox target. This command wraps the callback to
+ * service sb-conf show [<TARGET>]
+ * 
+ */
+public class ShowTargetCommand extends AbstractSB1Command {
+
+	public ShowTargetCommand(ICommandAbstractor commandAbstractor) {
+		super(commandAbstractor);
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see
+	 * org.maemo.esbox.core.internal.command.ICommand#performCommand(java.util
+	 * .List)
+	 */
+	public ScratchboxTarget performCommand(List<String> params)
+			throws ScratchboxException, ESboxException {
+		if (!this.checkParameters(params))
+			throw new ScratchboxInvalidParameterException(
+					"Invalid number of parameters");
+
+		String listAction = commandAbstractor
+				.getPreferenceValue(SB1PreferenceConstants.SB1_SHOW_ACT);
+		String showTargetCommandString = this.replaceScratchboxConfigCommand(
+				listAction, new String[] { params.get(0) });
+
+		Process process = createProcess(showTargetCommandString, null);
+
+		ScratchboxTarget target = null;
+		List<String> targetInfo = getLineInputFromProcessAndWait(process,
+				false, 0);
+		target = createTarget(params.get(0), targetInfo);
+
+		return target;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @seeorg.maemo.esbox.core.scratchbox.internal.command.ScratchboxCommand#
+	 * getParametersSize()
+	 */
+	@Override
+	public int getParametersSize() {
+		// TODO Auto-generated method stub
+		return 1;
+	}
+
+	private ScratchboxTarget createTarget(String targetName,
+			List<String> targetInfo) {
+		ScratchboxTarget target = new ScratchboxTarget();
+
+		target.setName(targetName);
+
+		String compilerField = targetInfo.get(0);
+		String compiler = compilerField.substring(
+				compilerField.indexOf(":") + 1).trim();
+		target.setCompiler(compiler);
+
+		String devkitsField = targetInfo.get(1);
+		devkitsField = devkitsField.substring(devkitsField.indexOf(":") + 1);
+		StringTokenizer tokens = new StringTokenizer(devkitsField);
+		List<String> devkits = new ArrayList<String>();
+		while (tokens.hasMoreTokens()) {
+			devkits.add(tokens.nextToken());
+		}
+		target.setDevkits(devkits);
+
+		String cputranspField = targetInfo.get(2);
+		String cpuTransp = cputranspField.substring(
+				cputranspField.indexOf(":") + 1).trim();
+		target.setCputransp(cpuTransp);
+
+		return target;
+	}
+
+}


Property changes on: trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/command/ShowTargetCommand.java
___________________________________________________________________
Name: svn:mergeinfo
   + 

Copied: trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/core/SB1PreferenceConstants.java (from rev 873, branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/maemosdk/sb1/core/SB1PreferenceConstants.java)
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/core/SB1PreferenceConstants.java	                        (rev 0)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/core/SB1PreferenceConstants.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -0,0 +1,76 @@
+/*******************************************************************************
+ * 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.sb1.core;
+
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.maemo.esbox.internal.maemosdk.sb1.Activator;
+
+/**
+ * This class encapsulates the keys for preference constants defined by
+ * Scratchbox 1.
+ * 
+ * @author eswartz
+ * 
+ */
+public class SB1PreferenceConstants {
+	public static final int VERSION_MAJOR = 17;
+	public static final int VERSION_MINOR = 0;
+
+	/** Get the preference store that contains these preferences */
+	public static IPreferenceStore getPreferenceStore() {
+		return Activator.getDefault().getPreferenceStore();
+	}
+
+	/* SB1 configuration options */
+
+	public static final String RUN_SCRIPT_LOC = "RUN_SCRIPT_LOC";
+
+	public static final String SB1_GDB_REMOTE_QEMU = "SB1_GDB_REMOTE_QEMU";
+	public static final String SB1_CURRENT_ACT = "SB1_CURRENT_ACT";
+	public static final String SB1_SBOX_COMMAND = "SB1_SBOX_COMMAND";
+	public static final String SB1_REMOVE_ACT = "SB1_REMOVE_ACT";
+	public static final String SB1_REMOVE_OPT_FORCE = "SB1_REMOVE_OPT_FORCE";
+	public static final String SB1_RESET_ACT = "SB1_RESET_ACT";
+	public static final String SB1_ROOTSTRAP_ACT = "SB1_ROOTSTRAP_ACT";
+	public static final String SB1_ROOTSTRAP_OPT_FORCE = "SB1_ROOTSTRAP_OPT_FORCE";
+	public static final String SB1_INSTALL_ACT = "SB1_INSTALL_ACT";
+	public static final String SB1_INSTALL_OPT_CLIB = "SB1_INSTALL_OPT_CLIB";
+	public static final String SB1_INSTALL_OPT_DEVKITS = "SB1_INSTALL_OPT_DEVKITS";
+	public static final String SB1_INSTALL_OPT_ETC = "SB1_INSTALL_OPT_ETC";
+	public static final String SB1_INSTALL_OPT_FAKE = "SB1_INSTALL_OPT_FAKE";
+	public static final String SB1_INSTALL_OPT_GDB = "SB1_INSTALL_OPT_GDB";
+	public static final String SB1_INSTALL_OPT_STRACE = "SB1_INSTALL_OPT_STRACE";
+	public static final String SB1_KILLALL_ACT = "SB1_KILLALL_ACT";
+	public static final String SB1_KILLALL_OPT_SIGNAL = "SB1_KILLALL_OPT_SIGNAL";
+	public static final String SB1_LIST_ACT = "SB1_LIST_ACT";
+	public static final String SB1_LIST_OPT_COMPILERS = "SB1_LIST_OPT_COMPILERS";
+	public static final String SB1_LIST_OPT_CPU = "SB1_LIST_OPT_CPU";
+	public static final String SB1_LIST_OPT_DEVKITS = "SB1_LIST_OPT_DEVKITS";
+	public static final String SB1_LIST_OPT_SESSIONS = "SB1_LIST_OPT_SESSIONS";
+	public static final String SB1_LIST_OPT_TARGETS = "SB1_LIST_OPT_TARGETS";
+	public static final String SB1_LOGIN_COMMAND = "SB1_LOGIN_COMMAND";
+	public static final String SB1_SBOX_SANDBOX = "SB1_SBOX_SANDBOX";
+	public static final String SB1_SELECT_ACT = "SB1_SELECT_ACT";
+	public static final String SB1_SETUP_ACT = "SB1_SETUP_ACT";
+	public static final String SB1_SETUP_OPT_COMPILER = "SB1_SETUP_OPT_COMPILER";
+	public static final String SB1_SETUP_OPT_CPUTRANSP = "SB1_SETUP_OPT_CPUTRANSP";
+	public static final String SB1_SETUP_OPT_DEVKITS = "SB1_SETUP_OPT_DEVKITS";
+	public static final String SB1_SETUP_OPT_FORCE = "SB1_SETUP_OPT_FORCE";
+	public static final String SB1_SHOW_ACT = "SB1_SHOW_ACT";
+	public static final String SB1_SHOW_OPT_COMP_ARCH = "SB1_SHOW_OPT_COMP_ARCH";
+	public static final String SB1_SHOW_OPT_COMP_CLIB = "SB1_SHOW_OPT_COMP_CLIB";
+	public static final String SB1_SHOW_OPT_COMP_SUBARCH = "SB1_SHOW_OPT_COMP_SUBARCH";
+	public static final String SB1_SHOW_OPT_COMPILERS = "SB1_SHOW_OPT_COMPILERS";
+	public static final String SB1_SHOW_OPT_CPU = "SB1_SHOW_OPT_CPU";
+	public static final String SB1_SHOW_OPT_DEVKITS = "SB1_SHOW_OPT_DEVKITS";
+	public static final String SB1_VERSION_ACT = "SB1_VERSION_ACT";
+}


Property changes on: trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/core/SB1PreferenceConstants.java
___________________________________________________________________
Name: svn:mergeinfo
   + 

Copied: trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/core/Scratchbox1FileSystemMapping.java (from rev 873, branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/maemosdk/sb1/core/Scratchbox1FileSystemMapping.java)
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/core/Scratchbox1FileSystemMapping.java	                        (rev 0)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/core/Scratchbox1FileSystemMapping.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -0,0 +1,70 @@
+/**
+ * (c) 2008 Nokia
+ */
+package org.maemo.esbox.internal.maemosdk.sb1.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));
+	}
+
+}


Property changes on: trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/core/Scratchbox1FileSystemMapping.java
___________________________________________________________________
Name: svn:mergeinfo
   + 

Copied: trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/core/Scratchbox1SDK.java (from rev 873, branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/maemosdk/sb1/core/Scratchbox1SDK.java)
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/core/Scratchbox1SDK.java	                        (rev 0)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/core/Scratchbox1SDK.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -0,0 +1,368 @@
+/*******************************************************************************
+ * 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:
+ *    Petr Baranov (Nokia) - initial API and implementation
+ *******************************************************************************/
+package org.maemo.esbox.internal.maemosdk.sb1.core;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.maemo.esbox.core.ESboxException;
+import org.maemo.esbox.core.machine.IMachine;
+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.commands.ICommandAbstractor;
+import org.maemo.esbox.internal.api.core.sdk.*;
+import org.maemo.esbox.internal.maemosdk.sb1.Activator;
+import org.maemo.esbox.internal.maemosdk.sb1.command.*;
+import org.maemo.esbox.maemosdk.core.MaemoSDKEngine;
+import org.maemo.esbox.maemosdk.core.MaemoSDKInfo;
+import org.maemo.esbox.maemosdk.core.sdk.IScratchboxSDKTarget;
+import org.maemo.esbox.maemosdk.sb1.sdk.IScratchbox1SDK;
+
+public class Scratchbox1SDK extends AbstractScratchboxSDK implements
+		IScratchbox1SDK {
+
+	private IPath sdkRoot;
+	/** String for URI of machine where we detected scratchbox 1 */
+	static final String SB1_MACHINE = "sb1_machine";
+	/** String for scratchbox 1 version or <code>null</code> */
+	static final String SB1_VERSION = "sb1_version";
+
+	public Scratchbox1SDK(IMachine machine, String version,
+			IPreferenceProvider prefProvider) {
+		super(machine, version, IScratchbox1SDK.NAME, "sb1_machine",
+				"sb1_version", "sb1_targets", 1);
+		this.sdkRoot = null;
+		this.prefProvider = prefProvider;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.maemo.esbox.maemosdk.core.sdk.AbstractScratchboxSDK#refresh()
+	 */
+	public void refresh() {
+		super.refresh();
+		try {
+			List<String> targetNames = getTargets();
+			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,
+						getPlatform(target), getArchitecture(target), target,
+						sb1TargetRoot);
+				newTargets.add(sdkTarget);
+			}
+			this.targets = newTargets;
+		} catch (ESboxException e) {
+			Activator.getErrorLogger().logError("Could not refresh targets", e);
+		}
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see
+	 * org.maemo.esbox.maemosdk.core.sdk.AbstractScratchboxSDK#getCommandAbstractor
+	 * ()
+	 */
+	public ICommandAbstractor getCommandAbstractor() throws ESboxException {
+		return getSb1WrappedAbstractor(super.getCommandAbstractor(), this
+				.getMachine());
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see
+	 * org.maemo.esbox.maemosdk.core.sdk.IScratchboxSDK#createTarget(java.lang
+	 * .String, java.lang.String, java.lang.String, java.lang.String)
+	 */
+	public boolean createTarget(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(this,
+				getCommandAbstractor());
+
+		CacheUtils.getInstance().setCachedValue(SB_TARGETS, null);
+		return (Boolean) createTargetCommand.performCommand(params);
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.maemo.esbox.maemosdk.core.sdk.IScratchboxSDK#getCompilers()
+	 */
+	public List<String> getCompilers() throws ESboxException {
+		ListCompilersCommand listCompilersCommand = new ListCompilersCommand(
+				getCommandAbstractor());
+		return listCompilersCommand.performCommand(EMPTY_ARGS);
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.maemo.esbox.maemosdk.core.sdk.IScratchboxSDK#getCputransp()
+	 */
+	public List<String> getCputransp() throws ESboxException {
+		ListCputranspCommand listCputranspCommand = new ListCputranspCommand(
+				getCommandAbstractor());
+		return listCputranspCommand.performCommand(EMPTY_ARGS);
+	}
+
+	/**
+	 * 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 static String getCurrentSboxVersion(IMachine machine)
+			throws ESboxException {
+		// find cached value
+		MachineUtils.ensureCurrentMachine(SB1_MACHINE, machine);
+		String version = (String) CacheUtils.getInstance().getCachedValue(
+				SB1_VERSION);
+		if (version != null)
+			return version;
+
+		// do the hard work
+		MachineUtils.acquireMachine(machine);
+		ICommandAbstractor commandAbstractor = MachineUtils
+				.getHostCommandAbstractor(machine);
+		commandAbstractor = getSb1WrappedAbstractor(commandAbstractor, machine);
+		GetVersionScratchboxCommand getVersionCommand = new GetVersionScratchboxCommand(
+				commandAbstractor);
+
+		String currentVersion = getVersionCommand
+				.performCommand(new ArrayList<String>());
+
+		// remember cached value
+		CacheUtils.getInstance().setCachedValue(SB1_VERSION, currentVersion);
+
+		return currentVersion;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.maemo.esbox.maemosdk.core.sdk.IScratchboxSDK#getCurrentTarget()
+	 */
+	public String getCurrentTarget() throws ESboxException {
+		GetCurrentTargetCommand getCurrentTargetCommand = new GetCurrentTargetCommand(
+				getCommandAbstractor(), this);
+		return (String) getCurrentTargetCommand
+				.performCommand(new ArrayList<String>());
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.maemo.esbox.maemosdk.core.sdk.IScratchboxSDK#getTargets()
+	 */
+	public List<String> getTargets() throws ESboxException {
+		MachineUtils.ensureCurrentMachine(SB_MACHINE, this.getMachine());
+
+		String[] targetsArray = (String[]) CacheUtils.getInstance()
+				.getCachedValue(SB_TARGETS);
+		if (targetsArray != null)
+			return Arrays.asList(targetsArray);
+
+		ListTargetsCommand listTargetsCommand = new ListTargetsCommand(
+				getCommandAbstractor());
+		List<String> targets = listTargetsCommand
+				.performCommand(new ArrayList<String>());
+
+		CacheUtils.getInstance().setCachedValue(SB_TARGETS,
+				(String[]) targets.toArray(new String[targets.size()]));
+
+		return targets;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.maemo.esbox.core.sdk.ISDK#getSDKRoot()
+	 */
+	public IPath getSDKRoot() {
+		if (sdkRoot == null) {
+			String userPath = prefProvider
+					.getPreferenceValue(SB1PreferenceConstants.SB1_SBOX_SANDBOX);
+			sdkRoot = new Path(userPath);
+		}
+		return sdkRoot;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see
+	 * org.maemo.esbox.maemosdk.core.sdk.IScratchboxSDK#removeTarget(java.lang
+	 * .String)
+	 */
+	public boolean removeTarget(String targetName) throws ESboxException {
+		List<String> params = new ArrayList<String>();
+		params.add(targetName);
+
+		RemoveTargetCommand removeTargetCommand;
+
+		removeTargetCommand = new RemoveTargetCommand(this,
+				getCommandAbstractor());
+		CacheUtils.getInstance().setCachedValue(SB_TARGETS, null);
+
+		return (Boolean) removeTargetCommand.performCommand(params);
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.maemo.esbox.maemosdk.sb1.core.IScratchbox1SDK#getDevkits()
+	 */
+	public List<String> getDevkits() throws ESboxException {
+		ListDevkitsCommand listDevkitsCommand = new ListDevkitsCommand(
+				getCommandAbstractor());
+		return listDevkitsCommand.performCommand(new ArrayList<String>());
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.maemo.esbox.maemosdk.sb1.core.IScratchbox1SDK#getSessions()
+	 */
+	public List<String> getSessions() throws ESboxException {
+		ListSessionsCommand listSessionsCommand = new ListSessionsCommand(
+				getCommandAbstractor());
+		return listSessionsCommand.performCommand(new ArrayList<String>());
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.maemo.esbox.maemosdk.sb1.core.IScratchbox1SDK#killProcess()
+	 */
+	public boolean killProcess() throws ESboxException {
+		List<String> params = new ArrayList<String>();
+		KillallCommand killallCommand = new KillallCommand(
+				getCommandAbstractor());
+		return (Boolean) killallCommand.performCommand(params);
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see
+	 * org.maemo.esbox.maemosdk.sb1.core.IScratchbox1SDK#killProcess(java.lang
+	 * .String)
+	 */
+	public boolean killProcess(String signal) throws ESboxException {
+		List<String> params = new ArrayList<String>();
+		params.add(signal);
+		KillallCommand killallCommand = new KillallCommand(
+				getCommandAbstractor());
+		return (Boolean) killallCommand.performCommand(params);
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see
+	 * org.maemo.esbox.maemosdk.sb1.core.IScratchbox1SDK#selectTarget(java.lang
+	 * .String)
+	 */
+	public boolean selectTarget(String targetName) throws ESboxException {
+		List<String> params = new ArrayList<String>();
+		params.add(targetName);
+
+		SelectTargetCommand selectTargetCommand = new SelectTargetCommand(
+				getCommandAbstractor(), this);
+
+		return (Boolean) selectTargetCommand.performCommand(params);
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @seeorg.maemo.esbox.internal.maemosdk.core.sdk.
+	 * IScratchboxSDKPlatformArchitectureProvider
+	 * #getArchitecture(java.lang.String)
+	 */
+	public String getArchitecture(String target) {
+		// convention says this is the part of the target after the underscore
+		int idx = target.lastIndexOf('_');
+		if (idx > 0)
+			return target.substring(idx + 1).toUpperCase();
+		else
+			return IScratchboxSDKTarget.ARCHITECTURE_UNKNOWN;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @seeorg.maemo.esbox.internal.maemosdk.core.sdk.
+	 * IScratchboxSDKPlatformArchitectureProvider#getPlatform(java.lang.String)
+	 */
+	public ISDKPlatform getPlatform(String target) {
+		// convention says this is the part of the target before the underscore,
+		// usually the name of the platform directly, except for aberrant 'SDK'
+		// cases
+		int idx = target.lastIndexOf('_');
+		String platformName = ISDKPlatform.NAME_UNKNOWN;
+		String version = ISDKPlatform.VERSION_UNKNOWN;
+		if (idx >= 1) {
+			String platform = target.substring(0, idx);
+			// the 'SDK' one is a hard nut to crack
+			if (!platform.equalsIgnoreCase("SDK")) {
+				platformName = platform.substring(0, 1).toUpperCase()
+						+ platform.substring(1).toLowerCase();
+
+				List<MaemoSDKInfo> maemoSDKS = MaemoSDKEngine.getInstance()
+						.getMaemoSDKS();
+				for (MaemoSDKInfo info : maemoSDKS) {
+					if (info.getName().equalsIgnoreCase(platformName)) {
+						version = info.getVersion();
+						break;
+					}
+				}
+			} else {
+				// TODO: look at key files or versions to determine the
+				// platform from the SDK target contents
+			}
+		}
+		return new BaseSDKPlatform(platformName, version);
+	}
+
+	/**
+	 * 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");
+	}
+
+}


Property changes on: trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/core/Scratchbox1SDK.java
___________________________________________________________________
Name: svn:mergeinfo
   + 

Copied: trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/core/Scratchbox1SDKTarget.java (from rev 873, branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/maemosdk/sb1/core/Scratchbox1SDKTarget.java)
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/core/Scratchbox1SDKTarget.java	                        (rev 0)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/core/Scratchbox1SDKTarget.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -0,0 +1,95 @@
+/*******************************************************************************
+ * 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:
+ *    Petr Baranov (Nokia) - initial API and implementation
+ *******************************************************************************/
+package org.maemo.esbox.internal.maemosdk.sb1.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.api.core.sdk.AbstractScratchboxSDKTarget;
+import org.maemo.esbox.internal.maemosdk.sb1.command.GetGdbQemuCommandPatternCommand;
+import org.maemo.esbox.internal.maemosdk.sb1.launcher.Scratchbox1ProcessLauncherFactory;
+
+/**
+ * SDK target for Scratchbox 1
+ * 
+ * @author baranov
+ * 
+ */
+public class Scratchbox1SDKTarget extends AbstractScratchboxSDKTarget {
+
+	private IPath targetRoot;
+
+	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)));
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @seeorg.maemo.esbox.maemosdk.core.sdk.IScratchboxSDKTarget#
+	 * getProcessLauncherFactoryForInstall()
+	 */
+	public IProcessLauncherFactory getProcessLauncherFactoryForInstall() {
+		return new Scratchbox1ProcessLauncherFactory(this, true);
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see
+	 * org.maemo.esbox.maemosdk.core.sdk.IScratchboxSDKTarget#getRootstrapPath()
+	 */
+	public IPath getRootstrapPath() {
+		return getSDKTargetRoot();
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.maemo.esbox.core.sdk.ISDKTarget#getProcessLauncherFactory()
+	 */
+	public IProcessLauncherFactory getProcessLauncherFactory() {
+		return new Scratchbox1ProcessLauncherFactory(this, false);
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.maemo.esbox.core.sdk.ISDKTarget#getSDKTargetRoot()
+	 */
+	public IPath getSDKTargetRoot() {
+		return targetRoot;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @seeorg.maemo.esbox.maemosdk.core.sdk.IScratchboxSDKTarget#
+	 * getGdbQemuCommandPattern(java.lang.String)
+	 */
+	public synchronized String getGdbQemuCommandPattern(String architecture)
+			throws ESboxException {
+		GetGdbQemuCommandPatternCommand command = new GetGdbQemuCommandPatternCommand(
+				this, this.getCommandAbstractor());
+		List<String> arguments = new ArrayList<String>(1);
+		arguments.add(architecture);
+		return command.performCommand(arguments);
+	}
+}


Property changes on: trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/core/Scratchbox1SDKTarget.java
___________________________________________________________________
Name: svn:mergeinfo
   + 

Copied: trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/launcher (from rev 873, branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/maemosdk/sb1/launcher)


Property changes on: trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/launcher
___________________________________________________________________
Name: svn:mergeinfo
   + 

Deleted: trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/launcher/Scratchbox1EnvironmentProvider.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/maemosdk/sb1/launcher/Scratchbox1EnvironmentProvider.java	2008-10-15 06:30:08 UTC (rev 873)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/launcher/Scratchbox1EnvironmentProvider.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -1,91 +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.sb1.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.maemosdk.sb1.internal.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)
-	 * 
-	 * @seeorg.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)
-	 * 
-	 * @seeorg.maemo.esbox.internal.api.core.IStandardEnvironmentProvider#
-	 * flushRawEnvironment()
-	 */
-	public void flushRawEnvironment() {
-		cachedStdEnvMap.remove(sdkTarget);
-	}
-
-}

Copied: trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/launcher/Scratchbox1EnvironmentProvider.java (from rev 873, branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/maemosdk/sb1/launcher/Scratchbox1EnvironmentProvider.java)
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/launcher/Scratchbox1EnvironmentProvider.java	                        (rev 0)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/launcher/Scratchbox1EnvironmentProvider.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -0,0 +1,91 @@
+/*******************************************************************************
+ * 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.sb1.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.sb1.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)
+	 * 
+	 * @seeorg.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)
+	 * 
+	 * @seeorg.maemo.esbox.internal.api.core.IStandardEnvironmentProvider#
+	 * flushRawEnvironment()
+	 */
+	public void flushRawEnvironment() {
+		cachedStdEnvMap.remove(sdkTarget);
+	}
+
+}

Deleted: trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/launcher/Scratchbox1ProcessLauncher.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/maemosdk/sb1/launcher/Scratchbox1ProcessLauncher.java	2008-10-15 06:30:08 UTC (rev 873)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/launcher/Scratchbox1ProcessLauncher.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -1,229 +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.sb1.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.maemosdk.core.scratchbox.ScratchboxException;
-import org.maemo.esbox.maemosdk.sb1.core.SB1PreferenceConstants;
-import org.maemo.esbox.maemosdk.sb1.internal.Activator;
-
-/**
- * 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());
-	}
-
-}

Copied: trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/launcher/Scratchbox1ProcessLauncher.java (from rev 873, branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/maemosdk/sb1/launcher/Scratchbox1ProcessLauncher.java)
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/launcher/Scratchbox1ProcessLauncher.java	                        (rev 0)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/launcher/Scratchbox1ProcessLauncher.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -0,0 +1,229 @@
+/*******************************************************************************
+ * 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.sb1.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.sb1.Activator;
+import org.maemo.esbox.internal.maemosdk.sb1.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());
+	}
+
+}

Deleted: trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/launcher/Scratchbox1ProcessLauncherFactory.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/maemosdk/sb1/launcher/Scratchbox1ProcessLauncherFactory.java	2008-10-15 06:30:08 UTC (rev 873)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/launcher/Scratchbox1ProcessLauncherFactory.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -1,57 +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.sb1.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);
-	}
-}

Copied: trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/launcher/Scratchbox1ProcessLauncherFactory.java (from rev 873, branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/maemosdk/sb1/launcher/Scratchbox1ProcessLauncherFactory.java)
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/launcher/Scratchbox1ProcessLauncherFactory.java	                        (rev 0)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/launcher/Scratchbox1ProcessLauncherFactory.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -0,0 +1,57 @@
+/*******************************************************************************
+ * 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.sb1.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);
+	}
+}

Deleted: trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/launcher/ScratchboxTargetSwitcher.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/maemosdk/sb1/launcher/ScratchboxTargetSwitcher.java	2008-10-15 06:30:08 UTC (rev 873)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/launcher/ScratchboxTargetSwitcher.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -1,183 +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.sb1.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.maemosdk.core.scratchbox.ESboxScriptLauncher;
-import org.maemo.esbox.maemosdk.core.scratchbox.ScratchboxException;
-import org.maemo.esbox.maemosdk.sb1.core.Scratchbox1SDK;
-import org.maemo.esbox.maemosdk.sb1.core.Scratchbox1SDKTarget;
-import org.maemo.esbox.maemosdk.sb1.internal.Activator;
-
-/**
- * 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 Scratchbox1SDKTarget)) {
-			return;
-		}
-
-		Scratchbox1SDK sdk = ((Scratchbox1SDK) 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);
-		}
-	}
-}

Copied: trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/launcher/ScratchboxTargetSwitcher.java (from rev 873, branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/maemosdk/sb1/launcher/ScratchboxTargetSwitcher.java)
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/launcher/ScratchboxTargetSwitcher.java	                        (rev 0)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/launcher/ScratchboxTargetSwitcher.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -0,0 +1,183 @@
+/*******************************************************************************
+ * 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.sb1.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.sb1.Activator;
+import org.maemo.esbox.internal.maemosdk.sb1.core.Scratchbox1SDK;
+import org.maemo.esbox.internal.maemosdk.sb1.core.Scratchbox1SDKTarget;
+import org.maemo.esbox.maemosdk.core.scratchbox.ESboxScriptLauncher;
+import org.maemo.esbox.maemosdk.core.scratchbox.ScratchboxException;
+
+/**
+ * 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 Scratchbox1SDKTarget)) {
+			return;
+		}
+
+		Scratchbox1SDK sdk = ((Scratchbox1SDK) 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);
+		}
+	}
+}

Copied: trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/provider (from rev 873, branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/maemosdk/sb1/provider)


Property changes on: trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/provider
___________________________________________________________________
Name: svn:mergeinfo
   + 

Deleted: trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/provider/Scratchbox1SDKProvider.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/maemosdk/sb1/provider/Scratchbox1SDKProvider.java	2008-10-15 06:30:08 UTC (rev 873)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/provider/Scratchbox1SDKProvider.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -1,113 +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
- *    Petr Baranov (Nokia)
- *******************************************************************************/
-package org.maemo.esbox.maemosdk.sb1.provider;
-
-import java.text.MessageFormat;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.runtime.IStatus;
-import org.maemo.esbox.core.CorePreferenceManager;
-import org.maemo.esbox.core.ESboxException;
-import org.maemo.esbox.core.ErrorLogger;
-import org.maemo.esbox.core.machine.IMachine;
-import org.maemo.esbox.core.machine.MachineRegistry;
-import org.maemo.esbox.core.sdk.IPreferenceProvider;
-import org.maemo.esbox.core.sdk.ISDK;
-import org.maemo.esbox.core.sdk.ISDKProvider;
-import org.maemo.esbox.internal.api.core.sdk.UserAwarePreferenceProviderWrapper;
-import org.maemo.esbox.maemosdk.core.scratchbox.ScratchboxException;
-import org.maemo.esbox.maemosdk.core.sdk.IScratchboxSDK;
-import org.maemo.esbox.maemosdk.core.sdk.CacheUtils;
-import org.maemo.esbox.maemosdk.sb1.core.Scratchbox1SDK;
-import org.maemo.esbox.maemosdk.sb1.internal.Activator;
-
-/**
- * This implementation of the SDK provider searches for SB1 targets using the
- * 'sb-conf list --targets' command. If any aspect of SB1 communication fails,
- * we assume SB1 is not installed.
- * 
- * @author eswartz
- * 
- */
-public class Scratchbox1SDKProvider implements ISDKProvider {
-
-	// only 1.0.x+ supported right now
-	private static final String SCRATCHBOX_VERSION_PATTERN = "1\\.\\d+\\..*"; //$NON-NLS-1$
-
-	/**
-	 * 
-	 */
-	public Scratchbox1SDKProvider() {
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.maemo.esbox.core.sdk.ISDKProvider#createSDKs()
-	 */
-	public List<ISDK> createSDKs() throws ESboxException {
-		ErrorLogger logger = Activator.getErrorLogger();
-
-		List<ISDK> sdks = new ArrayList<ISDK>();
-		for (IMachine machine : MachineRegistry.getInstance()
-				.getBuildMachines()) {
-			try {
-				IPreferenceProvider prefProvider = new UserAwarePreferenceProviderWrapper(
-						CorePreferenceManager.getInstance()
-								.getPreferenceProvider(), machine);
-				IScratchboxSDK sdk = getMachineSDKs(prefProvider, machine);
-				if (sdk != null) {
-					sdks.add(sdk);
-					sdk.refresh();
-				}
-			} catch (ScratchboxException e) {
-				logger.log(IStatus.INFO,
-						"Problem scanning Scratchbox 1 installation", e);
-			}
-		}
-		CacheUtils.getInstance().saveCachedData();
-		return sdks;
-	}
-
-	/**
-	 * @param prefProvider
-	 * @return
-	 * @throws ScratchboxException
-	 */
-	private IScratchboxSDK getMachineSDKs(IPreferenceProvider prefProvider,
-			IMachine machine) throws ESboxException {
-		ErrorLogger logger = Activator.getErrorLogger();
-
-		// only support one Scratchbox 1.x installation
-		String version = Scratchbox1SDK.getCurrentSboxVersion(machine);
-		if (version == null) {
-			// no scratchbox?
-			return null;
-		}
-
-		if (!version.matches(SCRATCHBOX_VERSION_PATTERN)) {
-			logger
-					.logError(
-							MessageFormat
-									.format(
-											"Only Scratchbox 1.x is supported (detected {0}); disabling Scratchbox 1 support",
-											version), null);
-			return null;
-		}
-
-		IScratchboxSDK sdk = new Scratchbox1SDK(machine, version, prefProvider);
-
-		return sdk;
-	}
-
-}

Copied: trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/provider/Scratchbox1SDKProvider.java (from rev 873, branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/maemosdk/sb1/provider/Scratchbox1SDKProvider.java)
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/provider/Scratchbox1SDKProvider.java	                        (rev 0)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/provider/Scratchbox1SDKProvider.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -0,0 +1,113 @@
+/*******************************************************************************
+ * 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
+ *    Petr Baranov (Nokia)
+ *******************************************************************************/
+package org.maemo.esbox.internal.maemosdk.sb1.provider;
+
+import java.text.MessageFormat;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.runtime.IStatus;
+import org.maemo.esbox.core.CorePreferenceManager;
+import org.maemo.esbox.core.ESboxException;
+import org.maemo.esbox.core.ErrorLogger;
+import org.maemo.esbox.core.machine.IMachine;
+import org.maemo.esbox.core.machine.MachineRegistry;
+import org.maemo.esbox.core.sdk.IPreferenceProvider;
+import org.maemo.esbox.core.sdk.ISDK;
+import org.maemo.esbox.core.sdk.ISDKProvider;
+import org.maemo.esbox.internal.api.core.sdk.CacheUtils;
+import org.maemo.esbox.internal.api.core.sdk.UserAwarePreferenceProviderWrapper;
+import org.maemo.esbox.internal.maemosdk.sb1.Activator;
+import org.maemo.esbox.internal.maemosdk.sb1.core.Scratchbox1SDK;
+import org.maemo.esbox.maemosdk.core.scratchbox.ScratchboxException;
+import org.maemo.esbox.maemosdk.core.sdk.IScratchboxSDK;
+
+/**
+ * This implementation of the SDK provider searches for SB1 targets using the
+ * 'sb-conf list --targets' command. If any aspect of SB1 communication fails,
+ * we assume SB1 is not installed.
+ * 
+ * @author eswartz
+ * 
+ */
+public class Scratchbox1SDKProvider implements ISDKProvider {
+
+	// only 1.0.x+ supported right now
+	private static final String SCRATCHBOX_VERSION_PATTERN = "1\\.\\d+\\..*"; //$NON-NLS-1$
+
+	/**
+	 * 
+	 */
+	public Scratchbox1SDKProvider() {
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.maemo.esbox.core.sdk.ISDKProvider#createSDKs()
+	 */
+	public List<ISDK> createSDKs() throws ESboxException {
+		ErrorLogger logger = Activator.getErrorLogger();
+
+		List<ISDK> sdks = new ArrayList<ISDK>();
+		for (IMachine machine : MachineRegistry.getInstance()
+				.getBuildMachines()) {
+			try {
+				IPreferenceProvider prefProvider = new UserAwarePreferenceProviderWrapper(
+						CorePreferenceManager.getInstance()
+								.getPreferenceProvider(), machine);
+				IScratchboxSDK sdk = getMachineSDKs(prefProvider, machine);
+				if (sdk != null) {
+					sdks.add(sdk);
+					sdk.refresh();
+				}
+			} catch (ScratchboxException e) {
+				logger.log(IStatus.INFO,
+						"Problem scanning Scratchbox 1 installation", e);
+			}
+		}
+		CacheUtils.getInstance().saveCachedData();
+		return sdks;
+	}
+
+	/**
+	 * @param prefProvider
+	 * @return
+	 * @throws ScratchboxException
+	 */
+	private IScratchboxSDK getMachineSDKs(IPreferenceProvider prefProvider,
+			IMachine machine) throws ESboxException {
+		ErrorLogger logger = Activator.getErrorLogger();
+
+		// only support one Scratchbox 1.x installation
+		String version = Scratchbox1SDK.getCurrentSboxVersion(machine);
+		if (version == null) {
+			// no scratchbox?
+			return null;
+		}
+
+		if (!version.matches(SCRATCHBOX_VERSION_PATTERN)) {
+			logger
+					.logError(
+							MessageFormat
+									.format(
+											"Only Scratchbox 1.x is supported (detected {0}); disabling Scratchbox 1 support",
+											version), null);
+			return null;
+		}
+
+		IScratchboxSDK sdk = new Scratchbox1SDK(machine, version, prefProvider);
+
+		return sdk;
+	}
+
+}

Copied: trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/ui/adapters (from rev 873, branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/maemosdk/sb1/ui/adapters)


Property changes on: trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/ui/adapters
___________________________________________________________________
Name: svn:mergeinfo
   + 

Deleted: trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/ui/adapters/MaemoSDKInstallTargetAdapterFactory.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/maemosdk/sb1/ui/adapters/MaemoSDKInstallTargetAdapterFactory.java	2008-10-15 06:30:08 UTC (rev 873)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/ui/adapters/MaemoSDKInstallTargetAdapterFactory.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -1,51 +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.sb1.ui.adapters;
-
-import org.eclipse.core.runtime.IAdapterFactory;
-import org.maemo.esbox.core.adapters.ISDKManageTargetAdapter;
-import org.maemo.esbox.maemosdk.sb1.core.Scratchbox1SDK;
-
-/**
- * @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 Scratchbox1SDK) {
-				return new MaemoScratchbox1SDKManageTargetAdapter(
-						(Scratchbox1SDK) adaptableObject);
-			}
-		}
-		return null;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.eclipse.core.runtime.IAdapterFactory#getAdapterList()
-	 */
-	public Class[] getAdapterList() {
-		// TODO Auto-generated method stub
-		return null;
-	}
-
-}

Copied: trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/ui/adapters/MaemoSDKInstallTargetAdapterFactory.java (from rev 873, branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/maemosdk/sb1/ui/adapters/MaemoSDKInstallTargetAdapterFactory.java)
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/ui/adapters/MaemoSDKInstallTargetAdapterFactory.java	                        (rev 0)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/ui/adapters/MaemoSDKInstallTargetAdapterFactory.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -0,0 +1,51 @@
+/*******************************************************************************
+ * 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.sb1.ui.adapters;
+
+import org.eclipse.core.runtime.IAdapterFactory;
+import org.maemo.esbox.core.adapters.ISDKManageTargetAdapter;
+import org.maemo.esbox.internal.maemosdk.sb1.core.Scratchbox1SDK;
+
+/**
+ * @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 Scratchbox1SDK) {
+				return new MaemoScratchbox1SDKManageTargetAdapter(
+						(Scratchbox1SDK) adaptableObject);
+			}
+		}
+		return null;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.eclipse.core.runtime.IAdapterFactory#getAdapterList()
+	 */
+	public Class[] getAdapterList() {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+}

Deleted: trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/ui/adapters/MaemoScratchbox1SDKManageTargetAdapter.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/maemosdk/sb1/ui/adapters/MaemoScratchbox1SDKManageTargetAdapter.java	2008-10-15 06:30:08 UTC (rev 873)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/ui/adapters/MaemoScratchbox1SDKManageTargetAdapter.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -1,97 +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
- *    Petr Baranov (Nokia)
- *******************************************************************************/
-
-package org.maemo.esbox.maemosdk.sb1.ui.adapters;
-
-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.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.maemosdk.core.sdk.IScratchboxSDK;
-import org.maemo.esbox.maemosdk.sb1.core.Scratchbox1SDK;
-import org.maemo.esbox.maemosdk.sb1.internal.Activator;
-import org.maemo.esbox.maemosdk.sb1.ui.wizard.NewScratchbox1TargetWizard;
-import org.maemo.esbox.maemosdk.ui.adapters.ESboxTargetRemover;
-import org.maemo.esbox.maemosdk.ui.adapters.MaemoScratchboxSDKManageTargetAdapterBase;
-
-/**
- * @author eswartz
- * 
- */
-public class MaemoScratchbox1SDKManageTargetAdapter extends
-		MaemoScratchboxSDKManageTargetAdapterBase implements
-		ISDKManageTargetAdapter {
-
-	private Scratchbox1SDK sdk;
-
-	/**
-	 * @param adaptableObject
-	 */
-	public MaemoScratchbox1SDKManageTargetAdapter(Scratchbox1SDK 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());
-	}
-
-	
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @seeorg.maemo.esbox.maemosdk.ui.adapters.
-	 * MaemoScratchboxSDKManageTargetAdapterBase
-	 * #createTargetRemover(org.eclipse.swt.widgets.Shell,
-	 * org.maemo.esbox.core.sdk.ISDKTarget, boolean)
-	 */
-	protected ESboxTargetRemover createTargetRemover(Shell shell,
-			ISDKTarget target, boolean deleteRootstrap) {
-		return new ESboxTargetRemover(shell, target, deleteRootstrap) {
-
-			@Override
-			protected void doRemoveTarget(IProgressMonitor monitor,
-					IScratchboxSDK sdk) {
-				monitor.worked(1);
-			}
-		};
-	}
-
-	@Override
-	protected boolean isRootStrapUsed(ISDKTarget selectedTarget) {
-		return false;
-	}
-	
-	
-
-}

Copied: trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/ui/adapters/MaemoScratchbox1SDKManageTargetAdapter.java (from rev 873, branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/maemosdk/sb1/ui/adapters/MaemoScratchbox1SDKManageTargetAdapter.java)
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/ui/adapters/MaemoScratchbox1SDKManageTargetAdapter.java	                        (rev 0)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/ui/adapters/MaemoScratchbox1SDKManageTargetAdapter.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -0,0 +1,97 @@
+/*******************************************************************************
+ * 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
+ *    Petr Baranov (Nokia)
+ *******************************************************************************/
+
+package org.maemo.esbox.internal.maemosdk.sb1.ui.adapters;
+
+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.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.sb1.Activator;
+import org.maemo.esbox.internal.maemosdk.sb1.core.Scratchbox1SDK;
+import org.maemo.esbox.internal.maemosdk.sb1.ui.wizard.NewScratchbox1TargetWizard;
+import org.maemo.esbox.internal.maemosdk.ui.adapters.ESboxTargetRemover;
+import org.maemo.esbox.internal.maemosdk.ui.adapters.MaemoScratchboxSDKManageTargetAdapterBase;
+import org.maemo.esbox.maemosdk.core.sdk.IScratchboxSDK;
+
+/**
+ * @author eswartz
+ * 
+ */
+public class MaemoScratchbox1SDKManageTargetAdapter extends
+		MaemoScratchboxSDKManageTargetAdapterBase implements
+		ISDKManageTargetAdapter {
+
+	private Scratchbox1SDK sdk;
+
+	/**
+	 * @param adaptableObject
+	 */
+	public MaemoScratchbox1SDKManageTargetAdapter(Scratchbox1SDK 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());
+	}
+
+	
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @seeorg.maemo.esbox.maemosdk.ui.adapters.
+	 * MaemoScratchboxSDKManageTargetAdapterBase
+	 * #createTargetRemover(org.eclipse.swt.widgets.Shell,
+	 * org.maemo.esbox.core.sdk.ISDKTarget, boolean)
+	 */
+	protected ESboxTargetRemover createTargetRemover(Shell shell,
+			ISDKTarget target, boolean deleteRootstrap) {
+		return new ESboxTargetRemover(shell, target, deleteRootstrap) {
+
+			@Override
+			protected void doRemoveTarget(IProgressMonitor monitor,
+					IScratchboxSDK sdk) {
+				monitor.worked(1);
+			}
+		};
+	}
+
+	@Override
+	protected boolean isRootStrapUsed(ISDKTarget selectedTarget) {
+		return false;
+	}
+	
+	
+
+}

Copied: trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/ui/preferences (from rev 873, branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/maemosdk/sb1/ui/preferences)


Property changes on: trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/ui/preferences
___________________________________________________________________
Name: svn:mergeinfo
   + 

Deleted: trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/ui/preferences/Scratchbox1PreferencesPage.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/maemosdk/sb1/ui/preferences/Scratchbox1PreferencesPage.java	2008-10-15 06:30:08 UTC (rev 873)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/ui/preferences/Scratchbox1PreferencesPage.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -1,159 +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.sb1.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.scratchbox.ScratchboxException;
-import org.maemo.esbox.maemosdk.core.sdk.IScratchboxSDK;
-import org.maemo.esbox.maemosdk.core.sdk.ScratchboxSDKFacade;
-import org.maemo.esbox.maemosdk.sb1.core.SB1PreferenceConstants;
-import org.maemo.esbox.maemosdk.sb1.core.Scratchbox1SDK;
-
-/**
- * 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(
-					Scratchbox1SDK.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.");
-
-		// 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);
-
-		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;
-	}
-
-}

Copied: trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/ui/preferences/Scratchbox1PreferencesPage.java (from rev 873, branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/maemosdk/sb1/ui/preferences/Scratchbox1PreferencesPage.java)
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/ui/preferences/Scratchbox1PreferencesPage.java	                        (rev 0)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/ui/preferences/Scratchbox1PreferencesPage.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -0,0 +1,159 @@
+/*******************************************************************************
+ * 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.internal.maemosdk.sb1.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.internal.maemosdk.sb1.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.sb1.sdk.*;
+
+/**
+ * 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(
+					IScratchbox1SDK.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.");
+
+		// 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);
+
+		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;
+	}
+
+}

Copied: trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/ui/wizard (from rev 873, branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/maemosdk/sb1/ui/wizard)


Property changes on: trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/ui/wizard
___________________________________________________________________
Name: svn:mergeinfo
   + 

Deleted: trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/ui/wizard/NewScratchbox1TargetWizard.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/maemosdk/sb1/ui/wizard/NewScratchbox1TargetWizard.java	2008-10-15 06:30:08 UTC (rev 873)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/ui/wizard/NewScratchbox1TargetWizard.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -1,328 +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)
- *    Petr Baranov (Nokia)
- *******************************************************************************/
-package org.maemo.esbox.maemosdk.sb1.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.sb1.core.Scratchbox1SDK;
-import org.maemo.esbox.maemosdk.sb1.internal.Activator;
-import org.maemo.esbox.maemosdk.sb1.ui.wizard.TargetWizardDevkitsPage;
-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 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 Scratchbox1SDK 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(Scratchbox1SDK 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

Copied: trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/ui/wizard/NewScratchbox1TargetWizard.java (from rev 873, branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/maemosdk/sb1/ui/wizard/NewScratchbox1TargetWizard.java)
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/ui/wizard/NewScratchbox1TargetWizard.java	                        (rev 0)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/ui/wizard/NewScratchbox1TargetWizard.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -0,0 +1,325 @@
+/*******************************************************************************
+ * 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)
+ *    Petr Baranov (Nokia)
+ *******************************************************************************/
+package org.maemo.esbox.internal.maemosdk.sb1.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.internal.maemosdk.sb1.Activator;
+import org.maemo.esbox.internal.maemosdk.sb1.core.Scratchbox1SDK;
+import org.maemo.esbox.internal.maemosdk.sb1.ui.wizard.TargetWizardDevkitsPage;
+import org.maemo.esbox.internal.maemosdk.ui.targets.wizards.*;
+import org.maemo.esbox.internal.maemosdk.ui.targets.wizards.sbrsh.SbrshConfigurationNFSServer;
+import org.maemo.esbox.internal.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 Scratchbox1SDK 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(Scratchbox1SDK 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

Deleted: trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/ui/wizard/TargetWizardDevkitsPage.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/maemosdk/sb1/ui/wizard/TargetWizardDevkitsPage.java	2008-10-15 06:30:08 UTC (rev 873)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/ui/wizard/TargetWizardDevkitsPage.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -1,148 +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)
- *    Petr Baranov (Nokia)
- *******************************************************************************/
-
-package org.maemo.esbox.maemosdk.sb1.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.sb1.core.Scratchbox1SDK;
-import org.maemo.esbox.maemosdk.sb1.internal.Activator;
-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 Scratchbox1SDK sdk;
-
-	/**
-	 * Constructs a NewTargetWizardDevkitsPage.
-	 */
-	protected TargetWizardDevkitsPage(Scratchbox1SDK 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

Copied: trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/ui/wizard/TargetWizardDevkitsPage.java (from rev 873, branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/maemosdk/sb1/ui/wizard/TargetWizardDevkitsPage.java)
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/ui/wizard/TargetWizardDevkitsPage.java	                        (rev 0)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/internal/maemosdk/sb1/ui/wizard/TargetWizardDevkitsPage.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -0,0 +1,148 @@
+/*******************************************************************************
+ * 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)
+ *    Petr Baranov (Nokia)
+ *******************************************************************************/
+
+package org.maemo.esbox.internal.maemosdk.sb1.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.internal.maemosdk.sb1.Activator;
+import org.maemo.esbox.internal.maemosdk.sb1.core.Scratchbox1SDK;
+import org.maemo.esbox.internal.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 Scratchbox1SDK sdk;
+
+	/**
+	 * Constructs a NewTargetWizardDevkitsPage.
+	 */
+	protected TargetWizardDevkitsPage(Scratchbox1SDK 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

Copied: trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/maemosdk (from rev 873, branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/maemosdk)

Copied: trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/maemosdk/sb1 (from rev 873, branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/maemosdk/sb1)

Copied: trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/maemosdk/sb1/sdk (from rev 873, branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/maemosdk/sb1/core)


Property changes on: trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/maemosdk/sb1/sdk
___________________________________________________________________
Name: svn:mergeinfo
   + 

Deleted: trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/maemosdk/sb1/sdk/IScratchbox1SDK.java
===================================================================
--- branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/maemosdk/sb1/core/IScratchbox1SDK.java	2008-10-15 06:30:08 UTC (rev 873)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/maemosdk/sb1/sdk/IScratchbox1SDK.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -1,74 +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:
- *    Petr Baranov (Nokia) - initial API and implementation
- *******************************************************************************/
-package org.maemo.esbox.maemosdk.sb1.core;
-
-import java.util.List;
-
-import org.maemo.esbox.core.ESboxException;
-import org.maemo.esbox.maemosdk.core.sdk.IScratchboxSDK;
-
-/**
- * @author baranov
- * 
- */
-public interface IScratchbox1SDK extends IScratchboxSDK {
-	public static final String NAME = "Scratchbox 1";
-
-	/**
-	 * Return the list of available devkits at Scratchbox.
-	 * 
-	 * @return a list with the available devkits at Scratchbox.
-	 * @throws ESboxException
-	 *             if some problem related to Scratchbox communication occurs.
-	 */
-	public List<String> getDevkits() throws ESboxException;
-
-	/**
-	 * Return the current sessions of Scratchbox.
-	 * 
-	 * @return a list with current sessions Scratchbox.
-	 * @throws ESboxException
-	 *             if some problem related to Scratchbox communication occurs.
-	 */
-	public List<String> getSessions() throws ESboxException;
-
-	/**
-	 * Select another available target as current Scratchbox target.
-	 * 
-	 * @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 boolean selectTarget(String targetName) throws ESboxException;
-
-	/**
-	 * Kill an Scratchbox process.
-	 * 
-	 * @return true, if the is performed successfully.
-	 * @throws ESboxException
-	 *             if some problem related to Scratchbox communication occurs.
-	 */
-	public boolean killProcess() throws ESboxException;
-
-	/**
-	 * 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 boolean killProcess(String signal) throws ESboxException;
-}

Copied: trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/maemosdk/sb1/sdk/IScratchbox1SDK.java (from rev 873, branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/maemosdk/sb1/core/IScratchbox1SDK.java)
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/maemosdk/sb1/sdk/IScratchbox1SDK.java	                        (rev 0)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.sb1/src/org/maemo/esbox/maemosdk/sb1/sdk/IScratchbox1SDK.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -0,0 +1,74 @@
+/*******************************************************************************
+ * 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:
+ *    Petr Baranov (Nokia) - initial API and implementation
+ *******************************************************************************/
+package org.maemo.esbox.maemosdk.sb1.sdk;
+
+import java.util.List;
+
+import org.maemo.esbox.core.ESboxException;
+import org.maemo.esbox.maemosdk.core.sdk.IScratchboxSDK;
+
+/**
+ * @author baranov
+ * 
+ */
+public interface IScratchbox1SDK extends IScratchboxSDK {
+	public static final String NAME = "Scratchbox 1";
+
+	/**
+	 * Return the list of available devkits at Scratchbox.
+	 * 
+	 * @return a list with the available devkits at Scratchbox.
+	 * @throws ESboxException
+	 *             if some problem related to Scratchbox communication occurs.
+	 */
+	public List<String> getDevkits() throws ESboxException;
+
+	/**
+	 * Return the current sessions of Scratchbox.
+	 * 
+	 * @return a list with current sessions Scratchbox.
+	 * @throws ESboxException
+	 *             if some problem related to Scratchbox communication occurs.
+	 */
+	public List<String> getSessions() throws ESboxException;
+
+	/**
+	 * Select another available target as current Scratchbox target.
+	 * 
+	 * @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 boolean selectTarget(String targetName) throws ESboxException;
+
+	/**
+	 * Kill an Scratchbox process.
+	 * 
+	 * @return true, if the is performed successfully.
+	 * @throws ESboxException
+	 *             if some problem related to Scratchbox communication occurs.
+	 */
+	public boolean killProcess() throws ESboxException;
+
+	/**
+	 * 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 boolean killProcess(String signal) throws ESboxException;
+}

Modified: trunk/maemosdk/org.maemo.esbox.maemosdk.tests/META-INF/MANIFEST.MF
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.tests/META-INF/MANIFEST.MF	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.tests/META-INF/MANIFEST.MF	2008-10-15 19:30:29 UTC (rev 877)
@@ -24,6 +24,8 @@
  org.maemo.esbox.cpp.tests;bundle-version="1.5.0",
  org.maemo.esbox.device.tests;bundle-version="1.5.0",
  org.maemo.esbox.python.tests;bundle-version="1.5.0",
- org.maemo.esbox.linux.tests;bundle-version="1.5.0"
+ org.maemo.esbox.linux.tests;bundle-version="1.5.0",
+ org.maemo.esbox.maemosdk.sb1;bundle-version="1.0.0",
+ org.maemo.esbox.maemosdk.sb2;bundle-version="1.0.0"
 Bundle-RequiredExecutionEnvironment: J2SE-1.5
 Bundle-ActivationPolicy: lazy

Modified: trunk/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/AllTests.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/AllTests.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/AllTests.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -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: trunk/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/ESboxProductTestSuite.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/ESboxProductTestSuite.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/ESboxProductTestSuite.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -11,6 +11,11 @@
 
 package org.maemo.esbox.maemosdk.tests;
 
+import org.maemo.esbox.core.ESboxException;
+import org.maemo.esbox.core.machine.IBuildMachine;
+import org.maemo.esbox.core.machine.MachineRegistry;
+import org.maemo.esbox.internal.api.core.sdk.MachineUtils;
+
 import junit.framework.Test;
 import junit.framework.TestSuite;
 
@@ -27,6 +32,13 @@
 		TestSuite suite = new TestSuite(
 				"Test for ESbox Product");
 		
+		for (IBuildMachine machine : MachineRegistry.getInstance().getBuildMachines()) {
+			try {
+				MachineUtils.acquireMachine(machine);
+			} catch (ESboxException e) {
+			}
+		}
+		
 		suite.addTest(org.maemo.esbox.core.tests.ESboxCoreTestSuite.suite());
 		suite.addTest(org.maemo.esbox.maemosdk.tests.ESboxMaemoSDKTestSuite.suite());
 		suite.addTest(org.maemo.esbox.linux.tests.ESboxLinuxTestSuite.suite());

Modified: trunk/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/TestOProfileValgrindSupport.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/TestOProfileValgrindSupport.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/TestOProfileValgrindSupport.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -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: trunk/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/TestProcessLauncher.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/TestProcessLauncher.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/TestProcessLauncher.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -10,24 +10,34 @@
  *******************************************************************************/
 package org.maemo.esbox.maemosdk.tests;
 
+import java.io.ByteArrayOutputStream;
+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.*;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Platform;
 import org.junit.Test;
-import org.maemo.esbox.core.*;
-import org.maemo.esbox.core.env.*;
+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.machine.IMachine;
 import org.maemo.esbox.core.machine.MachineRegistry;
-import org.maemo.esbox.core.process.*;
-import org.maemo.esbox.core.sdk.*;
+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.ISDK;
+import org.maemo.esbox.core.sdk.ISDKTarget;
 import org.maemo.esbox.core.tests.core.BaseTest;
 import org.maemo.esbox.internal.api.core.sdk.HostSDK;
 
-import java.io.ByteArrayOutputStream;
-import java.io.OutputStream;
-import java.util.*;
-
 /**
  * Test the generic IProcessLauncher interface.
  * This test is extended by SDK-specific tests which override

Modified: trunk/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/TestRunStandalone.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/TestRunStandalone.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/TestRunStandalone.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -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: trunk/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/TestSB1ProcessLauncher.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/TestSB1ProcessLauncher.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/TestSB1ProcessLauncher.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -10,18 +10,27 @@
  *******************************************************************************/
 package org.maemo.esbox.maemosdk.tests;
 
-import org.eclipse.core.runtime.*;
+import java.io.ByteArrayOutputStream;
+import java.util.Collections;
+import java.util.List;
+
+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.*;
+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.*;
-import org.maemo.esbox.core.sdk.*;
-import org.maemo.esbox.internal.maemosdk.core.sdk.providers.Scratchbox1SDKProvider;
+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.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.internal.maemosdk.sb1.provider.Scratchbox1SDKProvider;
 
-import java.io.ByteArrayOutputStream;
-import java.util.*;
-
 /**
  * If SB1 is installed, make sure its SDKs and targets are properly detected,
  * and that it launches processes in the expected way

Modified: trunk/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/TestSB1SDKProvider.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/TestSB1SDKProvider.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/TestSB1SDKProvider.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -10,18 +10,23 @@
  *******************************************************************************/
 package org.maemo.esbox.maemosdk.tests;
 
+import java.util.List;
+
 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.*;
+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.core.tests.core.BaseTest;
-import org.maemo.esbox.internal.maemosdk.core.sdk.providers.Scratchbox1SDKProvider;
+import org.maemo.esbox.internal.maemosdk.sb1.provider.Scratchbox1SDKProvider;
 import org.maemo.esbox.maemosdk.core.sdk.IScratchboxSDKTarget;
 
-import java.util.List;
-
 /**
  * If SB1 is installed, make sure its SDKs and targets
  * are properly detected, and that it launches processes

Modified: trunk/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/TestSB2ProcessLauncher.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/TestSB2ProcessLauncher.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/TestSB2ProcessLauncher.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -10,18 +10,25 @@
  *******************************************************************************/
 package org.maemo.esbox.maemosdk.tests;
 
+import java.util.Collections;
+import java.util.List;
+
 import org.eclipse.core.runtime.Platform;
 import org.eclipse.jface.preference.IPreferenceStore;
 import org.junit.Test;
-import org.maemo.esbox.core.*;
+import org.maemo.esbox.core.CorePreferenceConstants;
+import org.maemo.esbox.core.CorePreferenceManager;
+import org.maemo.esbox.core.ESboxException;
+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.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.internal.maemosdk.sb2.provider.Scratchbox2SDKProvider;
 
-import org.maemo.esbox.core.process.*;
-import org.maemo.esbox.core.sdk.*;
-import org.maemo.esbox.internal.maemosdk.core.sdk.providers.Scratchbox2SDKProvider;
-
-import java.util.Collections;
-import java.util.List;
-
 /**
  * If SB2 is installed, make sure its SDKs and targets are properly detected,
  * and that it launches processes in the expected way

Modified: trunk/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/TestSB2SDKProvider.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/TestSB2SDKProvider.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/TestSB2SDKProvider.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -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.internal.maemosdk.core.sdk.providers.Scratchbox2SDKProvider;
+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.internal.maemosdk.sb2.provider.Scratchbox2SDKProvider;
 import org.maemo.esbox.maemosdk.core.sdk.IScratchboxSDKTarget;
 
-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: trunk/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/commands/BaseTest.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/commands/BaseTest.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/commands/BaseTest.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -10,14 +10,19 @@
  *******************************************************************************/
 package org.maemo.esbox.maemosdk.tests.commands;
 
+import junit.framework.TestCase;
+
 import org.junit.Before;
 import org.maemo.esbox.core.sdk.ISDKTarget;
-import org.maemo.esbox.internal.maemosdk.core.command.ICommandAbstractor;
-import org.maemo.esbox.maemosdk.core.scratchbox.ScratchboxFacade;
-import org.maemo.esbox.maemosdk.core.sdk.*;
+import org.maemo.esbox.internal.api.core.commands.ICommandAbstractor;
+import org.maemo.esbox.internal.api.core.sdk.MaemoUtils;
+import org.maemo.esbox.internal.maemosdk.sb1.core.Scratchbox1SDK;
+import org.maemo.esbox.internal.maemosdk.sb2.core.Scratchbox2SDK;
+import org.maemo.esbox.maemosdk.core.sdk.IScratchboxSDKTarget;
+import org.maemo.esbox.maemosdk.core.sdk.ScratchboxSDKFacade;
+import org.maemo.esbox.maemosdk.sb1.sdk.IScratchbox1SDK;
+import org.maemo.esbox.maemosdk.sb2.sdk.IScratchbox2SDK;
 
-import junit.framework.TestCase;
-
 /**
  * Base test for the ICommand tests
  * @author eswartz
@@ -36,15 +41,16 @@
 	 */
 	@Before
 	public void setUp() throws Exception {
-		this.sb1Sdk = ScratchboxSDKFacade.getInstance().getScratchbox1SDK();
-		this.sb1Command = ScratchboxFacade.getInstance().getCommandAbstractor(sb1Sdk);
-		this.sb2Sdk = ScratchboxSDKFacade.getInstance().getScratchbox2SDK();
-		this.sb2Command = ScratchboxFacade.getInstance().getCommandAbstractor(sb2Sdk);
+		this.sb1Sdk = ScratchboxSDKFacade.getInstance().getScratchboxSDK(IScratchbox1SDK.class).get(0);
+		this.sb1Command = ((Scratchbox1SDK) sb1Sdk).getCommandAbstractor();  
+		this.sb2Sdk = ScratchboxSDKFacade.getInstance().getScratchboxSDK(IScratchbox2SDK.class).get(0);
+		this.sb2Command = ((Scratchbox2SDK) sb2Sdk).getCommandAbstractor();
 		if (sb2Sdk != null) {
 			for (ISDKTarget target : sb2Sdk.getSDKTargets()) {
 				if (target.getArchitecture().equals(IScratchboxSDKTarget.ARCHITECTURE_ARMEL) && 
-						!target.getName().contains("minimal")) {
-					this.sb2ArmelTargetCommand = ScratchboxFacade.getInstance().getCommandAbstractor(target);
+						!target.getName().contains("minimal") &&
+						!target.getName().contains("REMOVEME")) {
+					this.sb2ArmelTargetCommand = MaemoUtils.getCommandAbstractor(target);//ScratchboxFacade.getInstance().getCommandAbstractor(target);
 					break;
 				}
 			}

Modified: trunk/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/commands/MockCommandAbstractor.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/commands/MockCommandAbstractor.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/commands/MockCommandAbstractor.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -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.command.ICommandAbstractor;
-import org.maemo.esbox.internal.maemosdk.core.sdk.Scratchbox2ProcessLauncherFactory;
-import org.maemo.esbox.maemosdk.core.SB2PreferenceConstants;
+import org.maemo.esbox.internal.api.core.commands.ICommandAbstractor;
+import org.maemo.esbox.internal.api.maemosdk.sb2.core.SB2PreferenceConstants;
+import org.maemo.esbox.internal.maemosdk.sb2.launcher.Scratchbox2ProcessLauncherFactory;
 
-import java.util.List;
-
 public class MockCommandAbstractor implements ICommandAbstractor {
 	private final ISDKTarget target;
 	private final ICommandAbstractor wrapped;

Modified: trunk/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/commands/MockProcessLauncher.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/commands/MockProcessLauncher.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/commands/MockProcessLauncher.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -14,7 +14,7 @@
 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;

Modified: trunk/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/commands/MockProcessLauncherFactory.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/commands/MockProcessLauncherFactory.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/commands/MockProcessLauncherFactory.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -11,14 +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.

Modified: trunk/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/commands/TestCreateTargetCommand.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/commands/TestCreateTargetCommand.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/commands/TestCreateTargetCommand.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -11,15 +11,16 @@
  *******************************************************************************/
 package org.maemo.esbox.maemosdk.tests.commands;
 
-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.*;
-import org.maemo.esbox.maemosdk.core.SB1PreferenceConstants;
-
 import java.util.ArrayList;
 import java.util.List;
 
+import org.maemo.esbox.core.ESboxException;
+import org.maemo.esbox.internal.api.core.commands.ICommandAbstractor;
+import org.maemo.esbox.internal.maemosdk.sb1.command.*;
+import org.maemo.esbox.internal.maemosdk.sb1.core.SB1PreferenceConstants;
+import org.maemo.esbox.maemosdk.core.command.ScratchboxCommand;
+import org.maemo.esbox.maemosdk.sb1.sdk.IScratchbox1SDK;
+
 /**
  * Please, read file TESTS.txt for more instructions about test.
  */
@@ -28,7 +29,7 @@
 
 	private class CreateTargetCommandMock extends CreateTargetCommand {
 	
-		public CreateTargetCommandMock(ISDK sdk, ICommandAbstractor commandLauncher) {
+		public CreateTargetCommandMock(IScratchbox1SDK sdk, ICommandAbstractor commandLauncher) {
 			super(sdk, commandLauncher);
 		}
 
@@ -61,13 +62,13 @@
 		param.add("qemu-arm-0.8.2-sb2");
 		createTargetCommand.performCommand(param);
 
-		List<String> targetsAvailable = new ListTargetsCommand(sb1Command, 1)
+		List<String> targetsAvailable = new ListTargetsCommand(sb1Command)
 				.performCommand(new ArrayList<String>());
 		assertTrue(targetsAvailable.contains(TARGET_NAME));
 
 		// remove the target created for the test
 		removeTestTarget();
-		targetsAvailable = new ListTargetsCommand(sb1Command, 1)
+		targetsAvailable = new ListTargetsCommand(sb1Command)
 				.performCommand(new ArrayList<String>());
 		assertTrue(!targetsAvailable.contains(TARGET_NAME));
 
@@ -82,7 +83,7 @@
 		} catch (ESboxException se) {
 			// expected
 		}
-		targetsAvailable = new ListTargetsCommand(sb1Command, 1)
+		targetsAvailable = new ListTargetsCommand(sb1Command)
 				.performCommand(new ArrayList<String>());
 		assertTrue(!targetsAvailable.contains(TARGET_NAME));
 	}

Modified: trunk/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/commands/TestCreateTargetSb2Command.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/commands/TestCreateTargetSb2Command.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/commands/TestCreateTargetSb2Command.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -1,13 +1,13 @@
 package org.maemo.esbox.maemosdk.tests.commands;
 
-import org.maemo.esbox.core.ESboxException;
-import org.maemo.esbox.internal.maemosdk.core.command.scratchbox.CreateTargetSb2Command;
-import org.maemo.esbox.internal.maemosdk.core.command.scratchbox.ScratchboxCommand;
-
 import java.util.ArrayList;
 import java.util.List;
 
+import org.maemo.esbox.core.ESboxException;
+import org.maemo.esbox.internal.maemosdk.sb2.command.CreateTargetSb2Command;
+import org.maemo.esbox.maemosdk.core.command.ScratchboxCommand;
 
+
 public class TestCreateTargetSb2Command extends BaseTest {
 
 	private final String TARGET_NAME = "TEST_TARGET";

Modified: trunk/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/commands/TestGdbQemuCommand.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/commands/TestGdbQemuCommand.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/commands/TestGdbQemuCommand.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -11,21 +11,21 @@
 package org.maemo.esbox.maemosdk.tests.commands;
 
 import org.maemo.esbox.core.ESboxException;
-import org.maemo.esbox.core.sdk.ISDKTarget;
-import org.maemo.esbox.maemosdk.core.scratchbox.ScratchboxFacade;
-import org.maemo.esbox.maemosdk.core.sdk.*;
+import org.maemo.esbox.maemosdk.core.sdk.IScratchboxSDKTarget;
+import org.maemo.esbox.maemosdk.core.sdk.ScratchboxSDKFacade;
 
+
 /**
  * @author eswartz
  */
 public class TestGdbQemuCommand extends BaseTest {
 
 	public void testQemuVersionCommand() throws ESboxException {
-		for (ISDKTarget sdkTarget : ScratchboxSDKFacade.getInstance().getScratchboxSDKTargets()) {
-			String pattern = ScratchboxFacade.getInstance().getGdbQemuCommandPattern(sdkTarget,
+		for (IScratchboxSDKTarget sdkTarget : ScratchboxSDKFacade.getInstance().getScratchboxSDKTargets()) {
+			String pattern = sdkTarget.getGdbQemuCommandPattern(
 					sdkTarget.getArchitecture());
 			assertNotNull(pattern);
-			if (sdkTarget instanceof IScratchbox2SDKTarget) {
+			if (sdkTarget.getSboxVersion() == 2) {
 				assertTrue(pattern.contains("${PORT}"));
 			} 
 			if (sdkTarget.getArchitecture().equals(IScratchboxSDKTarget.ARCHITECTURE_ARMEL)) {

Modified: trunk/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/commands/TestGetCurrentTargetCommand.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/commands/TestGetCurrentTargetCommand.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/commands/TestGetCurrentTargetCommand.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -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 org.maemo.esbox.internal.maemosdk.sb1.command.GetCurrentTargetCommand;
 
-import java.util.ArrayList;
-
 /**
  *  Please, read file TESTS.txt for more instructions about test.
  */

Modified: trunk/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/commands/TestListCommands.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/commands/TestListCommands.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/commands/TestListCommands.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -11,16 +11,19 @@
  *******************************************************************************/
 package org.maemo.esbox.maemosdk.tests.commands;
 
-import org.maemo.esbox.core.*;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.maemo.esbox.core.ESboxException;
+import org.maemo.esbox.core.HostUtils;
 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.command.scratchbox.*;
-import org.maemo.esbox.maemosdk.core.scratchbox.ScratchboxFacade;
+import org.maemo.esbox.internal.maemosdk.sb1.command.*;
+import org.maemo.esbox.internal.maemosdk.sb1.core.Scratchbox1SDK;
 import org.maemo.esbox.maemosdk.core.sdk.ScratchboxSDKFacade;
 
-import java.util.*;
-
 /**
  * Please, read file TESTS.txt for more instructions about test.
  */
@@ -232,7 +235,8 @@
 		numberOfSessions = sessions.size();
 		
 		// launch a new session (without switching targets!)
-		ISDKTarget target = ScratchboxFacade.getInstance().getCurrentSDKTarget(ScratchboxSDKFacade.getInstance().getScratchbox1SDK());
+//		ISDKTarget target = ScratchboxFacade.getInstance().getCurrentSDKTarget(ScratchboxSDKFacade.getInstance().getScratchbox1SDK());
+		ISDKTarget target = ScratchboxSDKFacade.getInstance().getScratchboxSDK(Scratchbox1SDK.class).get(0).getCurrentSDKTarget();
 		
 		Process process = null;
 		try {
@@ -277,8 +281,9 @@
 		targetsExpected.add("BORA_X86");
 		targetsExpected.add("CHINOOK_ARMEL");
 		targetsExpected.add("CHINOOK_X86");
+		targetsExpected.add("DIABLO_ARMEL");
 
-		ListTargetsCommand listTargetsCommand = new ListTargetsCommand(sb1Command, 1);
+		ListTargetsCommand listTargetsCommand = new ListTargetsCommand(sb1Command);
 		List<String> targets = null;
 
 		try {

Modified: trunk/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/commands/TestListSb2Commands.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/commands/TestListSb2Commands.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/commands/TestListSb2Commands.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -10,21 +10,24 @@
  *******************************************************************************/
 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.CorePreferenceConstants;
+import org.maemo.esbox.core.ESboxException;
+import org.maemo.esbox.core.HostUtils;
 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.ICommandAbstractor;
-import org.maemo.esbox.internal.maemosdk.core.command.scratchbox.*;
+import org.maemo.esbox.internal.api.core.commands.ICommandAbstractor;
+import org.maemo.esbox.internal.maemosdk.sb2.command.*;
 import org.maemo.esbox.maemosdk.core.scratchbox.MaemoRootstrap;
 
-import java.util.*;
-
 /**
  */
 public class TestListSb2Commands extends BaseTest {
@@ -119,8 +122,9 @@
 		List<String> targetsExpected = new ArrayList<String>();
 		targetsExpected.add("bora31_armel");
 		targetsExpected.add("chinook40_armel");
+		targetsExpected.add("diablo41_armel");
 
-		ListTargetsCommand listTargetsCommand = new ListTargetsCommand(sb2Command, 2);
+		ListTargetsCommand listTargetsCommand = new ListTargetsCommand(sb2Command);
 		List<String> targets = null;
 
 		try {
@@ -193,7 +197,6 @@
 						public IEnvironmentModifierBlock defaultEnvironmentModifierBlock() {
 							return factory.defaultEnvironmentModifierBlock();
 						}
-
 						public Properties getRawEnvironment() {
 							return factory.getRawEnvironment();
 						}

Modified: trunk/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/commands/TestRemoveCommand.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/commands/TestRemoveCommand.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/commands/TestRemoveCommand.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -11,12 +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 java.util.ArrayList;
 import java.util.List;
 
+import org.maemo.esbox.core.ESboxException;
+import org.maemo.esbox.internal.maemosdk.core.command.scratchbox.ScratchboxInvalidOperationException;
+import org.maemo.esbox.internal.maemosdk.sb1.command.RemoveTargetCommand;
+import org.maemo.esbox.maemosdk.core.command.ScratchboxCommand;
+
 /**
  * Please, read file TESTS.txt for more instructions about test.
  */

Modified: trunk/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/commands/TestRemoveSb2Command.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/commands/TestRemoveSb2Command.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/commands/TestRemoveSb2Command.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -10,13 +10,15 @@
  *******************************************************************************/
 package org.maemo.esbox.maemosdk.tests.commands;
 
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
 import org.maemo.esbox.core.ESboxException;
-import org.maemo.esbox.internal.maemosdk.core.command.scratchbox.RemoveTargetSb2Command;
-import org.maemo.esbox.internal.maemosdk.core.command.scratchbox.ScratchboxCommand;
-import org.maemo.esbox.maemosdk.core.scratchbox.ScratchboxFacade;
+import org.maemo.esbox.internal.api.core.sdk.CacheUtils;
+import org.maemo.esbox.internal.maemosdk.sb2.command.RemoveTargetSb2Command;
+import org.maemo.esbox.maemosdk.core.command.ScratchboxCommand;
 
-import java.util.*;
-
 /**
  */
 public class TestRemoveSb2Command extends BaseTest {
@@ -49,8 +51,9 @@
 		final String TARGET = "REMOVEME_armel";
 		
 		try {
-			ScratchboxFacade.getInstance().createTarget(sb2Sdk, TARGET, 
-					ScratchboxFacade.getInstance().getCompilers(sb2Sdk).get(0), null);
+//			ScratchboxFacade.getInstance().createTarget(sb2Sdk, TARGET, 
+//					ScratchboxFacade.getInstance().getCompilers(sb2Sdk).get(0), null);
+			sb2Sdk.createTarget(TARGET,sb2Sdk.getCompilers().get(0), null,null);
 		} catch (ESboxException e) {
 			// don't worry if it fails, as it might, since installing a 
 			// bogus target in sb2 often fails to initialize properly
@@ -58,7 +61,8 @@
 		
 		List<String> targets = new ArrayList<String>();
 		try {
-			targets = ScratchboxFacade.getInstance().getTargets(sb2Sdk);
+//			targets = ScratchboxFacade.getInstance().getTargets(sb2Sdk);
+			targets = sb2Sdk.getTargets();
 		} catch (ESboxException e) {
 			// again, ignore error
 		}
@@ -68,11 +72,14 @@
 
 			List<String> param = Collections.singletonList(TARGET);
 			try {
-				ScratchboxFacade.getInstance().clearCachedData();
+//				ScratchboxFacade.getInstance().clearCachedData();
+				CacheUtils.getInstance().clearCachedData();
 				removeCommand.performCommand(param);
 				
-				ScratchboxFacade.getInstance().clearCachedData();
-				targets = ScratchboxFacade.getInstance().getTargets(sb2Sdk);
+//				ScratchboxFacade.getInstance().clearCachedData();
+				CacheUtils.getInstance().clearCachedData();
+//				targets = ScratchboxFacade.getInstance().getTargets(sb2Sdk);
+				targets = sb2Sdk.getTargets();
 				assertFalse(targets.contains(TARGET));
 			} catch (ESboxException e) {
 				fail(e.getMessage());

Modified: trunk/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/commands/TestScratchboxCommand.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/commands/TestScratchboxCommand.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/commands/TestScratchboxCommand.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -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.internal.api.core.commands.ICommandAbstractor;
+import org.maemo.esbox.internal.maemosdk.sb1.command.AbstractSB1Command;
+import org.maemo.esbox.internal.maemosdk.sb1.core.SB1PreferenceConstants;
 
-import java.util.List;
-
 /**
  * Please, read file TESTS.txt for more instructions about test.
  */
@@ -28,11 +28,11 @@
 	 * 
 	 * @author Raul Fernandes Herbster - raulherbster at gmail dot com
 	 */
-	class MockScratchboxCommand extends ScratchboxCommand {
+	class MockScratchboxCommand extends AbstractSB1Command {
 
 		
 		public MockScratchboxCommand(ICommandAbstractor commandAbstractor) {
-			super(commandAbstractor, 1);
+			super(commandAbstractor);
 		}
 
 		public Object performCommand(List<String> param)
@@ -46,6 +46,9 @@
 			return 0;
 		}
 
+		
+		
+
 	}
 
 	/**
@@ -56,7 +59,7 @@
 		final String stringToCompareA = "sb-conf current";
 		String currentTargetAction = sb1Sdk.getPreferenceValue(
 				SB1PreferenceConstants.SB1_CURRENT_ACT);
-		ScratchboxCommand scratchboxCommandA = new MockScratchboxCommand(sb1Command);
+		AbstractSB1Command scratchboxCommandA = new MockScratchboxCommand(sb1Command);
 
 		String stringGetCurrent = scratchboxCommandA
 				.replaceScratchboxConfigCommand(currentTargetAction);
@@ -79,7 +82,7 @@
 				SB1PreferenceConstants.SB1_SHOW_OPT_DEVKITS);
 		String cpuTranspShowOption = sb1Sdk.getPreferenceValue(
 				SB1PreferenceConstants.SB1_SHOW_OPT_CPU);
-		ScratchboxCommand scratchboxCommandA = new MockScratchboxCommand(sb1Command);
+		AbstractSB1Command scratchboxCommandA = new MockScratchboxCommand(sb1Command);
 
 		String stringShow = scratchboxCommandA.replaceScratchboxConfigCommand(
 				showAction, new String[] { compilersShowOption,

Modified: trunk/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/commands/TestScratchboxFacade.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/commands/TestScratchboxFacade.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/commands/TestScratchboxFacade.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -11,20 +11,25 @@
  *******************************************************************************/
 package org.maemo.esbox.maemosdk.tests.commands;
 
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import junit.framework.TestCase;
+
 import org.junit.Test;
-import org.maemo.esbox.core.*;
+import org.maemo.esbox.core.ESboxException;
+import org.maemo.esbox.core.HostUtils;
 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.IProcessLauncher;
+import org.maemo.esbox.core.process.ProcessLauncherCreator;
 import org.maemo.esbox.core.sdk.ISDKTarget;
-import org.maemo.esbox.maemosdk.core.scratchbox.ScratchboxFacade;
-import org.maemo.esbox.maemosdk.core.sdk.IScratchbox1SDK;
+import org.maemo.esbox.internal.maemosdk.sb1.core.Scratchbox1SDK;
+import org.maemo.esbox.internal.maemosdk.sb2.core.Scratchbox2SDK;
 import org.maemo.esbox.maemosdk.core.sdk.ScratchboxSDKFacade;
+import org.maemo.esbox.maemosdk.sb1.sdk.IScratchbox1SDK;
 
-import java.util.*;
-
-import junit.framework.TestCase;
-
 /**
  * Please, read file TESTS.txt for more instructions about test.
  */
@@ -37,19 +42,19 @@
 	@Override
 	protected void setUp() throws Exception {
 		super.setUp();
-		this.sdk = ScratchboxSDKFacade.getInstance().getScratchbox1SDK();
+		this.sdk = ScratchboxSDKFacade.getInstance().getScratchboxSDK(IScratchbox1SDK.class).get(0);
 	}
 
 	/**
 	 * Test method for
 	 * {@link org.maemo.esbox.core.scratchbox.ScratchboxFacade#getInstance()}.
 	 */
-	@Test
-	public void testGetInstance() {
-		ScratchboxFacade facadeA = ScratchboxFacade.getInstance();
-		ScratchboxFacade facadeB = ScratchboxFacade.getInstance();
-		assertSame(facadeA, facadeB);
-	}
+//	@Test
+//	public void testGetInstance() {
+//		ScratchboxFacade facadeA = ScratchboxFacade.getInstance();
+//		ScratchboxFacade facadeB = ScratchboxFacade.getInstance();
+//		assertSame(facadeA, facadeB);
+//	}
 
 	/**
 	 * Test method for
@@ -90,7 +95,7 @@
 	 */
 	private List<String> getCompilers() throws ESboxException {
 		if (cachedCompilers == null)
-			cachedCompilers = ScratchboxFacade.getInstance().getCompilers(sdk);
+			cachedCompilers = sdk.getCompilers();//ScratchboxFacade.getInstance().getCompilers(sdk);
 		List<String> compilers = cachedCompilers;
 		return compilers;
 	}
@@ -172,7 +177,7 @@
 	 */
 	private List<String> getCputransps() throws ESboxException {
 		if (cachedCputransps == null)
-			cachedCputransps = ScratchboxFacade.getInstance().getCputransp(sdk);
+			cachedCputransps = sdk.getCputransp();//ScratchboxFacade.getInstance().getCputransp(sdk);
 		List<String> cputransps = cachedCputransps;
 		return cputransps;
 	}
@@ -192,7 +197,7 @@
 		devkitsExpected.add("doctools");
 		devkitsExpected.add("perl");
 
-		List<String> devkits = ScratchboxFacade.getInstance().getDevkits(sdk);
+		List<String> devkits = ((Scratchbox1SDK)sdk).getDevkits();//ScratchboxFacade.getInstance().getDevkits(sdk);
 
 		// just make sure there is at leasr one devkit and that one of them looks like
 		// something we recognize
@@ -227,8 +232,10 @@
 		targetsExpected.add("BORA_X86");
 		targetsExpected.add("CHINOOK_ARMEL");
 		targetsExpected.add("CHINOOK_X86");
+		targetsExpected.add("DIABLO_X86");
+		targetsExpected.add("DIABLO_ARMEL");
 
-		List<String> targets = ScratchboxFacade.getInstance().getTargets(sdk);
+		List<String> targets =  sdk.getTargets();//ScratchboxFacade.getInstance().getTargets(sdk);
 
 		// just make sure there is more than one target and that one of them looks like
 		// something we recognize
@@ -263,7 +270,8 @@
 			
 		int numberOfSessions = 0;
 
-		List<String> sessions = ScratchboxFacade.getInstance().getSessions(sdk);
+//		List<String> sessions = ScratchboxFacade.getInstance().getSessions(sdk);
+		List<String> sessions = sdk.getSessions();
 
 		// make sure anything here is a pid
 		for (String pid : sessions) {
@@ -273,7 +281,8 @@
 		numberOfSessions = sessions.size();
 		
 		// launch a new session (without switching targets!)
-		ISDKTarget target = ScratchboxFacade.getInstance().getCurrentSDKTarget(ScratchboxSDKFacade.getInstance().getScratchbox1SDK());
+//		ISDKTarget target = ScratchboxFacade.getInstance().getCurrentSDKTarget(ScratchboxSDKFacade.getInstance().getScratchbox1SDK());
+		ISDKTarget target = ScratchboxSDKFacade.getInstance().getScratchboxSDK(Scratchbox1SDK.class).get(0).getCurrentSDKTarget();
 		Process process = null;
 		try {
 			// need a PTY or else the shell fails to launch
@@ -283,9 +292,9 @@
 			process = launcher.createProcess();
 			
 			// wait for it to really start
-			Thread.sleep(1000);
+			Thread.sleep(5000);
 		
-			sessions = ScratchboxFacade.getInstance().getSessions(sdk);
+			sessions = sdk.getSessions();// ScratchboxFacade.getInstance().getSessions(sdk);
 			
 			// this either launches 1 or 2 processes
 			assertTrue(numberOfSessions < sessions.size());
@@ -294,7 +303,9 @@
 			for (String pid : sessions) {
 				Integer.parseInt(pid);
 			}
-		} finally {		
+		} catch (Exception e) {
+			fail("Exception: "+e.getMessage());
+		}finally {		
 			// kill the shell (exit, then send ctrl-d)
 			process.getOutputStream().write("exit\n004\004\004\004\004\004\004\004\004".getBytes());
 			process.destroy();
@@ -309,8 +320,7 @@
 	 */
 	@Test
 	public void testGetCurrentTarget() throws ESboxException {
-		String currentTarget = ScratchboxFacade.getInstance()
-				.getCurrentTarget(sdk);
+		String currentTarget = sdk.getCurrentTarget();//ScratchboxFacade.getInstance().getCurrentTarget(sdk);
 		assertTrue(currentTarget.length() > 0);
 		assertNotNull(sdk.findSDKTarget(currentTarget));
 	}
@@ -344,20 +354,22 @@
 				break;
 			}
 		}
-		ScratchboxFacade.getInstance().createTarget(sdk,
+		
+		
+		sdk.createTarget(
 				TARGET_NAME,
 				compiler, 
 				"doctools:cputransp",
 				cputransp);
 
-		List<String> targetsAvailable = ScratchboxFacade.getInstance()
-				.getTargets(sdk);
+		List<String> targetsAvailable = sdk.getTargets();//ScratchboxFacade.getInstance().getTargets(sdk);
 		assertTrue(targetsAvailable.contains(TARGET_NAME));
 
 		// remove the target created for the test
-		assertTrue(ScratchboxFacade.getInstance().removeTarget(sdk, TARGET_NAME));
+//		assertTrue(ScratchboxFacade.getInstance().removeTarget(sdk, TARGET_NAME));
+		assertTrue(sdk.removeTarget(TARGET_NAME));
 
-		targetsAvailable = ScratchboxFacade.getInstance().getTargets(sdk);
+		targetsAvailable = sdk.getTargets();//ScratchboxFacade.getInstance().getTargets(sdk);
 		assertTrue(!targetsAvailable.contains(TARGET_NAME));
 	}
 
@@ -372,7 +384,8 @@
 		final String TARGET_DOESNT_EXIST = "GHOST";
 
 		try {
-			ScratchboxFacade.getInstance().removeTarget(sdk, TARGET_DOESNT_EXIST);
+//			ScratchboxFacade.getInstance().removeTarget(sdk, TARGET_DOESNT_EXIST);
+			sdk.removeTarget(TARGET_DOESNT_EXIST);
 			fail("The target " + TARGET_DOESNT_EXIST
 					+ " does not exist. An error must be throwed.");
 		} catch (ESboxException e) {
@@ -380,9 +393,9 @@
 		}
 
 		// find a known target which isn't the current one
-		List<String> targets = ScratchboxFacade.getInstance().getTargets(sdk);
+		List<String> targets = sdk.getTargets();//ScratchboxFacade.getInstance().getTargets(sdk);
 		
-		String currentTarget = ScratchboxFacade.getInstance().getCurrentTarget(sdk);
+		String currentTarget = sdk.getCurrentTarget();//ScratchboxFacade.getInstance().getCurrentTarget(sdk);
 		
 		String theTarget = null;
 		for (String target : targets) {
@@ -392,13 +405,13 @@
 			}
 		}
 
-		String lastTarget = ScratchboxFacade.getInstance().getCurrentTarget(sdk);
+		String lastTarget = sdk.getCurrentTarget();//ScratchboxFacade.getInstance().getCurrentTarget(sdk);
 		assertTrue(lastTarget != null && lastTarget.length() > 0);
 
-		assertTrue(ScratchboxFacade.getInstance().selectTarget(sdk, theTarget));
+//		assertTrue(ScratchboxFacade.getInstance().selectTarget(sdk, theTarget));
+		assertTrue(sdk.selectTarget(theTarget));
 
-		currentTarget = ScratchboxFacade.getInstance()
-				.getCurrentTarget(sdk);
+		currentTarget = sdk.getCurrentTarget();//ScratchboxFacade.getInstance().getCurrentTarget(sdk);
 		assertEquals(theTarget, currentTarget);
 	}
 
@@ -411,13 +424,20 @@
 	@Test
 	public void testGetCurrentSboxVersion() {
 		for (IMachine machine : MachineRegistry.getInstance().getBuildMachines()) {
-			String sboxVersion;
+			String sbox1Version;
 			try {
-				sboxVersion = ScratchboxFacade.getInstance().getCurrentSbox1Version(machine);
-				assertTrue(sboxVersion.matches("1\\.0\\.\\d+"));
+				sbox1Version = Scratchbox1SDK.getCurrentSboxVersion(machine);//ScratchboxFacade.getInstance().getCurrentSbox1Version(machine);
+				assertTrue(sbox1Version.matches("1\\.0\\.\\d+"));
 			} catch (ESboxException e) {
-				System.out.println("No Scratchbox on " + machine);
+				System.out.println("No Scratchbox 1 on " + machine);
 			}
+			String sbox2Version;
+			try {
+				sbox2Version = Scratchbox2SDK.getCurrentSboxVersion(machine);//ScratchboxFacade.getInstance().getCurrentSbox1Version(machine);
+				assertTrue(sbox2Version.matches("1\\.99\\..*|2\\..*"));
+			} catch (ESboxException e) {
+				System.out.println("No Scratchbox 2 on " + machine);
+			}
 		}
 	}
 
@@ -497,13 +517,13 @@
 	 * 
 	 * @throws ESboxException
 	 */
-	@Test
-	public void testExecSimpleCommand() throws ESboxException {
-		ISDKTarget sdkTarget = sdk.getSDKTargets()[0];
-		List<String> currentTarget = ScratchboxFacade.getInstance().execSimpleCommand(
-				sdkTarget, 
-				CommandLineArguments.createFromVarArgs("sb-conf", "current"));
-		assertEquals(sdkTarget.getName(), currentTarget.get(0));
-	}
+//	@Test
+//	public void testExecSimpleCommand() throws ESboxException {
+//		ISDKTarget sdkTarget = sdk.getSDKTargets()[0];
+//		List<String> currentTarget = ScratchboxFacade.getInstance().execSimpleCommand(
+//				sdkTarget, 
+//				CommandLineArguments.createFromVarArgs("sb-conf", "current"));
+//		assertEquals(sdkTarget.getName(), currentTarget.get(0));
+//	}
 
 }

Modified: trunk/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/commands/TestSelectTargetCommand.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/commands/TestSelectTargetCommand.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/commands/TestSelectTargetCommand.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -11,12 +11,13 @@
  *******************************************************************************/
 package org.maemo.esbox.maemosdk.tests.commands;
 
-import org.maemo.esbox.core.ESboxException;
-import org.maemo.esbox.internal.maemosdk.core.command.scratchbox.*;
-
 import java.util.ArrayList;
 import java.util.List;
 
+import org.maemo.esbox.core.ESboxException;
+import org.maemo.esbox.internal.maemosdk.sb1.command.*;
+import org.maemo.esbox.maemosdk.core.command.ScratchboxCommand;
+
 /**
  * Please, read file TESTS.txt for more instructions about test.
  */
@@ -48,7 +49,7 @@
 		}
 		
 		// find a known target which isn't the current one
-		ListTargetsCommand listTargets = new ListTargetsCommand(sb1Command, 1);
+		ListTargetsCommand listTargets = new ListTargetsCommand(sb1Command);
 		param.clear();
 		List<String> targets = listTargets.performCommand(param);
 		

Modified: trunk/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/commands/TestShowPathMappingSb2Command.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/commands/TestShowPathMappingSb2Command.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/commands/TestShowPathMappingSb2Command.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -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 org.maemo.esbox.internal.maemosdk.sb2.command.ShowPathMappingSb2Command;
 
-import java.util.*;
-
 public class TestShowPathMappingSb2Command extends BaseTest {
 
 	public void testPerformCommand() throws ESboxException {

Modified: trunk/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/commands/TestShowTargetCommand.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/commands/TestShowTargetCommand.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/commands/TestShowTargetCommand.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -11,15 +11,15 @@
  *******************************************************************************/
 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.ScratchboxCommand;
-import org.maemo.esbox.internal.maemosdk.core.command.scratchbox.ShowTargetCommand;
-import org.maemo.esbox.maemosdk.core.scratchbox.ScratchboxFacade;
+import org.maemo.esbox.internal.maemosdk.sb1.command.ShowTargetCommand;
+import org.maemo.esbox.internal.maemosdk.sb1.core.Scratchbox1SDK;
+import org.maemo.esbox.maemosdk.core.command.ScratchboxCommand;
 import org.maemo.esbox.maemosdk.core.scratchbox.ScratchboxTarget;
 
-import java.util.ArrayList;
-import java.util.List;
-
 /**
  * Please, read file TESTS.txt for more instructions about test.
  */
@@ -43,13 +43,19 @@
 		target = (ScratchboxTarget) showTargetCommand.performCommand(param);
 
 		assertEquals(theTarget, target.getName());
-		assertTrue(ScratchboxFacade.getInstance().getCompilers(sb1Sdk).contains(
+//		assertTrue(ScratchboxFacade.getInstance().getCompilers(sb1Sdk).contains(
+//				target.getCompiler()));
+		assertTrue(sb1Sdk.getCompilers().contains(
 				target.getCompiler()));
-		assertTrue(ScratchboxFacade.getInstance().getCputransp(sb1Sdk).contains(
+//		assertTrue(ScratchboxFacade.getInstance().getCputransp(sb1Sdk).contains(
+//				target.getCputransp()));
+		assertTrue(sb1Sdk.getCputransp().contains(
 				target.getCputransp()));
+		
+//		List<String> devkitsInstalled = ScratchboxFacade.getInstance().getDevkits(sb1Sdk);
 
-		List<String> devkitsInstalled = ScratchboxFacade.getInstance().getDevkits(sb1Sdk);
-
+		List<String> devkitsInstalled = ((Scratchbox1SDK)sb1Sdk).getDevkits();
+		
 		List<String> devkitsActual = target.getDevkits();
 		for (String devkit : devkitsActual) {
 			assertTrue(devkitsInstalled.contains(devkit));

Modified: trunk/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/commands/TestSimpleCommand.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/commands/TestSimpleCommand.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.tests/src/org/maemo/esbox/maemosdk/tests/commands/TestSimpleCommand.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -11,14 +11,13 @@
  *******************************************************************************/
 package org.maemo.esbox.maemosdk.tests.commands;
 
+import java.util.ArrayList;
+import java.util.List;
+
 import org.junit.Test;
 import org.maemo.esbox.core.ESboxException;
 import org.maemo.esbox.internal.maemosdk.core.command.scratchbox.SimpleCommand;
-import org.maemo.esbox.maemosdk.core.scratchbox.ScratchboxFacade;
 
-import java.util.ArrayList;
-import java.util.List;
-
 /**
  * 
  */
@@ -30,7 +29,8 @@
 	 */
 	@Test
 	public void testPerformCommand() throws ESboxException {
-		String currentTarget = ScratchboxFacade.getInstance().getCurrentTarget(sb1Sdk);
+//		String currentTarget = ScratchboxFacade.getInstance().getCurrentTarget(sb1Sdk);
+		String currentTarget = sb1Sdk.getCurrentTarget();
 		
 		SimpleCommand simpleCommand = new SimpleCommand(sb1Command);
 		List<String> params = new ArrayList<String>();

Modified: trunk/maemosdk/org.maemo.esbox.maemosdk.ui/META-INF/MANIFEST.MF
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.ui/META-INF/MANIFEST.MF	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.ui/META-INF/MANIFEST.MF	2008-10-15 19:30:29 UTC (rev 877)
@@ -8,8 +8,13 @@
 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.internal.maemosdk.ui.actions,
+ org.maemo.esbox.internal.maemosdk.ui.adapters,
+ org.maemo.esbox.internal.maemosdk.ui.preferences,
+ org.maemo.esbox.internal.maemosdk.ui.targets.wizards,
+ org.maemo.esbox.internal.maemosdk.ui.targets.wizards.sbrsh

Modified: trunk/maemosdk/org.maemo.esbox.maemosdk.ui/plugin.xml
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.ui/plugin.xml	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.ui/plugin.xml	2008-10-15 19:30:29 UTC (rev 877)
@@ -1,42 +1,21 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?eclipse version="3.2"?>
 <plugin>
-   <extension
-         point="org.eclipse.ui.newWizards">
-      <wizard
-            name="Scratchbox Targets"
-            icon="icons/full/obj16/maemoprj_obj.png"
-            class="org.maemo.esbox.maemosdk.ui.targets.wizards.NewScratchbox2TargetWizard"
-            id="org.maemo.esbox.maemosdk.ui.scratchbox.targets.wizards.NewTargetWizard">
-      </wizard>
-   </extension>
 
       <extension
          point="org.eclipse.ui.preferencePages">
       <page
             name="Gazpacho"
             category="org.maemo.esbox.ui.esboxPreferencePage"
-            class="org.maemo.esbox.maemosdk.ui.preferences.ESboxGazpachoPreferencePage"
+            class="org.maemo.esbox.internal.maemosdk.ui.preferences.ESboxGazpachoPreferencePage"
             id="org.maemo.esbox.maemosdk.ui.esboxPreferencePage.gazpacho">
       </page>
          
-      <page
-            category="org.maemo.esbox.ui.esboxPreferencePage"
-            class="org.maemo.esbox.maemosdk.ui.preferences.Scratchbox1PreferencesPage"
-            id="org.maemo.esbox.maemosdk.ui.esboxPreferencePage.scratchbox1"
-            name="Scratchbox 1">
-      </page>
-      <page
-            category="org.maemo.esbox.ui.esboxPreferencePage"
-            class="org.maemo.esbox.maemosdk.ui.preferences.Scratchbox2PreferencesPage"
-            id="org.maemo.esbox.maemosdk.ui.esboxPreferencePage.scratchbox2"
-            name="Scratchbox 2">
-      </page>
       
       <page
             name="X Server"
             category="org.maemo.esbox.ui.esboxPreferencePage"
-            class="org.maemo.esbox.maemosdk.ui.preferences.ESboxXServerPreferencePage"
+            class="org.maemo.esbox.internal.maemosdk.ui.preferences.ESboxXServerPreferencePage"
             id="org.maemo.esbox.maemosdk.ui.esboxPreferencePage.xserver">
       </page>   
       
@@ -56,7 +35,7 @@
             </separator>
          </menu>
          <action
-               class="org.maemo.esbox.maemosdk.ui.actions.XDropdownMenuAction"
+               class="org.maemo.esbox.internal.maemosdk.ui.actions.XDropdownMenuAction"
                enablesFor="*"
                icon="icons/full/etool16/xservermenu_misc.gif"
                id="org.maemo.esbox.maemosdk.ui.action.xserver"
@@ -67,7 +46,7 @@
                tooltip="Start X Server">
          </action>
          <action
-               class="org.maemo.esbox.maemosdk.ui.actions.MaemoDropdownMenuAction"
+               class="org.maemo.esbox.internal.maemosdk.ui.actions.MaemoDropdownMenuAction"
                enablesFor="*"
                icon="icons/full/etool16/maemomenu_misc.gif"
                id="org.maemo.esbox.maemosdk.ui.action.maemo"
@@ -85,7 +64,7 @@
          point="org.eclipse.ui.commands">
       <command
             categoryId="org.eclipse.ui.category.help"
-            defaultHandler="org.maemo.esbox.maemosdk.ui.actions.ValidateVirtualMachineCommand"
+            defaultHandler="org.maemo.esbox.internal.maemosdk.ui.actions.ValidateVirtualMachineCommand"
             description="Validate launching and communication with ESbox virtual machine"
             id="org.maemo.esbox.maemosdk.ui.validateVirtualMachineCommand"
             name="Validate ESbox Virtual Machine">
@@ -104,16 +83,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: trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/UIActivator.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/UIActivator.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/UIActivator.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -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
  */

Copied: trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/actions (from rev 873, trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/maemosdk/ui/actions)


Property changes on: trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/actions
___________________________________________________________________
Name: svn:mergeinfo
   + 

Modified: trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/actions/MaemoDropdownMenuAction.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/maemosdk/ui/actions/MaemoDropdownMenuAction.java	2008-10-15 06:30:08 UTC (rev 873)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/actions/MaemoDropdownMenuAction.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -9,18 +9,36 @@
  *    Tampere University of Technology - TUT/CS
  *    Ed Swartz (Nokia)
  *******************************************************************************/
-package org.maemo.esbox.maemosdk.ui.actions;
+package org.maemo.esbox.internal.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: trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/actions/ValidateVirtualMachineCommand.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/maemosdk/ui/actions/ValidateVirtualMachineCommand.java	2008-10-15 06:30:08 UTC (rev 873)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/actions/ValidateVirtualMachineCommand.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -9,7 +9,7 @@
  *    Ed Swartz (Nokia) - initial API and implementation
  *******************************************************************************/
 
-package org.maemo.esbox.maemosdk.ui.actions;
+package org.maemo.esbox.internal.maemosdk.ui.actions;
 
 import org.eclipse.core.commands.*;
 import org.eclipse.core.filesystem.EFS;
@@ -23,11 +23,10 @@
 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.ISDKTarget;
 import org.maemo.esbox.core.sdk.SDKFactory;
-import org.maemo.esbox.maemosdk.core.scratchbox.ScratchboxException;
+import org.maemo.esbox.maemosdk.core.sdk.IScratchboxSDKTarget;
 import org.maemo.esbox.maemosdk.core.sdk.ScratchboxSDKFacade;
 
 import java.io.OutputStream;
@@ -238,7 +237,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 +263,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: trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/actions/XDropdownMenuAction.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/maemosdk/ui/actions/XDropdownMenuAction.java	2008-10-15 06:30:08 UTC (rev 873)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/actions/XDropdownMenuAction.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -13,21 +13,26 @@
 /*
  * Created on Jun 22, 2005
  */
-package org.maemo.esbox.maemosdk.ui.actions;
+package org.maemo.esbox.internal.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

Deleted: trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/adapters/ESboxTargetRemover.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/adapters/ESboxTargetRemover.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/adapters/ESboxTargetRemover.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -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();
-		}
-	}
-	*/
-	
-}

Copied: trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/adapters/ESboxTargetRemover.java (from rev 873, branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/maemosdk/ui/adapters/ESboxTargetRemover.java)
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/adapters/ESboxTargetRemover.java	                        (rev 0)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/adapters/ESboxTargetRemover.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -0,0 +1,317 @@
+/*******************************************************************************
+ * 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
+ *    Petr Baranov (Nokia)
+ *******************************************************************************/
+
+package org.maemo.esbox.internal.maemosdk.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.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 abstract class ESboxTargetRemover {
+
+	protected 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) {
+			doRemoveTarget(monitor, sdk);
+			if (monitor.isCanceled())
+				return;
+		} else {
+			monitor.worked(1);
+		}
+		
+		// and remove the target
+		sdk.removeTarget(targetName);
+		monitor.worked(1);
+		if (monitor.isCanceled())
+			return;
+
+
+	}
+
+	/**
+	 * @param monitor
+	 * @param sdk
+	 */
+	protected abstract void doRemoveTarget(IProgressMonitor monitor, IScratchboxSDK sdk);
+//	{
+//		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);
+//		}
+//	}	
+		
+	/** 
+	 * 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();
+		}
+	}
+	*/
+	
+}


Property changes on: trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/adapters/ESboxTargetRemover.java
___________________________________________________________________
Name: svn:mergeinfo
   + 

Deleted: trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/adapters/MaemoSDKInstallTargetAdapterFactory.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/adapters/MaemoSDKInstallTargetAdapterFactory.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/adapters/MaemoSDKInstallTargetAdapterFactory.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -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: trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/adapters/MaemoScratchbox1SDKManageTargetAdapter.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/adapters/MaemoScratchbox1SDKManageTargetAdapter.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/adapters/MaemoScratchbox1SDKManageTargetAdapter.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -1,62 +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.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: trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/adapters/MaemoScratchbox2SDKManageTargetAdapter.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/adapters/MaemoScratchbox2SDKManageTargetAdapter.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/adapters/MaemoScratchbox2SDKManageTargetAdapter.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -1,62 +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.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());
-	}
-	
-
-}

Deleted: trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/adapters/MaemoScratchboxSDKManageTargetAdapterBase.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/adapters/MaemoScratchboxSDKManageTargetAdapterBase.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/adapters/MaemoScratchboxSDKManageTargetAdapterBase.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -1,142 +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.*;
-import org.eclipse.jface.dialogs.*;
-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.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 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();
-	}
-}

Copied: trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/adapters/MaemoScratchboxSDKManageTargetAdapterBase.java (from rev 873, branches/sdkPlugins/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/maemosdk/ui/adapters/MaemoScratchboxSDKManageTargetAdapterBase.java)
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/adapters/MaemoScratchboxSDKManageTargetAdapterBase.java	                        (rev 0)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/adapters/MaemoScratchboxSDKManageTargetAdapterBase.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -0,0 +1,145 @@
+/*******************************************************************************
+ * 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.*;
+import org.eclipse.jface.dialogs.*;
+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.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.api.core.sdk.CacheUtils;
+import org.maemo.esbox.internal.maemosdk.ui.UIActivator;
+
+import java.lang.reflect.InvocationTargetException;
+import java.text.MessageFormat;
+
+/**
+ * @author eswartz
+ *
+ */
+public abstract class MaemoScratchboxSDKManageTargetAdapterBase implements ISDKManageTargetAdapter {
+
+	
+
+	/* (non-Javadoc)
+	 * @see org.maemo.esbox.core.adapters.ISDKManageTargetAdapter#prepareRefresh()
+	 */
+	public void prepareRefresh() {
+		// this clears for both SB1 and SB2... oh well
+		CacheUtils.getInstance().clearCachedData();
+	}
+	
+	/*
+	 * (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_ = isRootStrapUsed(selectedTarget);
+
+		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());
+		}
+	}
+
+	/**
+	 * @param selectedTarget
+	 * @return
+	 */
+	protected abstract boolean isRootStrapUsed(ISDKTarget selectedTarget);
+	
+	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 =  createTargetRemover(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);
+		}
+	}
+
+	protected abstract ESboxTargetRemover createTargetRemover(final Shell shell, final ISDKTarget target, final boolean deleteRootstrap); 
+}


Property changes on: trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/adapters/MaemoScratchboxSDKManageTargetAdapterBase.java
___________________________________________________________________
Name: svn:mergeinfo
   + 

Copied: trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/preferences (from rev 873, trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/maemosdk/ui/preferences)


Property changes on: trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/preferences
___________________________________________________________________
Name: svn:mergeinfo
   + 

Modified: trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/preferences/ESboxGazpachoPreferencePage.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/maemosdk/ui/preferences/ESboxGazpachoPreferencePage.java	2008-10-15 06:30:08 UTC (rev 873)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/preferences/ESboxGazpachoPreferencePage.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -9,7 +9,7 @@
  *    Paulo Romulo (UFCG) - initial API and implementation
  *******************************************************************************/
 
-package org.maemo.esbox.maemosdk.ui.preferences;
+package org.maemo.esbox.internal.maemosdk.ui.preferences;
 
 import org.eclipse.jface.preference.*;
 import org.eclipse.swt.widgets.Composite;

Modified: trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/preferences/ESboxXServerPreferencePage.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/maemosdk/ui/preferences/ESboxXServerPreferencePage.java	2008-10-15 06:30:08 UTC (rev 873)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/preferences/ESboxXServerPreferencePage.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -10,14 +10,12 @@
  *    Ed Swartz (Nokia)
  *******************************************************************************/
 
-package org.maemo.esbox.maemosdk.ui.preferences;
+package org.maemo.esbox.internal.maemosdk.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.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;

Deleted: trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/preferences/Scratchbox1PreferencesPage.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/maemosdk/ui/preferences/Scratchbox1PreferencesPage.java	2008-10-15 06:30:08 UTC (rev 873)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/preferences/Scratchbox1PreferencesPage.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -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: trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/preferences/Scratchbox2PreferencesPage.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/maemosdk/ui/preferences/Scratchbox2PreferencesPage.java	2008-10-15 06:30:08 UTC (rev 873)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/preferences/Scratchbox2PreferencesPage.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -1,120 +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 implementation
- *******************************************************************************/
-
-package org.maemo.esbox.maemosdk.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
-	}
-	
-}

Copied: trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/targets/wizards/BadInstallationPage.java (from rev 873, trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/maemosdk/ui/targets/wizards/BadInstallationPage.java)
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/targets/wizards/BadInstallationPage.java	                        (rev 0)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/targets/wizards/BadInstallationPage.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -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.internal.maemosdk.ui.targets.wizards;
+
+import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.CLabel;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Composite;
+
+/**
+ * @author eswartz
+ *
+ */
+public class BadInstallationPage extends WizardPage {
+
+	protected BadInstallationPage() {
+		super("Inapplicable Wizard");
+	}
+
+	/* (non-Javadoc)
+	 * @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite)
+	 */
+	public void createControl(Composite parent) {
+		CLabel label = new CLabel(parent, SWT.WRAP);
+		label.setText("No scratchbox 1 or scratchbox 2 SDK installed");
+		label.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+		setControl(label);
+	}
+	
+	@Override
+	public boolean canFlipToNextPage() {
+		return false;
+	}
+
+}


Property changes on: trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/targets/wizards/BadInstallationPage.java
___________________________________________________________________
Name: svn:mergeinfo
   + 

Copied: trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/targets/wizards/IValidatePage.java (from rev 873, trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/maemosdk/ui/targets/wizards/IValidatePage.java)
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/targets/wizards/IValidatePage.java	                        (rev 0)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/targets/wizards/IValidatePage.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -0,0 +1,28 @@
+/*******************************************************************************
+ * 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:
+ *    Raul Herbster (UFCG) - initial API and implementation
+ *    Carolina Nogueira de Souza (UFCG) - initial API and implementation
+ *******************************************************************************/
+
+package org.maemo.esbox.internal.maemosdk.ui.targets.wizards;
+/**
+ * A ValidateWizardPage must validade the information on it, so that the
+ * wizard can continue. For example, if the name of a target must be specified
+ * and the user don't do it, the wizard can't continue.
+ * 
+ */
+public interface IValidatePage {
+
+	/**
+	 * Performes the action related to some validation action.
+	 * @return true, if the content of the page is correct; false, otherwise.
+	 */
+	public boolean validatePage();
+	
+}


Property changes on: trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/targets/wizards/IValidatePage.java
___________________________________________________________________
Name: svn:mergeinfo
   + 

Copied: trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/targets/wizards/TargetListener.java (from rev 873, trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/maemosdk/ui/targets/wizards/TargetListener.java)
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/targets/wizards/TargetListener.java	                        (rev 0)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/targets/wizards/TargetListener.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -0,0 +1,37 @@
+/*******************************************************************************
+ * 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:
+ *    Raul Herbster (UFCG) - initial API and implementation
+ *    Carolina Nogueira de Souza (UFCG) - initial API and implementation
+ *******************************************************************************/
+
+package org.maemo.esbox.internal.maemosdk.ui.targets.wizards;
+
+import java.util.EventListener;
+
+/**
+ * Listener interested in some modification on targets.
+ */
+public interface TargetListener extends EventListener {
+
+	/**
+	 * Notifies whenever a new target is added by the user.
+	 */
+	public void targetAdded();
+	
+	/**
+	 * Notifies whenever a target is removed.
+	 */
+	public void targetRemoved();
+	
+	/**
+	 * Notifies whenever a target is choosen.
+	 * @param name the name of the target choosen.
+	 */
+	public void targetChoosen(String name);
+}


Property changes on: trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/targets/wizards/TargetListener.java
___________________________________________________________________
Name: svn:mergeinfo
   + 

Copied: trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/targets/wizards/TargetWizardCPUMethod.java (from rev 873, trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/maemosdk/ui/targets/wizards/TargetWizardCPUMethod.java)
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/targets/wizards/TargetWizardCPUMethod.java	                        (rev 0)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/targets/wizards/TargetWizardCPUMethod.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -0,0 +1,138 @@
+/*******************************************************************************
+ * 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.internal.maemosdk.ui.targets.wizards;
+
+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.internal.maemosdk.ui.UIActivator;
+import org.maemo.esbox.maemosdk.core.sdk.IScratchboxSDK;
+
+/**
+ * This pages shows the CPU-transparency method that the user can choose for his/her
+ * target. The CPU-transparency method provides a way so that the user can execute the
+ * executable.
+ * 
+ */
+public class TargetWizardCPUMethod extends WizardPage implements IValidatePage {
+	
+	private Table table;
+	
+
+
+	private boolean sbrshConfigure;
+	private IScratchboxSDK sdk;
+	
+	private static final String SBRSH = "sbrsh";
+	
+	/**
+	 * Creates a NewTargetWizardCPUMethod
+	 */
+	protected TargetWizardCPUMethod(IScratchboxSDK sdk) {		
+		super("CPU-Transparency Method");
+		setTitle("CPU-Transparency Method");
+		setDescription("Select CPU-transparency method");	 
+		setPageComplete(false);
+		this.sdk = sdk;
+	}
+	
+	public Table getTable() {
+		return table;
+	}
+
+	
+	/*
+	 *  (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("CPU-Transparency Methods"); //$NON-NLS-1$
+				
+		table = new Table(composite, SWT.MULTI| SWT.BORDER | SWT.V_SCROLL);
+		table.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));		
+		table.setLinesVisible(true);
+		//table.setSize(50, 50);
+		table.setHeaderVisible(false);
+		table.addSelectionListener(new SelectionAdapter() {
+			public void widgetSelected(SelectionEvent event) {				
+				for(TableItem item: table.getSelection())					
+					setSbrshConfigure(item.getText().endsWith(TargetWizardCPUMethod.SBRSH));
+				validatePage();
+			}
+		});
+		
+		inicializeTable();	
+		table.redraw();
+		setControl(composite);
+	}
+	
+	
+	private void setSbrshConfigure(boolean value) {
+		sbrshConfigure = value;
+	}
+	
+	public boolean getSbrshConfigure() {
+		return sbrshConfigure;
+	}
+
+	public boolean canFinish() {
+		return isPageComplete();
+	}
+	
+	/**
+	 * Inicializes the contents of the table.
+	 */
+	private void inicializeTable() {	
+		List<String> targetMethod = null;
+		try {
+//			targetMethod = ScratchboxFacade.getInstance().getCputransp(sdk);
+			targetMethod = sdk.getCputransp();
+		} catch (ESboxException e) {
+			ErrorLogger errorLogger = UIActivator.getErrorLogger();
+			errorLogger.logAndShowError("Cannot get list of CPU-Transparency Method", e);
+			return;
+		}
+		
+		TableItem item = null;		
+		for (String cputransp : targetMethod) {			
+			item = new TableItem(table,SWT.NONE);
+			item.setText(cputransp);
+		}		
+	}
+	
+	
+
+	/*
+	 *  (non-Javadoc)
+	 * @see br.edu.ufcg.dee.omapsdk.properties.target.wizard.pages.ValidateWizardPage#perfomeAction()
+	 */
+	public boolean validatePage() {
+		setPageComplete(true);	
+		return true;
+	}
+}
\ No newline at end of file


Property changes on: trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/targets/wizards/TargetWizardCPUMethod.java
___________________________________________________________________
Name: svn:mergeinfo
   + 

Copied: trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/targets/wizards/TargetWizardCompilerPage.java (from rev 873, trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/maemosdk/ui/targets/wizards/TargetWizardCompilerPage.java)
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/targets/wizards/TargetWizardCompilerPage.java	                        (rev 0)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/targets/wizards/TargetWizardCompilerPage.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -0,0 +1,115 @@
+/*******************************************************************************
+ * 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.internal.maemosdk.ui.targets.wizards;
+
+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.internal.maemosdk.ui.UIActivator;
+import org.maemo.esbox.maemosdk.core.sdk.IScratchboxSDK;
+
+/**
+ * This pages shows the compilers that the user can choose for his/her
+ * target. The compilers are disposed as a list with checkbox, so the user
+ * can select only one.
+ * 
+ */
+public class TargetWizardCompilerPage extends WizardPage implements IValidatePage {
+
+	private Table table;
+	private IScratchboxSDK sdk;
+	
+	/**
+	 * Constructs a NewTargetWizardCompilerPage
+	 */
+	protected TargetWizardCompilerPage(IScratchboxSDK sdk) {
+		super("Compiler");
+		this.sdk = sdk;
+		setTitle("Compiler");
+		setDescription("Select compiler");
+		setPageComplete(false);
+	}
+	
+	public Table getTableControl(){
+		return table;
+	}
+	
+	/*
+	 *  (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("Compilers");
+				
+		table = new Table(composite,SWT.SINGLE | SWT.BORDER);
+		table.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));		
+		table.setLinesVisible(true);
+		table.setHeaderVisible(false);
+		table.addSelectionListener(new SelectionAdapter() {
+			public void widgetSelected(SelectionEvent event) {
+				validatePage();
+			}
+		});
+		
+		inicializeTable();
+		
+		setControl(composite);
+	}
+
+	/**
+	 * Inicializes the contents of the table.
+	 */
+	private void inicializeTable() {		
+		List<String> compilers = null;
+		try {
+//			compilers = ScratchboxFacade.getInstance().getCompilers(sdk);
+			compilers = sdk.getCompilers();
+		} catch (ESboxException e) {			
+			ErrorLogger errorLogger = UIActivator.getErrorLogger();
+			errorLogger.logAndShowError("Cannot get list of compilers", e);
+			return;
+		}		
+		
+		TableItem item = null;
+		for (String compilerName : compilers) {
+			item = new TableItem(table, SWT.NONE);			
+			item.setText(compilerName);
+		}		
+	}
+	
+	/*
+	 *  (non-Javadoc)
+	 * @see br.edu.ufcg.dee.omapsdk.properties.target.wizard.pages.ValidateWizardPage#perfomeAction()
+	 */
+	public boolean validatePage() {
+		setPageComplete(true);
+		return true;
+	}
+
+}


Property changes on: trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/targets/wizards/TargetWizardCompilerPage.java
___________________________________________________________________
Name: svn:mergeinfo
   + 

Copied: trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/targets/wizards/TargetWizardNamePage.java (from rev 873, trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/maemosdk/ui/targets/wizards/TargetWizardNamePage.java)
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/targets/wizards/TargetWizardNamePage.java	                        (rev 0)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/targets/wizards/TargetWizardNamePage.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -0,0 +1,143 @@
+/*******************************************************************************
+ * 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.internal.maemosdk.ui.targets.wizards;
+
+import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.KeyEvent;
+import org.eclipse.swt.events.KeyListener;
+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.Text;
+import org.maemo.esbox.maemosdk.core.sdk.IScratchboxSDK;
+
+/**
+ * The user insert the name for the target. This name must be unique.
+ */
+public class TargetWizardNamePage extends WizardPage implements IValidatePage, TargetListener {
+	
+	private Text text;	
+	private IScratchboxSDK sdk;
+	
+	/**
+	 * Constructs a NewTargetWizardNamePage.
+	 */
+	protected TargetWizardNamePage(IScratchboxSDK sdk) {		
+		super("Target Name");
+		this.sdk = sdk;
+		setTitle("Target Name");
+		setDescription("Enter name for the new target");
+		this.targetAdded();		
+		setPageComplete(false);		
+	}	
+		
+	public Text getTextControl(){
+		return text;
+	}
+	/*
+	 *  (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("Target Name:"); 
+		
+		text = new Text(composite, SWT.BORDER);
+		text.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
+		
+		text.addKeyListener(new KeyListener() {
+			public void keyPressed(KeyEvent event) {
+				validatePage();
+			}
+			
+			public void keyReleased(KeyEvent event) {
+				validatePage();				
+			}
+		});		
+		
+		setControl(composite);
+	}
+	
+	/*
+	 *  (non-Javadoc)
+	 * @see br.edu.ufcg.dee.omapsdk.properties.target.wizard.pages.ValidateWizardPage#perfomeAction()
+	 */
+	public boolean validatePage() {		
+		String value = text.getText();		
+		if(value.length() >= 1) {
+			setPageComplete(true);
+		} else {
+			setPageComplete(false);
+		}
+		boolean isValid = false;
+		isValid = verifyName();
+		setPageComplete(isValid);		
+		return isValid;
+	}
+		
+	/**
+	 * Verify if the name of the target exists previously.
+	 * 
+	 * @return 
+	 * 				true, if the name of the target have been defined already; false, otherwise.
+	 */
+	private boolean verifyName() {
+		String targetName = text.getText().trim();
+		if(sdk.findSDKTarget(targetName) != null) {
+			setErrorMessage("This target name is already defined.");
+			return false;			
+		} else {
+			setErrorMessage(null);			
+			return true;
+		}
+	}
+
+	/*
+	 *  (non-Javadoc)
+	 * @see br.edu.ufcg.dee.omapsdk.properties.target.wizard.TargetWizardListener#targetAdded()
+	 */
+	public void targetAdded() {
+		updateTargetList();
+	}
+
+	/*
+	 *  (non-Javadoc)
+	 * @see dee.nokia.esbox.plugin.ui.internal.wizard.targets.TargetListener#targetRemoved()
+	 */
+	public void targetRemoved() {
+		updateTargetList();
+	}
+
+	/*
+	 *  (non-Javadoc)
+	 * @see dee.nokia.esbox.plugin.ui.internal.wizard.targets.TargetListener#targetChoosen(java.lang.String)
+	 */
+	public void targetChoosen(String name) {
+		// for this wizard page, this action doesnt matter.		
+	}	
+	
+	/**
+	 * Update the list of target on Scratchbox. This process is done
+	 * because the wizard needs to know the target to control the creation of 
+	 * new targets.
+	 */
+	private void updateTargetList() {
+		sdk.refresh();
+	}
+}
\ No newline at end of file


Property changes on: trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/targets/wizards/TargetWizardNamePage.java
___________________________________________________________________
Name: svn:mergeinfo
   + 

Copied: trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/targets/wizards/TargetWizardPageFactory.java (from rev 873, trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/maemosdk/ui/targets/wizards/TargetWizardPageFactory.java)
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/targets/wizards/TargetWizardPageFactory.java	                        (rev 0)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/targets/wizards/TargetWizardPageFactory.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -0,0 +1,102 @@
+/*******************************************************************************
+ * 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.internal.maemosdk.ui.targets.wizards;
+
+import org.eclipse.jface.wizard.IWizardPage;
+import org.eclipse.jface.wizard.WizardPage;
+import org.maemo.esbox.internal.maemosdk.ui.targets.wizards.sbrsh.SbrshConfigurationNFSServer;
+import org.maemo.esbox.internal.maemosdk.ui.targets.wizards.sbrsh.SbrshConfigurationTargetDevice;
+import org.maemo.esbox.maemosdk.core.sdk.IScratchboxSDK;
+
+/**
+ * Factory that creates all pages of the new target wizard.
+ * 
+ */
+public class TargetWizardPageFactory {
+
+	private static TargetWizardPageFactory singleton = null;
+	
+	/**
+	 * Construtor
+	 */
+	private TargetWizardPageFactory() {
+		
+	}
+	
+	/**
+	 * Returns only one instance of TargetWizardPageFactory object.
+	 * @return only one instance of TargetWizardPageFactory object.
+	 */
+	public static TargetWizardPageFactory getInstance() {
+		if(singleton == null)
+			singleton = new TargetWizardPageFactory();
+		return singleton;
+	}
+	
+	/**
+	 * Creates a new name page.
+	 * @return a new name page.
+	 */
+	public WizardPage createNamePage(IScratchboxSDK sdk) {
+		return new TargetWizardNamePage(sdk);
+	}
+	
+	/**
+	 * Creates a new compiler page.
+	 * @return a new compiler page.
+	 */
+	public WizardPage createCompilerPage(IScratchboxSDK sdk) {
+		return new TargetWizardCompilerPage(sdk);
+	}
+	
+	/**
+	 * Creates a new CPU-method transparency page.
+	 * @return a new CPU-method transparency page.
+	 */
+	public WizardPage createCPUMethod(IScratchboxSDK sdk) {
+		return new TargetWizardCPUMethod(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.
+	 * @return a new page to configure sbrsh device target.
+	 */
+	public WizardPage createSbrshConfigDeviceTargetPage() {
+		return new SbrshConfigurationTargetDevice();
+	}
+	
+	/**
+	 * Create a new page to configure sbrsh nfs server.
+	 * @return a new page to configure sbrsh nfs server.
+	 */
+	public WizardPage createSbrshConfigNFSSServer() {
+		return new SbrshConfigurationNFSServer();
+	}
+
+	public IWizardPage createBadInstallationPage() {
+		return new BadInstallationPage();
+	}
+
+//	public WizardPage createMaemoRootstrapPage(IScratchboxSDK sdk) {
+//		return new TargetWizardRootstrapSb2Page(sdk);
+//	}
+}


Property changes on: trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/targets/wizards/TargetWizardPageFactory.java
___________________________________________________________________
Name: svn:mergeinfo
   + 

Copied: trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/targets/wizards/sbrsh (from rev 873, trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/maemosdk/ui/targets/wizards/sbrsh)


Property changes on: trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/targets/wizards/sbrsh
___________________________________________________________________
Name: svn:mergeinfo
   + 

Modified: trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/targets/wizards/sbrsh/SbrshConfigurationNFSServer.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/maemosdk/ui/targets/wizards/sbrsh/SbrshConfigurationNFSServer.java	2008-10-15 06:30:08 UTC (rev 873)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/targets/wizards/sbrsh/SbrshConfigurationNFSServer.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -10,7 +10,7 @@
  *    Carolina Nogueira de Souza (UFCG) - initial API and implementation
  *******************************************************************************/
 
-package org.maemo.esbox.maemosdk.ui.targets.wizards.sbrsh;
+package org.maemo.esbox.internal.maemosdk.ui.targets.wizards.sbrsh;
 
 import org.eclipse.jface.wizard.WizardPage;
 import org.eclipse.swt.SWT;
@@ -21,7 +21,7 @@
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Label;
 import org.eclipse.swt.widgets.Text;
-import org.maemo.esbox.maemosdk.ui.targets.wizards.IValidatePage;
+import org.maemo.esbox.internal.maemosdk.ui.targets.wizards.IValidatePage;
 
 /**
  * A page for configuration of the NFS server. 

Modified: trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/targets/wizards/sbrsh/SbrshConfigurationTargetDevice.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/maemosdk/ui/targets/wizards/sbrsh/SbrshConfigurationTargetDevice.java	2008-10-15 06:30:08 UTC (rev 873)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/internal/maemosdk/ui/targets/wizards/sbrsh/SbrshConfigurationTargetDevice.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -10,7 +10,7 @@
  *    Carolina Nogueira de Souza (UFCG) - initial API and implementation
  *******************************************************************************/
 
-package org.maemo.esbox.maemosdk.ui.targets.wizards.sbrsh;
+package org.maemo.esbox.internal.maemosdk.ui.targets.wizards.sbrsh;
 
 import org.eclipse.jface.wizard.WizardPage;
 import org.eclipse.swt.SWT;
@@ -21,7 +21,7 @@
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Label;
 import org.eclipse.swt.widgets.Text;
-import org.maemo.esbox.maemosdk.ui.targets.wizards.IValidatePage;
+import org.maemo.esbox.internal.maemosdk.ui.targets.wizards.IValidatePage;
 
 /**
  * A page for configuration of the device IP. 

Deleted: trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/maemosdk/ui/MaemoRootstrapContentLabelProvider.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/maemosdk/ui/MaemoRootstrapContentLabelProvider.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/maemosdk/ui/MaemoRootstrapContentLabelProvider.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -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;
-	}
-	
-}

Deleted: trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/maemosdk/ui/targets/wizards/BadInstallationPage.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/maemosdk/ui/targets/wizards/BadInstallationPage.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/maemosdk/ui/targets/wizards/BadInstallationPage.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -1,44 +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.wizard.WizardPage;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CLabel;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * @author eswartz
- *
- */
-public class BadInstallationPage extends WizardPage {
-
-	protected BadInstallationPage() {
-		super("Inapplicable Wizard");
-	}
-
-	/* (non-Javadoc)
-	 * @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite)
-	 */
-	public void createControl(Composite parent) {
-		CLabel label = new CLabel(parent, SWT.WRAP);
-		label.setText("No scratchbox 1 or scratchbox 2 SDK installed");
-		label.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
-		setControl(label);
-	}
-	
-	@Override
-	public boolean canFlipToNextPage() {
-		return false;
-	}
-
-}

Deleted: trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/maemosdk/ui/targets/wizards/IValidatePage.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/maemosdk/ui/targets/wizards/IValidatePage.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/maemosdk/ui/targets/wizards/IValidatePage.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -1,28 +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:
- *    Raul Herbster (UFCG) - initial API and implementation
- *    Carolina Nogueira de Souza (UFCG) - initial API and implementation
- *******************************************************************************/
-
-package org.maemo.esbox.maemosdk.ui.targets.wizards;
-/**
- * A ValidateWizardPage must validade the information on it, so that the
- * wizard can continue. For example, if the name of a target must be specified
- * and the user don't do it, the wizard can't continue.
- * 
- */
-public interface IValidatePage {
-
-	/**
-	 * Performes the action related to some validation action.
-	 * @return true, if the content of the page is correct; false, otherwise.
-	 */
-	public boolean validatePage();
-	
-}

Deleted: trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/maemosdk/ui/targets/wizards/NewScratchbox1TargetWizard.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/maemosdk/ui/targets/wizards/NewScratchbox1TargetWizard.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/maemosdk/ui/targets/wizards/NewScratchbox1TargetWizard.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -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: trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/maemosdk/ui/targets/wizards/NewScratchbox2TargetWizard.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/maemosdk/ui/targets/wizards/NewScratchbox2TargetWizard.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/maemosdk/ui/targets/wizards/NewScratchbox2TargetWizard.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -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: trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/maemosdk/ui/targets/wizards/TargetListener.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/maemosdk/ui/targets/wizards/TargetListener.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/maemosdk/ui/targets/wizards/TargetListener.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -1,37 +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:
- *    Raul Herbster (UFCG) - initial API and implementation
- *    Carolina Nogueira de Souza (UFCG) - initial API and implementation
- *******************************************************************************/
-
-package org.maemo.esbox.maemosdk.ui.targets.wizards;
-
-import java.util.EventListener;
-
-/**
- * Listener interested in some modification on targets.
- */
-public interface TargetListener extends EventListener {
-
-	/**
-	 * Notifies whenever a new target is added by the user.
-	 */
-	public void targetAdded();
-	
-	/**
-	 * Notifies whenever a target is removed.
-	 */
-	public void targetRemoved();
-	
-	/**
-	 * Notifies whenever a target is choosen.
-	 * @param name the name of the target choosen.
-	 */
-	public void targetChoosen(String name);
-}

Deleted: trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/maemosdk/ui/targets/wizards/TargetWizardCPUMethod.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/maemosdk/ui/targets/wizards/TargetWizardCPUMethod.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/maemosdk/ui/targets/wizards/TargetWizardCPUMethod.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -1,127 +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.IScratchboxSDK;
-
-import java.util.List;
-
-/**
- * This pages shows the CPU-transparency method that the user can choose for his/her
- * target. The CPU-transparency method provides a way so that the user can execute the
- * executable.
- * 
- */
-public class TargetWizardCPUMethod extends WizardPage implements IValidatePage {
-	
-	protected Table table;
-	private boolean sbrshConfigure;
-	private IScratchboxSDK sdk;
-	
-	private static final String SBRSH = "sbrsh";
-	
-	/**
-	 * Creates a NewTargetWizardCPUMethod
-	 */
-	protected TargetWizardCPUMethod(IScratchboxSDK sdk) {		
-		super("CPU-Transparency Method");
-		setTitle("CPU-Transparency Method");
-		setDescription("Select CPU-transparency method");	 
-		setPageComplete(false);
-		this.sdk = sdk;
-	}
-	
-	/*
-	 *  (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("CPU-Transparency Methods"); //$NON-NLS-1$
-				
-		table = new Table(composite, SWT.MULTI| SWT.BORDER | SWT.V_SCROLL);
-		table.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));		
-		table.setLinesVisible(true);
-		//table.setSize(50, 50);
-		table.setHeaderVisible(false);
-		table.addSelectionListener(new SelectionAdapter() {
-			public void widgetSelected(SelectionEvent event) {				
-				for(TableItem item: table.getSelection())					
-					setSbrshConfigure(item.getText().endsWith(TargetWizardCPUMethod.SBRSH));
-				validatePage();
-			}
-		});
-		
-		inicializeTable();	
-		table.redraw();
-		setControl(composite);
-	}
-	
-	
-	private void setSbrshConfigure(boolean value) {
-		sbrshConfigure = value;
-	}
-	
-	public boolean getSbrshConfigure() {
-		return sbrshConfigure;
-	}
-
-	public boolean canFinish() {
-		return isPageComplete();
-	}
-	
-	/**
-	 * Inicializes the contents of the table.
-	 */
-	private void inicializeTable() {	
-		List<String> targetMethod = null;
-		try {
-			targetMethod = ScratchboxFacade.getInstance().getCputransp(sdk);
-		} catch (ESboxException e) {
-			ErrorLogger errorLogger = UIActivator.getErrorLogger();
-			errorLogger.logAndShowError("Cannot get list of CPU-Transparency Method", e);
-			return;
-		}
-		
-		TableItem item = null;		
-		for (String cputransp : targetMethod) {			
-			item = new TableItem(table,SWT.NONE);
-			item.setText(cputransp);
-		}		
-	}
-	
-	
-
-	/*
-	 *  (non-Javadoc)
-	 * @see br.edu.ufcg.dee.omapsdk.properties.target.wizard.pages.ValidateWizardPage#perfomeAction()
-	 */
-	public boolean validatePage() {
-		setPageComplete(true);	
-		return true;
-	}
-}
\ No newline at end of file

Deleted: trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/maemosdk/ui/targets/wizards/TargetWizardCompilerPage.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/maemosdk/ui/targets/wizards/TargetWizardCompilerPage.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/maemosdk/ui/targets/wizards/TargetWizardCompilerPage.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -1,108 +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.IScratchboxSDK;
-
-import java.util.List;
-
-/**
- * This pages shows the compilers that the user can choose for his/her
- * target. The compilers are disposed as a list with checkbox, so the user
- * can select only one.
- * 
- */
-public class TargetWizardCompilerPage extends WizardPage implements IValidatePage {
-
-	protected Table table;
-	private IScratchboxSDK sdk;
-	
-	/**
-	 * Constructs a NewTargetWizardCompilerPage
-	 */
-	protected TargetWizardCompilerPage(IScratchboxSDK sdk) {
-		super("Compiler");
-		this.sdk = sdk;
-		setTitle("Compiler");
-		setDescription("Select compiler");
-		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("Compilers");
-				
-		table = new Table(composite,SWT.SINGLE | SWT.BORDER);
-		table.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));		
-		table.setLinesVisible(true);
-		table.setHeaderVisible(false);
-		table.addSelectionListener(new SelectionAdapter() {
-			public void widgetSelected(SelectionEvent event) {
-				validatePage();
-			}
-		});
-		
-		inicializeTable();
-		
-		setControl(composite);
-	}
-
-	/**
-	 * Inicializes the contents of the table.
-	 */
-	private void inicializeTable() {		
-		List<String> compilers = null;
-		try {
-			compilers = ScratchboxFacade.getInstance().getCompilers(sdk);
-		} catch (ESboxException e) {			
-			ErrorLogger errorLogger = UIActivator.getErrorLogger();
-			errorLogger.logAndShowError("Cannot get list of compilers", e);
-			return;
-		}		
-		
-		TableItem item = null;
-		for (String compilerName : compilers) {
-			item = new TableItem(table, SWT.NONE);			
-			item.setText(compilerName);
-		}		
-	}
-	
-	/*
-	 *  (non-Javadoc)
-	 * @see br.edu.ufcg.dee.omapsdk.properties.target.wizard.pages.ValidateWizardPage#perfomeAction()
-	 */
-	public boolean validatePage() {
-		setPageComplete(true);
-		return true;
-	}
-
-}

Deleted: trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/maemosdk/ui/targets/wizards/TargetWizardDevkitsPage.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/maemosdk/ui/targets/wizards/TargetWizardDevkitsPage.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/maemosdk/ui/targets/wizards/TargetWizardDevkitsPage.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -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

Deleted: trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/maemosdk/ui/targets/wizards/TargetWizardNamePage.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/maemosdk/ui/targets/wizards/TargetWizardNamePage.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/maemosdk/ui/targets/wizards/TargetWizardNamePage.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -1,138 +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.KeyEvent;
-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.maemo.esbox.maemosdk.core.sdk.IScratchboxSDK;
-
-/**
- * The user insert the name for the target. This name must be unique.
- */
-public class TargetWizardNamePage extends WizardPage implements IValidatePage, TargetListener {
-	
-	protected Text text;	
-	private IScratchboxSDK sdk;
-	
-	/**
-	 * Constructs a NewTargetWizardNamePage.
-	 */
-	protected TargetWizardNamePage(IScratchboxSDK sdk) {		
-		super("Target Name");
-		this.sdk = sdk;
-		setTitle("Target Name");
-		setDescription("Enter name for the new target");
-		this.targetAdded();		
-		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("Target Name:"); 
-		
-		text = new Text(composite, SWT.BORDER);
-		text.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
-		
-		text.addKeyListener(new KeyListener() {
-			public void keyPressed(KeyEvent event) {
-				validatePage();
-			}
-			
-			public void keyReleased(KeyEvent event) {
-				validatePage();				
-			}
-		});		
-		
-		setControl(composite);
-	}
-	
-	/*
-	 *  (non-Javadoc)
-	 * @see br.edu.ufcg.dee.omapsdk.properties.target.wizard.pages.ValidateWizardPage#perfomeAction()
-	 */
-	public boolean validatePage() {		
-		String value = text.getText();		
-		if(value.length() >= 1) {
-			setPageComplete(true);
-		} else {
-			setPageComplete(false);
-		}
-		boolean isValid = false;
-		isValid = verifyName();
-		setPageComplete(isValid);		
-		return isValid;
-	}
-		
-	/**
-	 * Verify if the name of the target exists previously.
-	 * 
-	 * @return 
-	 * 				true, if the name of the target have been defined already; false, otherwise.
-	 */
-	private boolean verifyName() {
-		String targetName = text.getText().trim();
-		if(sdk.findSDKTarget(targetName) != null) {
-			setErrorMessage("This target name is already defined.");
-			return false;			
-		} else {
-			setErrorMessage(null);			
-			return true;
-		}
-	}
-
-	/*
-	 *  (non-Javadoc)
-	 * @see br.edu.ufcg.dee.omapsdk.properties.target.wizard.TargetWizardListener#targetAdded()
-	 */
-	public void targetAdded() {
-		updateTargetList();
-	}
-
-	/*
-	 *  (non-Javadoc)
-	 * @see dee.nokia.esbox.plugin.ui.internal.wizard.targets.TargetListener#targetRemoved()
-	 */
-	public void targetRemoved() {
-		updateTargetList();
-	}
-
-	/*
-	 *  (non-Javadoc)
-	 * @see dee.nokia.esbox.plugin.ui.internal.wizard.targets.TargetListener#targetChoosen(java.lang.String)
-	 */
-	public void targetChoosen(String name) {
-		// for this wizard page, this action doesnt matter.		
-	}	
-	
-	/**
-	 * Update the list of target on Scratchbox. This process is done
-	 * because the wizard needs to know the target to control the creation of 
-	 * new targets.
-	 */
-	private void updateTargetList() {
-		sdk.refresh();
-	}
-}
\ No newline at end of file

Deleted: trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/maemosdk/ui/targets/wizards/TargetWizardPageFactory.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/maemosdk/ui/targets/wizards/TargetWizardPageFactory.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/maemosdk/ui/targets/wizards/TargetWizardPageFactory.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -1,103 +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.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;
-
-/**
- * Factory that creates all pages of the new target wizard.
- * 
- */
-public class TargetWizardPageFactory {
-
-	private static TargetWizardPageFactory singleton = null;
-	
-	/**
-	 * Construtor
-	 */
-	private TargetWizardPageFactory() {
-		
-	}
-	
-	/**
-	 * Returns only one instance of TargetWizardPageFactory object.
-	 * @return only one instance of TargetWizardPageFactory object.
-	 */
-	public static TargetWizardPageFactory getInstance() {
-		if(singleton == null)
-			singleton = new TargetWizardPageFactory();
-		return singleton;
-	}
-	
-	/**
-	 * Creates a new name page.
-	 * @return a new name page.
-	 */
-	public WizardPage createNamePage(IScratchboxSDK sdk) {
-		return new TargetWizardNamePage(sdk);
-	}
-	
-	/**
-	 * Creates a new compiler page.
-	 * @return a new compiler page.
-	 */
-	public WizardPage createCompilerPage(IScratchboxSDK sdk) {
-		return new TargetWizardCompilerPage(sdk);
-	}
-	
-	/**
-	 * Creates a new CPU-method transparency page.
-	 * @return a new CPU-method transparency page.
-	 */
-	public WizardPage createCPUMethod(IScratchboxSDK sdk) {
-		return new TargetWizardCPUMethod(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.
-	 * @return a new page to configure sbrsh device target.
-	 */
-	public WizardPage createSbrshConfigDeviceTargetPage() {
-		return new SbrshConfigurationTargetDevice();
-	}
-	
-	/**
-	 * Create a new page to configure sbrsh nfs server.
-	 * @return a new page to configure sbrsh nfs server.
-	 */
-	public WizardPage createSbrshConfigNFSSServer() {
-		return new SbrshConfigurationNFSServer();
-	}
-
-	public IWizardPage createBadInstallationPage() {
-		return new BadInstallationPage();
-	}
-
-	public WizardPage createMaemoRootstrapPage(IScratchboxSDK sdk) {
-		return new TargetWizardRootstrapSb2Page(sdk);
-	}
-}

Deleted: trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/maemosdk/ui/targets/wizards/TargetWizardRootstrapSb2Page.java
===================================================================
--- trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/maemosdk/ui/targets/wizards/TargetWizardRootstrapSb2Page.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/maemosdk/org.maemo.esbox.maemosdk.ui/src/org/maemo/esbox/maemosdk/ui/targets/wizards/TargetWizardRootstrapSb2Page.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -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

Modified: trunk/python/org.maemo.esbox.python.tests/META-INF/MANIFEST.MF
===================================================================
--- trunk/python/org.maemo.esbox.python.tests/META-INF/MANIFEST.MF	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/python/org.maemo.esbox.python.tests/META-INF/MANIFEST.MF	2008-10-15 19:30:29 UTC (rev 877)
@@ -12,7 +12,8 @@
  org.maemo.esbox.project.core;bundle-version="1.5.0",
  org.maemo.esbox.python.project.core;bundle-version="1.5.0",
  org.maemo.esbox.core.tests;bundle-version="1.5.0",
- org.maemo.esbox.maemosdk.core;bundle-version="1.5.0"
+ org.maemo.esbox.maemosdk.core;bundle-version="1.5.0",
+ org.maemo.esbox.maemosdk.sb1;bundle-version="1.5.0"
 Bundle-RequiredExecutionEnvironment: J2SE-1.5
 Bundle-ActivationPolicy: lazy
 Export-Package: org.maemo.esbox.python.tests

Modified: trunk/python/org.maemo.esbox.python.tests/src/org/maemo/esbox/python/tests/TestPythonProjectConverter.java
===================================================================
--- trunk/python/org.maemo.esbox.python.tests/src/org/maemo/esbox/python/tests/TestPythonProjectConverter.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/python/org.maemo.esbox.python.tests/src/org/maemo/esbox/python/tests/TestPythonProjectConverter.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -51,7 +51,8 @@
 		sdkTargets = ScratchboxSDKFacade.getInstance().getScratchboxSDKTargets();
 		for (ISDKTarget target : sdkTargets) {
 			// TODO: check platform/target
-			if (target instanceof IScratchbox1SDKTarget 
+			if (target instanceof IScratchboxSDKTarget 
+					&& ((IScratchboxSDKTarget)target).getSboxVersion() == 1
 					&& target.getName().equals("CHINOOK_ARMEL")) {
 				theSB1SDKTarget = target;
 			}

Modified: trunk/python/org.maemo.esbox.python.tests/src/org/maemo/esbox/python/tests/TestPythonProjectCreator.java
===================================================================
--- trunk/python/org.maemo.esbox.python.tests/src/org/maemo/esbox/python/tests/TestPythonProjectCreator.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/python/org.maemo.esbox.python.tests/src/org/maemo/esbox/python/tests/TestPythonProjectCreator.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -51,7 +51,7 @@
 		sdkTargets = ScratchboxSDKFacade.getInstance().getScratchboxSDKTargets();
 		for (ISDKTarget target : sdkTargets) {
 			// TODO: check platform/target
-			if (target instanceof IScratchbox1SDKTarget 
+			if (target instanceof IScratchboxSDKTarget 
 					&& target.getName().equals("CHINOOK_ARMEL")) {
 				theSB1SDKTarget = target;
 			}

Modified: trunk/python/org.maemo.esbox.python.tests/src/org/maemo/esbox/python/tests/TestPythonProjectProperties.java
===================================================================
--- trunk/python/org.maemo.esbox.python.tests/src/org/maemo/esbox/python/tests/TestPythonProjectProperties.java	2008-10-15 19:25:44 UTC (rev 876)
+++ trunk/python/org.maemo.esbox.python.tests/src/org/maemo/esbox/python/tests/TestPythonProjectProperties.java	2008-10-15 19:30:29 UTC (rev 877)
@@ -19,7 +19,7 @@
 import org.maemo.esbox.core.tests.core.BaseTest;
 import org.maemo.esbox.internal.python.tests.TestActivator;
 import org.maemo.esbox.maemosdk.core.execEnv.GTKExecutionEnvironment;
-import org.maemo.esbox.maemosdk.core.sdk.IScratchbox1SDK;
+import org.maemo.esbox.maemosdk.sb1.sdk.IScratchbox1SDK;
 import org.maemo.esbox.project.core.IProjectProperties;
 import org.maemo.esbox.project.core.ProjectManager;
 



More information about the Esbox-commits mailing list